diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e726f7..769be62 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,12 +6,14 @@ on: paths-ignore: - '**.md' - '.github/ISSUE_TEMPLATE/*' + - '.docs/changelog' push: branches: - master paths-ignore: - '**.md' - '.github/ISSUE_TEMPLATE/*' + - '.docs/changelog' jobs: linux-build: diff --git a/docs/changelog b/docs/changelog index 9f286ea..868cacf 100644 --- a/docs/changelog +++ b/docs/changelog @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [2.0.6] +### Fixed + - Reverted (Fixed LGJ, VT3 and ID4/ID5 JVS passthrough). + - Outrun 2 High Scores. + ## [2.0.5] ### Fixed - Fixed LGJ, VT3 and ID4/ID5 JVS passthrough. diff --git a/src/lindbergh/hook.c b/src/lindbergh/hook.c index 4722a53..9d72e83 100644 --- a/src/lindbergh/hook.c +++ b/src/lindbergh/hook.c @@ -337,9 +337,67 @@ DIR *opendir(const char *dirname) return _opendir(dirname + 1); } } + + // Fix for Outrun high scores + switch (gId) + { + case OUTRUN_2_SP_SDX: + case OUTRUN_2_SP_SDX_REVA: + case OUTRUN_2_SP_SDX_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST2: + { + if (strcmp(dirname, "/home/disk1/rankingdata") == 0) + { + return _opendir("./rankingdata"); + } + } + } return _opendir(dirname); } +int remove(const char *path) +{ + int (*_remove)(const char *path) = dlsym(RTLD_NEXT, "remove"); + + switch (gId) + { + case OUTRUN_2_SP_SDX: + case OUTRUN_2_SP_SDX_REVA: + case OUTRUN_2_SP_SDX_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST2: + { + if (strcmp(path, "/home/disk1/rankingdata/%s") == 0) + { + return _remove("./rankingdata/%s"); + } + } + } + return _remove(path); +} + +int mkdir(const char *path, mode_t mode) +{ + int (*_mkdir)(const char *path, mode_t mode) = dlsym(RTLD_NEXT, "mkdir"); + + switch (gId) + { + case OUTRUN_2_SP_SDX: + case OUTRUN_2_SP_SDX_REVA: + case OUTRUN_2_SP_SDX_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST2: + { + if (strcmp(path, "/home/disk1/rankingdata") == 0) + { + return _mkdir("./rankingdata", mode); + } + } + } + return _mkdir(path, mode); +} + int __xstat64(int ver, const char *path, struct stat64 *stat_buf) { int (*___xstat64)(int ver, const char *path, struct stat64 *stat_buf) = dlsym(RTLD_NEXT, "__xstat64"); @@ -572,6 +630,22 @@ FILE *fopen(const char *restrict pathname, const char *restrict mode) pathname = newPathname; } + // Fix for Outrun high scores + switch (gId) + { + case OUTRUN_2_SP_SDX: + case OUTRUN_2_SP_SDX_REVA: + case OUTRUN_2_SP_SDX_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST2: + { + if ((newPathname = strstr(pathname, "/home/disk1")) != NULL) + { + pathname = newPathname + 12; + } + } + } + // This forces LGJ games and ID games to not use the pre-compiled shaders. if ((strstr(pathname, "asm_lbg") != NULL) || (strstr(pathname, "asm_gl") != NULL)) {