GameBoy emulator in pure JavaScript.
Caution
This is not stable! I made this to learn emulation and it's my first attempt at it. I did not dig too deep in many areas, so a few things might be plain wrong.
- Supports GameBoy ROMs (no gbc, sgb, gba)
- Supports No MBC and MBC1 ROMs
- You can try it out here
- Passes most Blarrg's tests
If you have NodeJS>=20.5.1 you can run JamSoy locally with
# This is only needed for the example, so it's not in the main package.json
npm i --no-save @kmamal/sdl
./examples/jamsoy.mjs <ROM path>
The web version is deployed on GitHub pages. You can deploy a new version like this:
git checkout docs
git merge origin/main
npm run bundle
git add .
git commit -m "chore: release"
git push
The project is Vanilla JavaScript and has no dependencies.
The entry point is the GameBoy
class, which instantiates and wires up all the
other components. The structure loosely maps hardware components.
cpu
: execute instructions and return the correct cycle timesdecoder
: inspect the ROM and the opcodes, used for debugginggfx
: display pixels with right timing, it abstract screen to not depend on browsergameboy
: orchestrator classinput
: abstracts sending input to the emulator, to be used by browsers or other drivers (seepublic/index.html
for an example)interrupts
: handles all the interrupts for the emulatormemory
: the bus thorugh which all the read/write operation are routedtimer
: synchronizes actions and issues timer interrupts