Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Emulation (Games) Games

JavaScript Gameboy Color Emulator 153

Prosthetic_Lips writes "A programmer named Grant Galitz has released a GameBoy Color emulator written in HTML5/JavaScript, and it will run ROM images stored locally. What's amazing is that it runs the games at a playable speed. We discussed a different, but similar project six months ago, but it seems like this one is pretty complete at this point. It's also open source."
This discussion has been archived. No new comments can be posted.

JavaScript Gameboy Color Emulator

Comments Filter:
  • by Anonymous Coward on Tuesday June 14, 2011 @03:32AM (#36433166)

    Holy shit someone made JavaScript useful?!?

  • It's really cool, and I bow to his technical prowess for getting it working, but I have to ask why anyone in their right mind would choose HTML5 and Javascript to implement a Gameboy emulator???

    • Re:Why? (Score:5, Insightful)

      by Shikaku ( 1129753 ) on Tuesday June 14, 2011 @03:37AM (#36433186)

      Well, if you can visit this site on the phone with a modern browser for example...

    • by Anonymous Coward

      well. think about it. your walled garden mobile device has to do js and html5 soon enough. .. ..so it's not so walled garden anymore. it shows how futile it is to try to keep censoring what you can run on a device from the user.

      • As long as you limited yourself to Java applets, there never have been any walls whatsoever on the iPhone. Apple allowed Java applets, uncensored, from day one. However, developers weren't happy about being restricted to this inferior and slow language, and wanted to make native apps to take full advantage of the device. The "walls" are only for those native apps (which would have no trouble whatsoever running Gameboy games at 10 times the native speed while this Java Gameboy emulator is getting headlines f
        • What? who mentioned Java?

          • Yeah, I know, Java, Javascript, whatever
            • by narcc ( 412956 )

              Yeah, I know, Java, Javascript, whatever

              There is a HUGE difference.

              • Java/Javascript/Javawhatever are all object-oriented programming languages that are (supposed to be) platform-independent and as a result, due to various translation and other issues, run rather more slowly than native code. Yes, Java and Javacript are TOTALLY different, just like tigers and polar bears are TOTALLY different (if you disregard the fact that they're both large carnivores and therefore incredibly similar from an alien point of view). My point is that, if you were happy using non-native code, n
                • Re: (Score:3, Funny)

                  by narcc ( 412956 )

                  Wow, you're an idiot.

                  • Elaborate much?
                    • You confused Java and Javascript for one.

                    • I explained that I do know that there's a big difference, but that they are also very similar. Object oriented languages, not native, etc... Tigers and polar bears, remember I wrote that? Yes, they are used for different things. One runs in the browser, the other runs in a box in the browser (or in other places), WHATEVER! They are similar, period.
                    • JavaScript isn't OO in the same way that, say, Java and C# are. Java is class-based, JavaScript is prototype-based. JavaScript is also dynamically typed while Java is statically typed.

                    • by 228e2 ( 934443 )
                      A painful death isn't fun to watch. I hope you concede defeat :/
                    • Yes, I'm a total idiot for mistakenly seeing any similarity whatsoever between Java and Javascript. I humbly apologise. I bet this message will be modded insightful now ;-)
                    • by Toonol ( 1057698 )
                      Java is also a real, object-oriented programming language, while Javascript is solely a web scripting language. With very little in common with Java.

                      Well, several years ago you could say Javascript was solely a web scripting language. It's showing up more and more as a general-purpose scripting language in stand-alone applications. It's actually much cleaner and faster when divorced from the browser, because 90% of the annoying cruft associated with Javascript is actually the crappy HTML DOM, browser
                • My point is that, if you were happy using non-native code, no "walls" have ever stopped you on the iPhone.

                  Three differences:

                  • Apps that use CACHE MANIFEST and localStorage to remain available offline appeared to be limited to 5 MB last time I checked. Game Boy Color ROMs were already up to 4 MB.
                  • JavaScript is slow on iPhone due to lack of JIT. JavaScript in Safari has become faster on iOS 4.3, but pages bookmarked on the home screen still use the old slow interpreter.
                  • And how does a program written in JavaScript request access to the camera and microphone? For example, how would a Game Boy Color emulator written
                  • Well, I suppose it probably does not have access to the camera, unless html5 provides access to it somehow. Which confirms my point that the comment about the "walled garden" not being so "walled" anymore was off the mark. Nothing has changed, you're not running native code. The walls apply only to native code, and those walls are still intact.
                    • The walls apply only to native code

                      Then please allow me to rephrase: The 5 MB wall, speed wall, and camera/microphone wall apply to non-native code. I'd like to hear why these aren't walls.

                    • I was originally replying to someone saying that the walled garden is "not so walled garden anymore". I haven't actually seen any walls come down. Of course there are still limitations to JavaWhatever. But it's not like someone suddenly took down walls by programming in JavaScript. The walled garden is still unchanged. The possibilities outside the walls which are being used for the emulator, and the limitations, are still unchanged too. Nothing new. That's all I ever meant to say.
                  • From my understanding, 5MB is the default, and if it grows the user is prompted to allow the increase. That may be just for databases though, I haven't personally tested it.

                    See: http://ofps.oreilly.com/titles/9780596805784/ch05_id35816678.html [oreilly.com]

                • by wisty ( 1335733 )

                  Yes, Java and Javacript are TOTALLY different, just like tigers and polar bears are TOTALLY different (if you disregard the fact that they're both large carnivores and therefore incredibly similar from an alien point of view). My point is that, if you were happy using non-native code, no "walls" have ever stopped you on the iPhone.

                  Um, no. The iPhone doesn't *have* Java support. Yes, they are like polar bears and tigers. And the iPhone is like Antarctica. To an alien visiting Antarctica, there's a big difference between a polar bear and a tiger because only one of them lives there.

                  And yes, I know that there's a difference between Antarctic and The Arctic Circle, but they are both kinda similar, right? Except for the lack of polar bears ...

                  • Yes, I get it, Java and Javascript are different, give me a break! Google for "Java Javascript difference", count the similarities and count the differences. I found more similarities than differences. Yes, one has to be compiled and the other doesn't. Yes, one is a scripting language and the other isn't. I don't care. They are languages with a C-ish syntax that are mainly used to run little programs in browsers (yes, Java can run outside of a browser too, I know), they are slower than native code and have

    • by Anonymous Coward

      It's really cool, and I bow to his technical prowess for getting it working, but I have to ask why anyone in their right mind would choose HTML5 and Javascript to implement a Gameboy emulator???

      You answered your own questions in your opening remarks.

      • by tepples ( 727027 )

        I have to ask why anyone in their right mind would choose HTML5 and Javascript to implement a Gameboy emulator???

        Platforms that require digital signatures with an expensive certificate for native applications often do not require them for JavaScript applications.

    • Re:Why? (Score:4, Funny)

      by teh kurisu ( 701097 ) on Tuesday June 14, 2011 @04:56AM (#36433466) Homepage

      Maybe they want it to run on Windows 8.

    • by bberens ( 965711 )
      Because someone who is looking for an expert Javascript developer is going to offer him a job at $200k+.
      • $200k, seriously?
        • by bberens ( 965711 )
          Yeah, there's jobs out there with that kind of salary for top notch web development (html, css, javascript). They're usually leading teams of other developers for high profile companies like Google, Yahoo, etc. You probably have to be willing to move, but the money is out there if you're good enough to pontificate on end about the different implementations of each of those technologies between browsers and the versions of each of those browsers.
    • The same reason they have three-legged races.

  • http://i.imgur.com/HX3pF.png [imgur.com]
    Render me impressed. The sound is a bit of a mess but works better than that javascript Doom from some days ago.
    I don't have a ROM for pokemon gold/silver but they might work as well. Pretty cool.
    (Why pokemon and why should you care? It squeezes the gameboy until the last drop)

    • I would have thought the port of Donkey Kong Country would have pushed it more. At least graphically.. I guess Pokemon has a LOT more values to keep track of.
      • Well yes, graphically speaking DKC or even the infamous Resident Evil and a few other titles I can think about, do push the console much further in graphics.
        However, pokemon required a lot of clever and/or gross hacks to fit everything in the minuscule available space. It's like cramming a modern-style database in a 8086.
        (I believe the second generation (gold/silver/crystal) used a larger ROM size so they could relax a bit and fit stuff more liberally, but read about the "glitch pokemon" "Missingno" which o

        • Oh right, that glitch. I was just learning about programming basics when I learned why that happend and it blew my mind out of my skull.
    • I have a self-dumped pokémon red rom, and it does indeed run pretty well.

      Colour me impressed!

  • Ring in sick...
    Google Pokemon ROMs...
    Download Pokemon Gold...
    I'll be back in 20 hours...
  • It's also open source.

    Are there any JavaScript applications which aren't?

  • Remember back when JavaScript was good for little more than web forms and maybe some silly sparkling rainbow ponies? It's amazing how far this little language has come. I think a lot of these developers start projects like this just to show they can. Preconceptions die hard with developers. There's a lot of developers out there still afraid to use anything other than C++ for a basic desktop application because, "those other languages are slow". In think in the open source and *nix communities attitudes

    • by DerPflanz ( 525793 ) <bart@NOSPAm.friesoft.nl> on Tuesday June 14, 2011 @05:45AM (#36433642) Homepage

      There's a lot of developers out there still afraid to use anything other than C++ for a basic desktop application because, "those other languages are slow".

      Euhm. JavaScript *is* slow. In this case, it runs a technology of 13 years ago in a platform-on-a-platform. On hardware that is a zillion times faster than a handheld game computer. I have the feeling computers get more and more sluggish the last years, just because of all this eye candy and layer-upon-layer.

      Remember C64 boot times? It was subsecond. Granted, it loaded almost nothing, but it is also 30 years ago. But even the iPad (dedicated hardware, relatively small OS footprint) needs several tens of seconds to boot.

      • by DMFNR ( 1986182 )

        You're right, and I'm not trying to say JavaScript is just so damn blazing fast people should rewrite all their FORTRAN code in JS. I'm just saying that a lot of progress has been made making the language somewhat capable. It's come along way in the last 10 years. I guess I went off topic a bit, as I wasn't specifically referring to JavaScript with that comment; I was talking more about why people do fun, but somewhat pointless projects like this in a language like JavaScript. It's good fun do things wi

        • Isn't QuickBasic a compiled language? If so, I don't see anything weird in making 3d games in it, even on old and slow hardware.

      • Remember C64 boot times? It was subsecond.

        Wait, what are you talking about? Do you mean booting to (presumably) the BASIC interpreter (built into ROM), or actually booting off of a 5.25" floppy into an OS? If the latter, I doubt sub-second. Maybe a couple of seconds at best.

        I never had a C64, I am comparing with the general features/abilities of other computers of the time.

        • by grumbel ( 592662 )

          Do you mean booting to (presumably) the BASIC interpreter (built into ROM)

          The one second boot is booting into BASIC interpreter, as that essentially was the C64s OS/commandline. Loading stuff from a floppy of course took a whole lot longer.

          • Yeah, but if you had a floppy in the drive, doesn't it boot directly from that?

            In other words, that was my point that I didn't state too clearly -- that most people wouldn't actually get that sub-second boot time, since they'd be booting a floppy to get an OS/run a program.

            • by grumbel ( 592662 )

              Yeah, but if you had a floppy in the drive, doesn't it boot directly from that?

              No, it would always boot into BASIC from which the user then had to load the game manually with LOAD "*",8,1:RUN. Only the later Amiga did auto-boot into whatever floppy you had in the drive. The C64 however had a module slot, so that you could for example insert an enhanced BASIC module and if that was inserted, on power on, the C64 would boot directly into that, instead of the default BASIC, again that was essentially a second.

              Now of course, actually loading a game from floppy could take minutes, but havi

    • Comment removed (Score:4, Insightful)

      by account_deleted ( 4530225 ) on Tuesday June 14, 2011 @08:30AM (#36434328)
      Comment removed based on user account deletion
  • by Hazel Bergeron ( 2015538 ) on Tuesday June 14, 2011 @04:36AM (#36433396) Journal

    Finding that your machine is fast enough? Noticing that previous generation native software runs at a good speed, providing you the security of physical barriers and an uptime which doesn't require you to rely on hundreds of cooperating network, storage and service companies? Worried that it's too easy to trust the admins in your own office more than any number of competitors, foreign governments and bored hackers?

    Then you want... THE CLOUD. Turn your PC into a graphical terminal and turn the UI and responsiveness clock back 15 years. Show off to your friends that, thanks to the uniquely layered framework making up THE CLOUD, only you have a machine modern and beefy enough to emulate a 4MHz Z80. You too can have what you had with Windows 95, today!

    • by Sycraft-fu ( 314770 ) on Tuesday June 14, 2011 @05:18AM (#36433562)

      I've no issue with stuff being online. I love the Internet, it is a major part of my life both in terms of entertainment and profession. However let's be straight as to when it is and isn't useful. This "Let's do everything in a webbrowser," shit is stupid. No, let's not. There is nothing wrong with local, native apps and indeed there's efficiency advantages to be had.

      Maybe someday we'll have processors so ridiculously overpowered it won't matter, you'll be able to run everything in a very high level language, all sandboxed up, with all kinds of crazy overhead and still have great performance and do it on less than a watt. However until that day, I think there's plenty of room for more efficient things on your computer.

      That is all, of course, not to mention any of the security or privacy concerns you note.

      I like the progress of technology but I dislike the fadism. People get in to these various fads with no real thought of if they are a good idea for everything. Currently "the cloud" and 3D video top my list of stupid fads. Not that having remote, distributed, data storage and computing is useless in all cases, but we had that before "the cloud." "The cloud" is rather ill defined and just seems to be BS speak for "Let's do everything somewhere else online because... well I don't know but it is an awesome fad!"

      Seriously people, use the right tool for the job.

      • I love the Internet

        Yes, but.

        The Internet is like that hot girlfriend that promised to give you a threesome with her and her twin sister, but you've been with her for three years, spending money all your money on her and now the twins are starting to get fat and skanky and they still haven't put out and now they're starting to become nothing but a pair of greedy sluts. On top of that they've both got these suspicious sores around their mouths.

        Yes, that's the Internet.

        I like the progress of technology but I

      • by tepples ( 727027 )

        There is nothing wrong with local, native apps

        I can think of a few things:

        • Several popular platforms require all native applications to be digitally signed, and there's so much bureaucracy in getting an application signed that a smaller firm cannot compete.
        • Local applications are usually packaged in such a way that the user must have administrator privileges to install it, and not everybody who uses a computer is its owner. Some applications are distributed as a "portable application", which installs to the user's home directory or from removable media
        • Several popular platforms require all native applications to be digitally signed, and there's so much bureaucracy in getting an application signed that a smaller firm cannot compete.

          Since you mention iTunes separately, I presume you are referring to are referring to the iPhone here. There have been lots of one-programmer apps that have shown up on the App Store. How exactly can't a smaller firm compete?

          • by tepples ( 727027 )

            Since you mention iTunes separately, I presume you are referring to are referring to the iPhone here.

            I'm largely referring to Nintendo and Sony video game consoles. Not all game concepts work well on a PC or a phone.

        • Several popular platforms require all native applications to be digitally signed, and there's so much bureaucracy in getting an application signed that a smaller firm cannot compete.

          You're being deliberately vague with "several popular platforms" because you're probably referring to games consoles or something rather than general purpose platforms we're talking about. Can you get comparable gaming performance from a web app?

          Local applications are usually packaged in such a way that the user must have administrator privileges to install it, and not everybody who uses a computer is its owner. [...]

          "Web apps are a way of bypassing the environment's security policy." And please don't respond with the statement that HTML/Javascript engines are 100% secure so it's totally OK to break these rules as it won't have any technical consequences.

          Even on a home PC, where a sympathetic administrator is usually within easy reach, downloading and installing an application is a psychological barrier to using the application.

          The minute or two requir

          • by tepples ( 727027 )

            you're probably referring to games consoles or something rather than general purpose platforms we're talking about.

            A lot of users don't own their own PC.

            Can you get comparable gaming performance from a web app?

            No, but millions of FarmVille players will attest that Adobe technology gives good enough gaming performance. And HTML5 performance is better than zero performance and an error message "The application could not be installed because its signature is invalid."

            "Web apps are a way of bypassing the environment's security policy."

            Pretty much. If operating systems had easy-to-reach UI for creating a sandbox in which to run native applications, as in "point, click, jail", this workaround wouldn't be as necessary.

            If you're really lazy and impulsive

            Which a lot of end users are, e

            • A lot of users don't own their own PC.

              Which users are you thinking of? Don't handwave an argument.

              No, but millions of FarmVille players will attest that Adobe technology gives good enough gaming performance.

              "Look over there, it's something else."

              And HTML5 performance is better than zero performance and an error message "The application could not be installed because its signature is invalid."

              What is your obsession with signatures? The two top platforms have no mandatory app signing by default. It's an option for Windows but it's entirely at the discretion of the guy who controls the client machine.

              Which a lot of end users are, especially users who routinely use a web application on several machines that don't belong to them.

              This might be true for casual usage such as checking for information or reading mail, but which user routinely gets sustained, productive work done on machines which are in no way prepared for him to use

              • by tepples ( 727027 )

                A lot of users don't own their own PC.

                Which users are you thinking of?

                Someone in a school computer lab, in the break room at work, or in a public library or Internet cafe uses a PC that he does not own. A school-age child uses a parent's PC that he does not own.

                What is your obsession with signatures?

                All popular set-top interactive devices, which are not general-purpose PCs, have them.

                This might be true for casual usage such as checking for information or reading mail

                Or someone who spends all day on Facebook and on things linked from Facebook.

                but which user routinely gets sustained, productive work done on machines which are in no way prepared for him to use them?

                Not all applications are tools for "sustained, productive work". Consider a regular user of a PC in the break room at work, where IT has authorized web appli

    • ... I do not think it means what you think it means. This is a story about an emulator which runs client-side and can read local ROMs. Just because the magic words "Javascript" and "HTML" are in there doesn't mean it's "in the cloud".

    • Comment removed based on user account deletion
    • Bwahaha so true :-)

    • I'm as fed up as anyone with the hype surrounding "the cloud", and wish that energy was directed at more long-sighted initiatives like getting universal IPv6 support (which would make much of the need for "the cloud" unnecessary).

      However software not improving much in responsiveness even while the technology gets much faster is due to increased security layers, increased hardware abstraction layers, more things going on at once, software development environments which put the priority on dev time rather
  • by Anonymous Coward

    Wait a sec, is it even possible to hide Javascript code? Thought it was open by design, being client side and all...

  • Nicely done!

  • by Per Wigren ( 5315 ) on Tuesday June 14, 2011 @06:31AM (#36433780) Homepage
    Cool, but not as cool as the JavaScript C64 emulator [kingsquare.nl].
    • The author really needs to sort that space bar issue out.

    • Cool, but not as cool as the JavaScript C64 emulator [kingsquare.nl].

      Umm, whatever your beliefs about the relative "coolness" of both the C64 and the GBC, it can hardly be argued that the thing you linked to is cooler than this GBC emulator. Not only is the GBC considerably more complex as a machine, the emulator is surprisingly complete and very usable.

  • Is it possible to make something like or we will be doomed to slow interpreted code?
  • Link's Awakening at work? Challenge accepted.
  • My JavaScript gameboy color emulator is not related to the one the op has you believe was incompletely done months ago, that's imran's and it's still an incomplete one. The sound may sound bad, it's not my fault, it's actually your browser, since in some cases I need to fallback to flash outputting the audio due to a lack of a JavaScript API to drive the realtime audio. Try running it in firefox 4 for better audio. And for those saying this is another gameboy color emulator in JS, nope, you're just thinkin
    • Hmm it seems the op changes the details on the project from months ago by imran, thanks for saying it's different and not the same project, you must have corrected it in this repost.
  • It's not the only JavaScript classic system emulator.

    For example, here are TWO different JavaScript Amstrad CPC emulators: http://www.cpcbox.com/ [cpcbox.com] http://roland.antoniovillena.es/ [antoniovillena.es]
    A Spectrum emulator! http://jbacteria.antoniovillena.es/ [antoniovillena.es]
    TRS-80: http://jtandy.antoniovillena.es/ [antoniovillena.es]

    Of course the first two systems here are 4MHz Z80s, not 8MHz Z80s like the Gameboy Color.

  • by Dwedit ( 232252 ) on Tuesday June 14, 2011 @11:33AM (#36436686) Homepage

    Wow, we have a thread about a Javascript Gameboy Color emulator, and nobody has mentioned Nezulator, the Javascript NES emulator [zelex.net].

  • What's amazing is that it runs the games at a playable speed.

    It's really a sad state for software in general when something like this is considered "amazing".

    • What, emulating a 4 MHz, 8 bit CPU with bitmap graphics on a 3 GHz, 64 bit machine with a multi-core GPU isn't exciting? It runs *at full speed*!
  • by slapout ( 93640 )

    But does it work in iOS?

THEGODDESSOFTHENETHASTWISTINGFINGERSANDHERVOICEISLIKEAJAVELININTHENIGHTDUDE

Working...