Skip to content

lowczarc/gameboy-emulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

65 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Gameboy Emulator ๐ŸŽฎ

demo

My goal is to introduce myself to low level programming and emulators by writing a gameboy emulator in Rust ๐Ÿฆ€.

๐Ÿงฐ Structure

  • emulator/ - This contains the main Gameboy emulator. You'll find all of the necessary files and the core logic inside this folder.
  • asm/ - This is an assembler for the Gameboy, written in Python ๐Ÿ, made before starting the emulator. It's very basic and I made it only to list and understand each opcodes.

๐Ÿš€ Getting started

If you want to try this out or play around with the code, you can do the following:

๐ŸŽฎ Emulator

Clone the repository:

git clone https://github.com/lowczarc/gameboy-emulator.git

Build and run the emulator (from within the emulator/ directory):

cargo run --release <gameboy_rom>

NOTE: You need to have a gamepad to play, I didn't implement keyboard inputs yet

By default the emulator will spin lock instead of using thread::sleep.
If you're on battery or the 100% CPU usage bothers you, you can use the --thread-sleep option, though it might cause some lags and inaccurate timing.

cargo run --release <gameboy_rom> --thread-sleep

๐Ÿง‘โ€๐Ÿ’ป Assembler

There are some (not very interesting) examples of roms in the asm/ directory and a ton of them you can find using the power of the information superhighway.

Run the assembler (from within the asm/ directory):

python main.py <gbasm_input> <rom_output>

๐Ÿ“ License

This project is licensed under the NPDSML - Nintendo Please Don't Sue Me License

๐Ÿ“š References