From f5c8c8c0f0ec1a6c854ff55ab6a6daf2ff43c0f6 Mon Sep 17 00:00:00 2001 From: dkeruza-neo Date: Sat, 31 May 2025 21:45:19 -0300 Subject: [PATCH] A couple additions and fixes. --- docs/changelog | 8 ++++++++ src/lindbergh/baseboard.c | 22 +++++++++++++++++++++- src/lindbergh/config.c | 6 +++--- src/lindbergh/config.h | 2 +- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/docs/changelog b/docs/changelog index 8b90f37..6a456b8 100644 --- a/docs/changelog +++ b/docs/changelog @@ -2,8 +2,16 @@ All notable changes to this project will be documented in this file. +## [2.0.14] +### Added + - Bobby's birthday checking! + - FPS target to float. +### Fixed + - a bub in config.c where MJ4_ENABLED_ALL_THE_TIME was using the wrong variable. + ## [2.0.13] ### Added + - Clear window when the game is loading to prevent ghosting in SDL - Prevent the created windows to resize/maximize. - Version in github now matches the version in the changelog. diff --git a/src/lindbergh/baseboard.c b/src/lindbergh/baseboard.c index fb1969f..2b52750 100644 --- a/src/lindbergh/baseboard.c +++ b/src/lindbergh/baseboard.c @@ -61,6 +61,8 @@ int selectReply = -1; int jvsFileDescriptor = -1; int jvsPacketSize = -1; +char serialString[1024] = {0}; + int initBaseboard() { char *sramPath = getConfig()->sramPath; @@ -86,6 +88,24 @@ int initBaseboard() return -1; } + strcpy(serialString, SERIAL_STRING); + + time_t t = time(NULL); // Get current time + struct tm *tm_info = localtime(&t); // Convert to local time structure + + int month = tm_info->tm_mon + 1; // tm_mon is 0-based (0 = Jan, 4 = May) + int day = tm_info->tm_mday; // tm_mday is the day of the month + + if (month == 1 && day == 18) + { + strcpy(serialString, "HAPPY BIRTHDAY F"); + } + + if (month == 5 && day == 21) + { + strcpy(serialString, "HAPPY BIRTHDAY B"); + } + initJVSSerial(jvsFileDescriptor); startJVSFrameThread(&jvsFileDescriptor); } @@ -236,7 +256,7 @@ int baseboardIoctl(int fd, unsigned int request, void *data) case BASEBOARD_GET_SERIAL: { - memcpy(&sharedMemory[serialCommand.destAddress + 96], SERIAL_STRING, strlen(SERIAL_STRING)); + memcpy(&sharedMemory[serialCommand.destAddress + 96], serialString, strlen(serialString)); _data[1] = 1; // Set the status to success } break; diff --git a/src/lindbergh/config.c b/src/lindbergh/config.c index b1d8d08..55347e1 100644 --- a/src/lindbergh/config.c +++ b/src/lindbergh/config.c @@ -1238,7 +1238,7 @@ int readConfig(FILE *configFile, EmulatorConfig *config) config->fpsLimiter = atoi(getNextToken(NULL, " ", &saveptr)); else if (strcmp(command, "FPS_TARGET") == 0) - config->fpsTarget = atoi(getNextToken(NULL, " ", &saveptr)); + config->fpsTarget = atof(getNextToken(NULL, " ", &saveptr)); else if (strcmp(command, "LGJ_RENDER_WITH_MESA") == 0) config->lgjRenderWithMesa = atoi(getNextToken(NULL, " ", &saveptr)); @@ -1274,7 +1274,7 @@ int readConfig(FILE *configFile, EmulatorConfig *config) config->phTouchCursorHeight = atoi(getNextToken(NULL, " ", &saveptr)); else if (strcmp(command, "MJ4_ENABLED_ALL_THE_TIME") == 0) - config->phMode = atoi(getNextToken(NULL, " ", &saveptr)); + config->mj4EnabledAtT = atoi(getNextToken(NULL, " ", &saveptr)); else if (strcmp(command, "OR2_IP") == 0) strcpy(config->or2IP, getNextToken(NULL, " ", &saveptr)); @@ -1567,7 +1567,7 @@ int initConfig(const char* configFilePath) config.jvsIOType = SEGA_TYPE_3; config.GPUVendor = AUTO_DETECT_GPU; config.fpsLimiter = 0; - config.fpsTarget = 60; + config.fpsTarget = 60.0f; config.noSDL = 0; config.phMode = 2; config.disableBuiltinFont = 0; diff --git a/src/lindbergh/config.h b/src/lindbergh/config.h index 9ce7933..75d85c6 100644 --- a/src/lindbergh/config.h +++ b/src/lindbergh/config.h @@ -261,7 +261,7 @@ typedef struct int hummerFlickerFix; int keepAspectRatio; int fpsLimiter; - int fpsTarget; + float fpsTarget; int lgjRenderWithMesa; int noSDL; int phMode;