aki os dejo el texto del post original
I ported FCEUltra to PS2 to play a couple NES games on a TV in a different room for the holiday season. I have an autistic brother who loves Megaman, heh. As it's back to school season again, I don't have time to work on it anymore.
It uses the built-in savestate support and sram support, which both save to memory card @ MC0:FCEUMM/state and MC0:FCEUMM/sav, respectively.
The built-in game genie rom support works if you put the game genie rom as MC0:FCEUMM/gg.rom. I haven't used any codes, so I'm not sure if they actually work on the PS2.
Notes about the porting process:
I based my code somewhat off the structure of the fceux port to GameCube, as I needed an example at which to look. There's no sound, as just enabling it was causing a massive slowdown to 1 or 2 fps; however, it does play fullspeed without it enabled. I used gsKit to render the screen. Trying to optimize the emulator further is beyond my capability, as I think it would require utilizing the VU's and IOP. I suspect that a more experienced programmer/ps2 programmer could probably get sound and netplay working. The sound code makes wav samples, which is why I intended to use audsrv for playback. I'm pretty sure that the gamepad code is a little screwy as ps2link was giving me weird 0 modes found and etc. messages. It was late at night by the time I got it working using the ulaunchelf source and the ps2sdk example as references. I suspect it's from not checking or not initializing the dual shock functions/motors/analog or something, but the input works, so I let it be.
Some notes about the source code:
The original project source code that I ported is at sourceforge.net/projects/fceumm. The version dated fceu-mm-june16-2006-win32. It's a mapper modded version, which supports the most mappers of any FCEUltra version, I think. I tried to make as little change as possible, so using a diff utility won't be too much trouble to see the changes I made. From what I can remember:
I had to remove support from gzip compressed nes roms because of a reference to dup() which wasn't supported and it was over my head on how to implement a similar function.
Added fclose(); lines to the sram functions (was freezing the ps2 without them), changed the sav/state/gg.rom filepaths in general.c, and defined the ps2's variable types in types.h.
I commented out the call to SexyFilter in sound.c and put in a simple memcpy, as I was getting a stack overflow in the SexyFilter function.
I copied the original FCEUI_LoadGame(); function and commented it, in case I screwed up something and needed to revert.
I also commented out a call here or there to the PPU Viewer code that was in the windows sourcecode.
A list of 64-bit md5 numbers stored for SRAM support had to be modified in ines.c to two 32-bit nes numbers, then cast to 64-bit because of a type conflict or something (big thanks to DCGrendel for helping me on this by giving me an example of what to do)
Sound code & Profiling:
I included two reports with sound on and off.
To enable sound, in main.c, define samplerate as 44100 or 48000. Add -DSOUND_ON to the CFLAGS in the Makefile. This doesn't do anything but enable the FCEUltra core to process sound since I didn't add any output code.
To enable profiling, EE_CFLAGS, replace -03 with -pg, and comment out the second EE_CFLAGS line.
Instructions for use:
Supports only two roms which should go in MC0:FCEUMM/nesrom1.nes and MC0:FCEUMM/nesrom2.nes
Only the digital pad is supported for directional movement.
Cross is A.
Square is B.
Select is Select.
Start is Start.
R1 toggles through 10 savestate numbers (shows onscreen).
L2 loads savestate
R2 saves savestate
Circle closes the nesrom1.nes game (needs to be pressed to save a game's SRAM data, like in zelda type games) and then loads nesrom2.nes (pushing it again after this just reloads the second rom, but it saves sram too)
2 controllers should work, I haven't tested it though, but added support for it since it was simple to do.
Saves and savestates use the filename of the rom, so if you replace nesrom1.nes or nesrom2.nes, delete the nesrom1.sav/nesrom1.fc# or nesrom2.sav/nesrom2.fc# with ulaunchelf first, or copy them somewhere else and rename them if you want to keep them. I'm not sure what will happen if you try, since I never did.
cah4e3 for making a version of FCEUltra with extra mapper support.
DCGrendel for his help for the stack overflow error in SexyFilter();, as well as the list of SRAM compatible md5 hashes
The entire ps2dev/ps2-scene community for PS2SDK, gsKit, and various other projects I utilized when porting FCEUltra.
And finally, here's the source, and binaries. I included packed/unpacked binaries as well as NTSC/PAL versions. I haven't tested the PAL .elfs, but they should work fine.
La verdad es q mi ingles es de pena asi q no se muy bien lo q dice, tb he intentado descargarme el emu del foro y me dice q no tngo suficientes privilegios.... si alguien puede bajarlo y me puede pasar se lo agradecere muxo