The JavaScript blog.


emulators games emscripten

JavaScript MESS and the Internet Archive

Posted on .

Atari 2600

if you program and want any longevity to your work, make a game. all else recycles, but people rewrite architectures to keep games alive. -- Why the Lucky Stiff

Archive.org has a section dedicated to software. Inside you'll find The Internet Archive Console Living Room, which has details on some major games consoles from the late 70s and 1980s, including the Atari 2600 and the ColecoVision.

The great thing about this project is they're trying to keep old software alive. You can browse through titles and play them in a browser. This is powered by jsmess (GitHub: jsmess / jsmess), an Emscripten-based emulator derived from MESS:

The JAVASCRIPT MESS project is a porting of the MESS emulator, a program that emulates hundreds of machine types, into the JavaScript language. The MESS program can emulate (or begin to emulate) a majority of home computers, and continues to be improved frequently. By porting this program into the standardized and cross-platform JavaScript language, it will be possible to turn computer history and experience into the same embeddable object as movies, documents, and audio.

Running a game binary requires a suitable BIOS, but the groundwork for lots of systems has been added to MESS:

MESS and MAME were started over a decade ago to provide ubiquitous, universal emulation of arcade/gaming machines (MAME) and general computer hardware (MESS). While specific emulation implementations exist that do specific machines better than MAME/MESS, no other project has the comprehensiveness and modularity. Modifications are consistently coming in, and emulation breadth and quality increases over time. In the case of MAME, pages exist listing machines it does not emulate.

Over the last two years there's been a flood of new browser-based emulators, supporting everything from the Amiga to the Game Boy Advance. Part of what makes these project possible is recent technologies like Canvas, WebGL, WebAudio, and FileReader. But even seemingly less buzzwordy APIs like typed arrays can help get old games running smoothly.


emulators games

JSNES and Emulation

Posted on .

If you haven't seen JSNES or
JSSpeccy they're worth trying out, if only as a way of proving what JavaScript and canvas can
do. The most interesting thing about these emulators, though is the
source. JSNES is on GitHub so you can
casually browse files like
cpu.js to see how the emulator works.

In fact, if you've never written an emulator but wondered how they work,
JSNES is worth checking out. Emulators aren't really as scary as they
sound: they're essentially decoders that can understand code for
particular hardware and run it in a different environment. They're giant
case statements and simple algorithms.

In JSNES, you can see how the CPU registers and interrupts are handled.
Since the original hardware has been reverse engineered there's nothing
fundamentally complicated or difficult to understand, there's just a
sizable amount of code.

Now all we need to do is find the source for an x86 emulator to create a
JavaScript PC emulator. Browser
VMware could be the most computationally extravagant use of JavaScript