Post subject: Building a Game Boy emulator in Javascript
Joined: 11/22/2004
Posts: 1468
Location: Rotterdam, The Netherlands
Yeah, some guy is actually doing this. And he's documenting every step of the way as a sort of learning tool for programmers: http://imrannazar.com/GameBoy-Emulation-in-JavaScript This is very neat, and it seems that the latest step in development allows Tetris to run.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
JavaScript is not one of the most efficient scripting languages in existence (even though some web browsers have optimized the execution speed quite a bit in the last years). Browser-based JavaScript also was never designed for drawing graphics at high speed. Seems to be a rather suboptimal platform for that purpose. Well, I suppose it's a project akin to those raytracers written in PostScript (which are thus completely runnable in a PS-based printer).
Joined: 10/20/2006
Posts: 1248
Imran Nazar wrote:
JavaScript is often perceived as a Web scripting language, with a specialist purpose of manipulating HTML pages. JavaScript is, however, a general-purpose Turing-complete language: the best way to illustrate this is to emulate another system through JavaScript.
He doesn't really seem to have picked it because he thought it was the most efficient language to do the job. Readers of his blog can learn about js and how to write emulators at the same time this way. I like it. ^^
Editor
Joined: 3/10/2010
Posts: 899
Location: Sweden
Everybody knows that you should use Flash for something like this.
Joined: 11/22/2004
Posts: 1468
Location: Rotterdam, The Netherlands
Kuwaga wrote:
Imran Nazar wrote:
JavaScript is often perceived as a Web scripting language, with a specialist purpose of manipulating HTML pages. JavaScript is, however, a general-purpose Turing-complete language: the best way to illustrate this is to emulate another system through JavaScript.
He doesn't really seem to have picked it because he thought it was the most efficient language to do the job. Readers of his blog can learn about js and how to write emulators at the same time this way. I like it. ^^
Yeah, this is really more of a proof-of-concept. Javascript is easy to understand and to program in, and it gives you results immediately, so it's a great language for giving a basic lesson in how things like the CPU work and how one can emulate them. It's true that Actionscript/Flash is way more efficient for this (especially when using the AVM2 virtual machine) though. He'll most likely use that when he writes the chapter on emulating sound since if I'm not mistaken, it's still not possible to create sound in the browser without it.
Player (36)
Joined: 9/11/2004
Posts: 2631
Untrue! Combine document.write with base64 url'd audio tag. It will be slow as crap though!
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
arflech
He/Him
Joined: 5/3/2008
Posts: 1120
It has already been done with the NES: http://benfirshman.com/projects/jsnes/
i imgur com/QiCaaH8 png