Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 3.08 KB

README.md

File metadata and controls

42 lines (31 loc) · 3.08 KB

yagbem

yet another gameboy emulator

Features

  • Written in rust (as a way for me to learn the language!)
  • Emulation of all SM83 processor instructions
    • passes the blargg cpu_instrs test roms
    • passes the jsmoo instruction tests. These were very helpful for validating basic CPU function! (Place these json files in the moo-tests directory and run with a test-moo argument)
    • not cycle accurate -- the base unit of time is one instruction, which ranges from 4 - 24 "T-cycles", aka 1 - 6 "M-cycles"
  • A basic text-based gdb-like debugger for monitoring processor status
  • Line-based PPU (pixel-processing unit) rendering
  • 4 of 5 interrupts are generated and handled (LCD Vblank, LCD status change, timer overflow, and joypad button press), but again not at a cycle-accurate level
  • MBC1 cartridge support

Peripherals

  • Joypad is hooked up to keyboard: WASD for direction, jk for B/A, and ,. for select/start
  • LCD screen is displayed on the monitor using the SDL2 library
  • Audio is not yet implemented (but I want to at some point!) Right now it just plays the same jingle over and over again.
  • Serial port output gets printed as ASCII to stderr

Acknowledgements

Many thanks to the many enthusiasts who have shared information online. In the process of working on this, I totally blown away by the dedication and kindess of this online community. There is so much stuff available! I made extensive use of the resources I could find, and in a few places my implementation derives from what I saw (though I tried my best not to peek too much!)

I am grateful to the following websites in particular:

Caveats

The code is not perfect, but I am not a professional programmer :) It works well enough to run simple games (like Kirby's dreamland and Link to the Past!) and that is enough to make me happy for now. Some other games don't really work. If you want to try to run it yourself, I have no idea if it will compile on your computer since I have only compiled it on my computer so far (x86 Linux).

Screenshots

Screenshot of the emulator playing the title screen of The Legend of Zelda, Link's Awakening Screenshot of a text-based debugger for the emulator