https://github.com/ioncodes/gg
GameGear emulator with partial Sega Master System support
https://github.com/ioncodes/gg
emulator gamegear sega sega-master-system
Last synced: about 1 month ago
JSON representation
GameGear emulator with partial Sega Master System support
- Host: GitHub
- URL: https://github.com/ioncodes/gg
- Owner: ioncodes
- Created: 2023-12-08T13:57:02.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-02T01:24:30.000Z (about 2 years ago)
- Last Synced: 2025-12-13T09:55:01.302Z (3 months ago)
- Topics: emulator, gamegear, sega, sega-master-system
- Language: Rust
- Homepage:
- Size: 98.4 MB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## gg
WIP GameGear (and possibly Sega Master System) emulator. Most of the information I either figured out by reverse engineering
the hardware and software myself or by using the excellent docs found on [smspower.org](https://www.smspower.org/). This project is
messed up in some cases and should not be used as direct reference for your own implementation. I mostly implemented everything on a
"fuck around and find out" basis, implementing features where needed to get things working. Also, there is no PSG support! Oh, and I
used AI to generate the z80 opcode parser / jump table. :)
Demos
| Sonic The Hedgehog 2 Demo | Lucky Dime Caper Starring Donald Duck Demo | Pac-Man Demo | Earthworm Jim Demo |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| | | | |
I would not have gotten this far without the amazing help from the helpful people over on the [Emulation Development](https://discord.gg/dkmJAes) Discord server:
* originaldave_
* ZjoyKiLer
* Mask of Destiny
* and everyone else that helped along the way <3
Mandatory quote:
> Layle - certified idiot — Yesterday at 9:49 PM
> i am
> officially an idiot
## Compatibility List
| **Title** | **CRC32** | **Status** |
| ----------------------------------------------------------------------------- | :--------: | :--------: |
| [BIOS] Sega Game Gear (USA) (Majesco) | `0ebea9d4` | 👌 |
| Pac-Man (USA) | `b318dd37` | 👌 |
| Sonic The Hedgehog 2 (U) [!] | `95a18ec7` | 👌 |
| Sonic & Tails (Japan) (En) | `8ac0dade` | 👌 |
| Sonic & Tails 2 (Japan) | `496bce64` | 👌 |
| Sonic Labyrinth (World) | `5550173b` | 👌 |
| Sonic The Hedgehog - Triple Trouble (USA, Europe, Brazil) (Beta) (1994-08-08) | `80eb7cfb` | 👌 |
| Lucky Dime Caper Starring Donald Duck, The (USA, Europe) | `07a7815a` | 👌 |
| Sonic The Hedgehog (U) (V1.0) [!] | `3e31cb8c` | 👌 |
| Earthworm Jim (Europe) | `691ae339` | 🐥 |
| Batman Returns (World) | `7ac4a3ca` | 🐥 |
| Ecco the Dolphin (Japan) | `a32eb9d5` | 🐥 |
| Ecco - The Tides of Time (USA, Europe, Brazil) | `e2f3b203` | 🐥 |
| GG Shinobi II, The ~ Shinobi II - The Silent Fury (World) | `6201c694` | 🐥 |
| Asterix and the Great Rescue (Europe) (En,Fr,De,Es,It) | `328c5cc8` | 🐣 |
| Tom and Jerry - The Movie (USA, Europe) | `5cd33ff2` | 🐞 |
| Shinobi (USA, Europe) | `30f1c984` | 🐞 |
* 👌: No known issues
* 🐥: Playable with a few bugs
* 🐣: In-Game, but only limited playability
* 🐞: Bugged/Broken
Note: This rating is completely subjective.
## Running
It is strongly recommended to run the emulator in release mode, no matter what.
```
cargo run --release -- --bios bios.gg --rom game.gg
```
It is possible to dump debug and/or trace information either to stderr or a file:
```
Usage: gg.exe [OPTIONS] --bios --rom
Options:
-b, --bios
-r, --rom
-l, --lua
-c, --cpu-test
-l, --log-level [default: info]
-l, --log-to-file
-h, --help Print help
```
## Debugging
The emulator features a debugger built around [egui and eframe](https://github.com/emilk/egui). It is very simple and hosts the following features:
* Memory Viewer (ROM, RAM, SRAM, VRAM, CRAM)
* Display CPU memory address mappings (ROM / RAM banks)
* "Resume", "Break On" and "Step" debugger controls
* Disassembly & Trace
* View CPU and VDP infromation such as registers
* SDSC Debug Console
There's more features that are CLI only:
* Lua scripting (pretick/posttick hooks with access to CPU & VDP state and memory)
* Debug and trace logging ("debug", "trace")
## Testing
Currently the Z80 implementation can be tested using [ZEXDOC/ZEXALL](https://github.com/maxim-zhao/zexall-smsjsm) and using the JSON unit tests
provided by [jsmoo](https://github.com/raddad772/jsmoo/tree/main/misc/tests/GeneratedTests/z80/v1). However, some features are ignored/disabled/not implemented.
### ZEXDOC & ZEXALL
`zexdoc` is built into the emulator and can be executed by passing the `--cpu-test` flag.
### JSON Tests
`cargo test` in the workspace folder will launch all unit tests. The current implementation measures only registers and RAM content. Status at the time of writing:
```
test result: FAILED. 1388 passed; 222 failed; 0 ignored; 0 measured; 0 filtered out; finished in 66.36s
```