3 ms·
The parent link is Super Mario Bros running fullscreen. It runs best in FF4, the audio in Chrome can be a little choppy. It will suck in FF3.6 and everything el
by paulirish 16y ago
The parent link is Super Mario Bros running fullscreen. It runs best in FF4, the audio in Chrome can be a little choppy. It will suck in FF3.6 and everything else, probably. It uses the (very) experiemental Web Audio API in webkit and the Audio Data API in FF4; it has a fallback to standard HTML5 Audio(), which has known performance issues everywhere.
You can view the full emulator here: http://www.grantgalitz.org/gameboy/ http://www.grantgalitz.org/gameboy/
It's all on github: https://github.com/grantgalitz/GameBoy-Online https://github.com/grantgalitz/GameBoy-Online
And a few other ROMS are available for play now:
* http://www.grantgalitz.org/zelda/ http://www.grantgalitz.org/zelda/
* http://www.grantgalitz.org/pokemon/ http://www.grantgalitz.org/pokemon/
- daeken 16y agoNice work! As it stands, you seem to be doing pure interpretation for the CPU; have you considered dynamic recompilation? You can see this in practice for the 6502 here: https://github.com/daeken/Dyna6502Asm https://github.com/daeken/Dyna6502Asm 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.
- grantg 16y agoYou might want to talk to me then (Look at the user name on the github repo. ;) ). The DMG/CGB CPU needs to be emulated with clock-cycle accuracy though, so dynarec would be very difficult. P.S.: Here's another game - http://www.grantgalitz.org/SuperMarioLand2/ http://www.grantgalitz.org/SuperMarioLand2/
- daeken 16y agoAh, my apologies -- thought that the OP was the original creator. 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.
- jacoblyles 16y agoHTML5 audio in Chrome is not at a point where it can be used for game sound effects yet. Rewinding and restarting a sound doesn't work consistently, and creating new Audio() objects too quickly crashes the tab. FF4 is great, though. Star my Chromium bug reports if you want this fixed. http://bit.ly/g9KJNz http://bit.ly/g9KJNz http://bit.ly/hSXvOj http://bit.ly/hSXvOj
- ars 16y agoBTW, just a reminder not to use shortened urls here - even if they are very long. Those urls are actually: http://code.google.com/p/chromium/issues/detail?id=71322&can=4&colspec=ID%20Stars%20Pri%20Area%20Feature%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS http://code.google.com/p/chromium/issues/detail?id=71322&... http://code.google.com/p/chromium/issues/detail?id=71323&can=4&colspec=ID%20Stars%20Pri%20Area%20Feature%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS 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.
- aw3c2 16y agoNothing is ported to HTML5, you made a emulator though. Porting != emulating! Great work!