From cae07b58b510ad9d94a2202ffca0f6adbd0ee060 Mon Sep 17 00:00:00 2001 From: Bobby Dilley Date: Fri, 3 Jan 2025 23:18:10 +0000 Subject: [PATCH] Make outrun cabinet check a setting --- docs/lindbergh.conf | 4 ++++ src/lindbergh/config.c | 4 ++++ src/lindbergh/config.h | 1 + src/lindbergh/patch.c | 9 ++++++--- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/lindbergh.conf b/docs/lindbergh.conf index fa581d3..94138d0 100644 --- a/docs/lindbergh.conf +++ b/docs/lindbergh.conf @@ -123,6 +123,10 @@ # Default: 60 # FPS_TARGET 60 +# Set to 1 to bypass cabinet checks including drive board and tower in Outrun 2 SP SDX +# Default: 0 +# SKIP_OUTRUN_CABINET_CHECK 0 + # Set to 1 if you want to render LGJ using the mesa patches instead of nVidia (fixes some glitches) # Default: 1 # LGJ_RENDER_WITH_MESA 1 diff --git a/src/lindbergh/config.c b/src/lindbergh/config.c index 89b1ecb..b075190 100644 --- a/src/lindbergh/config.c +++ b/src/lindbergh/config.c @@ -1225,6 +1225,9 @@ int readConfig(FILE *configFile, EmulatorConfig *config) config->arcadeInputs.analogue_deadzone_end[7] = atoi(getNextToken(NULL, " ", &saveptr)); } + else if (strcmp(command, "SKIP_OUTRUN_CABINET_CHECK") == 0) + config->skipOutrunCabinetCheck = atoi(getNextToken(NULL, " ", &saveptr)); + else if (strcmp(command, "INPUT_MODE") == 0) config->inputMode = atoi(getNextToken(NULL, " ", &saveptr)); @@ -1309,6 +1312,7 @@ int initConfig() memset(&config.arcadeInputs.analogue_deadzone_middle, 0, sizeof(config.arcadeInputs.analogue_deadzone_middle)); memset(&config.arcadeInputs.analogue_deadzone_end, 0, sizeof(config.arcadeInputs.analogue_deadzone_end)); config.crc32 = elf_crc; + config.skipOutrunCabinetCheck = 0; if (detectGame(config.crc32) != 0) { printf("Warning: Unsure what game with CRC 0x%X is. Please submit this new game to the GitHub repository: " diff --git a/src/lindbergh/config.h b/src/lindbergh/config.h index 9b864fb..9a6c1aa 100644 --- a/src/lindbergh/config.h +++ b/src/lindbergh/config.h @@ -256,6 +256,7 @@ typedef struct int phMode; ArcadeInputs arcadeInputs; int inputMode; // 0 = both, 1 = SDL/X11 only, 2 = EVDEV only + int skipOutrunCabinetCheck; } EmulatorConfig; KeyMapping getDefaultKeymap(); diff --git a/src/lindbergh/patch.c b/src/lindbergh/patch.c index f0837f8..fd564ed 100644 --- a/src/lindbergh/patch.c +++ b/src/lindbergh/patch.c @@ -661,9 +661,12 @@ int initPatch() } detourFunction(0x0804d148, or2snprintf); // Fixes a bug in snprintf libc 2.39?? - // Bypass checks for tower and Force Feedback? - detourFunction(0x08103eaa, stubRetOne); - detourFunction(0x08105d88, stubRetOne); + // Only apply these patches if skipOutrunCabinetCheck is enabled + if (config->skipOutrunCabinetCheck) { + // Bypass checks for tower and Force Feedback + detourFunction(0x08103eaa, stubRetOne); + detourFunction(0x08105d88, stubRetOne); + } } break; case OUTRUN_2_SP_SDX_REVA_TEST: