Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jabolol/gameboy
An accurate GameBoy emulator written in C from scratch
https://github.com/jabolol/gameboy
c emulator gameboy
Last synced: about 22 hours ago
JSON representation
An accurate GameBoy emulator written in C from scratch
- Host: GitHub
- URL: https://github.com/jabolol/gameboy
- Owner: Jabolol
- License: mit
- Created: 2023-04-09T12:30:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-22T00:38:55.000Z (about 1 month ago)
- Last Synced: 2024-12-22T01:23:37.679Z (about 1 month ago)
- Topics: c, emulator, gameboy
- Language: C
- Homepage: https://gameboy.deno.dev/
- Size: 5.76 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gameboy
An accurate **gameboy** emulator written in C from scratch.
![](./assets/super-mario.png)
## development
In order to run the emulator, you need to have `cmake`, a build system like
`ninja` and a C compiler. `SDL2` is included as a submodule and will be compiled
along with the project.1. Clone the repository
```bash
git clone --recurse-submodules [email protected]:Jabolol/gameboy.git .
```2. Add the `ROMs` directory with the ROMs to be loaded in the web version
```bash
mkdir ROMs && cp /path/to/rom.gb ROMs
```3. Compile the project
```bash
cmake -B build -G Ninja && cmake --build build
```4. Run the emulator
```bash
./build/gameboy /path/to/rom.gb
```## features
- [x] Bus (Memory Management)
- [x] CPU
- [x] PPU (Graphics)
- [x] Input (Joypad)
- [x] Timer
- [x] Interrupts (V-Blank, LCD, Timer, Serial, Joypad)
- [x] MBC1 (Memory Bank Controller 1)
- [x] Save States (.sav files)
- [x] Web version at [gameboy.deno.dev](https://gameboy.deno.dev/)## controls
- `Arrow Keys` - D-Pad
- `A` - A
- `B` - B
- `Enter` - Start## web version
The emulator is also available as a web version using `emscripten` and `deno`.
In order to run the web version, you need to have `deno` installed.Some games are preloaded in the web version, just append `?game=${game}` to the
url to load a different game. The supported games are shown
[here](./www/static/inject.js).The web version will bundle the ROMs available at `ROMs` directory and serve
them at `http://localhost:8000`.```bash
deno task --cwd www start
```## screenshots
> [Legend of Zelda, The - Link's Awakening](https://gameboy.deno.dev/?game=zelda)
![](./assets/zelda.png)
> [Dr. Mario](https://gameboy.deno.dev/?game=dr-mario)
![](./assets/dr-mario.png)
> [Mega Man - Dr. Wily's Revenge](https://gameboy.deno.dev/?game=megaman-willy)
![](./assets/megaman.png)
> [Contra - The Alien Wars](https://gameboy.deno.dev/?game=contra)
![](./assets/contra.png)
> [Kirby - Dream Land](https://gameboy.deno.dev/?game=kirby-dream)
![](./assets/kirby.png)
> [Tetris](https://gameboy.deno.dev/?game=tetris)
![](./assets/tetris.png)
## resources
- [Gameboy CPU Manual](http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf): A
comprehensive guide to the Gameboy CPU.
- [Gameboy Opcodes](https://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html):
List of all opcodes for the Gameboy CPU.
- [Gameboy Pan Docs](https://gbdev.io/pandocs/): A detailed guide to the Gameboy
hardware.## license
This project is licensed under the MIT License - see the [LICENSE](./LICENSE)
file for details.