diff --git a/README.md b/README.md index 0645edc..f21dd76 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,8 @@ 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 ` -(`-s `) to scale the game screen by an integer factor. +(`-s `) to scale the game screen by an integer factor in windowed mode (this +only sets the starting configuration; the window should be resizeable). Add `--debug` (`-g`) to show logging information while running. Pass it twice (`-gg`) to show more detailed logs, including an emulator trace. @@ -56,6 +57,19 @@ Add `--debug` (`-g`) to show logging information while running. Pass it twice `./crater -h` gives (fairly basic) command-line usage, and `./crater -v` gives the current version. +### Key mapping + +Custom key mappings are not supported. There are two primary configurations I +like: + +- `Return`/`Esc` for `Start`; `WASD` for D-pad; `.` for `1`/left trigger; + `/` for `2`/right trigger + +- `Return`/`Esc` for `Start`; arrow keys for D-pad; `Z` for `1`/left trigger; + `X` for `2`/right trigger + +You can switch between them freely. + ### Assembler/Disassembler crater has built-in support for converting Z80 assembly into ROM images, as diff --git a/src/emulator.c b/src/emulator.c index 39b1098..f623b6b 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -105,10 +105,16 @@ static void handle_keypress(GameGear *gg, SDL_Keycode key, bool state) case SDLK_d: button = BUTTON_RIGHT; break; case SDLK_j: + case SDLK_z: + case SDLK_PERIOD: button = BUTTON_TRIGGER_1; break; case SDLK_k: + case SDLK_x: + case SDLK_SLASH: button = BUTTON_TRIGGER_2; break; case SDLK_RETURN: + case SDLK_RETURN2: + case SDLK_ESCAPE: button = BUTTON_START; break; default: return;