Skip to content

Commit

Permalink
Fix Y offset of 'Core settings' menu
Browse files Browse the repository at this point in the history
- Last entry (Restore defaults) was being drawn off-screen
- This produced a buffer overflow, causing the menu to generate a segfault on OpenDingux Beta
  (bug was hidden on OD stock, due to lax memory handling...)
  • Loading branch information
jdgleaver committed Apr 3, 2021
1 parent 665221d commit 22ed0b9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/port/sdl/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ static char *SlowBoot_show()

static void SlowBoot_hint()
{
port_printf(7 * 8, 10 * 8, "Skip BIOS logos at startup");
port_printf(6 * 8, 10 * 6, "Skip BIOS logos at startup");
}

static int SlowBoot_alter(u32 keys)
Expand All @@ -1208,7 +1208,7 @@ static int AnalogArrow_alter(u32 keys)

static void AnalogArrow_hint()
{
port_printf(6 * 8, 10 * 8, "Analog Stick -> Arrow Keys");
port_printf(6 * 8, 10 * 6, "Analog Stick -> Arrow Keys");
}

static char* AnalogArrow_show()
Expand All @@ -1232,7 +1232,7 @@ static int Analog_Mode_alter(u32 keys)

static void Analog_Mode_hint()
{
port_printf(6 * 8, 10 * 8, "Analog Mode");
port_printf(6 * 8, 10 * 6, "Analog Mode");
}

static char* Analog_Mode_show()
Expand Down Expand Up @@ -1295,7 +1295,7 @@ static int MenuToggleCombo_alter(u32 keys)

static void MenuToggleCombo_hint()
{
port_printf(6 * 8, 10 * 8, "POWER button also opens menu");
port_printf(6 * 8, 10 * 6, "POWER button also opens menu");
}

static char* MenuToggleCombo_show()
Expand Down Expand Up @@ -1333,7 +1333,7 @@ static char *AsyncCD_show()
}

static void AsyncCD_hint() {
port_printf(2 * 8, 10 * 8, "Async: Reduce stutter (restart req.)");
port_printf(2 * 8, 10 * 6, "Async: Reduce stutter (restart req.)");
}

#endif
Expand All @@ -1358,7 +1358,7 @@ static char *RCntFix_show()

static void RCntFix_hint()
{
port_printf(2 * 8 - 4, 10 * 8, "Parasite Eve 2, Vandal Hearts 1/2 Fix");
port_printf(2 * 8 - 4, 10 * 6, "Parasite Eve 2, Vandal Hearts 1/2 Fix");
}

static int VSyncWA_alter(u32 keys)
Expand All @@ -1374,7 +1374,7 @@ static int VSyncWA_alter(u32 keys)

static void VSyncWA_hint()
{
port_printf(6 * 8, 10 * 8, "InuYasha Sengoku Battle Fix");
port_printf(6 * 8, 10 * 6, "InuYasha Sengoku Battle Fix");
}

static char *VSyncWA_show()
Expand Down Expand Up @@ -1495,12 +1495,12 @@ static MENUITEM gui_SettingsItems[] = {
{(char *)"VSyncWA ", NULL, &VSyncWA_alter, &VSyncWA_show, &VSyncWA_hint},
{(char *)"Memory card Slot1 ", NULL, &McdSlot1_alter, &McdSlot1_show, NULL},
{(char *)"Memory card Slot2 ", NULL, &McdSlot2_alter, &McdSlot2_show, NULL},
{(char *)"Restore defaults ", &settings_defaults, NULL, NULL, NULL},
{(char *)"Restore defaults ", &settings_defaults, NULL, NULL, NULL},
{0}
};

#define SET_SIZE ((sizeof(gui_SettingsItems) / sizeof(MENUITEM)) - 1)
static MENU gui_SettingsMenu = { SET_SIZE, 0, 56, 102, (MENUITEM *)&gui_SettingsItems };
static MENU gui_SettingsMenu = { SET_SIZE, 0, 56, 82, (MENUITEM *)&gui_SettingsItems };

static int fps_alter(u32 keys)
{
Expand Down

0 comments on commit 22ed0b9

Please sign in to comment.