A small update:
I’ve now ‘hard wired’ the memory map to get rid of some indirections. This gave me a small (but noticeable) performance gain of about 10% (this version is not online yet).
To speed up things more, I’ll see if it helps to get rid of the generic graphics decoding & blitting code and replace that part with a custom optimised version. There’s already a simple ‘dirty rectangles’ algorithm in place, so I’m not sure how much I can gain there since Donkey Kong’s graphics are quite static.
After that, I guess there’s realistically not much more performance to squeeze out of this without reverting to things like recompilation. I already down-clocked the CPU emulation (which is of course a gross cheat :)), so even busy loop removal won’t help that much, and I even reverted to 30FPS rendering…
To be honest, I’m a bit disappointed with the performance of the new android JIT runtime. I think that got me at most 2x the performance.
Donkey Run ran fine on J2SE 1.4 on a 266MHz Pentium II laptop, 60 fps with sound and all, without all those ugly hacks…
I know a laptop is not the same as a phone, but still, hopefully Google will improve things there. After all, my phone’s clock speed is still more than 2 times higher than the old laptop where I did most of JEmu2’s development.