You can view the full emulator here: http://www.grantgalitz.org/gameboy/
It's all on github: https://github.com/grantgalitz/GameBoy-Online
And a few other ROMS are available for play now:
You can view the full emulator here: http://www.grantgalitz.org/gameboy/
It's all on github: https://github.com/grantgalitz/GameBoy-Online
And a few other ROMS are available for play now:
In essence, you accumulate instructions in basic blocks and turn them into functions, which are then 'executed' (meaning turned into function objects) and then cached. In your case it becomes a little more complex as you do cycle timing, interrupts, etc, but there's no reason you can't bake this into your basic block functions. This drastically increases the performance of CPU emulation, while maintaining the same high quality.
If you're interested in doing this and/or have any questions, feel free to contact me.
P.S.: Here's another game - http://www.grantgalitz.org/SuperMarioLand2/
So, in effect what you do is take your code from `GameBoyCore.prototype.executeIteration' and roll that into your dynarec'd function on a per-instruction basis. The simpler you can make it, the better for performance; you have the benefit of knowing how long each instruction will take to execute at dynarec-time, so you can do some fun optimizations there.
Dynarec'ing cycle-accurate code is hard, but it's a lot of fun and damn efficient if you get it right.
http://code.google.com/p/chromium/issues/detail?id=71322&... http://code.google.com/p/chromium/issues/detail?id=71323&...
And you if you had wanted them shorter just remove everything after the id field.
Great work!