diff options
author | neonloop | 2021-04-03 00:39:16 +0000 |
---|---|---|
committer | neonloop | 2021-04-03 00:39:16 +0000 |
commit | 92c860d1d31e4fcaaf978d7fb5fd93b657b51ee4 (patch) | |
tree | 5026ec21d6f5770122e23142e8abd4ba88cf6131 /shell/menu | |
parent | 08ba753083031def20d86a6b7daff1754a4d3c8a (diff) | |
parent | e2303a4166ec3b78219115c18a0113e24fa48cf6 (diff) | |
download | snesemu-92c860d1d31e4fcaaf978d7fb5fd93b657b51ee4.tar.gz snesemu-92c860d1d31e4fcaaf978d7fb5fd93b657b51ee4.tar.bz2 snesemu-92c860d1d31e4fcaaf978d7fb5fd93b657b51ee4.zip |
Merge branch 'eggs-improvements' into trimui-s
Diffstat (limited to 'shell/menu')
-rw-r--r-- | shell/menu/config.h | 1 | ||||
-rw-r--r-- | shell/menu/menu.c | 81 |
2 files changed, 56 insertions, 26 deletions
diff --git a/shell/menu/config.h b/shell/menu/config.h index 9b71fc2..dfe4b6e 100644 --- a/shell/menu/config.h +++ b/shell/menu/config.h @@ -5,6 +5,7 @@ typedef struct { int32_t fullscreen; /* For input remapping */ uint32_t config_buttons[6][19]; + int32_t showfps; } t_config; extern t_config option; diff --git a/shell/menu/menu.c b/shell/menu/menu.c index 9db4539..7dcf229 100644 --- a/shell/menu/menu.c +++ b/shell/menu/menu.c @@ -34,7 +34,7 @@ extern void SRAM_Save(char* path, uint_fast8_t state); static uint8_t selectpressed = 0; static uint8_t save_slot = 0; -static const int8_t upscalers_available = 2 +static const int8_t upscalers_available = 4 #ifdef SCALE2X_UPSCALER +1 #endif @@ -93,7 +93,8 @@ static void config_load() option.config_buttons[0][10] = BTN_START; option.config_buttons[0][11] = BTN_SELECT; - option.fullscreen = 0; + option.fullscreen = 3; + option.showfps = 0; } } @@ -355,7 +356,7 @@ void Menu() SRAM_Menu(0); RTC_Menu(0); - while (((currentselection != 1) && (currentselection != 6)) || (!pressed)) + while (((currentselection != 1) && (currentselection != 7) && (currentselection != 8)) || (!pressed)) { pressed = 0; @@ -363,34 +364,39 @@ void Menu() print_string("SNESEmu - Built on " __DATE__, TextWhite, 0, 5, 15, backbuffer->pixels); - if (currentselection == 1) print_string("Continue", TextRed, 0, 5, 45, backbuffer->pixels); - else print_string("Continue", TextWhite, 0, 5, 45, backbuffer->pixels); +#define MENU_Y(y) 29 + (18*y) + + if (currentselection == 1) print_string("Continue", TextRed, 0, 5, MENU_Y(1), backbuffer->pixels); + else print_string("Continue", TextWhite, 0, 5, MENU_Y(1), backbuffer->pixels); snprintf(text, sizeof(text), "Load State %d", save_slot); - if (currentselection == 2) print_string(text, TextRed, 0, 5, 65, backbuffer->pixels); - else print_string(text, TextWhite, 0, 5, 65, backbuffer->pixels); + if (currentselection == 2) print_string(text, TextRed, 0, 5, MENU_Y(2), backbuffer->pixels); + else print_string(text, TextWhite, 0, 5, MENU_Y(2), backbuffer->pixels); snprintf(text, sizeof(text), "Save State %d", save_slot); - if (currentselection == 3) print_string(text, TextRed, 0, 5, 85, backbuffer->pixels); - else print_string(text, TextWhite, 0, 5, 85, backbuffer->pixels); + if (currentselection == 3) print_string(text, TextRed, 0, 5, MENU_Y(3), backbuffer->pixels); + else print_string(text, TextWhite, 0, 5, MENU_Y(3), backbuffer->pixels); if (currentselection == 4) { switch(option.fullscreen) { case 0: - print_string("Scaling : Native", TextRed, 0, 5, 105, backbuffer->pixels); + print_string("Scaling : Native", TextRed, 0, 5, MENU_Y(4), backbuffer->pixels); break; case 1: - print_string("Scaling : Stretched", TextRed, 0, 5, 105, backbuffer->pixels); + print_string("Scaling : FS Sharp", TextRed, 0, 5, MENU_Y(4), backbuffer->pixels); break; case 2: - print_string("Scaling : Bilinear", TextRed, 0, 5, 105, backbuffer->pixels); + print_string("Scaling : FS Smooth", TextRed, 0, 5, MENU_Y(4), backbuffer->pixels); break; case 3: - print_string("Scaling : EPX/Scale2x", TextRed, 0, 5, 105, backbuffer->pixels); + print_string("Scaling : Bilinear", TextRed, 0, 5, MENU_Y(4), backbuffer->pixels); + break; + case 4: + print_string("Scaling : Overscan", TextRed, 0, 5, MENU_Y(4), backbuffer->pixels); break; } } @@ -399,25 +405,36 @@ void Menu() switch(option.fullscreen) { case 0: - print_string("Scaling : Native", TextWhite, 0, 5, 105, backbuffer->pixels); + print_string("Scaling : Native", TextWhite, 0, 5, MENU_Y(4), backbuffer->pixels); break; case 1: - print_string("Scaling : Stretched", TextWhite, 0, 5, 105, backbuffer->pixels); + print_string("Scaling : FS Sharp", TextWhite, 0, 5, MENU_Y(4), backbuffer->pixels); break; case 2: - print_string("Scaling : Bilinear", TextWhite, 0, 5, 105, backbuffer->pixels); + print_string("Scaling : FS Smooth", TextWhite, 0, 5, MENU_Y(4), backbuffer->pixels); break; case 3: - print_string("Scaling : EPX/Scale2x", TextWhite, 0, 5, 105, backbuffer->pixels); + print_string("Scaling : Bilinear", TextWhite, 0, 5, MENU_Y(4), backbuffer->pixels); + break; + case 4: + print_string("Scaling : Overscan", TextWhite, 0, 5, MENU_Y(4), backbuffer->pixels); break; } } - if (currentselection == 5) print_string("Input remapping", TextRed, 0, 5, 125, backbuffer->pixels); - else print_string("Input remapping", TextWhite, 0, 5, 125, backbuffer->pixels); + if (option.showfps == 0) snprintf(text, sizeof(text), "Show FPS : OFF"); + else snprintf(text, sizeof(text), "Show FPS : ON"); + if (currentselection == 5) print_string(text, TextRed, 0, 5, MENU_Y(5), backbuffer->pixels); + else print_string(text, TextWhite, 0, 5, MENU_Y(5), backbuffer->pixels); - if (currentselection == 6) print_string("Quit", TextRed, 0, 5, 145, backbuffer->pixels); - else print_string("Quit", TextWhite, 0, 5, 145, backbuffer->pixels); + if (currentselection == 6) print_string("Input remapping", TextRed, 0, 5, MENU_Y(6), backbuffer->pixels); + else print_string("Input remapping", TextWhite, 0, 5, MENU_Y(6), backbuffer->pixels); + + if (currentselection == 7) print_string("Reset", TextRed, 0, 5, MENU_Y(7), backbuffer->pixels); + else print_string("Reset", TextWhite, 0, 5, MENU_Y(7), backbuffer->pixels); + + if (currentselection == 8) print_string("Quit", TextRed, 0, 5, MENU_Y(8), backbuffer->pixels); + else print_string("Quit", TextWhite, 0, 5, MENU_Y(8), backbuffer->pixels); print_string("Libretro Fork by gameblabla", TextWhite, 0, 5, 205, backbuffer->pixels); print_string("Credits: Snes9x dev team, libretro", TextWhite, 0, 5, 225, backbuffer->pixels); @@ -431,11 +448,11 @@ void Menu() case BTN_UP: currentselection--; if (currentselection == 0) - currentselection = 6; + currentselection = 8; break; case BTN_DOWN: currentselection++; - if (currentselection == 7) + if (currentselection == 9) currentselection = 1; break; case BTN_L2: @@ -460,6 +477,9 @@ void Menu() if (option.fullscreen < 0) option.fullscreen = upscalers_available; break; + case 5: + option.showfps ^= 1; + break; } break; case BTN_RIGHT: @@ -476,6 +496,9 @@ void Menu() if (option.fullscreen > upscalers_available) option.fullscreen = 0; break; + case 5: + option.showfps ^= 1; + break; } break; default: @@ -484,7 +507,7 @@ void Menu() } else if (Event.type == SDL_QUIT) { - currentselection = 6; + currentselection = 8; pressed = 1; } } @@ -493,9 +516,15 @@ void Menu() { switch(currentselection) { - case 5: + case 7: + S9xReset(); + break; + case 6: Input_Remapping(); break; + case 5: + option.showfps ^= 1; + break; case 4 : option.fullscreen++; if (option.fullscreen > upscalers_available) @@ -524,7 +553,7 @@ void Menu() SDL_Flip(sdl_screen); #endif - if (currentselection == 6) + if (currentselection == 8) { exit_snes = 1; } |