SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 75d3470d55335b5eb56cd73a296c15c56baf8682 parent fcbbecea1795430c31a309fa92dc2a0ae69f4924 Author: Lior Halphon <LIJI32@gmail.com> Date: Wed, 19 May 2021 00:15:02 +0300 That code made very little sense Diffstat:
| M | SDL/gui.c | 14 | +++----------- |
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/SDL/gui.c b/SDL/gui.c @@ -921,10 +921,7 @@ static const struct menu_item controls_menu[] = { static const char *key_name(unsigned index) { - if (index >= 8) { - if (index == 8) { - return SDL_GetScancodeName(configuration.keys[8]); - } + if (index > 8) { return SDL_GetScancodeName(configuration.keys_2[index - 9]); } return SDL_GetScancodeName(configuration.keys[index]); @@ -1376,13 +1373,8 @@ void run_gui(bool is_running) case SDL_KEYDOWN: if (gui_state == WAITING_FOR_KEY) { - if (current_selection >= 8) { - if (current_selection == 8) { - configuration.keys[8] = event.key.keysym.scancode; - } - else { - configuration.keys_2[current_selection - 9] = event.key.keysym.scancode; - } + if (current_selection > 8) { + configuration.keys_2[current_selection - 9] = event.key.keysym.scancode; } else { configuration.keys[current_selection] = event.key.keysym.scancode;
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.