Skip to content

shikaan/jamsoy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JamSoy

GameBoy emulator in pure JavaScript.

The Legend of Zelda - Link's Awakening Opening Screen Dr. Mario Opening Screen Tetris Opening Screen

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.

Features

  • Supports GameBoy ROMs (no gbc, sgb, gba)
  • Supports No MBC and MBC1 ROMs
  • You can try it out here
  • Passes most Blarrg's tests

Run it locally

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>

Deployment

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

Development

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 times
  • decoder: inspect the ROM and the opcodes, used for debugging
  • gfx: display pixels with right timing, it abstract screen to not depend on browser
  • gameboy: orchestrator class
  • input: abstracts sending input to the emulator, to be used by browsers or other drivers (see public/index.html for an example)
  • interrupts: handles all the interrupts for the emulator
  • memory: the bus thorugh which all the read/write operation are routed
  • timer: synchronizes actions and issues timer interrupts