diff --git a/libretro.cpp b/libretro.cpp index f63eb7f..bcb323b 100644 --- a/libretro.cpp +++ b/libretro.cpp @@ -1182,6 +1182,7 @@ static void set_volume (uint32_t *ptr, unsigned number) static uint8_t input_type[MAX_PLAYERS] = {}; static uint8_t input_buf[MAX_PLAYERS][5] = {}; static float mouse_sensitivity = 1.0f; +static bool disable_softreset = false; // Array to keep track of whether a given player's button is turbo static int turbo_enable[MAX_PLAYERS][MAX_BUTTONS] = {}; @@ -1343,6 +1344,13 @@ static void check_variables(void) turbo_toggle_alt = false; } + var.key = "pce_disable_softreset"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + disable_softreset = (strcmp(var.value, "enabled") == 0); + } + var.key = "pce_mouse_sensitivity"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) @@ -1518,6 +1526,10 @@ static void update_input(void) { input_state |= input_state_cb(j, RETRO_DEVICE_JOYPAD, 0, map[i]) ? (1 << i) : 0; + // disable soft reset + if (disable_softreset == true) + if ((input_state & 0xC) == 0xC) input_state &= ~0xC; + // handle turbo buttons if (turbo_enable[j][i] == 1) // Check whether a given button is turbo-capable { diff --git a/libretro_core_options.h b/libretro_core_options.h index a2473ad..902224e 100644 --- a/libretro_core_options.h +++ b/libretro_core_options.h @@ -217,6 +217,17 @@ struct retro_core_option_definition option_defs_us[] = { }, "242" }, + { + "pce_disable_softreset", + "Disable Soft Reset (RUN+SELECT)", + "If set, when RUN+SEL are pressed simultaneously, disable both buttons temporarily.", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL }, + }, + "disabled" + }, { "pce_cddavolume", "(CD) CDDA Volume %",