Welcome
Welcome to a320

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

[EMULATOR] PIE320 0.1 Pacman Emulator

Only for posting new releases of Dingoo OS based software.

Moderator: Moderators

Re: PIE320 0.1 Pacman Emulator

Postby SiENcE on Mon May 18, 2009 11:57 pm

hi joyrider,

thanks for your ideas. you should get the code from svn and try yourself. you can create a patch file and send it to me. i will add it to svn.
until the end of this week i hav no time to add sound.

stay tuned
SiENcE
 
Posts: 67
Joined: Wed Apr 29, 2009 9:19 am
Location: Berlin/Germany

Re: PIE320 0.1 Pacman Emulator

Postby joyrider on Tue May 19, 2009 12:00 am

ok i just downloaded the source code, and i tried out my suggestion and it works !!! (well more or less, i can clearly hear the pacman sound playing but it's a bit distorted but you can hear the tune and stuff) so you guys should definatly get it working using that workaround !
joyrider
 
Posts: 77
Joined: Sun May 03, 2009 4:27 pm

Re: PIE320 0.1 Pacman Emulator

Postby SiENcE on Tue May 19, 2009 12:50 am

the source from my svn? create an svn patch file and i will add it. thats why i created the svn. to share the development of dingoo applications.
i also added my dingoo benchmark. not really ready yet, but you can compare your windows pc with your dingoo.
SiENcE
 
Posts: 67
Joined: Wed Apr 29, 2009 9:19 am
Location: Berlin/Germany

Re: PIE320 0.1 Pacman Emulator

Postby joyrider on Tue May 19, 2009 1:12 am

yes, downloaded the source from your svn, however i can only get it to work in the windows version :(
there's no sound on the device itself and the game runs noticeably slower then when using (/ calling the) sound (functions).

i don't know enough about wav and samples and stuff to get it into the right format. But at least you guys have a way to get around the problem of not being able to load sound from memory.

here's what i changed : (not svn worthy don't wanna mess up and the sound is not playing correctly in windows either and on the device it doesn't play at all :( )

Code: Select all
//added globals from original source
AudioData *Sound;
short *backbuffer;
int * rawSoundBuf = 0;
unsigned framesPerSecond    = 60; //PacmanMachine::VideoFrequency;
unsigned samplesPerSecond   = 44100;    // Valid values: 11025, 22050, 44100
unsigned samplesPerFrame    = samplesPerSecond / framesPerSecond;
unsigned bytesPerSample     = 2;


//add this in game engine::init
rawSoundBuf = new int[ samplesPerFrame ];
backbuffer=(short*)malloc(A320_SCREEN_WIDTH*A320_SCREEN_HEIGHT*sizeof(short));
memset((char*)backbuffer,0x00,A320_SCREEN_WIDTH*A320_SCREEN_HEIGHT*sizeof(short));
Sound = new AudioData();
Sound->LoadPCM(_LS("dummy.snd"));

//Add this in the render function, below the screen drawing part
int i;
        int * rawBuf = rawSoundBuf;
        char * sndBuf = (char *) Sound->GetBuf();

        if( bytesPerSample == 1 ) {
            for( i=0; i<(int)samplesPerFrame; i++ ) {
                *sndBuf++ = (unsigned char) (*rawBuf++ / 3) + 0x80;
            }
        }

      
        else {
            for( i=0; i<(int)samplesPerFrame; i++ ) {
                unsigned short w = (unsigned short)(*rawBuf++ * 85);
                *sndBuf++ = (unsigned char) (w);
                *sndBuf++ = (unsigned char) (w >> 8);
            }
        }
       m_pAudioPlayer->Play(Sound,1,(int)samplesPerFrame,200,false);

//add this in the exit function
SAFE_DELETE(Sound);


you will need the dummy.snd file as well (it's a 1 minute silenced raw pcm 16 bit pcm file generated using gold wave).

if you run it with those parameters in windows the sound will partially work ! so it should be possible to get it working on the dingoo also. I think it doesn't play the sound on the dingoo because the sound format is wrong or something but i'm not sure :(
joyrider
 
Posts: 77
Joined: Sun May 03, 2009 4:27 pm

Re: PIE320 0.1 Pacman Emulator

Postby Bingo83 on Tue May 19, 2009 7:58 pm

Plays fine Link, was playing it last night for around 20 mins.
Image
Bingo83
Moderator
 
Posts: 128
Joined: Sat Mar 21, 2009 2:59 pm

Re: PIE320 0.1 Pacman Emulator

Postby joyrider on Wed May 20, 2009 6:19 pm

btw SiENcE you got the color's wrong also (it's supposed to be blue instead of red). Looking at the source you seem to have mixed up the Red & blue values, it's an easy fix : PutPixel(x,y,(color),(color >> 8),(color >> 16));

how you gotten sound to work yet ? i can produce sound that resembles to pacman sound but it's not "rendered" correctly because i don't know enough about it unfortunatly :(
joyrider
 
Posts: 77
Joined: Sun May 03, 2009 4:27 pm

Re: PIE320 0.1 Pacman Emulator

Postby SiENcE on Wed May 20, 2009 8:59 pm

colors are already fixed in svn.

today i wanna try implement sound.
SiENcE
 
Posts: 67
Joined: Wed Apr 29, 2009 9:19 am
Location: Berlin/Germany

Re: PIE320 0.1 Pacman Emulator

Postby Link on Sun May 24, 2009 4:50 pm

Hey all,

Tough morning... Iphone sh!t the bed on me, touchscreen would not work this morning at all.

Found myself needing a PC & doing some file transfers. Which brings me here after the iphone came back to life after a hard reset & windows grabbing photos out of it.

ON topic:
Tried putting this Pie320 on my MicroSD card. Won't work (EDIT: Red dot/blackscreen). I'm assuming my roms need to be in the ROOT of the Dingoo proper and not on the SD card or in the SD card folder where the Pie files were extracted.

My issue is I brought the wrong USB cable and can't transfer the roms to the Dingoo with the cable I currently have. Glad its not Monday.

Hope to get this working later tocday!

Peace

Link
Link
 
Posts: 58
Joined: Wed Apr 22, 2009 4:28 pm

Re: PIE320 0.1 Pacman Emulator

Postby seagal on Sun May 24, 2009 9:20 pm

pacman roms has to be on a folder called 'roms' on the root of your dingoo, it doest look for the roms at the minisd (red dot :P)
seagal
 
Posts: 14
Joined: Tue Mar 31, 2009 5:17 pm

Re: PIE320 0.1 Pacman Emulator

Postby SiENcE on Mon May 25, 2009 2:26 pm

Hey joyrider.

i added zlib support to compress the romfiles for one pacman game into one zip file. This already works fine. I also used the SIM implementation. Now this Emu works like all the others.

One problem left. I tried your sound sample and it doesn't work for me. When i activate the implementation in the renderer, my dingoo hangs.

Any Idea?
SiENcE
 
Posts: 67
Joined: Wed Apr 29, 2009 9:19 am
Location: Berlin/Germany

PreviousNext

Return to Dingoo OS Releases

Who is online

Users browsing this forum: No registered users and 0 guests