News for hackers. Stuff that matters.
Re:GameBoy Color emulator entirely in JavaScript+HTML5 by T-R on Saturday April 09, 2011 @06:15PM (#2428222)
Impressive, but might I suggest using a public domain ROM, instead of exposing yourself to a lawsuit:

http://www.zophar.net/pdroms/gameboy.html

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by city41 on Saturday April 09, 2011 @06:18PM (#2428230)
Or just have the user load a rom locally, like I do with my little NES ROM painter[0]. Nintendo strikes down hard on emulation like this. Although I see why he chose DKC, that is one beautiful GBC game.

[0]http://www.mattgreer.org/exercise/1nespaint

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by grantg on Saturday April 09, 2011 @06:52PM (#2428297)
okay, removed offending ROMs, and put up a homebrew one: http://www.grantgalitz.org/CrazyZone/

The URL linked above now redirects to the homebrew ROM.

Edit: Oops, I overwrote the redirect, sorry. Try http://www.grantgalitz.org/CrazyZone/

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by jambo on Saturday April 09, 2011 @07:22PM (#2428365)
I'm getting "Please try using a standards compliant browser." in Safari 5 & Chromium 12.

[edit: fix confirmed]

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by malnourish on Saturday April 09, 2011 @07:28PM (#2428375)
I am as well in Firefox 4.
Re:GameBoy Color emulator entirely in JavaScript+HTML5 by grantg on Saturday April 09, 2011 @07:34PM (#2428393)
Edit: Fixed
Re:GameBoy Color emulator entirely in JavaScript+HTML5 by DarkShikari on Saturday April 09, 2011 @07:28PM (#2428373)
What would be even more interesting is a JIT-based emulator that worked by compiling bytecode into Javascript, then relying on the browser to compile it back into machine code.

A machine-independent, JIT-compiled JS emulator might actually end up being faster than some purely-interpreted native-code emulators. And unlike a purely native JIT emulator, it wouldn't need a compilation component (the browser would do that itself).

Obviously such a thing would be dramatically slower than a native JIT emulator -- but surprisingly few emulators are JIT-based.

(Possible catch: I know for a fact that some Nintendo DS games use small amounts of self-modifying code. This probably is true of previous generations, too.)

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by grantg on Saturday April 09, 2011 @07:31PM (#2428381)
Not a good idea with hand-coded ROMs for CPUs that are in single-digit MHz that use interrupts liberally, it would cause code cache invalidation a lot.

Some stats for SML2 running (Audio ON (web audio for mac in about:flags for chrome, mozAudio for Firefox 4), scaling OFF):

Chrome 12: http://i.imgur.com/JjpT5.jpg 27.0% CPU load

Firefox 4: http://i.imgur.com/yEzzw.jpg 68.6% CPU load

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by wazoox on Saturday April 09, 2011 @05:49PM (#2428175)
Impressive. Any information on the inner workings?
Re:GameBoy Color emulator entirely in JavaScript+HTML5 by geuis on Saturday April 09, 2011 @07:34PM (#2428392)
"Could not initialize the emulator properly. Please try using a standards compliant browser."

Getting this in Chrome 10.

I think your project needs a little love.

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by DiabloD3 on Saturday April 09, 2011 @04:37PM (#2428032)
Doesn't seem to work in Firefox.
Re:GameBoy Color emulator entirely in JavaScript+HTML5 by DiabloD3 on Saturday April 09, 2011 @04:40PM (#2428040)
Er, whoops, it takes about 5+ minutes to load. Seems to work fine.
Re:GameBoy Color emulator entirely in JavaScript+HTML5 by grantg on Saturday April 09, 2011 @07:45PM (#2428424)
x is A

z is B

shift is Select

return is Start

D-Pad is Joypad

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by tudorizer on Saturday April 09, 2011 @04:59PM (#2428091)
Why do you say it's an emulator? Looks like a ported game to me. Ported in JS, that is.
Re:GameBoy Color emulator entirely in JavaScript+HTML5 by skymt on Saturday April 09, 2011 @06:04PM (#2428204)
It's an emulator: http://www.grantgalitz.org/gameboy/js/GameBoyCore.js

Edit: Here's the home page, with a full UI: http://www.grantgalitz.org/gameboy/

Re:GameBoy Color emulator entirely in JavaScript+HTML5 by DiabloD3 on Saturday April 09, 2011 @05:32PM (#2428146)
Compare it to the original on a GBC or an emulator. It looks and sounds just like it.
Re:GameBoy Color emulator entirely in JavaScript+HTML5 by ubertaco on Saturday April 09, 2011 @05:41PM (#2428161)
Ported is different from emulated though. Ported involves altering the game itself to run on a different platform. Emulation is building a virtual version of the original platform that does "translation" of sorts between the original platform's methods/attributes/etc and the new platform, leaving the game itself unaltered.