I proudly present yet another Maemo port, DrNokSnes, which comes from DrPocketSnes.
It is capable of emulating Mode7 games like Mario Kart at 20fps with sound in your average N810, which is nowhere near full speed, but much better than original snes9x’s 2-3 fps (without sound!) and still very playable.
You can get it from extras-devel, and check development over at garage.
The biggest problem I found while porting opensnes9x ASM core sources is that it seems that the ABI the N8x0 devices follow mandates that the upper 16 bits of a register holding a unsigned short parameter value be set to zero. The ASM code doesn’t take care of zeroing those and as such random data was being introduced in the C functions, making those crash at weird points, or even worse, adding random behavior to the emulated games (man, seeing all the Mario kart characters keeping hitting themselves the whole race instead of racing was fun).
Also, I was bitten by a gcc bug; thankfully just switching the order of two statements (in the dsp1emu.c file) made the bug go away.
The port
uses SDL for its video, audio, input, and timekeeping functions. SDL
uses XShm in Maemo and I believe is the third fastest way to put images
to the N8x0 video hardware (first one being omapfb, second one being
Xv). Audio uses the SDL ESD backend by default; I found it works much
better setting buffer sizes <= 512 samples — same as what the SDL
ALSA backend “wants”.
I implemented snesadvance.dat speedhacks support into the emulator, since they’re becoming very common these days. Incredibly enough, I couldn’t find a single opcode 42 implementation for the opensnes9x asm arm core, so I had to write my own. It’s still incomplete and doesn’t handle most branch types, but it seems to work fine with my test rom set.
The GUI uses osso-games-startup. I don’t know why I decided to use it (probably because I like integration with the rest of the system), it’s a bit undocumented and has some “wtf” features, but I like the result.Many thanks to the original authors of DrPocketSnes and all of #maemo, who helped me a lot with the port, and enjoy!
Leave a comment