|
@@ -1,9 +1,11 @@ |
|
|
crater |
|
|
crater |
|
|
====== |
|
|
====== |
|
|
|
|
|
|
|
|
**crater** is an emulator for the [Sega Game Gear][game gear], written in C. |
|
|
|
|
|
|
|
|
**crater** is an emulator for the [Sega Game Gear][game gear], with an included |
|
|
|
|
|
[Z80][z80] assembler/disassembler, written in C. |
|
|
|
|
|
|
|
|
[game gear]: https://en.wikipedia.org/wiki/Sega_Game_Gear |
|
|
[game gear]: https://en.wikipedia.org/wiki/Sega_Game_Gear |
|
|
|
|
|
[z80]: https://en.wikipedia.org/wiki/Zilog_Z80 |
|
|
|
|
|
|
|
|
Why? |
|
|
Why? |
|
|
---- |
|
|
---- |
|
@@ -21,40 +23,42 @@ codename for the Game Gear during development. |
|
|
Installing |
|
|
Installing |
|
|
---------- |
|
|
---------- |
|
|
|
|
|
|
|
|
Only OS X and Linux are tested. You'll need a decent compiler that supports C11 |
|
|
|
|
|
|
|
|
Only OS X and Linux are tested. You'll need a modern compiler that supports C11 |
|
|
(clang preferred) and SDL 2. Using Homebrew, you can `brew install sdl2`; using |
|
|
(clang preferred) and SDL 2. Using Homebrew, you can `brew install sdl2`; using |
|
|
apt, you can `apt-get install libsdl2-dev`. |
|
|
apt, you can `apt-get install libsdl2-dev`. |
|
|
|
|
|
|
|
|
Run `make` to create `./crater`. To build the development version with debug |
|
|
Run `make` to create `./crater`. To build the development version with debug |
|
|
symbols (they can exist simultaneously), run `make DEBUG=1`, which creates |
|
|
symbols (they can exist simultaneously), run `make DEBUG=1`, which creates |
|
|
`./crater-dev`. |
|
|
|
|
|
|
|
|
`./crater-dev`. This also enables the printing of debugging info to stdout. |
|
|
|
|
|
|
|
|
Usage |
|
|
Usage |
|
|
----- |
|
|
----- |
|
|
|
|
|
|
|
|
Running `./crater` without arguments will display a list of ROM images located |
|
|
|
|
|
|
|
|
Running `./crater` without arguments will display a list of ROM images located |
|
|
in the `roms/` directory, and then ask the user to pick one, or enter their own |
|
|
in the `roms/` directory, and then ask the user to pick one, or enter their own |
|
|
ROM path. You can provide a path directly with `./crater path/to/rom`. |
|
|
ROM path. You can provide a path directly with `./crater path/to/rom`. |
|
|
|
|
|
|
|
|
Add or symlink ROMs to `roms/` at your leisure. Note that they should end in |
|
|
|
|
|
`.gg` or `.bin`. |
|
|
|
|
|
|
|
|
Add or symlink ROMs to `roms/` at your leisure. Note that they must end in |
|
|
|
|
|
`.gg` or `.bin` to be auto-detected. |
|
|
|
|
|
|
|
|
Add `--fullscreen` (`-f`) to enable fullscreen mode, or `--scale <n>` |
|
|
Add `--fullscreen` (`-f`) to enable fullscreen mode, or `--scale <n>` |
|
|
(`-s <n>`) to scale the game screen by an integer factor. |
|
|
(`-s <n>`) to scale the game screen by an integer factor. |
|
|
|
|
|
|
|
|
|
|
|
Add `--debug` (`-g`) to display detailed information about emulation state |
|
|
|
|
|
while running, including register values and memory contents. You can also |
|
|
|
|
|
pause emulation to set breakpoints and change state. |
|
|
|
|
|
|
|
|
`./crater -h` gives (fairly basic) command-line usage, and `./crater -v` gives |
|
|
`./crater -h` gives (fairly basic) command-line usage, and `./crater -v` gives |
|
|
the current version. |
|
|
the current version. |
|
|
|
|
|
|
|
|
### Advanced options |
|
|
|
|
|
|
|
|
### Assembler/Disassembler |
|
|
|
|
|
|
|
|
crater supports several advanced features. Add `--debug` (`-g`) to display |
|
|
|
|
|
detailed information about emulation state while running, including register |
|
|
|
|
|
values and memory contents. You can also pause emulation to set breakpoints and |
|
|
|
|
|
change state. |
|
|
|
|
|
|
|
|
crater has built-in support for converting Z80 assembly into ROM images, as |
|
|
|
|
|
well as attempting the reverse process (i.e., disassembling). |
|
|
|
|
|
|
|
|
`--assemble <input> [<output>]` (`-a`) converts z80 assembly source code into a |
|
|
|
|
|
`.gg` binary that can be run by crater. `--disassemble <input> [<output>]` |
|
|
|
|
|
(`-d`) executes the opposite operation. If no output file is given, crater will |
|
|
|
|
|
use the name of the input file, with the extension replaced with `.gg` for `-a` |
|
|
|
|
|
and `.s` for `-d`. By default, this will never overwrite the original filename; |
|
|
|
|
|
pass `--overwrite` (`-r`) to let crater do so. |
|
|
|
|
|
|
|
|
`--assemble <input> [<output>]` (`-a`) converts source code into a `.gg` binary |
|
|
|
|
|
that can be run by crater. `--disassemble <input> [<output>]` (`-d`) executes |
|
|
|
|
|
the opposite operation. If no output file is given, crater will use the name of |
|
|
|
|
|
the input file, with the extension replaced with `.gg` for `-a` and `.asm` for |
|
|
|
|
|
`-d`. By default, this will never overwrite the original filename; pass |
|
|
|
|
|
`--overwrite` (`-r`) to let crater do so. |