6 ms·
Super Mario Brothers GameBoy (and all GameBoy games) ported to HTML5
- paulirish 16y agoThe 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!
- aforty 16y agoThe audio is messed up for me on SMB using Chrome on a MBR running OSX. Anyone else?
- Dilpil 16y agoHorrid sound glitches on mozilla in windows 7 as well.
- grantg 16y agoI'm guessing you're not using Firefox 4 then, I take it? Edit: Firefox 4 on linux has a GC issue, not my fault.
- grantg 16y ago
- arange 16y agowow and it runs just as fast as it did back then too!
- estel 16y agoThere's also JSNES: http://benfirshman.com/projects/jsnes/ http://benfirshman.com/projects/jsnes/ which probably benefits from not stretching to fullscreen.
- deleted 16y ago[deleted]
- deleted 16y ago[deleted]
- daeken 16y agoA Hacker News user created some cool tech and opened it up. How is this not something interesting to hackers? Not to mention that the rules say that you should simply flag articles you don't believe belong, not complain about it.
- deleted 16y ago[deleted]
- wzdd 16y agoImpressively, it runs (very slowly) to the point of showing a title screen on an HTC Desire, but then I can't figure out how to send input.
- makmanalp 16y agoIf you want to read on about how to go about building one of these, check out my friend Imran Nazar's very detailed jsgb article series: http://imrannazar.com/GameBoy-Emulation-in-JavaScript http://imrannazar.com/GameBoy-Emulation-in-JavaScript Also, the source code: https://github.com/Two9A/jsGB https://github.com/Two9A/jsGB
- JonnieCache 16y agoI can vouch for the quality of these tutorials. It actually puts emulation within easy reach of novice programmers, as unlikely as that may sound. Give it a go!
- jerf 16y agoWithout criticism of this particular project or site intended, I am surprised at the number of these emulation sites running commercial ROMs popping up without action being taken by Nintendo et al. Someone's going to have an example made out of them. grantg, if you're just trying to show off an emulator but aren't ready to be the example, may I suggest finding a free Gameboy game to show off instead? I know there are actually-free games for many other consoles, I presume there are for the gameboy as well.
- wladimir 16y agoThe game companies generally don't care about the really old stuff. They don't see much (if any) commercial value in them anymore. Don't try to emulate their latest or one-to-latest console though.
- wesley 16y agoHeh, nintendo certainly does. They are actively reselling these games in the wii / 3DS online stores. Expect a takedown notice soon.
- postfuturist 16y agoMaybe, maybe not. Either the jsnes site has been boldly ignoring takedown notices for some time now, or Nintendo doesn't really care that much: http://benfirshman.com/projects/jsnes/ http://benfirshman.com/projects/jsnes/
- zandorg 16y agoThe UK company Codemasters takes a heavy handed approach to piracy, of 1986-era ZX Spectrum games!
- grantg 16y agoI took down the violating pages. I put up a freeware ROM test page - http://www.grantgalitz.org/gbc_demo/ http://www.grantgalitz.org/gbc_demo/
- w1ntermute 16y agoInput doesn't seem to be working with Firefox 4 beta 12 on Linux...I tried the shortcuts listed under "Instructions" on http://www.grantgalitz.org/gameboy/ http://www.grantgalitz.org/gameboy/ to no avail.
- zcid 16y agoRunning Iceweasel 4 beta 12 here and it is running fine on my Debian system.
- determinobot 16y agoSounds cool, tried it on my Droid, but unfortunately it runs at something like 0.25 frames per second.
- guigui 16y agoVery nice work. Too bad webkit browsers don't allow to turn off image smoothing like Firefox does, which makes true pixel art impossible. I'd love to see support for nearest-neighbor resampling included in the future versions of Chrome/Safari.
- grantg 16y ago+1 -webkit-crisp-edges or crisp-edges See -moz-crisp-edges @ https://developer.mozilla.org/en/css/image-rendering https://developer.mozilla.org/en/css/image-rendering
- alxp 16y agoWhat the what I'm walking backwards?? What crazy magic is this? Super Mario Bros. should be frozen in time exactly as I remember them, damnit.
- alxp 16y agoOh nevermind, it's just an artifact of the smaller viewport. I still want you kids off my lawn, though.
- ciupicri 16y agoHow do I get past the menu? I'm using epiphany-2.30.6-1.fc14.x86_64 which is powered by WebKit.
- grantg 16y agoFor anyone interested in seeing this run well in a safari build on mac, please see http://chromium.googlecode.com/svn/trunk/samples/audio/bin/WebKit-audio.05Jan2011.zip http://chromium.googlecode.com/svn/trunk/samples/audio/bin/W... It's a webkit/safari build with web audio in it, so audio is perfect as hell in it. :) And for firefox, just get firefox 4 (god no, not 3.6!).
- FnewscorpintheA 16y agoSame problem as a few others, can't get past menu screen. I can scroll up and down, but can't select anything. Tried in Safari 5 and Firefox 4 on OS X.6.5
- blub 16y agoI'm currently reading Masters of Doom, and I can't help but chuckle: John Carmack was doing this in 1990 on the PC platform. Back then it was considered too slow to do side-scrolling.
- grantgalitz 16y agoI removed these pages because others here were right, in that I shouldn't be providing the ROMs, but the users themselves instead providing them. You can still use the emulator, just go to http://www.grantgalitz.org/gameboy/ http://www.grantgalitz.org/gameboy/ and load in your own ROM files.
- ljf 16y agoAnyone else seeing the site down? Or just me? Can't get to link or parent site.
- grantg 16y agoSee http://news.ycombinator.com/item?id=2268214 http://news.ycombinator.com/item?id=2268214 I took it down because the others posting about potential problems are right, so in order to use the emulator go to http://www.grantgalitz.org/gameboy/ http://www.grantgalitz.org/gameboy/ and load in your OWN ROM files. Before I was providing the for you, but due to legalities, I am forcing you to provide your own. I didn't get a takedown notice, but I definitely don't want to get one, sorry for the inconvenience. :P
- ljf 16y agoThanks for letting me know. Great tool though.