From a1c71144f4754e86d5c4686b4df9eb216d678237 Mon Sep 17 00:00:00 2001 From: dkeruza Date: Wed, 13 Dec 2023 00:32:28 -0500 Subject: [PATCH] HOD SP added --- src/lindbergh/config.c | 18 ++++++++++++++++++ src/lindbergh/config.h | 2 ++ src/lindbergh/patch.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/src/lindbergh/config.c b/src/lindbergh/config.c index f6d4188..248dd35 100644 --- a/src/lindbergh/config.c +++ b/src/lindbergh/config.c @@ -68,6 +68,20 @@ static int detectGame(uint32_t elf_crc) return 0; } + if (elf_crc == 0x12266f81) + { + config.game = THE_HOUSE_OF_THE_DEAD_SP; + config.gameStatus = WORKING; + return 0; + } + + if (elf_crc == 0x83ba3b45) + { + config.game = THE_HOUSE_OF_THE_DEAD_SP_TEST; + config.gameStatus = WORKING; + return 0; + } + if (elf_crc == 0x85c0c22a) { config.game = THE_HOUSE_OF_THE_DEAD_EX; @@ -217,6 +231,10 @@ char *getGameName() return "The House of the Dead 4 - Test Menu"; case THE_HOUSE_OF_THE_DEAD_4_STRIPPED: return "The House of the Dead 4"; + case THE_HOUSE_OF_THE_DEAD_SP: + return "House of the Dead 4 Special"; + case THE_HOUSE_OF_THE_DEAD_SP_TEST: + return "House of the Dead 4 Special - Test Menu"; case THE_HOUSE_OF_THE_DEAD_EX: return "The House of the Dead EX"; case THE_HOUSE_OF_THE_DEAD_EX_TEST: diff --git a/src/lindbergh/config.h b/src/lindbergh/config.h index 70c478d..42bab98 100644 --- a/src/lindbergh/config.h +++ b/src/lindbergh/config.h @@ -12,6 +12,8 @@ typedef enum THE_HOUSE_OF_THE_DEAD_4, THE_HOUSE_OF_THE_DEAD_4_TEST, THE_HOUSE_OF_THE_DEAD_4_STRIPPED, + THE_HOUSE_OF_THE_DEAD_SP, + THE_HOUSE_OF_THE_DEAD_SP_TEST, THE_HOUSE_OF_THE_DEAD_EX, THE_HOUSE_OF_THE_DEAD_EX_TEST, OUTRUN, diff --git a/src/lindbergh/patch.c b/src/lindbergh/patch.c index 02e7790..705cf8d 100644 --- a/src/lindbergh/patch.c +++ b/src/lindbergh/patch.c @@ -378,6 +378,34 @@ int initPatch() setVariable(0x08072195, cpu_vendor.ecx); } break; + case THE_HOUSE_OF_THE_DEAD_SP: + { + detourFunction(0x08363438, amDongleInit); + detourFunction(0x0836374b, amDongleIsAvailable); + detourFunction(0x083636b2, amDongleUpdate); + // Fixes + detourFunction(0x08360e93, amDipswGetData); + detourFunction(0x08360f0b, stubRetZero); // Stub amDipswSetLed + // CPU patch to support AMD processors + setVariable(0x083cef0a, cpu_vendor.ebx); + setVariable(0x083cef1a, cpu_vendor.edx); + setVariable(0x083cef25, cpu_vendor.ecx); + } + break; + case THE_HOUSE_OF_THE_DEAD_SP_TEST: + { + detourFunction(0x0806e914, amDongleInit); + detourFunction(0x0806ec27, amDongleIsAvailable); + detourFunction(0x0806eb8e, amDongleUpdate); + // Fixes + detourFunction(0x0806e7c7, amDipswGetData); + detourFunction(0x0806e83f, stubRetZero); // Stub amDipswSetLed + // CPU patch to support AMD processors + setVariable(0x0807a3ba, cpu_vendor.ebx); + setVariable(0x0807a3ca, cpu_vendor.edx); + setVariable(0x0807a3d5, cpu_vendor.ecx); + } + break; case THE_HOUSE_OF_THE_DEAD_EX: { detourFunction(0x084ba886, amDongleInit);