From 3804e1820da6f8bf7688b898a437896727aab303 Mon Sep 17 00:00:00 2001 From: Rolel Date: Tue, 31 Dec 2024 18:16:07 +0100 Subject: [PATCH] Readproofed config: - default config file now tells the default value - region default is JP - wrong region will trigger a warning --- docs/lindbergh.conf | 30 ++++++++++++++++++++++++++++-- src/lindbergh/config.c | 13 +++++++++---- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/docs/lindbergh.conf b/docs/lindbergh.conf index d2b4825..fa581d3 100644 --- a/docs/lindbergh.conf +++ b/docs/lindbergh.conf @@ -1,31 +1,38 @@ # SEGA Lindbergh Emulator Configuration File -# Written by Bobby Dilley +# By the Lindbergh Development Team 2024-2025 # All config options here are commented out by default. # Uncomment them to enable that configuration override option. # Set the requested dip switch width here +# Default: 640 # WIDTH 1360 # Set the requested dip switch height here +# Default: 480 # HEIGHT 768 # Set if the emulator should go full screen +# Default: 0 # FULLSCREEN 0 # Sets the Input Mode # Mode 0: will use both SDL/X11 and EVDEV inputs (default) # Mode 1: will use SDL/X11 inputs only # Mode 2: will use EVDEV raw inputs only, which should be configured at the bottom of the settings file +# Default: 0 # INPUT_MODE 0 # Set to 1 if you want to disable SDL (Fixes SRTV boost bar) +# Default: 0 # NO_SDL 1 # Set the Region ( JP/US/EX ) +# Default: JP # REGION EX # Set if you want the game to be Free Play +# Default: 0 # FREEPLAY 1 # Set the different keys used to control the games. @@ -47,60 +54,77 @@ # Set if the emulator should emulate JVS and use the keyboard/mouse for controls. # If this is set to 0, then the emulator will route the traffic to the serial device # defined in JVS_PATH if it has been defined. +# Default: 1 # EMULATE_JVS 0 # Set if the emulator should emulate the rideboard used in the special games here # If this is set to 0, then the emulator will route the traffic to the serial device # defined in RIDEBOARD_PATH if it has been defined. +# Default: 0 (unless set by game) # EMULATE_RIDEBOARD 1 # Set if the emulator should emulate the driveboard used in driving games here # If this is set to 0, then the emulator will route the traffic to the serial device # defined in DRIVEBOARD_PATH if it has been defined. +# Default: 0 (unless set by game) # EMULATE_DRIVEBOARD 1 # Set if the emulator should emulate the motion board from Outrun 2 SP SDX here # If this is set to 0, then the emulator will route the traffic to the serial device # defined in MOTIONBOARD_PATH if it has been defined. +# Default: 0 (unless set by game) # EMULATE_MOTIONBOARD 1 # Define the path to pass the JVS packets to if JVS is not being emulated. +# Default: /dev/ttyUSB0 # JVS_PATH /dev/ttyUSB0 # Define the path to pass the first serial port to if it's not being emulated. +# Default: /dev/ttyS0 # SERIAL_1_PATH /dev/ttyUSB0 # Define the path to pass the second serial port to if it's not being emulated. +# Default: /dev/ttyS1 # SERIAL_2_PATH /dev/ttyUSB0 # Define the path to the sram.bin file +# Default: sram.bin # SRAM_PATH sram.bin # Define the path to the eeprom.bin file +# Default: eeprom.bin # EEPROM_PATH eeprom.bin # Set the GPU vendor (0 = Autodetect / 1 = NVidia / 2 = AMD / 3 = ATI(AMD-PRO) / 4 = Intel / 5 = Unknown) +# Default: 0 # GPU_VENDOR 0 # Set if you want to see debug messages in the console +# Default: 0 # DEBUG_MSGS 1 # Set to true if you experience flickering in hummer +# Default: 0 # HUMMER_FLICKER_FIX 1 # Set to keep the aspect ratio (4:3) in games like Sega Race TV and Primeval Hunt +# Default: 0 # KEEP_ASPECT_RATIO 1 # Set to 0 if you want to disable the Glare effect in OutRun +# Default: 0 # OUTRUN_LENS_GLARE_ENABLED 0 # Set to 1 if you want to limit the FPS in games that are not limited like OutRun2 +# Default: 0 # FPS_LIMITER_ENABLED 1 # Set the target FPS (will only work if FPS_LIMITER_ENABLED = 1) +# Default: 60 # FPS_TARGET 60 # 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 # Set the Primeval Hunt mode @@ -109,10 +133,12 @@ # Mode 2: Side by Side # Mode 3: 3ds mode 1 (Touch screen to the right) # Mode 4: 3ds mode 2 (Touch screen to the bottom) +# Default: 1 # PRIMEVAL_HUNT_MODE 1 # Set the colour of the lindbergh to change the Segaboot logo -# Possible colours are: YELLOW and RED +# Possible colours are: YELLOW, RED, BLUE, SILVER, REDEX +# Default: YELLOW # LINDBERGH_COLOUR YELLOW # EVDEV MODE (Input Mode 2) diff --git a/src/lindbergh/config.c b/src/lindbergh/config.c index 753d56c..89b1ecb 100644 --- a/src/lindbergh/config.c +++ b/src/lindbergh/config.c @@ -1005,8 +1005,13 @@ int readConfig(FILE *configFile, EmulatorConfig *config) config->region = JP; else if (strcmp(region, "US") == 0) config->region = US; - else + else if (strcmp(region, "EX") == 0) config->region = EX; + else + { + // Print a warning and keep the default region + printf("Warning: Unknown Region '%s'. Keeping default value.\n", region); + } } else if (strcmp(command, "DEBUG_MSGS") == 0) @@ -1279,11 +1284,13 @@ int initConfig() strcpy(config.serial2Path, "/dev/ttyS1"); config.width = 640; config.height = 480; - config.region = -1; + config.region = 0; config.freeplay = -1; config.showDebugMessages = 0; config.hummerFlickerFix = 0; config.keepAspectRatio = 0; + config.outrunLensGlareEnabled = 1; + config.lgjRenderWithMesa = 1; config.gameTitle = "Unknown game"; config.gameID = "XXXX"; config.gameDVP = "DVP-XXXX"; @@ -1293,11 +1300,9 @@ int initConfig() config.gameNativeResolutions = ""; config.keymap = getDefaultKeymap(); config.jvsIOType = SEGA_TYPE_3; - config.outrunLensGlareEnabled = 1; config.GPUVendor = AUTO_DETECT_GPU; config.fpsLimiter = 0; config.fpsTarget = 60; - config.lgjRenderWithMesa = 1; config.noSDL = 0; config.phMode = 1; memset(&config.arcadeInputs.analogue_deadzone_start, 0, sizeof(config.arcadeInputs.analogue_deadzone_start));