From 3c02f03c48871d707521f2f729c9bdf59658eaa3 Mon Sep 17 00:00:00 2001 From: Bobby Dilley Date: Wed, 20 Jul 2022 19:57:07 +0100 Subject: [PATCH] Update config to read JVS --- src/lindbergh/config.c | 14 +++++++++++++- src/lindbergh/config.h | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lindbergh/config.c b/src/lindbergh/config.c index 5e458af..2eb0ded 100644 --- a/src/lindbergh/config.c +++ b/src/lindbergh/config.c @@ -111,6 +111,15 @@ int readConfig(FILE *configFile, EmulatorConfig *config) else if (strcmp(command, "EMULATE_MOTIONBOARD") == 0) config->emulateMotionboard = atoi(getNextToken(NULL, " ", &saveptr)); + else if (strcmp(command, "FULLSCREEN") == 0) + config->fullscreen = atoi(getNextToken(NULL, " ", &saveptr)); + + else if (strcmp(command, "EMULATE_JVS") == 0) + config->emulateJVS = atoi(getNextToken(NULL, " ", &saveptr)); + + else if (strcmp(command, "JVS_PATH") == 0) + strcpy(config->jvsPath, getNextToken(NULL, " ", &saveptr)); + else printf("Error: Unknown settings command %s\n", command); } @@ -123,8 +132,11 @@ int initConfig() config.emulateRideboard = 0; config.emulateDriveboard = 0; config.emulateMotionboard = 0; + config.emulateJVS = 1; + config.fullscreen = 0; strcpy(config.eepromPath, "eeprom.bin"); strcpy(config.sramPath, "sram.bin"); + strcpy(config.jvsPath, "/dev/ttyUSB0"); config.width = 1024; config.height = 768; if (detectGame() != 0) @@ -136,7 +148,7 @@ int initConfig() if (configFile == NULL) { - printf("Error: Cannot open %s, using default values\n", CONFIG_PATH); + printf("Warning: Cannot open %s, using default values\n", CONFIG_PATH); return 1; } diff --git a/src/lindbergh/config.h b/src/lindbergh/config.h index 113acc7..d044de7 100644 --- a/src/lindbergh/config.h +++ b/src/lindbergh/config.h @@ -14,8 +14,11 @@ typedef struct int emulateRideboard; int emulateDriveboard; int emulateMotionboard; + int emulateJVS; + int fullscreen; char eepromPath[MAX_PATH_LENGTH]; char sramPath[MAX_PATH_LENGTH]; + char jvsPath[MAX_PATH_LENGTH]; int width; int height; Game game;