Browse Source

Start adding some new arguments.

master
Ben Kurtovic 9 years ago
parent
commit
da8a18c338
2 changed files with 39 additions and 2 deletions
  1. +15
    -1
      README.md
  2. +24
    -1
      crater.c

+ 15
- 1
README.md View File

@@ -11,7 +11,7 @@ Why?
While the internet is full of emulators for retro game systems, writing one is
nevertheless a fun learning project.

Crater is named after [31 Crateris][crateris], a star that was – for a short
crater is named after [31 Crateris][crateris], a star that was – for a short
time in 1974 – misidentified as [a moon of Mercury][moon]. Mercury was Sega's
codename for the Game Gear during development.

@@ -39,5 +39,19 @@ 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 `--fullscreen` (`-f`) to enable fullscreen mode, or `--scale <n>`
(`-s <n>`) to scale the game screen by an integer factor.

`./crater -h` gives (fairly basic) command-line usage, and `./crater -v` gives
the current version.

### Advanced options

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.

`--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.

+ 24
- 1
crater.c View File

@@ -18,7 +18,25 @@
/* Print command-line help/usage. */
static void print_help(const char *arg1)
{
printf("%s [--help|-h] [--version|-v] [rom_path]\n", arg1);
printf("%s [-h] [-v] [-f] [-s <n>] [<rom_path>] ...\n"
"\n"
"basic options:\n"
" -h, --help show this help message and exit\n"
" -v, --version show crater's version number and exit\n"
" -f, --fullscreen enable fullscreen mode\n"
" -s, --scale <n> scale the game screen by an integer factor\n"
" (applies to windowed mode only)\n"
" <rom_path> path to the rom file to execute; if not given, will look\n"
" in the roms/ directory and prompt the user\n"
"\n"
"advanced options:\n"
" -g, --debug display information about emulation state while running,\n"
" including register and memory values; can also pause\n"
" emulation, set breakpoints, and change state\n"
" -a, --assemble <in> <out> convert z80 assembly source code into a\n"
" binary file that can be run by crater\n"
" -d, --disassemble <in> <out> convert a binary file into z80 assembly code\n",
arg1);
}

/* Print crater's version. */
@@ -47,6 +65,11 @@ static void parse_args(int argc, char *argv[])
} else if (!strcmp(arg, "v") || !strcmp(arg, "version")) {
print_version();
exit(0);
// f fullscreen
// s scale
// g debug
// a assemble
// d disassemble
} else {
FATAL("unknown argument: %s", argv[i])
}


Loading…
Cancel
Save