diff --git a/docs/changelog b/docs/changelog index 8129e71..e2edcb5 100644 --- a/docs/changelog +++ b/docs/changelog @@ -2,7 +2,15 @@ All notable changes to this project will be documented in this file. -## [2.0.2] +## [2.0.3] +### Added + - Display a warning when loading an Elf that is not clean. + - Added to the lib folder, common libraries that are usually missing. +### Fixed + - Missing patch in HOD-EX. + - Alows to run a game that does not support Card reader if option enabled in conf file. + +## [2.0.2] 2025-01-27 ### Added - InitialD 5 SBRY added. - HOD4 SP CPU Frequency fix. diff --git a/libs/Cg-3.1.zip b/libs/Cg-3.1.zip new file mode 100644 index 0000000..5cc5b0c Binary files /dev/null and b/libs/Cg-3.1.zip differ diff --git a/libs/libcrypto.so.0.9.7 b/libs/libcrypto.so.0.9.7 new file mode 100644 index 0000000..6f425c2 Binary files /dev/null and b/libs/libcrypto.so.0.9.7 differ diff --git a/libs/libopenal.so.0 b/libs/libopenal.so.0 new file mode 100644 index 0000000..802c0db Binary files /dev/null and b/libs/libopenal.so.0 differ diff --git a/libs/libssl.so.0.9.7 b/libs/libssl.so.0.9.7 new file mode 100644 index 0000000..8c5670d Binary files /dev/null and b/libs/libssl.so.0.9.7 differ diff --git a/src/lindbergh/card_reader.c b/src/lindbergh/card_reader.c index 6aba517..cfa054b 100644 --- a/src/lindbergh/card_reader.c +++ b/src/lindbergh/card_reader.c @@ -38,25 +38,28 @@ void initWriteCmd(int fdIdx) int initCardReader() { - initReadCmd(0); - initReadCmd(1); - initWriteCmd(0); - initWriteCmd(1); - uint32_t gId = getConfig()->crc32; if (gId != VIRTUA_TENNIS_3 && gId != VIRTUA_TENNIS_3_TEST && gId != VIRTUA_TENNIS_3_REVA && gId != VIRTUA_TENNIS_3_REVA_TEST && gId != VIRTUA_TENNIS_3_REVB && gId != VIRTUA_TENNIS_3_REVB_TEST && gId != VIRTUA_TENNIS_3_REVC && gId != VIRTUA_TENNIS_3_REVC_TEST && gId != R_TUNED) { - printf("Game does not support Card Reader, please disable the card reader emulation in the config file.\n"); - return -1; + printf("Warning: This Game does not support Card Reader, please disable the card reader emulation in the config file.\n"); + printf(" I will disable the card reader for you.\n"); + EmulatorConfig *config = getConfig(); + config->emulateCardreader = 0; + return 0; } if (getConfig()->emulateCardreader && getConfig()->emulateDriveboard && gId != R_TUNED) { - printf("Game does not support Card Reader and Driver Board emulation enabled at the same time.\n"); + printf("Warning: This Game does not support Card Reader and Driver Board emulation enabled at the same time.\n"); printf("Please disable Drive Board emulations in the config file.\n"); return -1; } + + initReadCmd(0); + initReadCmd(1); + initWriteCmd(0); + initWriteCmd(1); return 0; } diff --git a/src/lindbergh/config.c b/src/lindbergh/config.c index 0d1d8cd..f7fede5 100644 --- a/src/lindbergh/config.c +++ b/src/lindbergh/config.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -41,6 +41,28 @@ const char* GpuTypeStrings [] = { "ERROR_GPU" }; +/** + * Function to calculate CRC32 checksum in memory. + */ +uint32_t get_crc32(const char *s, ssize_t n) +{ + uint32_t crc = 0xFFFFFFFF; + + for (size_t i = 0; i < n; i++) + { + char ch = s[i]; + for (size_t j = 0; j < 8; j++) + { + uint32_t b = (ch ^ crc) & 1; + crc >>= 1; + if (b) + crc = crc ^ 0xEDB88320; + ch >>= 1; + } + } + return ~crc; +} + static char *getNextToken(char *buffer, char *seperator, char **saveptr) { char *token = strtok_r(buffer, seperator, saveptr); @@ -62,370 +84,6 @@ static int detectGame(uint32_t elf_crc) switch (elf_crc) { - - case SEGABOOT_2_4: - { - config.gameTitle = "Segaboot 2.4"; - config.gameStatus = WORKING; - return 0; - } - break; - - case SEGABOOT_2_4_SYM: - { - config.gameTitle = "Segaboot 2.4 with symbols"; - config.gameStatus = WORKING; - return 0; - } - break; - - case THE_HOUSE_OF_THE_DEAD_4_REVA: - case THE_HOUSE_OF_THE_DEAD_4_REVA_TEST: - { - config.gameTitle = "The House of the Dead 4 Rev A"; - config.gameID = "SBLC"; - config.gameDVP = "DVP-0003A"; - config.gameReleaseYear = "2005"; - config.gameNativeResolutions = "640x480, 1280x768"; - config.gameType = SHOOTING; - config.gameStatus = WORKING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case THE_HOUSE_OF_THE_DEAD_4_REVB: - case THE_HOUSE_OF_THE_DEAD_4_REVB_TEST: - { - config.gameTitle = "The House of the Dead 4 Rev B"; - config.gameID = "SBLC"; - config.gameDVP = "DVP-0003B"; - config.gameReleaseYear = "2005"; - config.gameNativeResolutions = "640x480, 1280x768"; - config.gameType = SHOOTING; - config.gameStatus = WORKING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case THE_HOUSE_OF_THE_DEAD_4_REVC: - case THE_HOUSE_OF_THE_DEAD_4_REVC_TEST: - { - config.gameTitle = "The House of the Dead 4 Rev C"; - config.gameID = "SBLC"; - config.gameDVP = "DVP-0003C"; - config.gameReleaseYear = "2005"; - config.gameNativeResolutions = "640x480, 1280x768"; - config.gameType = SHOOTING; - config.gameStatus = WORKING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case THE_HOUSE_OF_THE_DEAD_4_SPECIAL: - case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_TEST: - { - config.gameTitle = "The House of the Dead 4 Special"; - config.emulateRideboard = 1; - config.gameID = "SBLS"; - config.gameDVP = "DVP-0010"; - config.gameReleaseYear = "2006"; - config.gameNativeResolutions = "1024x768"; - config.gameStatus = WORKING; - config.gameType = SHOOTING; - config.width = 1024; - config.height = 768; - return 0; - } - break; - - case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB: - case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB_TEST: - { - config.gameTitle = "The House of the Dead 4 Special Rev B"; - config.emulateRideboard = 1; - config.gameID = "SBLS"; - config.gameDVP = "DVP-0010B"; - config.gameReleaseYear = "2006"; - config.gameNativeResolutions = "1024x768"; - config.gameStatus = WORKING; - config.gameType = SHOOTING; - config.width = 1024; - config.height = 768; - return 0; - } - break; - - case THE_HOUSE_OF_THE_DEAD_EX: - case THE_HOUSE_OF_THE_DEAD_EX_TEST: - - { - config.gameTitle = "Ai Sareruyori Ai Shitai: The House of the Dead EX"; - config.gameStatus = WORKING; - config.gameType = SHOOTING; - config.gameID = "SBRC"; - config.gameDVP = "DVP-0063"; - config.gameReleaseYear = "2008"; - config.gameNativeResolutions = "1280x768"; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case OUTRUN_2_SP_SDX_REVA: - case OUTRUN_2_SP_SDX_REVA_TEST: - case OUTRUN_2_SP_SDX_REVA_TEST2: - { - config.gameTitle = "Outrun 2 SP SDX Rev A"; - config.gameDVP = "DVP-0015A"; - config.gameID = "SBMB"; - config.gameReleaseYear = "2006"; - config.gameNativeResolutions = "800x480"; - config.emulateDriveboard = 1; - config.emulateMotionboard = 1; - config.gameStatus = WORKING; - config.gameType = DRIVING; - config.width = 800; - config.height = 480; - return 0; - } - break; - - case OUTRUN_2_SP_SDX: - case OUTRUN_2_SP_SDX_TEST: - { - config.gameTitle = "Outrun 2 SP SDX"; - config.gameDVP = "DVP-0015"; - config.gameID = "SBMB"; - config.gameReleaseYear = "2006"; - config.gameNativeResolutions = "800x480"; - config.emulateDriveboard = 1; - config.emulateMotionboard = 1; - config.gameStatus = WORKING; - config.gameType = DRIVING; - config.width = 800; - config.height = 480; - return 0; - } - break; - - case VIRTUA_FIGHTER_5: - { - config.gameTitle = "Virtua Fighter 5"; - config.gameDVP = "DVP-0008"; - config.gameID = "SBLM"; - config.gameReleaseYear = "2005"; - config.gameNativeResolutions = "1280x768"; - config.gameStatus = WORKING; - config.gameType = FIGHTING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_REVA: - { - config.gameTitle = "Virtua Fighter 5 Rev A"; - config.gameDVP = "DVP-0008A"; - config.gameID = "SBLM"; - config.gameReleaseYear = "2005"; - config.gameNativeResolutions = "1280x768"; - config.gameStatus = WORKING; - config.gameType = FIGHTING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_REVB: - { - config.gameTitle = "Virtua Fighter 5 Rev B"; - config.gameDVP = "DVP-0008B"; - config.gameID = "SBLM"; - config.gameReleaseYear = "2005"; - config.gameNativeResolutions = "1280x768"; - config.gameStatus = WORKING; - config.gameType = FIGHTING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_REVE: - { - config.gameTitle = "Virtua Fighter 5 Rev E (Public Version C)"; - config.gameDVP = "DVP-0008E"; - config.gameID = "SBLM"; - config.gameReleaseYear = "2005"; - config.gameNativeResolutions = "1280x768"; - config.gameStatus = WORKING; - config.gameType = FIGHTING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_EXPORT: - { - config.gameTitle = "Virtua Fighter 5 Export"; - config.gameDVP = "DVP-0043"; - config.gameID = "SBLM"; - config.gameReleaseYear = "2005"; - config.gameNativeResolutions = "1280x768"; - config.gameStatus = WORKING; - config.gameType = FIGHTING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_R: - { - config.gameTitle = "Virtua Fighter 5 R"; - config.gameDVP = "DVP-XXXX"; - config.gameID = "SBQU"; - config.gameReleaseYear = "2008"; - config.gameNativeResolutions = "1280x768"; - config.gameStatus = WORKING; - config.gameType = FIGHTING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_R_REVD: - { - config.gameTitle = "Virtua Fighter 5 R Rev D"; - config.gameDVP = "DVP-XXXX"; - config.gameID = "SBQU"; - config.gameReleaseYear = "2008"; - config.gameNativeResolutions = "1280x768"; - config.gameStatus = WORKING; - config.gameType = FIGHTING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_R_REVG: - { - config.gameTitle = "Virtua Fighter 5 R Rev G"; - config.gameDVP = "DVP-XXXX"; - config.gameID = "SBQU"; - config.gameReleaseYear = "2008"; - config.gameNativeResolutions = "1280x768"; - config.gameStatus = WORKING; - config.gameType = FIGHTING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN: - { - config.gameTitle = "Virtua Fighter 5 Final Showdown"; - config.gameDVP = "DVP-SBUV"; - config.gameID = "SBUV"; - config.gameReleaseYear = "2010"; - config.gameNativeResolutions = "1280x768"; - config.gameType = FIGHTING; - config.gameStatus = WORKING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVA: - { - config.gameTitle = "Virtua Fighter 5 Final Showdown REV A"; - config.gameDVP = "DVP-5019A"; - config.gameID = "SBUV"; - config.gameReleaseYear = "2010"; - config.gameNativeResolutions = "1280x768"; - config.gameType = FIGHTING; - config.gameStatus = WORKING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB: - { - config.gameTitle = "Virtua Fighter 5 Final Showdown REV B"; - config.gameDVP = "DVP-5020"; - config.gameID = "SBXX"; - config.gameReleaseYear = "2010"; - config.gameNativeResolutions = "1280x768"; - config.gameType = FIGHTING; - config.gameStatus = WORKING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB_6000: - { - config.gameTitle = "Virtua Fighter 5 Final Showdown REV B ver 6.0000"; - config.gameDVP = "DVP-5020"; - config.gameID = "SBXX"; - config.gameReleaseYear = "2010"; - config.gameNativeResolutions = "1280x768"; - config.gameType = FIGHTING; - config.gameStatus = WORKING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case LETS_GO_JUNGLE: - { - config.gameTitle = "Let's Go Jungle! Lost on the Island of Spice!"; - config.gameDVP = "DVP-0011"; - config.gameID = "SBLU"; - config.gameReleaseYear = "2006"; - config.gameNativeResolutions = "1360x768"; - config.gameType = SHOOTING; - config.gameStatus = WORKING; - config.width = 1360; - config.height = 768; - return 0; - } - break; - - case LETS_GO_JUNGLE_SPECIAL: - { - config.gameTitle = "Let's Go Jungle! Special!"; - config.emulateRideboard = 1; - config.gameID = "SBNR"; - config.gameDVP = "DVP-0036"; - config.gameReleaseYear = "2007"; - config.gameNativeResolutions = "1024x768"; - config.gameType = SHOOTING; - config.gameStatus = WORKING; - config.width = 1024; - config.height = 768; - return 0; - } - break; - case AFTER_BURNER_CLIMAX: { config.gameTitle = "After Burner Climax"; @@ -534,6 +192,138 @@ static int detectGame(uint32_t elf_crc) } break; + case GHOST_SQUAD_EVOLUTION: + { + config.gameTitle = "Ghost Squad Evolution"; + config.gameStatus = WORKING; + config.gameDVP = "DVP-0029A"; + config.gameID = "SBNJ"; + config.gameReleaseYear = "2007"; + config.gameNativeResolutions = "640x480"; + config.gameLindberghColour = RED; + config.gameType = SHOOTING; + config.jvsIOType = SEGA_TYPE_1; + config.width = 640; + config.height = 480; + return 0; + } + break; + + case HARLEY_DAVIDSON: + { + config.gameTitle = "Harley-Davidson: King of the Road"; + config.gameDVP = "DVP-5007"; + config.gameID = "SBRG"; + config.gameReleaseYear = "2009"; + config.gameNativeResolutions = "1360x768"; + config.gameLindberghColour = RED; + config.gameType = HARLEY; + config.gameStatus = WORKING; + config.width = 1360; + config.height = 768; + return 0; + } + break; + + case HUMMER: + { + config.gameTitle = "Hummer"; + config.gameID = "SBQN"; + config.gameDVP = "DVP-0057B"; + config.gameReleaseYear = "2008"; + config.gameNativeResolutions = "1280x768"; + config.gameType = DRIVING; + config.gameStatus = WORKING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case HUMMER_EXTREME: + { + config.gameTitle = "Hummer Extreme"; + config.gameID = "SBST"; + config.gameDVP = "DVP-0079"; + config.gameReleaseYear = "2009"; + config.gameNativeResolutions = ""; + config.gameType = DRIVING; + config.gameStatus = WORKING; + return 0; + } + break; + + case HUMMER_EXTREME_MDX: + { + config.gameTitle = "Hummer Extreme MDX"; + config.gameID = "SBST"; + config.gameDVP = "DVP-0083"; + config.gameReleaseYear = "2009"; + config.gameNativeResolutions = "1280x768"; + config.gameType = DRIVING; + config.gameStatus = WORKING; + return 0; + } + break; + + case HUMMER_SDLX: + { + config.gameTitle = "Hummer SDLX"; + config.gameID = "SBST"; + config.gameDVP = "DVP-0057"; + config.gameReleaseYear = "2008"; + config.gameNativeResolutions = ""; + config.gameType = DRIVING; + config.gameStatus = WORKING; + return 0; + } + break; + + case INITIALD_4_EXP_REVB: + { + config.gameTitle = "Initial D Arcade Stage 4 Export Rev B"; + config.gameID = "SBNK"; + config.gameDVP = "DVP-0030B"; + config.gameReleaseYear = "2007"; + config.gameNativeResolutions = "1360x768"; + config.gameStatus = WORKING; + config.gameType = DRIVING; + config.width = 1360; + config.height = 768; + return 0; + } + break; + + case INITIALD_4_EXP_REVC: + { + config.gameTitle = "Initial D Arcade Stage 4 Export Rev C"; + config.gameID = "SBNK"; + config.gameDVP = "DVP-0030C"; + config.gameReleaseYear = "2007"; + config.gameNativeResolutions = "1360x768"; + config.gameStatus = WORKING; + config.gameType = DRIVING; + config.width = 1360; + config.height = 768; + return 0; + } + break; + + case INITIALD_4_EXP_REVD: + { + config.gameTitle = "Initial D Arcade Stage 4 Export Rev D"; + config.gameID = "SBNK"; + config.gameDVP = "DVP-0030D"; + config.gameReleaseYear = "2007"; + config.gameNativeResolutions = "1360x768"; + config.gameStatus = WORKING; + config.gameType = DRIVING; + config.width = 1360; + config.height = 768; + return 0; + } + break; + case INITIALD_4_REVA: { config.gameTitle = "Initial D Arcade Stage 4 Rev A"; @@ -609,12 +399,42 @@ static int detectGame(uint32_t elf_crc) } break; - case INITIALD_4_EXP_REVB: + case INITIALD_5_EXP: { - config.gameTitle = "Initial D Arcade Stage 4 Export Rev B"; - config.gameID = "SBNK"; - config.gameDVP = "DVP-0030B"; - config.gameReleaseYear = "2007"; + config.gameTitle = "Initial D5 EXP"; + config.gameStatus = WORKING; + config.gameDVP = "DVP-0075"; + config.gameID = "SBRY"; + config.gameReleaseYear = "2009"; + config.gameNativeResolutions = "1360x768"; + config.gameType = DRIVING; + config.width = 1360; + config.height = 768; + return 0; + } + break; + + case INITIALD_5_EXP_20: + { + config.gameTitle = "Initial D5 EXP 2.0"; + config.gameStatus = WORKING; + config.gameDVP = "DVP-0084"; + config.gameID = "SBTS"; + config.gameReleaseYear = "2009"; + config.gameNativeResolutions = "1360x768"; + config.gameType = DRIVING; + config.width = 1360; + config.height = 768; + return 0; + } + break; + + case INITIALD_5_EXP_20A: + { + config.gameTitle = "Initial D5 5 EXP 2.0"; + config.gameDVP = "DVP-0084A"; + config.gameID = "SBQN"; + config.gameReleaseYear = "2009"; config.gameNativeResolutions = "1360x768"; config.gameStatus = WORKING; config.gameType = DRIVING; @@ -624,12 +444,12 @@ static int detectGame(uint32_t elf_crc) } break; - case INITIALD_4_EXP_REVC: + case INITIALD_5_JAP_REVA: { - config.gameTitle = "Initial D Arcade Stage 4 Export Rev C"; - config.gameID = "SBNK"; - config.gameDVP = "DVP-0030C"; - config.gameReleaseYear = "2007"; + config.gameTitle = "Initial D Arcade Stage 5 Rev A"; + config.gameDVP = "DVP-0070A"; + config.gameID = "SBQZ"; + config.gameReleaseYear = "2009"; config.gameNativeResolutions = "1360x768"; config.gameStatus = WORKING; config.gameType = DRIVING; @@ -639,12 +459,12 @@ static int detectGame(uint32_t elf_crc) } break; - case INITIALD_4_EXP_REVD: + case INITIALD_5_JAP_REVF: { - config.gameTitle = "Initial D Arcade Stage 4 Export Rev D"; - config.gameID = "SBNK"; - config.gameDVP = "DVP-0030D"; - config.gameReleaseYear = "2007"; + config.gameTitle = "Initial D Arcade Stage 5 Rev F"; + config.gameDVP = "DVP-0070F"; + config.gameID = "SBQZ"; + config.gameReleaseYear = "2009"; config.gameNativeResolutions = "1360x768"; config.gameStatus = WORKING; config.gameType = DRIVING; @@ -654,16 +474,121 @@ static int detectGame(uint32_t elf_crc) } break; - case SEGA_RACE_TV: + case LETS_GO_JUNGLE: { - config.gameTitle = "SEGA Race TV"; + config.gameTitle = "Let's Go Jungle! Lost on the Island of Spice!"; + config.gameDVP = "DVP-0011"; + config.gameID = "SBLU"; + config.gameReleaseYear = "2006"; + config.gameNativeResolutions = "1360x768"; + config.gameType = SHOOTING; + config.gameStatus = WORKING; + config.width = 1360; + config.height = 768; + return 0; + } + break; + + case LETS_GO_JUNGLE_REVA: + { + config.gameTitle = "Let's Go Jungle! Lost on the Island of Spice! Rev A"; + config.gameDVP = "DVP-0011A"; + config.gameID = "SBLU"; + config.gameReleaseYear = "2006"; + config.gameNativeResolutions = "1360x768"; + config.gameType = SHOOTING; + config.gameStatus = WORKING; + config.width = 1360; + config.height = 768; + return 0; + } + break; + + case LETS_GO_JUNGLE_SPECIAL: + { + config.gameTitle = "Let's Go Jungle! Special!"; + config.emulateRideboard = 1; + config.gameID = "SBNR"; + config.gameDVP = "DVP-0036"; + config.gameReleaseYear = "2007"; + config.gameNativeResolutions = "1024x768"; + config.gameType = SHOOTING; + config.gameStatus = WORKING; + config.width = 1024; + config.height = 768; + return 0; + } + break; + + case MJ4_EVO: + { + config.gameTitle = "SEGA Network Taisen Mahjong MJ4 Evolution"; + config.gameDVP = "DVP-0081"; + config.gameID = "SBTA"; + config.gameStatus = WORKING; + config.gameType = MAHJONG; + return 0; + } + break; + + case MJ4_REVG: + { + config.gameTitle = "SEGA Network Taisen Mahjong MJ4"; + config.gameDVP = "DVP-0049G"; + config.gameID = "SBPN"; + config.gameStatus = WORKING; + config.gameType = MAHJONG; + return 0; + } + break; + + case OUTRUN_2_SP_SDX: + case OUTRUN_2_SP_SDX_TEST: + { + config.gameTitle = "Outrun 2 SP SDX"; + config.gameDVP = "DVP-0015"; + config.gameID = "SBMB"; + config.gameReleaseYear = "2006"; + config.gameNativeResolutions = "800x480"; config.emulateDriveboard = 1; - config.gameDVP = "DVP-0044"; - config.gameID = "SBPF"; + config.emulateMotionboard = 1; + config.gameStatus = WORKING; + config.gameType = DRIVING; + config.width = 800; + config.height = 480; + return 0; + } + break; + + case OUTRUN_2_SP_SDX_REVA: + case OUTRUN_2_SP_SDX_REVA_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST2: + { + config.gameTitle = "Outrun 2 SP SDX Rev A"; + config.gameDVP = "DVP-0015A"; + config.gameID = "SBMB"; + config.gameReleaseYear = "2006"; + config.gameNativeResolutions = "800x480"; + config.emulateDriveboard = 1; + config.emulateMotionboard = 1; + config.gameStatus = WORKING; + config.gameType = DRIVING; + config.width = 800; + config.height = 480; + return 0; + } + break; + + case PRIMEVAL_HUNT: + { + config.gameTitle = "Primeval Hunt"; + config.gameDVP = "DVP-0048A"; + config.gameID = "SBPP"; config.gameReleaseYear = "2008"; config.gameNativeResolutions = "640x480"; + config.gameLindberghColour = RED; config.gameStatus = WORKING; - config.gameType = DRIVING; + config.gameType = SHOOTING; config.width = 640; config.height = 480; return 0; @@ -702,6 +627,136 @@ static int detectGame(uint32_t elf_crc) } break; + case SEGABOOT_2_4: + { + config.gameTitle = "Segaboot 2.4"; + config.gameStatus = WORKING; + return 0; + } + break; + + case SEGABOOT_2_4_SYM: + { + config.gameTitle = "Segaboot 2.4 with symbols"; + config.gameStatus = WORKING; + return 0; + } + break; + + case SEGA_RACE_TV: + { + config.gameTitle = "SEGA Race TV"; + config.emulateDriveboard = 1; + config.gameDVP = "DVP-0044"; + config.gameID = "SBPF"; + config.gameReleaseYear = "2008"; + config.gameNativeResolutions = "640x480"; + config.gameStatus = WORKING; + config.gameType = DRIVING; + config.width = 640; + config.height = 480; + return 0; + } + break; + + case THE_HOUSE_OF_THE_DEAD_4_REVA: + case THE_HOUSE_OF_THE_DEAD_4_REVA_TEST: + { + config.gameTitle = "The House of the Dead 4 Rev A"; + config.gameID = "SBLC"; + config.gameDVP = "DVP-0003A"; + config.gameReleaseYear = "2005"; + config.gameNativeResolutions = "640x480, 1280x768"; + config.gameType = SHOOTING; + config.gameStatus = WORKING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case THE_HOUSE_OF_THE_DEAD_4_REVB: + case THE_HOUSE_OF_THE_DEAD_4_REVB_TEST: + { + config.gameTitle = "The House of the Dead 4 Rev B"; + config.gameID = "SBLC"; + config.gameDVP = "DVP-0003B"; + config.gameReleaseYear = "2005"; + config.gameNativeResolutions = "640x480, 1280x768"; + config.gameType = SHOOTING; + config.gameStatus = WORKING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case THE_HOUSE_OF_THE_DEAD_4_REVC: + case THE_HOUSE_OF_THE_DEAD_4_REVC_TEST: + { + config.gameTitle = "The House of the Dead 4 Rev C"; + config.gameID = "SBLC"; + config.gameDVP = "DVP-0003C"; + config.gameReleaseYear = "2005"; + config.gameNativeResolutions = "640x480, 1280x768"; + config.gameType = SHOOTING; + config.gameStatus = WORKING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case THE_HOUSE_OF_THE_DEAD_4_SPECIAL: + case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_TEST: + { + config.gameTitle = "The House of the Dead 4 Special"; + config.emulateRideboard = 1; + config.gameID = "SBLS"; + config.gameDVP = "DVP-0010"; + config.gameReleaseYear = "2006"; + config.gameNativeResolutions = "1024x768"; + config.gameStatus = WORKING; + config.gameType = SHOOTING; + config.width = 1024; + config.height = 768; + return 0; + } + break; + + case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB: + case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB_TEST: + { + config.gameTitle = "The House of the Dead 4 Special Rev B"; + config.emulateRideboard = 1; + config.gameID = "SBLS"; + config.gameDVP = "DVP-0010B"; + config.gameReleaseYear = "2006"; + config.gameNativeResolutions = "1024x768"; + config.gameStatus = WORKING; + config.gameType = SHOOTING; + config.width = 1024; + config.height = 768; + return 0; + } + break; + + case THE_HOUSE_OF_THE_DEAD_EX: + case THE_HOUSE_OF_THE_DEAD_EX_TEST: + { + config.gameTitle = "Ai Sareruyori Ai Shitai: The House of the Dead EX"; + config.gameStatus = WORKING; + config.gameType = SHOOTING; + config.gameID = "SBRC"; + config.gameDVP = "DVP-0063"; + config.gameReleaseYear = "2008"; + config.gameNativeResolutions = "640x480, 1280x768"; + config.width = 1360; + config.height = 768; + return 0; + } + break; + case TOO_SPICY: case TOO_SPICY_TEST: { @@ -719,6 +774,171 @@ static int detectGame(uint32_t elf_crc) } break; + case VIRTUA_FIGHTER_5: + { + config.gameTitle = "Virtua Fighter 5"; + config.gameDVP = "DVP-0008"; + config.gameID = "SBLM"; + config.gameReleaseYear = "2005"; + config.gameNativeResolutions = "1280x768"; + config.gameStatus = WORKING; + config.gameType = FIGHTING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_EXPORT: + { + config.gameTitle = "Virtua Fighter 5 Export"; + config.gameDVP = "DVP-0043"; + config.gameID = "SBLM"; + config.gameReleaseYear = "2005"; + config.gameNativeResolutions = "1280x768"; + config.gameStatus = WORKING; + config.gameType = FIGHTING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVA: + { + config.gameTitle = "Virtua Fighter 5 Final Showdown REV A"; + config.gameDVP = "DVP-5019A"; + config.gameID = "SBUV"; + config.gameReleaseYear = "2010"; + config.gameNativeResolutions = "1280x768"; + config.gameType = FIGHTING; + config.gameStatus = WORKING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB: + { + config.gameTitle = "Virtua Fighter 5 Final Showdown REV B"; + config.gameDVP = "DVP-5020"; + config.gameID = "SBXX"; + config.gameReleaseYear = "2010"; + config.gameNativeResolutions = "1280x768"; + config.gameType = FIGHTING; + config.gameStatus = WORKING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB_6000: + { + config.gameTitle = "Virtua Fighter 5 Final Showdown REV B ver 6.0000"; + config.gameDVP = "DVP-5020"; + config.gameID = "SBXX"; + config.gameReleaseYear = "2010"; + config.gameNativeResolutions = "1280x768"; + config.gameType = FIGHTING; + config.gameStatus = WORKING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_R: + { + config.gameTitle = "Virtua Fighter 5 R"; + config.gameDVP = "DVP-XXXX"; + config.gameID = "SBQU"; + config.gameReleaseYear = "2008"; + config.gameNativeResolutions = "1280x768"; + config.gameStatus = WORKING; + config.gameType = FIGHTING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_R_REVD: + { + config.gameTitle = "Virtua Fighter 5 R Rev D"; + config.gameDVP = "DVP-XXXX"; + config.gameID = "SBQU"; + config.gameReleaseYear = "2008"; + config.gameNativeResolutions = "1280x768"; + config.gameStatus = WORKING; + config.gameType = FIGHTING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_R_REVG: + { + config.gameTitle = "Virtua Fighter 5 R Rev G"; + config.gameDVP = "DVP-XXXX"; + config.gameID = "SBQU"; + config.gameReleaseYear = "2008"; + config.gameNativeResolutions = "1280x768"; + config.gameStatus = WORKING; + config.gameType = FIGHTING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_REVA: + { + config.gameTitle = "Virtua Fighter 5 Rev A"; + config.gameDVP = "DVP-0008A"; + config.gameID = "SBLM"; + config.gameReleaseYear = "2005"; + config.gameNativeResolutions = "1280x768"; + config.gameStatus = WORKING; + config.gameType = FIGHTING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_REVB: + { + config.gameTitle = "Virtua Fighter 5 Rev B"; + config.gameDVP = "DVP-0008B"; + config.gameID = "SBLM"; + config.gameReleaseYear = "2005"; + config.gameNativeResolutions = "1280x768"; + config.gameStatus = WORKING; + config.gameType = FIGHTING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + + case VIRTUA_FIGHTER_5_REVE: + { + config.gameTitle = "Virtua Fighter 5 Rev E (Public Version C)"; + config.gameDVP = "DVP-0008E"; + config.gameID = "SBLM"; + config.gameReleaseYear = "2005"; + config.gameNativeResolutions = "1280x768"; + config.gameStatus = WORKING; + config.gameType = FIGHTING; + config.width = 1280; + config.height = 768; + return 0; + } + break; + case VIRTUA_TENNIS_3: case VIRTUA_TENNIS_3_TEST: { @@ -781,222 +1001,6 @@ static int detectGame(uint32_t elf_crc) return 0; } break; - - case PRIMEVAL_HUNT: - { - config.gameTitle = "Primeval Hunt"; - config.gameDVP = "DVP-0048A"; - config.gameID = "SBPP"; - config.gameReleaseYear = "2008"; - config.gameNativeResolutions = "640x480"; - config.gameLindberghColour = RED; - config.gameStatus = WORKING; - config.gameType = SHOOTING; - config.width = 640; - config.height = 480; - return 0; - } - break; - - case GHOST_SQUAD_EVOLUTION: - { - config.gameTitle = "Ghost Squad Evolution"; - config.gameStatus = WORKING; - config.gameDVP = "DVP-0029A"; - config.gameID = "SBNJ"; - config.gameReleaseYear = "2007"; - config.gameNativeResolutions = "640x480"; - config.gameLindberghColour = RED; - config.gameType = SHOOTING; - config.jvsIOType = SEGA_TYPE_1; - config.width = 640; - config.height = 480; - return 0; - } - break; - - case INITIALD_5_JAP_REVA: - { - config.gameTitle = "Initial D Arcade Stage 5 Rev A"; - config.gameDVP = "DVP-0070A"; - config.gameID = "SBQZ"; - config.gameReleaseYear = "2009"; - config.gameNativeResolutions = "1360x768"; - config.gameStatus = WORKING; - config.gameType = DRIVING; - config.width = 1360; - config.height = 768; - return 0; - } - break; - - case INITIALD_5_JAP_REVF: - { - config.gameTitle = "Initial D Arcade Stage 5 Rev F"; - config.gameDVP = "DVP-0070F"; - config.gameID = "SBQZ"; - config.gameReleaseYear = "2009"; - config.gameNativeResolutions = "1360x768"; - config.gameStatus = WORKING; - config.gameType = DRIVING; - config.width = 1360; - config.height = 768; - return 0; - } - break; - - case INITIALD_5_EXP: - { - config.gameTitle = "Initial D5 EXP"; - config.gameStatus = WORKING; - config.gameDVP = "DVP-0075"; - config.gameID = "SBRY"; - config.gameReleaseYear = "2009"; - config.gameNativeResolutions = "1360x768"; - config.gameType = DRIVING; - config.width = 1360; - config.height = 768; - return 0; - } - break; - - case INITIALD_5_EXP_20: - { - config.gameTitle = "Initial D5 EXP 2.0"; - config.gameStatus = WORKING; - config.gameDVP = "DVP-0084"; - config.gameID = "SBTS"; - config.gameReleaseYear = "2009"; - config.gameNativeResolutions = "1360x768"; - config.gameType = DRIVING; - config.width = 1360; - config.height = 768; - return 0; - } - break; - - case INITIALD_5_EXP_20A: - { - config.gameTitle = "Initial D5 5 EXP 2.0"; - config.gameDVP = "DVP-0084A"; - config.gameID = "SBQN"; - config.gameReleaseYear = "2009"; - config.gameNativeResolutions = "1360x768"; - config.gameStatus = WORKING; - config.gameType = DRIVING; - config.width = 1360; - config.height = 768; - return 0; - } - break; - - case HUMMER: - { - config.gameTitle = "Hummer"; - config.gameID = "SBQN"; - config.gameDVP = "DVP-0057B"; - config.gameReleaseYear = "2008"; - config.gameNativeResolutions = "1280x768"; - config.gameType = DRIVING; - config.gameStatus = WORKING; - config.width = 1280; - config.height = 768; - return 0; - } - break; - - case HUMMER_SDLX: - { - config.gameTitle = "Hummer SDLX"; - config.gameID = "SBST"; - config.gameDVP = "DVP-0057"; - config.gameReleaseYear = "2008"; - config.gameNativeResolutions = ""; - config.gameType = DRIVING; - config.gameStatus = WORKING; - return 0; - } - break; - - case HUMMER_EXTREME: - { - config.gameTitle = "Hummer Extreme"; - config.gameID = "SBST"; - config.gameDVP = "DVP-0079"; - config.gameReleaseYear = "2009"; - config.gameNativeResolutions = ""; - config.gameType = DRIVING; - config.gameStatus = WORKING; - return 0; - } - break; - - case HUMMER_EXTREME_MDX: - { - config.gameTitle = "Hummer Extreme MDX"; - config.gameID = "SBST"; - config.gameDVP = "DVP-0083"; - config.gameReleaseYear = "2009"; - config.gameNativeResolutions = "1280x768"; - config.gameType = DRIVING; - config.gameStatus = WORKING; - return 0; - } - break; - - case LETS_GO_JUNGLE_REVA: - { - config.gameTitle = "Let's Go Jungle! Lost on the Island of Spice! Rev A"; - config.gameDVP = "DVP-0011A"; - config.gameID = "SBLU"; - config.gameReleaseYear = "2006"; - config.gameNativeResolutions = "1360x768"; - config.gameType = SHOOTING; - config.gameStatus = WORKING; - config.width = 1360; - config.height = 768; - return 0; - } - break; - - case HARLEY_DAVIDSON: - { - config.gameTitle = "Harley-Davidson: King of the Road"; - config.gameDVP = "DVP-5007"; - config.gameID = "SBRG"; - config.gameReleaseYear = "2009"; - config.gameNativeResolutions = "1360x768"; - config.gameLindberghColour = RED; - config.gameType = HARLEY; - config.gameStatus = WORKING; - config.width = 1360; - config.height = 768; - return 0; - } - break; - - case MJ4_REVG: - { - config.gameTitle = "SEGA Network Taisen Mahjong MJ4"; - config.gameDVP = "DVP-0049G"; - config.gameID = "SBPN"; - config.gameStatus = WORKING; - config.gameType = MAHJONG; - return 0; - } - break; - - case MJ4_EVO: - { - config.gameTitle = "SEGA Network Taisen Mahjong MJ4 Evolution"; - config.gameDVP = "DVP-0081"; - config.gameID = "SBTA"; - config.gameStatus = WORKING; - config.gameType = MAHJONG; - return 0; - } - break; - default: { config.crc32 = UNKNOWN; diff --git a/src/lindbergh/config.h b/src/lindbergh/config.h index b3b606c..287f4cd 100644 --- a/src/lindbergh/config.h +++ b/src/lindbergh/config.h @@ -2,6 +2,7 @@ #define CONFIG_H #include +#include #define MAX_PATH_LENGTH 1024 #define INPUT_STRING_LENGTH 256 @@ -71,7 +72,6 @@ #define VIRTUA_FIGHTER_5_REVB 0x8953bd52 // DVP-0008B #define VIRTUA_FIGHTER_5_REVE 0x4c2edbf6 // DVP-0008E #define VIRTUA_FIGHTER_5_EXPORT 0xec474630 // DVP-0043 -#define VIRTUA_FIGHTER_5_FINAL_SHOWDOWN 0x48 // DVP-5019 or does not exist #define VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVA 0xbae2be62 // DVP-5019A #define VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB 0x7cee1d81 // DVP-5020 #define VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB_6000 0x34c0d02 // DVP-5020 ver 6.00 (Weird public version) @@ -279,6 +279,7 @@ typedef struct int borderEnabled; } EmulatorConfig; +uint32_t get_crc32(const char *s, ssize_t n); KeyMapping getDefaultKeymap(); int initConfig(const char* configFilePath); EmulatorConfig *getConfig(); diff --git a/src/lindbergh/hook.c b/src/lindbergh/hook.c index 5c15382..76746f8 100644 --- a/src/lindbergh/hook.c +++ b/src/lindbergh/hook.c @@ -30,8 +30,6 @@ #include #include -#include "hook.h" - #include "baseboard.h" #include "config.h" #include "driveboard.h" @@ -305,15 +303,6 @@ int open(const char *pathname, int flags, ...) int (*_open)(const char *pathname, int flags, ...) = dlsym(RTLD_NEXT, "open"); - // Attempt to open /dev/dsp and /dev/dsp1 - if (strcmp(pathname, "/dev/dsp") == 0) { - int dspFileDescriptor = _open("/dev/dsp", flags, mode); - if(dspFileDescriptor != -1) - return dspFileDescriptor; - - return _open("/dev/dsp1", flags, mode); - } - if (strcmp(pathname, "/dev/lbb") == 0) { hooks[BASEBOARD] = _open(HOOK_FILE_NAME, flags, mode); @@ -1210,28 +1199,6 @@ int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) return _connect(sockfd, addr, addrlen); } -/** - * Function to calculate CRC32 checksum in memory. - */ -uint32_t get_crc32(const char *s, size_t n) -{ - uint32_t crc = 0xFFFFFFFF; - - for (size_t i = 0; i < n; i++) - { - char ch = s[i]; - for (size_t j = 0; j < 8; j++) - { - uint32_t b = (ch ^ crc) & 1; - crc >>= 1; - if (b) - crc = crc ^ 0xEDB88320; - ch >>= 1; - } - } - return ~crc; -} - /** * Callback function to get the offset and size of the execution program in memory of the ELF we hook to. */ diff --git a/src/lindbergh/hook.h b/src/lindbergh/hook.h deleted file mode 100644 index 43801f4..0000000 --- a/src/lindbergh/hook.h +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include - -uint32_t get_crc32(const char *s, size_t n); \ No newline at end of file diff --git a/src/lindbergh/lindbergh.c b/src/lindbergh/lindbergh.c index 8af8852..616b0bb 100644 --- a/src/lindbergh/lindbergh.c +++ b/src/lindbergh/lindbergh.c @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -41,6 +40,151 @@ char *games[] = {"main.exe", "a.elf", "END"}; +/** + * An array containin clean games elf's CRC32 + */ +uint32_t cleanElfCRC32[] = { + 0x51C4D2F6, // DVP-0003A | hod4M.elf + 0x1348BCA8, // DVP-0003A | hod4testM.elf + 0x0AAE384E, // DVP-0003B | hod4M.elf + 0x352AA797, // DVP-0003B | hod4testM.elf + 0x42EED61A, // DVP-0003C | hod4M.elf + 0x6DA6E511, // DVP-0003C | hod4testM.elf + 0x0E4BF4B1, // DVP-0005 | vt3_Lindbergh + 0x9E48AB5B, // DVP-0005 | vt3_testmode + 0xE4C64D01, // DVP-0005A | vt3_Lindbergh + 0x9C0E77E5, // DVP-0005A | vt3_testmode + 0xA4BDB9E2, // DVP-0005B | vt3_Lindbergh + 0x74E25472, // DVP-0005B | vt3_testmode + 0x987AE3FF, // DVP-0005C | vt3_Lindbergh + 0x1E4271A4, // DVP-0005C | vt3_testmode + 0xD409B70C, // DVP-0008 | vf5 + 0x08EBC0DB, // DVP-0008A | vf5 + 0xA47FBA2D, // DVP-0008B | vf5 + 0x8CA46167, // DVP-0008C | vf5 + 0x75946796, // DVP-0008E | vf5 + 0x2C8F5D57, // DVP-0009 | abc + 0x13D90755, // DVP-0009A | abc + 0x633AD6FB, // DVP-0009B | abc + 0xD39825A8, // DVP-0010 | hod4M.elf + 0x0745CF0A, // DVP-0010 | hod4testM.elf + 0x13E59583, // DVP-0010B | hod4M.elf + 0x302FEB00, // DVP-0010B | hod4testM.elf + 0x04E08C99, // DVP-0011 | lgj_final + 0x0C3D3CC3, // DVP-0011A | lgj_final + 0xD9660B2E, // DVP-0015 | JenTest + 0x821C3404, // DVP-0015 | Jennifer + 0x13AF8581, // DVP-0015A | JenTest + 0xB2CE9B23, // DVP-0015A | Jennifer + 0xCC32DEAE, // DVP-0018 | abc + 0x17114BC1, // DVP-0018A | abc + 0x22905D60, // DVP-0019A | id4.elf + 0x43582D48, // DVP-0019B | id4.elf + 0x2D2A18C1, // DVP-0019C | id4.elf + 0x9BFD0D98, // DVP-0019D | id4.elf + 0x9CF9BBCC, // DVP-0019G | id4.elf + 0xFA0F6AB0, // DVP-0027A | apacheM.elf + 0x9D414D18, // DVP-0029A | vsg + 0xC345E213, // DVP-0030B | id4.elf + 0x98E6A516, // DVP-0030C | id4.elf + 0xF67365C9, // DVP-0030D | id4.elf + 0x8BDD31BA, // DVP-0031 | abc + 0x3DF37873, // DVP-0031A | abc + 0xDD8BB792, // DVP-0036A | lgjsp_app + 0xB0A96E34, // DVP-0043 | vf5 + 0xF99E5635, // DVP-0044 | drive.elf + 0x4143F6B4, // DVP-0048A | main.exe + 0x653BC83B, // DVP-0057 | a.elf + 0x04D88552, // DVP-0057B | a.elf + 0x089D6051, // DVP-0060 | dsr + 0x317F3B90, // DVP-0063 | hodexRI.elf + 0x3A5EEC69, // DVP-0063 | hodextestR.elf + 0x81E02850, // DVP-0069 | ramboM.elf + 0xE4F202BB, // DVP-0070A | id5.elf + 0x2E6732A3, // DVP-0070F | id5.elf + 0xF99A3CDB, // DVP-0075 | id5.elf + 0x05647A8E, // DVP-0079 | hummer_Master.elf + 0x4442EA15, // DVP-0083 | hummer_Master.elf + 0x8DF6BBF9, // DVP-0084 | id5.elf + 0x2AF8004E, // DVP-0084A | id5.elf + 0xB95528F4, // DVP-5004 | vf5 + 0x012E4898, // DVP-5004D | vf5 + 0x74465F9F, // DVP-5004G | vf5 + 0x75B48E22, // DVP-5007 | chopperM.elf + 0xFCB9D941, // DVP-5019A | vf5 + 0xAB70901C, // DVP-5020 | vf5 + 0x6BAA510D, // DVP-5020 | vf5 | Ver 6.000 +}; + +int cleanElfCRC32Count = sizeof(cleanElfCRC32) / sizeof(uint32_t); + +uint32_t calcCrc32(uint32_t crc, uint8_t data) +{ + crc ^= data; // No shift needed; working in LSB-first order + for (int i = 0; i < 8; i++) + { + if (crc & 1) + { + crc = (crc >> 1) ^ 0xEDB88320; + } + else + { + crc = (crc >> 1); + } + } + return crc; +} + +int lookupCrcTable(uint32_t crc) +{ + for (int x = 0; x < cleanElfCRC32Count; x++) + { + if (cleanElfCRC32[x] == crc) + return 1; + } + return 0; +} + +void isCleanElf(char *command) +{ + const char *space_pos = strchr(command, ' '); + size_t length = space_pos ? (size_t)(space_pos - command) : strlen(command); + + char elfName[256]; + strncpy(elfName, command, length); + elfName[length] = '\0'; + + FILE *file = fopen(elfName, "rb"); + if (!file) + { + log_error("Could not calculate the Elf CRC32."); + return; + } + + uint32_t crc = 0xFFFFFFFF; + uint8_t buffer[4096]; + size_t bytesRead; + + while ((bytesRead = fread(buffer, 1, sizeof(buffer), file)) > 0) + { + for (size_t i = 0; i < bytesRead; i++) + { + crc = calcCrc32(crc, buffer[i]); + } + } + + fclose(file); + crc = crc ^ 0xFFFFFFFF; + + if (!lookupCrcTable(crc)) + { + printf("\033[1;31m"); + printf("Warning: The ELF you are running is not Clean and might cause unwanted behavior.\n"); + printf(" Make sure you ELF and game dump are clean before reporting issues.\n"); + printf("\033[0m"); + } +} + /** * Tests if the game uses a seperate elf for test mode * and updates the command line to this elf. @@ -311,6 +455,8 @@ int main(int argc, char *argv[]) if (testMode) testModePath(command); + isCleanElf(command); + if (gdb) { char temp[128]; @@ -318,6 +464,7 @@ int main(int argc, char *argv[]) strcat(temp, command); strcpy(command, temp); } + if (extConfigPath[0] != '\0') { setenv(LINDBERGH_CONFIG_PATH,extConfigPath,1); diff --git a/src/lindbergh/patch.c b/src/lindbergh/patch.c index 9412521..473fa73 100644 --- a/src/lindbergh/patch.c +++ b/src/lindbergh/patch.c @@ -19,7 +19,6 @@ #include #include "config.h" -#include "hook.h" #include "resolution.h" #include "securityboard.h" #include "shader_patches.h" @@ -425,61 +424,6 @@ int initPatch() switch (config->crc32) { - case R_TUNED: - { - // Security - detourFunction(0x08366846, amDongleInit); - detourFunction(0x08365301, amDongleIsAvailable); - detourFunction(0x08365cf7, amDongleUpdate); - // Fixes - amDipswContextAddr = (void *)0x08578be8; - detourFunction(0x08365094, amDipswInit); - detourFunction(0x08365118, amDipswExit); - detourFunction(0x08365203, amDipswSetLed); - detourFunction(0x0836518d, amDipswGetData); - patchMemory(0x8388C90, "2e2f72616d2f746f2e74787400"); // Patch /home/disk2 folder - patchMemory(0x8388CA7, "2e2f72616d2f66726f6d2e74787400"); // Patch /home/disk2 folder - patchMemory(0x8388CC0, "2e2f72616d2f2e746d7000"); // Patch /home/disk2 folder - patchMemory(0x8388D10, "2e2f72616d00"); // Patch /home/disk2 folder - patchMemory(0x8388D20, "2e2f666f6f3100"); // Patch /home/disk2 folder - patchMemory(0x8388D31, "2e2f666f6f3200"); // Patch /home/disk2 folder - patchMemory(0x83C979E, "2e2f00"); // Patch /home/disk2 folder - patchMemory(0x838C498, "2e2f524f4d5f4c414e472f656e00"); // Patch /home/disk0 folder - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x080507e8, gl_ProgramStringARB); - } - // Disable Force Feedback check? - patchMemory(0x0817f8d9, "891c2490909090"); - patchMemory(0x0817f8e5, "ebc5"); - } - break; - case SEGA_RACE_TV: - { - // Security - detourFunction(0x084d5b40, amDongleInit); - detourFunction(0x084d45f9, amDongleIsAvailable); - detourFunction(0x084d4fef, amDongleUpdate); - // Fixes - amDipswContextAddr = (void *)0x08df9cec; - detourFunction(0x084d438c, amDipswInit); - detourFunction(0x084d4410, amDipswExit); - detourFunction(0x084d44fc, amDipswSetLed); - detourFunction(0x084d4485, amDipswGetData); - patchMemory(0x0804edb2, "9090909090"); //__intel_new_proc_init_P - - detourFunction(0x0804e594, gl_XGetProcAddressARB); - srtvElfShaderPatcher(); - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - patchMemory(0x082d3ce9, "9090"); // Force GL_NVX_conditional_render - } - } - break; case AFTER_BURNER_CLIMAX: // DVP-0009 { // Security @@ -633,6 +577,1279 @@ int initPatch() } } break; + case GHOST_SQUAD_EVOLUTION: + { + if (config->showDebugMessages == 1) + { + // Debug + detourFunction(0x080984fe, _putConsole); + } + // Security + detourFunction(0x08183046, amDongleInit); + detourFunction(0x08181a91, amDongleIsAvailable); + detourFunction(0x081824f5, amDongleUpdate); + detourFunction(0x080e7ee8, stubRetOne); // stub check_dongle_validate + patchMemory(0x080e7db2, "01"); + // Fixes + amDipswContextAddr = (void *)0x0aeafc28; // Address of amDipswContext + detourFunction(0x08181824, amDipswInit); + detourFunction(0x081818a8, amDipswExit); + detourFunction(0x0818191d, amDipswGetData); + detourFunction(0x08181994, stubRetZero); + patchMemory(0x080f37dd, "75"); // patch to prevent memory assignment error + // Stop the extra inputs by removing io_glut_init + detourFunction(0x080e7f94, stubRetZero); + + cacheModedShaderFiles(); + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + gsEvoElfShaderPatcher(); + detourFunction(0x0804c334, gl_ProgramStringARB); + } + } + break; + case HARLEY_DAVIDSON: + { + // Security + detourFunction(0x08395ede, amDongleInit); + detourFunction(0x083949b6, amDongleIsDevelop); + detourFunction(0x0818ba08, stubRetZero); + detourFunction(0x0818b9ce, stubRetZero); + + // Fixes + amDipswContextAddr = (void *)0x0abe35a8; + detourFunction(0x0839472c, amDipswInit); + detourFunction(0x083947b0, amDipswExit); + detourFunction(0x08394825, amDipswGetData); + detourFunction(0x08395da5, amDongleUserInfoEx); + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + cacheModedShaderFiles(); + loadLibCg(); + cacheNnstdshader(); + patchMemory(0x082d4437, "9090909090"); // Stop the folder rename + patchMemory(0x088a6127, "66732f636f6d70696c65646d657361"); // Change folder to compiledshdmesa + patchMemory(0x082646b3, "01"); // Compile using CGC + replaceCallAtAddress(0x082d48ac, compileWithCGC); + replaceCallAtAddress(0x082d4b3b, compileWithCGC); + } + // Turns off the opponent marker at higher resolutions because it is out of place. + if (getConfig()->width > 1360) + detourFunction(0x080f19a6, stubRetZero); + } + break; + case HUMMER: + { + if (config->showDebugMessages == 1) + { + setVariable(0x0a6e9fac, 2); // amBackupDebugLevel + setVariable(0x0a6e9fc0, 2); // amCreditDebugLevel + setVariable(0x0a6ea218, 2); // amDipswDebugLevel + setVariable(0x0a6ea21c, 2); // amDongleDebugLevel + setVariable(0x0a6ea220, 2); // amEepromDebugLevel + setVariable(0x0a6ea224, 2); // amHwmonitorDebugLevel + setVariable(0x0a6ea228, 2); // amJvsDebugLevel + setVariable(0x0a6ea22c, 2); // amLibDebugLevel + setVariable(0x0a6ea230, 2); // amMiscDebugLevel + setVariable(0x0a6ea234, 2); // amOsinfoDebugLevel + setVariable(0x0a6ea238, 2); // amSysDataDebugLevel + setVariable(0x0a6ea240, 2); // bcLibDebugLevel + } + + // Security + detourFunction(0x083dcbf6, amDongleInit); + detourFunction(0x083db641, amDongleIsAvailable); + detourFunction(0x083dc0a5, amDongleUpdate); + detourFunction(0x083db65e, amDongleIsDevelop); + detourFunction(0x083dcabd, amDongleUserInfoEx); + detourFunction(0x080f4e04, stubRetMinusOne); // checkError + detourFunction(0x083dc5aa, amDongleDecryptEx); // Return 0 + detourFunction(0x083dbddd, amDongleSetIv); // Retrun 0 + + // Security Board + amDipswContextAddr = (void *)0x0a6f2c88; + detourFunction(0x083db3d4, amDipswInit); + detourFunction(0x083db458, amDipswExit); + detourFunction(0x083db4cd, amDipswGetData); + detourFunction(0x083db544, amDipswSetLed); + + // Networking + detourFunction(0x083e339d, stubRetZero); // amOsinfoModifyNetworkAdr + detourFunction(0x083e3a2f, stubRetZero); // amOsinfoModifyNetworkProperty + + // While we can't get into the test menu, immidiately return from the + // call to clSteerErrorDisp::run that complains about the calibration + // values. + patchMemory(0x082e8f48, "C3"); + // Fixes Black screen after finishing the race + patchMemory(0x08078b4c, "C3"); + + detourFunction(0x082b5e4a, stubReturn); // adx_err_callback + detourFunction(0x082d199c, stubReturn); // clSerialLindbergh::send + detourFunction(0x082d1ab4, stubReturn); // clSerialLindbergh::receive + + // Shader patching + cacheModedShaderFiles(); + detourFunction(0x0804f480, gl_XGetProcAddressARB); + } + break; + case HUMMER_EXTREME: + { + if (config->showDebugMessages == 1) + { + setVariable(0x0a79a834, 2); // amAdtecDebugLevel + setVariable(0x0a79a838, 2); // amAtaDebugLevel + setVariable(0x0a79a83c, 2); // amBackupDebugLevel + setVariable(0x0a79a840, 2); // amCreditDebugLevel + setVariable(0x0a79aa98, 2); // amDipswDebugLevel + setVariable(0x0a79aa9c, 2); // amDongleDebugLevel + setVariable(0x0a79aaa0, 2); // amEepromDebugLevel + setVariable(0x0a79aaa4, 2); // amHwmonitorDebugLevel + setVariable(0x0a79aaa8, 2); // amJvsDebugLevel + setVariable(0x0a79aaac, 2); // amLibDebugLevel + setVariable(0x0a79aab0, 2); // amMiscDebugLevel + setVariable(0x0a79aab4, 2); // amOsinfoDebugLevel + setVariable(0x0a79a830, 2); // amsLibDebugLevel + setVariable(0x0a79aab8, 2); // amSysDataDebugLevel + setVariable(0x0a79aac0, 2); // bcLibDebugLevel + } + + // Security + detourFunction(0x0831c0d1, amDongleInit); + detourFunction(0x0831a95d, amDongleIsAvailable); + detourFunction(0x0831b47e, amDongleUpdate); + detourFunction(0x0831a97a, amDongleIsDevelop); + detourFunction(0x0831bf97, amDongleUserInfoEx); + detourFunction(0x0831668c, stubRetZero); // amsInit + detourFunction(0x08170654, stubRetMinusOne); // checkError + detourFunction(0x0831b982, amDongleDecryptEx); // Return 0 + detourFunction(0x0831b08b, amDongleSetIv); // Retrun 0 + patchMemory(0x082b4d51, "00"); + patchMemory(0x082b5163, "00"); + patchMemory(0x082b5306, "00"); + patchMemory(0x082b570f, "00"); + patchMemory(0x082b57c8, "909090909090"); + + // Security Board + amDipswContextAddr = (void *)0x0a7aefe8; + detourFunction(0x0831a6f0, amDipswInit); + detourFunction(0x0831a774, amDipswExit); + detourFunction(0x0831a7e9, amDipswGetData); + detourFunction(0x0831a85f, amDipswSetLed); + + // Networking + detourFunction(0x08323886, stubRetZero); // amOsinfoModifyNetworkAdr + detourFunction(0x0832386b, stubRetZero); // amOsinfoModifyNetworkProperty + + // While we can't get into the test menu, immidiately return from the + // call to clSteerErrorDisp::run that complains about the calibration + // values. + patchMemory(0x080e8b40, "C3"); + // Fixes Black screen after finishing the race + patchMemory(0x0811d0c0, "C3"); + + // Shader patching + cacheModedShaderFiles(); + detourFunction(0x0807a9dc, gl_XGetProcAddressARB); + } + break; + case HUMMER_EXTREME_MDX: + { + if (config->showDebugMessages == 1) + { + setVariable(0x0a7ae7b4, 2); // amAdtecDebugLevel + setVariable(0x0a7ae7b8, 2); // amAtaDebugLevel + setVariable(0x0a7ae7bc, 2); // amBackupDebugLevel + setVariable(0x0a7ae7c0, 2); // amCreditDebugLevel + setVariable(0x0a7aea18, 2); // amDipswDebugLevel + setVariable(0x0a7aea1c, 2); // amDongleDebugLevel + setVariable(0x0a7aea20, 2); // amEepromDebugLevel + setVariable(0x0a7aea24, 2); // amHwmonitorDebugLevel + setVariable(0x0a7aea28, 2); // amJvsDebugLevel + setVariable(0x0a7aea2c, 2); // amLibDebugLevel + setVariable(0x0a7aea30, 2); // amMiscDebugLevel + setVariable(0x0a7aea34, 2); // amOsinfoDebugLevel + setVariable(0x0a7ae7b0, 2); // amsLibDebugLevel + setVariable(0x0a7aea38, 2); // amSysDataDebugLevel + setVariable(0x0a7aea40, 2); // bcLibDebugLevel + } + + // Security + detourFunction(0x0832b411, amDongleInit); + detourFunction(0x08329c9d, amDongleIsAvailable); + detourFunction(0x0832a7be, amDongleUpdate); + detourFunction(0x08329cba, amDongleIsDevelop); + detourFunction(0x0832b2d7, amDongleUserInfoEx); + detourFunction(0x083259cc, stubRetZero); // amsInit + detourFunction(0x0817a0b6, stubRetMinusOne); // checkError + detourFunction(0x0832acc2, amDongleDecryptEx); // Return 0 + detourFunction(0x0832a3cb, amDongleSetIv); // Retrun 0 + patchMemory(0x082c2465, "00"); + patchMemory(0x082c2877, "00"); + patchMemory(0x082c2a16, "00"); + patchMemory(0x082c2e1f, "00"); + patchMemory(0x082c2ed8, "909090909090"); + + patchMemory(0x080de537, "909090909090"); + + // Security Board + amDipswContextAddr = (void *)0x0a7c2f68; + detourFunction(0x08329a30, amDipswInit); + detourFunction(0x08329ab4, amDipswExit); + detourFunction(0x08329b29, amDipswGetData); + detourFunction(0x08329b9f, amDipswSetLed); + + // Networking + detourFunction(0x08332bc6, stubRetZero); // amOsinfoModifyNetworkAdr + detourFunction(0x08332bab, stubRetZero); // amOsinfoModifyNetworkProperty + + // While we can't get into the test menu, immidiately return from the + // call to clSteerErrorDisp::run that complains about the calibration + // values. + patchMemory(0x080ebe20, "C3"); + // Fixes Black screen after finishing the race + patchMemory(0x081260f0, "C3"); + + // Shader patching + cacheModedShaderFiles(); + detourFunction(0x0807a9dc, gl_XGetProcAddressARB); + } + break; + case HUMMER_SDLX: + { + if (config->showDebugMessages == 1) + { + setVariable(0x0a6eac0c, 2); // amBackupDebugLevel + setVariable(0x0a6eac20, 2); // amCreditDebugLevel + setVariable(0x0a6eae78, 2); // amDipswDebugLevel + setVariable(0x0a6eae7c, 2); // amDongleDebugLevel + setVariable(0x0a6eae80, 2); // amEepromDebugLevel + setVariable(0x0a6eae84, 2); // amHwmonitorDebugLevel + setVariable(0x0a6eae88, 2); // amJvsDebugLevel + setVariable(0x0a6eae8c, 2); // amLibDebugLevel + setVariable(0x0a6eae90, 2); // amMiscDebugLevel + setVariable(0x0a6eae94, 2); // amOsinfoDebugLevel + setVariable(0x0a6eae98, 2); // amSysDataDebugLevel + setVariable(0x0a6eaea0, 2); // bcLibDebugLevel + } + + // Security + detourFunction(0x083dd7d2, amDongleInit); + detourFunction(0x083dc21d, amDongleIsAvailable); + detourFunction(0x083dcc81, amDongleUpdate); + detourFunction(0x083dc23a, amDongleIsDevelop); + detourFunction(0x083dd699, amDongleUserInfoEx); + detourFunction(0x080f4ea8, stubRetMinusOne); // checkError + detourFunction(0x083dd186, amDongleDecryptEx); // Return 0 + detourFunction(0x083dc9b9, amDongleSetIv); // Retrun 0 + + // Security Board + amDipswContextAddr = (void *)0x0a6f38e8; + detourFunction(0x083dbfb0, amDipswInit); + detourFunction(0x083dc034, amDipswExit); + detourFunction(0x083dc0a9, amDipswGetData); + detourFunction(0x083dc120, amDipswSetLed); + + // Networking + detourFunction(0x083e3f79, stubRetZero); // amOsinfoModifyNetworkAdr + detourFunction(0x083e460b, stubRetZero); // amOsinfoModifyNetworkProperty + + // While we can't get into the test menu, immidiately return from the + // call to clSteerErrorDisp::run that complains about the calibration + // values. + patchMemory(0x082e99ec, "C3"); + // Fixes Black screen after finishing the race + patchMemory(0x08078b84, "C3"); + + detourFunction(0x082b650a, stubReturn); // adx_err_callback + detourFunction(0x082d2414, stubReturn); // clSerialLindbergh::send + detourFunction(0x082d252c, stubReturn); // clSerialLindbergh::receive + + // Shader patching + cacheModedShaderFiles(); + detourFunction(0x0804f480, gl_XGetProcAddressARB); + } + break; + case INITIALD_4_EXP_REVB: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08d93b70, 2); // amBackupDebugLevel + setVariable(0x08d93b80, 2); // amCreditDebugLevel + setVariable(0x08d93dd8, 2); // amDipswDebugLevel + setVariable(0x08d93ddc, 2); // amDongleDebugLevel + setVariable(0x08d93de0, 2); // amEepromDebugLevel + setVariable(0x08d93de4, 2); // amHwmonitorDebugLevel + setVariable(0x08d93de8, 2); // amJvsDebugLevel + setVariable(0x08d93dec, 2); // amLibDebugLevel + setVariable(0x08d93df0, 2); // amMiscDebugLevel + setVariable(0x08d93df8, 2); // amSysDataDebugLevel + setVariable(0x08d93e00, 2); // bcLibDebugLevel + setVariable(0x08d93df4, 2); // amOsinfoDebugLevel + setVariable(0x08d93e04, 0x0FFFFFFF); // s_logMask + detourFunction(0x0854a778, _putConsoleSeparate); // Debug Messages (crashes game) + } + // Security + detourFunction(0x0870ee36, amDongleInit); + detourFunction(0x0870d881, amDongleIsAvailable); + detourFunction(0x0870e2e5, amDongleUpdate); + detourFunction(0x0870ecfd, amDongleUserInfoEx); + memcpy(elfID, (void *)0x087c0a61, 4); // Gets gameID from the ELF + + // Fixes + amDipswContextAddr = (void *)0x08dc2d08; + detourFunction(0x0870d614, amDipswInit); + detourFunction(0x0870d698, amDipswExit); + detourFunction(0x0870d70d, amDipswGetData); + detourFunction(0x0870d784, stubRetZero); // amDipswSetLed + detourFunction(0x0822fdde, stubRetOne); // isEthLinkUp + // patchMemory(0x082ddfcd, "e954010000"); // tickWaitDHCP + patchMemory(0x082df619, "eb60"); // tickInitAddress + detourFunction(0x0821a1fa, stubRetOne); // Skip Kickback initialization + setVariable(0x0857f0e9, 0x000126e9); // Avoid Full Screen set from Game + patchMemory(0x087bc56c, "ab"); // Skips initialization + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x08078860, gl_MultiTexCoord2fARB); + detourFunction(0x080788d0, gl_Color4ub); + detourFunction(0x08078b00, gl_Vertex3f); + detourFunction(0x08079200, gl_TexCoord2f); + detourFunction(0x080792a0, cg_GLIsProfileSupported); + patchMemory(0x08549c10, "9090"); + patchMemory(0x0856e843, "31C090"); // cgCreateProgram args argument to 0; + cacheModedShaderFiles(); + detourFunction(0x08079730, gl_XGetProcAddressARB); + detourFunction(0x080794d0, gl_ProgramParameters4fvNV); + } + detourFunction(0x08264e7a, stubRetOne); // isExistNewerSource (forces shader recompilation) + } + break; + case INITIALD_4_EXP_REVC: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08d93b70, 2); // amBackupDebugLevel + setVariable(0x08d93b80, 2); // amCreditDebugLevel + setVariable(0x08d93dd8, 2); // amDipswDebugLevel + setVariable(0x08d93ddc, 2); // amDongleDebugLevel + setVariable(0x08d93de0, 2); // amEepromDebugLevel + setVariable(0x08d93de4, 2); // amHwmonitorDebugLevel + setVariable(0x08d93de8, 2); // amJvsDebugLevel + setVariable(0x08d93dec, 2); // amLibDebugLevel + setVariable(0x08d93df0, 2); // amMiscDebugLevel + setVariable(0x08d93df8, 2); // amSysDataDebugLevel + setVariable(0x08d93e00, 2); // bcLibDebugLevel + setVariable(0x08d93df4, 2); // amOsinfoDebugLevel + setVariable(0x08d93e04, 0x0FFFFFFF); // s_logMask + detourFunction(0x0854a4f8, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x0870ebb6, amDongleInit); + detourFunction(0x0870d601, amDongleIsAvailable); + detourFunction(0x0870e065, amDongleUpdate); + detourFunction(0x0870ea7d, amDongleUserInfoEx); + memcpy(elfID, (void *)0x08337197, 4); // Gets gameID from the ELF + + // Fixes + amDipswContextAddr = (void *)0x08dc2d08; + detourFunction(0x0870d394, amDipswInit); + detourFunction(0x0870d418, amDipswExit); + detourFunction(0x0870d48d, amDipswGetData); + detourFunction(0x0870d504, stubRetZero); // amDipswSetLed + detourFunction(0x0822feae, stubRetOne); // isEthLinkUp + // patchMemory(0x082dde0d, "e954010000"); // tickWaitDHCP + patchMemory(0x082df459, "eb60"); // tickInitAddress + detourFunction(0x0821a2aa, stubRetOne); // Skip Kickback initialization + setVariable(0x0857ee69, 0x000126e9); // Avoid Full Screen set from Game + patchMemory(0x087bc2ec, "eb"); // Skips initialization + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x08078860, gl_MultiTexCoord2fARB); + detourFunction(0x080788d0, gl_Color4ub); + detourFunction(0x08078b00, gl_Vertex3f); + detourFunction(0x08079200, gl_TexCoord2f); + detourFunction(0x080792a0, cg_GLIsProfileSupported); + patchMemory(0x0854b4a0, "9090"); + patchMemory(0x085700d3, "31C090"); // cgCreateProgram args argument to 0; + cacheModedShaderFiles(); + detourFunction(0x08079730, gl_XGetProcAddressARB); + detourFunction(0x080794d0, gl_ProgramParameters4fvNV); + } + detourFunction(0x08264f62, stubRetOne); // isExistNewerSource (forces shader recompilation) + } + break; + case INITIALD_4_EXP_REVD: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08d972d0, 2); // amBackupDebugLevel + setVariable(0x08d972e0, 2); // amCreditDebugLevel + setVariable(0x08d97538, 2); // amDipswDebugLevel + setVariable(0x08d9753c, 2); // amDongleDebugLevel + setVariable(0x08d97540, 2); // amEepromDebugLevel + setVariable(0x08d97544, 2); // amHwmonitorDebugLevel + setVariable(0x08d97548, 2); // amJvsDebugLevel + setVariable(0x08d9754c, 2); // amLibDebugLevel + setVariable(0x08d97550, 2); // amMiscDebugLevel + setVariable(0x08d97554, 2); // amSysDataDebugLevel + setVariable(0x08d97558, 2); // bcLibDebugLevel + setVariable(0x08d97560, 2); // amOsinfoDebugLevel + setVariable(0x08d97564, 0x0FFFFFFF); // s_logMask + detourFunction(0x0854c008, _putConsoleSeparate); // Debug Messages (crashes game) + } + // Security + detourFunction(0x087106e6, amDongleInit); + detourFunction(0x0870f131, amDongleIsAvailable); + detourFunction(0x0870fb95, amDongleUpdate); + detourFunction(0x087105ad, amDongleUserInfoEx); + memcpy(elfID, (void *)0x08338ce7, 4); // Gets gameID from the ELF + + // Fixes + amDipswContextAddr = (void *)0x08dc6928; + detourFunction(0x0870eec4, amDipswInit); + detourFunction(0x0870ef48, amDipswExit); + detourFunction(0x0870efbd, amDipswGetData); + detourFunction(0x0870f034, stubRetZero); // amDipswSetLed + detourFunction(0x08230fde, stubRetOne); // isEthLinkUp + patchMemory(0x082df87d, "e954010000"); // tickWaitDHCP + patchMemory(0x082e0ec9, "eb60"); // tickInitAddress + detourFunction(0x0821b3ea, stubRetOne); // Skip Kickback initialization + setVariable(0x08580979, 0x000126e9); // Avoid Full Screen set from Game + patchMemory(0x087beb6c, "5b"); // Skips initialization + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x080788ec, gl_MultiTexCoord2fARB); + detourFunction(0x0807895c, gl_Color4ub); + detourFunction(0x08078b8c, gl_Vertex3f); + detourFunction(0x0807928c, gl_TexCoord2f); + detourFunction(0x0807932c, cg_GLIsProfileSupported); + patchMemory(0x0854b4a0, "9090"); + patchMemory(0x085700d3, "31C090"); // cgCreateProgram args argument to 0; + cacheModedShaderFiles(); + detourFunction(0x080797dc, gl_XGetProcAddressARB); + detourFunction(0x0807955c, gl_ProgramParameters4fvNV); + } + detourFunction(0x08266098, stubRetOne); // isExistNewerSource (forces shader recompilation) + } + break; + case INITIALD_4_REVA: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08d71470, 2); // amBackupDebugLevel + setVariable(0x08d71480, 2); // amCreditDebugLevel + setVariable(0x08d716d8, 2); // amDipswDebugLevel + setVariable(0x08d716dc, 2); // amDongleDebugLevel + setVariable(0x08d716e0, 2); // amEepromDebugLevel + setVariable(0x08d716e4, 2); // amHwmonitorDebugLevel + setVariable(0x08d716e8, 2); // amJvsDebugLevel + setVariable(0x08d716ec, 2); // amLibDebugLevel + setVariable(0x08d716f0, 2); // amMiscDebugLevel + setVariable(0x08d716f8, 2); // amSysDataDebugLevel + setVariable(0x08d71700, 2); // bcLibDebugLevel + setVariable(0x08d716f4, 2); // amOsinfoDebugLevel + setVariable(0x08d71704, 0x0FFFFFFF); // s_logMask + detourFunction(0x08524c88, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x086e20fa, amDongleInit); + detourFunction(0x086e0b45, amDongleIsAvailable); + detourFunction(0x086e15a9, amDongleUpdate); + detourFunction(0x086e1fc1, amDongleUserInfoEx); + memcpy(elfID, (void *)0x8318835, 4); // Gets gameID from the ELF + // Fixes + amDipswContextAddr = (void *)0x08da0628; // Address of amDipswContext + detourFunction(0x086e08d8, amDipswInit); + detourFunction(0x086e095c, amDipswExit); + detourFunction(0x086e09d1, amDipswGetData); + detourFunction(0x086e0a48, amDipswSetLed); // amDipswSetLED + + detourFunction(0x0821e52c, stubRetOne); // isEthLinkUp + patchMemory(0x082cb222, "c0270900"); // tickInitStoreNetwork + patchMemory(0x082cb4e9, "e950010000"); // tickWaitDHCP + patchMemory(0x082ccc68, "eb"); // Skip Kickback initialization + patchMemory(0x08799acc, "62"); // Skips initialization + patchMemory(0x08799adc, "df"); // Skips initialization + setVariable(0x085593c9, 0x000126e9); // Avoid Full Screen set from Game + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x08078980, gl_MultiTexCoord2fARB); + detourFunction(0x080789f0, gl_Color4ub); + detourFunction(0x08078c10, gl_Vertex3f); + detourFunction(0x08079330, gl_TexCoord2f); + detourFunction(0x080793d0, cg_GLIsProfileSupported); + patchMemory(0x085241ea, "9090"); + cacheModedShaderFiles(); + detourFunction(0x08079870, gl_XGetProcAddressARB); + detourFunction(0x08079600, gl_ProgramParameters4fvNV); + } + patchMemory(0x08548cb3, "31C090"); // cgCreateProgram args argument to 0; + detourFunction(0x0825637a, stubRetOne); // isExistNewerSource (forces shader recompilation) + } + break; + case INITIALD_4_REVB: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08d71750, 2); // amBackupDebugLevel + setVariable(0x08d71760, 2); // amCreditDebugLevel + setVariable(0x08d719b8, 2); // amDipswDebugLevel + setVariable(0x08d719bc, 2); // amDongleDebugLevel + setVariable(0x08d719c0, 2); // amEepromDebugLevel + setVariable(0x08d719c4, 2); // amHwmonitorDebugLevel + setVariable(0x08d719c8, 2); // amJvsDebugLevel + setVariable(0x08d719cc, 2); // amLibDebugLevel + setVariable(0x08d719d0, 2); // amMiscDebugLevel + setVariable(0x08d719d8, 2); // amSysDataDebugLevel + setVariable(0x08d719e0, 2); // bcLibDebugLevel + setVariable(0x08d719d4, 2); // amOsinfoDebugLevel + setVariable(0x08d719e4, 0x0FFFFFFF); // s_logMask + detourFunction(0x08524ec8, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x086e2336, amDongleInit); + detourFunction(0x086e0d81, amDongleIsAvailable); + detourFunction(0x086e17e5, amDongleUpdate); + detourFunction(0x086e21fd, amDongleUserInfoEx); + memcpy(elfID, (void *)0x08318a45, 4); // Gets gameID from the ELF + // Fixes + amDipswContextAddr = (void *)0x08da0908; // Address of amDipswContext + detourFunction(0x086e0b14, amDipswInit); + detourFunction(0x086e0b98, amDipswExit); + detourFunction(0x086e0c0d, amDipswGetData); + detourFunction(0x086e0c84, amDipswSetLed); // amDipswSetLED + + detourFunction(0x0821e6dc, stubRetOne); // isEthLinkUp + patchMemory(0x082cb412, "c0270900"); // tickInitStoreNetwork + patchMemory(0x082cb6d9, "e950010000"); // tickWaitDHCP + patchMemory(0x082cce58, "EB"); // Skip Kickback initialization + patchMemory(0x08799d8c, "52"); // Skips initialization + patchMemory(0x08799d9c, "cf"); // Skips initialization + setVariable(0x08559609, 0x000126e9); // Avoid Full Screen set from Game + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x080789a4, gl_MultiTexCoord2fARB); + detourFunction(0x08078a14, gl_Color4ub); + detourFunction(0x08078c34, gl_Vertex3f); + detourFunction(0x08079354, gl_TexCoord2f); + detourFunction(0x080793f4, cg_GLIsProfileSupported); + patchMemory(0x0852442a, "9090"); + cacheModedShaderFiles(); + detourFunction(0x08079894, gl_XGetProcAddressARB); + detourFunction(0x08079624, gl_ProgramParameters4fvNV); + } + patchMemory(0x08548ef3, "31C090"); // cgCreateProgram args argument to 0; + detourFunction(0x0825653a, stubRetOne); // isExistNewerSource (forces shader recompilation) + } + break; + case INITIALD_4_REVC: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08d7c8f0, 2); // amBackupDebugLevel + setVariable(0x08d7c900, 2); // amCreditDebugLevel + setVariable(0x08d7cb58, 2); // amDipswDebugLevel + setVariable(0x08d7cb5c, 2); // amDongleDebugLevel + setVariable(0x08d7cb60, 2); // amEepromDebugLevel + setVariable(0x08d7cb64, 2); // amHwmonitorDebugLevel + setVariable(0x08d7cb68, 2); // amJvsDebugLevel + setVariable(0x08d7cb6c, 2); // amLibDebugLevel + setVariable(0x08d7cb70, 2); // amMiscDebugLevel + setVariable(0x08d7cb78, 2); // amSysDataDebugLevel + setVariable(0x08d7cb80, 2); // bcLibDebugLevel + setVariable(0x08d7cb74, 2); // amOsinfoDebugLevel + setVariable(0x08d7cb84, 0x0FFFFFFF); // s_logMask + detourFunction(0x0852d738, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x086eabd6, amDongleInit); + detourFunction(0x086e9621, amDongleIsAvailable); + detourFunction(0x086ea085, amDongleUpdate); + detourFunction(0x086eaa9d, amDongleUserInfoEx); + memcpy(elfID, (void *)0x08795338, 4); // Gets gameID from the ELF + // Fixes + amDipswContextAddr = (void *)0x08dabaa8; // Address of amDipswContext + detourFunction(0x086e93b4, amDipswInit); + detourFunction(0x086e9438, amDipswExit); + detourFunction(0x086e94ad, amDipswGetData); + detourFunction(0x086e9524, amDipswSetLed); // amDipswSetLED + + detourFunction(0x0821f0dc, stubRetOne); // isEthLinkUp + patchMemory(0x082cfe42, "c0270900"); // tickInitStoreNetwork + patchMemory(0x082d0109, "e950010000"); // tickWaitDHCP + patchMemory(0x082d1888, "EB"); // Skip Kickback initialization + patchMemory(0x087a2eec, "82"); // Skips initialization + patchMemory(0x087a2efc, "ff"); // Skips initialization + setVariable(0x08561e79, 0x000126e9); // Avoid Full Screen set from Game + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x080789a4, gl_MultiTexCoord2fARB); + detourFunction(0x08078a14, gl_Color4ub); + detourFunction(0x08078c34, gl_Vertex3f); + detourFunction(0x08079354, gl_TexCoord2f); + detourFunction(0x080793f4, cg_GLIsProfileSupported); + patchMemory(0x0852cc9a, "9090"); + cacheModedShaderFiles(); + detourFunction(0x08079894, gl_XGetProcAddressARB); + detourFunction(0x08079624, gl_ProgramParameters4fvNV); + } + patchMemory(0x08551763, "31C090"); // cgCreateProgram args argument to 0; + detourFunction(0x08256ff4, stubRetOne); // isExistNewerSource (forces shader recompilation) + } + break; + case INITIALD_4_REVD: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08d798b0, 2); // amBackupDebugLevel + setVariable(0x08d798c0, 2); // amCreditDebugLevel + setVariable(0x08d79b18, 2); // amDipswDebugLevel + setVariable(0x08d79b1c, 2); // amDongleDebugLevel + setVariable(0x08d79b20, 2); // amEepromDebugLevel + setVariable(0x08d79b24, 2); // amHwmonitorDebugLevel + setVariable(0x08d79b28, 2); // amJvsDebugLevel + setVariable(0x08d79b2c, 2); // amLibDebugLevel + setVariable(0x08d79b30, 2); // amMiscDebugLevel + setVariable(0x08d79b38, 2); // amSysDataDebugLevel + setVariable(0x08d79b40, 2); // bcLibDebugLevel + setVariable(0x08d79b34, 2); // amOsinfoDebugLevel + setVariable(0x08d79b44, 0x0FFFFFFF); // s_logMask + detourFunction(0x0852add8, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x086e8276, amDongleInit); + detourFunction(0x086e6cc1, amDongleIsAvailable); + detourFunction(0x086e7725, amDongleUpdate); + detourFunction(0x086e813d, amDongleUserInfoEx); + memcpy(elfID, (void *)0x087929d8, 4); // Gets gameID from the ELF + // Fixes + amDipswContextAddr = (void *)0x08da8a68; // Address of amDipswContext + detourFunction(0x086e6a54, amDipswInit); + detourFunction(0x086e6ad8, amDipswExit); + detourFunction(0x086e6b4d, amDipswGetData); + detourFunction(0x086e6bc4, amDipswSetLed); // amDipswSetLED + + detourFunction(0x0821f5cc, stubRetOne); // isEthLinkUp + patchMemory(0x082cd3b2, "c0270900"); // tickInitStoreNetwork + patchMemory(0x082cd679, "e950010000"); // tickWaitDHCP + patchMemory(0x082cedf8, "EB"); // Skip Kickback initialization + patchMemory(0x087a024c, "f2"); // Skips initialization + patchMemory(0x087a025c, "6f"); // Skips initialization + setVariable(0x0855f519, 0x000126e9); // Avoid Full Screen set from Game + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x080789a4, gl_MultiTexCoord2fARB); + detourFunction(0x08078a14, gl_Color4ub); + detourFunction(0x08078c34, gl_Vertex3f); + detourFunction(0x08079354, gl_TexCoord2f); + detourFunction(0x080793f4, cg_GLIsProfileSupported); + patchMemory(0x0852a33a, "9090"); + cacheModedShaderFiles(); + detourFunction(0x08079894, gl_XGetProcAddressARB); + detourFunction(0x08079624, gl_ProgramParameters4fvNV); + } + patchMemory(0x0854ee03, "31C090"); // cgCreateProgram args argument to 0; + detourFunction(0x08257470, stubRetOne); // isExistNewerSource (forces shader recompilation) + } + break; + case INITIALD_4_REVG: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08dde130, 2); // amBackupDebugLevel + setVariable(0x08dde140, 2); // amCreditDebugLevel + setVariable(0x08dde398, 2); // amDipswDebugLevel + setVariable(0x08dde39c, 2); // amDongleDebugLevel + setVariable(0x08dde3a0, 2); // amEepromDebugLevel + setVariable(0x08dde3a4, 2); // amHwmonitorDebugLevel + setVariable(0x08dde3a8, 2); // amJvsDebugLevel + setVariable(0x08dde3ac, 2); // amLibDebugLevel + setVariable(0x08dde3b0, 2); // amMiscDebugLevel + setVariable(0x08dde3b8, 2); // amSysDataDebugLevel + setVariable(0x08dde3c0, 2); // bcLibDebugLevel + setVariable(0x08dde3b4, 2); // amOsinfoDebugLevel + setVariable(0x08dde3c4, 0x0FFFFFFF); // s_logMask + detourFunction(0x08564ea8, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x0872c8d6, amDongleInit); + detourFunction(0x0872b321, amDongleIsAvailable); + detourFunction(0x0872bd85, amDongleUpdate); + detourFunction(0x0872c79d, amDongleUserInfoEx); + memcpy(elfID, (void *)0x087da56c, 4); // Gets gameID from the ELF + // Fixes + amDipswContextAddr = (void *)0x08e0d7a8; // Address of amDipswContext + detourFunction(0x0872b0b4, amDipswInit); + detourFunction(0x0872b138, amDipswExit); + detourFunction(0x0872b1ad, amDipswGetData); + detourFunction(0x0872b224, amDipswSetLed); // amDipswSetLED + + detourFunction(0x0823813a, stubRetOne); // isEthLinkUp + patchMemory(0x082f4396, "c0270900"); // tickInitStoreNetwork + patchMemory(0x082f4efb, "e94d010000"); // tickWaitDHCP + patchMemory(0x082f6d5b, "EB"); // Skip Kickback initialization + patchMemory(0x087e9eac, "c2"); // Skips initialization + patchMemory(0x087e9ebc, "3f36"); // Skips initialization + setVariable(0x08599819, 0x000126e9); // Avoid Full Screen set from Game + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x0807a298, gl_MultiTexCoord2fARB); + detourFunction(0x0807a308, gl_Color4ub); + detourFunction(0x0807a538, gl_Vertex3f); + detourFunction(0x0807ac48, gl_TexCoord2f); + detourFunction(0x0807ace8, cg_GLIsProfileSupported); + patchMemory(0x08564340, "9090"); + cacheModedShaderFiles(); + detourFunction(0x0807b1b8, gl_XGetProcAddressARB); + detourFunction(0x0807af28, gl_ProgramParameters4fvNV); + } + patchMemory(0x08588f73, "31C090"); // cgCreateProgram args argument to 0; + detourFunction(0x08271cec, stubRetOne); // isExistNewerSource (forces shader recompilation) + } + break; + case INITIALD_5_EXP: + { + if (config->showDebugMessages == 1) + { + setVariable(0x093a93f0, 2); // amBackupDebugLevel + setVariable(0x093a9400, 2); // amCreditDebugLevel + setVariable(0x093a9658, 2); // amDipswDebugLevel + setVariable(0x093a965c, 2); // amDongleDebugLevel + setVariable(0x093a9660, 2); // amEepromDebugLevel + setVariable(0x093a9664, 2); // amHwmonitorDebugLevel + setVariable(0x093a9668, 2); // amJvsDebugLevel + setVariable(0x093a966c, 2); // amLibDebugLevel + setVariable(0x093a9670, 2); // amMiscDebugLevel + setVariable(0x093a9678, 2); // amSysDataDebugLevel + setVariable(0x093a9680, 2); // bcLibDebugLevel + setVariable(0x093a9674, 2); // amOsinfoDebugLevel + setVariable(0x093a9684, 0x0FFFFFFF); // s_logMask + detourFunction(0x08745e28, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x08911dca, amDongleInit); + detourFunction(0x08910815, amDongleIsAvailable); + detourFunction(0x08911279, amDongleUpdate); + detourFunction(0x08911c91, amDongleUserInfoEx); + memcpy(elfID, (void *)0x084e2407, 4); // Get gameID from the ELF + // Fixes + amDipswContextAddr = (void *)0x093d94c8; + detourFunction(0x089105a8, amDipswInit); + detourFunction(0x0891062c, amDipswExit); + detourFunction(0x089106a1, amDipswGetData); + detourFunction(0x08910718, amDipswSetLed); // amDipswSetLed + detourFunction(0x08322248, stubRetOne); // isEthLinkUp + detourFunction(0x083084a2, stubRetOne); // Skip Kickback initialization + patchMemory(0x084429d9, "eb60"); // tickInitAddress + patchMemory(0x0843fb34, "C0270900"); // tickInitStoreNetwork + detourFunction(0x084deddc, stubRetZero); // doesNeedRollerCleaning + detourFunction(0x084dedf8, stubRetZero); // doesNeedStockerCleaning + patchMemory(0x0843f5ad, "c7c300030000"); // Moves Initializing text + patchMemory(0x089e314c, "47f3"); // Skips initialization + patchMemory(0x08789a49, "e92601000090"); // Prevents Full Screen set from the game + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x0807a3f0, gl_MultiTexCoord2fARB); + detourFunction(0x0807a470, gl_Color4ub); + detourFunction(0x0807a6b0, gl_Vertex3f); + detourFunction(0x0807ae10, gl_TexCoord2f); + detourFunction(0x0807aed0, cg_GLIsProfileSupported); + patchMemory(0x087450ef, "9090"); + cacheModedShaderFiles(); + } + + detourFunction(0x08389544, stubRetOne); // isExistNewerSource + detourFunction(0x0807b370, gl_XGetProcAddressARB); + patchMemory(0x08744f2e, "00"); // Fix cutscenes + } + break; + case INITIALD_5_EXP_20: + { + if (config->showDebugMessages == 1) + { + setVariable(0x093f6fa0, 2); // amBackupDebugLevel + setVariable(0x093f6fc0, 2); // amCreditDebugLevel + setVariable(0x093f7218, 2); // amDipswDebugLevel + setVariable(0x093f721c, 2); // amDongleDebugLevel + setVariable(0x093f7220, 2); // amEepromDebugLevel + setVariable(0x093f7224, 2); // amHwmonitorDebugLevel + setVariable(0x093f7228, 2); // amJvsDebugLevel + setVariable(0x093f722c, 2); // amLibDebugLevel + setVariable(0x093f7230, 2); // amMiscDebugLevel + setVariable(0x093f7238, 2); // amSysDataDebugLevel + setVariable(0x093f7240, 2); // bcLibDebugLevel + setVariable(0x093f7234, 2); // amOsinfoDebugLevel + setVariable(0x093f7244, 0x0FFFFFFF); // s_logMask + detourFunction(0x08762978, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x0893dd25, amDongleInit); + detourFunction(0x0893c5b1, amDongleIsAvailable); + detourFunction(0x0893d0d2, amDongleUpdate); + detourFunction(0x0893dbeb, amDongleUserInfoEx); + memcpy(elfID, (void *)0x084fdec2, 4); // Get gameID from the ELF + patchMemory(0x084fde9c, "00"); // Patch KEYCHECK + // Fixes + amDipswContextAddr = (void *)0x09427128; + detourFunction(0x0893c344, amDipswInit); + detourFunction(0x0893c3c8, amDipswExit); + detourFunction(0x0893c43d, amDipswGetData); + detourFunction(0x0893c4b3, amDipswSetLed); // amDipswSetLed + detourFunction(0x0832fca6, stubRetOne); // isEthLinkUp + patchMemory(0x08456348, "e991000000"); // tickWaitDHCP + patchMemory(0x0845843b, "eb60"); // tickInitAddress + patchMemory(0x08455584, "C0270900"); // tickInitStoreNetwork + detourFunction(0x08943eb6, stubRetZero); // amOsinfoExecDhcpNic + detourFunction(0x085135e0, stubRetZero); // isUseServerBox + patchMemory(0x084592be, "30B5E3"); // seqInitWheel + detourFunction(0x084fa3ae, stubRetZero); // doesNeedRollerCleaning + detourFunction(0x084fa3ca, stubRetZero); // doesNeedStockerCleaning + patchMemory(0x08455001, "c7c300030000"); // Moves Initializing text + patchMemory(0x08513a10, "00"); // Network init just once + patchMemory(0x08a0f78c, "95"); // Skips initialization + patchMemory(0x087a6599, "e92601000090"); // Prevents Full Screen set from the game + + // amsInit + detourFunction(0x089382e0, stubRetZero); // Eliminates amsInit Function + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x0807a6c0, gl_MultiTexCoord2fARB); + detourFunction(0x0807a740, gl_Color4ub); + detourFunction(0x0807a990, gl_Vertex3f); + detourFunction(0x0807b130, gl_TexCoord2f); + detourFunction(0x0807b1f0, cg_GLIsProfileSupported); + patchMemory(0x08761c3f, "9090"); + cacheModedShaderFiles(); + } + + detourFunction(0x08397224, stubRetOne); // isExistNewerSource + detourFunction(0x0807b6c0, gl_XGetProcAddressARB); + patchMemory(0x08761a7e, "00"); // Fix cutscenes + } + break; + case INITIALD_5_EXP_20A: + { + if (config->showDebugMessages == 1) + { + setVariable(0x093f6fa0, 2); // amBackupDebugLevel + setVariable(0x093f6fc0, 2); // amCreditDebugLevel + setVariable(0x093f7218, 2); // amDipswDebugLevel + setVariable(0x093f721c, 2); // amDongleDebugLevel + setVariable(0x093f7220, 2); // amEepromDebugLevel + setVariable(0x093f7224, 2); // amHwmonitorDebugLevel + setVariable(0x093f7228, 2); // amJvsDebugLevel + setVariable(0x093f722c, 2); // amLibDebugLevel + setVariable(0x093f7230, 2); // amMiscDebugLevel + setVariable(0x093f7238, 2); // amSysDataDebugLevel + setVariable(0x093f7240, 2); // bcLibDebugLevel + setVariable(0x093f7234, 2); // amOsinfoDebugLevel + setVariable(0x093f7244, 0x0FFFFFFF); // s_logMask + detourFunction(0x08762bc8, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x0893df75, amDongleInit); + detourFunction(0x0893c801, amDongleIsAvailable); + detourFunction(0x0893d322, amDongleUpdate); + detourFunction(0x0893de3b, amDongleUserInfoEx); + memcpy(elfID, (void *)0x084fe0f2, 4); // Get gameID from the ELF + patchMemory(0x084fe0cc, "00"); // Patch KEYCHECK + // Fixes + amDipswContextAddr = (void *)0x09427128; + detourFunction(0x0893c594, amDipswInit); + detourFunction(0x0893c618, amDipswExit); + detourFunction(0x0893c68d, amDipswGetData); + detourFunction(0x0893c703, amDipswSetLed); // amDipswSetLed + detourFunction(0x0832fe46, stubRetOne); // isEthLinkUp + patchMemory(0x084566d8, "e991000000"); // tickWaitDHCP + patchMemory(0x084587cb, "eb60"); // tickInitAddress + patchMemory(0x08455914, "C0270900"); // tickInitStoreNetwork + detourFunction(0x08944106, stubRetZero); // amOsinfoExecDhcpNic + detourFunction(0x08513810, stubRetZero); // isUseServerBox + patchMemory(0x0845964e, "40b3e3"); // seqInitWheel + detourFunction(0x084fa5de, stubRetZero); // doesNeedRollerCleaning + detourFunction(0x084fa5fa, stubRetZero); // doesNeedStockerCleaning + patchMemory(0x08455391, "c7c300030000"); // Moves Initializing text + patchMemory(0x08513c40, "00"); // Network init just once + patchMemory(0x08a0f9cc, "25"); // Skips initialization + patchMemory(0x087a67e9, "e92601000090"); // Prevents Full Screen set from the game + + // amsInit + detourFunction(0x08938530, stubRetZero); // Eliminates amsInit Function + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x0807a6c0, gl_MultiTexCoord2fARB); + detourFunction(0x0807a740, gl_Color4ub); + detourFunction(0x0807a990, gl_Vertex3f); + detourFunction(0x0807b130, gl_TexCoord2f); + detourFunction(0x0807b1f0, cg_GLIsProfileSupported); + patchMemory(0x08761e8f, "9090"); + cacheModedShaderFiles(); + } + + detourFunction(0x083973a4, stubRetOne); // isExistNewerSource + detourFunction(0x0807b6c0, gl_XGetProcAddressARB); + patchMemory(0x08761cce, "00"); // Fix cutscenes + } + break; + case INITIALD_5_JAP_REVA: // ID5 - DVP-0070A + { + if (config->showDebugMessages == 1) + { + setVariable(0x093a92d0, 2); // amBackupDebugLevel + setVariable(0x093a92e0, 2); // amCreditDebugLevel + setVariable(0x093a9538, 2); // amDipswDebugLevel + setVariable(0x093a953c, 2); // amDongleDebugLevel + setVariable(0x093a9540, 2); // amEepromDebugLevel + setVariable(0x093a9544, 2); // amHwmonitorDebugLevel + setVariable(0x093a9548, 2); // amJvsDebugLevel + setVariable(0x093a954c, 2); // amLibDebugLevel + setVariable(0x093a9550, 2); // amMiscDebugLevel + setVariable(0x093a9558, 2); // amSysDataDebugLevel + setVariable(0x093a9560, 2); // bcLibDebugLevel + setVariable(0x093a9554, 2); // amOsinfoDebugLevel + setVariable(0x093a9564, 0x0FFFFFFF); // s_logMask + detourFunction(0x08745238, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x089111da, amDongleInit); + detourFunction(0x0890fc25, amDongleIsAvailable); + detourFunction(0x08910689, amDongleUpdate); + detourFunction(0x089110a1, amDongleUserInfoEx); + memcpy(elfID, (void *)0x084e1707, 4); // Get gameID from the ELF + amDipswContextAddr = (void *)0x093d93a8; + detourFunction(0x0890f9b8, amDipswInit); + detourFunction(0x0890fa3c, amDipswExit); + detourFunction(0x0890fab1, amDipswGetData); + detourFunction(0x0890fb28, amDipswSetLed); // amDipswSetLed + detourFunction(0x08321968, stubRetOne); // isEthLinkUp + patchMemory(0x0843f068, "c0270900"); // tickInitStoreNetwork + // patchMemory(0x0843fed0, "e98d000000"); // tickWaitDHCP + detourFunction(0x08307b62, stubRetOne); // Skip Kickback initialization + detourFunction(0x084de0dc, stubRetZero); // doesNeedRollerCleaning + detourFunction(0x084de0f8, stubRetZero); // doesNeedStockerCleaning + patchMemory(0x089e308c, "BA"); // Skips initialization + patchMemory(0x08788e59, "e92601000090"); // Prevents Full Screen set from the game + + patchMemory(0x08441f99, "eb60"); // tickInitAddress + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x0807a3f0, gl_MultiTexCoord2fARB); + detourFunction(0x0807a470, gl_Color4ub); + detourFunction(0x0807a6b0, gl_Vertex3f); + detourFunction(0x0807ae10, gl_TexCoord2f); + detourFunction(0x0807aed0, cg_GLIsProfileSupported); + patchMemory(0x087444ff, "9090"); + cacheModedShaderFiles(); + } + + detourFunction(0x08388cb4, stubRetOne); // isExistNewerSource + detourFunction(0x0807b370, gl_XGetProcAddressARB); + patchMemory(0x0874433e, "00"); // Fix cutscenes + } + break; + case INITIALD_5_JAP_REVF: // ID5 - DVP-0070F + { + if (config->showDebugMessages == 1) + { + setVariable(0x093e52d4, 2); // amBackupDebugLevel + setVariable(0x093e52e0, 2); // amCreditDebugLevel + setVariable(0x093e5538, 2); // amDipswDebugLevel + setVariable(0x093e553c, 2); // amDongleDebugLevel + setVariable(0x093e5540, 2); // amEepromDebugLevel + setVariable(0x093e5544, 2); // amHwmonitorDebugLevel + setVariable(0x093e5548, 2); // amJvsDebugLevel + setVariable(0x093e554c, 2); // amLibDebugLevel + setVariable(0x093e5550, 2); // amMiscDebugLevel + setVariable(0x093e5558, 2); // amSysDataDebugLevel + setVariable(0x093e5560, 2); // bcLibDebugLevel + setVariable(0x093e5554, 2); // amOsinfoDebugLevel + setVariable(0x093e5564, 0x0FFFFFFF); // s_logMask + detourFunction(0x0875f0a8, _putConsoleSeparate); // Debug Messages + } + // Security + detourFunction(0x08937b71, amDongleInit); + detourFunction(0x089363fd, amDongleIsAvailable); + detourFunction(0x08936f1e, amDongleUpdate); + detourFunction(0x08937a37, amDongleUserInfoEx); + memcpy(elfID, (void *)0x084fa2e2, 4); // Get gameID from the ELF + patchMemory(0x084fa2bc, "00"); // Patch KEYCHECK + // Fixes + amDipswContextAddr = (void *)0x09415388; + detourFunction(0x08936190, amDipswInit); + detourFunction(0x08936214, amDipswExit); + detourFunction(0x08936289, amDipswGetData); + detourFunction(0x089362ff, amDipswSetLed); // amDipswSetLed + detourFunction(0x08330368, stubRetOne); // isEthLinkUp + patchMemory(0x084519ee, "C0270900"); // tickInitStoreNetwork + // patchMemory(0x08452848, "e991000000"); // tickWaitDHCP + detourFunction(0x08316392, stubRetOne); // Skip Kickback initialization + detourFunction(0x084f67ce, stubRetZero); // doesNeedRollerCleaning + detourFunction(0x084f67ea, stubRetZero); // doesNeedStockerCleaning + + patchMemory(0x08451501, "c7c300030000"); // Moves Initializing text + patchMemory(0x0850ffd0, "00"); // Network init just once + patchMemory(0x08a098ac, "95"); // Skips initialization + patchMemory(0x087a2cc9, "e92601000090"); // Prevents Full Screen set from the game + + patchMemory(0x0845493b, "eb60"); // tickInitAddress + detourFunction(0x0893dd02, stubRetZero); // amOsinfoExecDhcpNic + detourFunction(0x0850fba0, stubRetZero); // isUseServerBox + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x0807a42c, gl_MultiTexCoord2fARB); + detourFunction(0x0807a4ac, gl_Color4ub); + detourFunction(0x0807a6ec, gl_Vertex3f); + detourFunction(0x0807ae4c, gl_TexCoord2f); + detourFunction(0x0807af0c, cg_GLIsProfileSupported); + patchMemory(0x0875e36f, "9090"); + cacheModedShaderFiles(); + } + + detourFunction(0x08397aa4, stubRetOne); // isExistNewerSource + detourFunction(0x0807b3bc, gl_XGetProcAddressARB); + patchMemory(0x0875e1ae, "00"); // Fix cutscenes + } + break; + case LETS_GO_JUNGLE_REVA: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08c10604, 2); // amBackupDebugLevel + setVariable(0x08c10620, 2); // amCreditDebugLevel + setVariable(0x08c10878, 2); // amDipswDebugLevel + setVariable(0x08c1087c, 2); // amDongleDebugLevel + setVariable(0x08c10880, 2); // amEepromDebugLevel + setVariable(0x08c10884, 2); // amHwmonitorDebugLevel + setVariable(0x08c10888, 2); // amJvsDebugLevel + setVariable(0x08c1088c, 2); // amLibDebugLevel + setVariable(0x08c10890, 2); // amMiscDebugLevel + setVariable(0x08c10898, 2); // amSysDataDebugLevel + setVariable(0x08c108a0, 2); // bcLibDebugLevel + setVariable(0x08c10894, 2); // amOsinfoDebugLevel + setVariable(0x08c108a4, 0x0FFFFFFF); // s_logMask + detourFunction(0x08074a8c, _putConsole); // Debug Messages + } + // Security + detourFunction(0x084e9fbc, amDongleInit); + detourFunction(0x084ea378, amDongleIsAvailable); + detourFunction(0x084ea29c, amDongleUpdate); + patchMemory(0x0807b86a, "9090"); // Patch initializeArcadeBackup + // Fixes + amDipswContextAddr = (void *)0x08c43e08; // Address of amDipswContext + detourFunction(0x084e9de0, amDipswInit); + detourFunction(0x084e9e7c, amDipswExit); + detourFunction(0x084e9ef2, amDipswGetData); + detourFunction(0x084e9f6a, amDipswSetLed); + patchMemory(0x084125f0, "9090"); // No full screen + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU || getConfig()->lgjRenderWithMesa) + { + detourFunction(0x08071790, gl_MultiTexCoord2fARB); + detourFunction(0x08071800, gl_Color4ub); + detourFunction(0x08071a30, gl_Vertex3f); + detourFunction(0x08072080, gl_TexCoord2f); + detourFunction(0x08072110, cg_GLIsProfileSupported); + detourFunction(0x08071e50, gl_ProgramStringARB); + cacheModedShaderFiles(); + } + detourFunction(0x080722e0, gl_ProgramParameters4fvNV); + // patchMemory(0x083f4626, "909090909090"); + detourFunction(0x08072520, gl_XGetProcAddressARB); + } + break; + case LETS_GO_JUNGLE: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08c083a4, 2); // amBackupDebugLevel + setVariable(0x08c083c0, 2); // amCreditDebugLevel + setVariable(0x08c08618, 2); // amDipswDebugLevel + setVariable(0x08c0861c, 2); // amDongleDebugLevel + setVariable(0x08c08620, 2); // amEepromDebugLevel + setVariable(0x08c08624, 2); // amHwmonitorDebugLevel + setVariable(0x08c08628, 2); // amJvsDebugLevel + setVariable(0x08c0862c, 2); // amLibDebugLevel + setVariable(0x08c08630, 2); // amMiscDebugLevel + setVariable(0x08c08638, 2); // amSysDataDebugLevel + setVariable(0x08c08640, 2); // bcLibDebugLevel + setVariable(0x08c08634, 2); // amOsinfoDebugLevel + setVariable(0x08c08644, 0x0FFFFFFF); // s_logMask + detourFunction(0x08074a8c, _putConsole); // Debug Messages + } + // Security + detourFunction(0x084e50d8, amDongleInit); + detourFunction(0x084e5459, amDongleIsAvailable); + detourFunction(0x084e537d, amDongleUpdate); + patchMemory(0x0807b76a, "9090"); // Patch initializeArcadeBackup + // Fixes + amDipswContextAddr = (void *)0x08c3bba8; // Address of amDipswContext + detourFunction(0x084e4efc, amDipswInit); + detourFunction(0x084e4f98, amDipswExit); + detourFunction(0x084e500e, amDipswGetData); + detourFunction(0x084e5086, amDipswSetLed); + patchMemory(0x0840d858, "9090"); // No full screen + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU || getConfig()->lgjRenderWithMesa) + { + detourFunction(0x080716e4, gl_MultiTexCoord2fARB); + detourFunction(0x08071754, gl_Color4ub); + detourFunction(0x08071984, gl_Vertex3f); + detourFunction(0x08071fc4, gl_TexCoord2f); + detourFunction(0x08072054, cg_GLIsProfileSupported); + detourFunction(0x08071da4, gl_ProgramStringARB); + cacheModedShaderFiles(); + } + detourFunction(0x08072214, gl_ProgramParameters4fvNV); + // patchMemory(0x083ef88e, "909090909090"); + detourFunction(0x08072454, gl_XGetProcAddressARB); + } + break; + case LETS_GO_JUNGLE_SPECIAL: + { + if (config->showDebugMessages == 1) + { + setVariable(0x08c453e4, 2); // amBackupDebugLevel + setVariable(0x08c45400, 2); // amCreditDebugLevel + setVariable(0x08c45658, 2); // amDipswDebugLevel + setVariable(0x08c4565c, 2); // amDongleDebugLevel + setVariable(0x08c45660, 2); // amEepromDebugLevel + setVariable(0x08c45664, 2); // amHwmonitorDebugLevel + setVariable(0x08c45668, 2); // amJvsDebugLevel + setVariable(0x08c4566c, 2); // amLibDebugLevel + setVariable(0x08c45670, 2); // amMiscDebugLevel + setVariable(0x08c45678, 2); // amSysDataDebugLevel + setVariable(0x08c45680, 2); // bcLibDebugLevel + setVariable(0x08c45674, 2); // amOsinfoDebugLevel + setVariable(0x08c45684, 0x0FFFFFFF); // s_logMask + detourFunction(0x08075012, _putConsole); // Debug Messages + } + // Security + detourFunction(0x08510320, amDongleInit); + detourFunction(0x085106dc, amDongleIsAvailable); + detourFunction(0x08510600, amDongleUpdate); + patchMemory(0x0807e609, "909090909090"); + // Fixes + amDipswContextAddr = (void *)0x08c78be8; // Address of amDipswContext + detourFunction(0x08510144, amDipswInit); + detourFunction(0x085101e0, amDipswExit); + detourFunction(0x08510256, amDipswGetData); + detourFunction(0x085102ce, amDipswSetLed); + patchMemory(0x08438954, "9090"); // No full screen + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU || getConfig()->lgjRenderWithMesa) + { + detourFunction(0x080718e0, gl_MultiTexCoord2fARB); + detourFunction(0x08071950, gl_Color4ub); + detourFunction(0x08071b80, gl_Vertex3f); + detourFunction(0x08072210, gl_TexCoord2f); + detourFunction(0x080722a0, cg_GLIsProfileSupported); + detourFunction(0x08071fd0, gl_ProgramStringARB); + cacheModedShaderFiles(); + } + detourFunction(0x08072480, gl_ProgramParameters4fvNV); + patchMemory(0x0841a98a, "909090909090"); + detourFunction(0x080726c0, gl_XGetProcAddressARB); + } + break; + case MJ4_REVG: + { + setVariable(0x0acf85d4, 2); + setVariable(0x0acf85d0, 2); + setVariable(0x0acf85cc, 2); + setVariable(0x0acf85c8, 2); + setVariable(0x0acf85c0, 2); + setVariable(0x0acf85bc, 2); + + // Security + detourFunction(0x08710c0a, amDongleInit); + detourFunction(0x0870f6c5, amDongleIsAvailable); + detourFunction(0x0870f6e2, amDongleIsDevelop); + detourFunction(0x087100bb, amDongleUpdate); + + // Fixes and patches to bypss network check + amDipswContextAddr = (void *)0x0ad224fc; // Address of amDipswContext + detourFunction(0x0870f458, amDipswInit); + detourFunction(0x0870f4dc, amDipswExit); + detourFunction(0x0870f551, amDipswGetData); + detourFunction(0x0870f5c7, amDipswSetLed); + + // detourFunction(0x080e286a, stubRetZero); // skip checks + // detourFunction(0x080ed7f8, stubRetZero); + // patchMemory(0x080e954b, "75"); + // patchMemory(0x08a4cb90, "00"); + // patchMemory(0x080e955d, "909090909090"); // test skip countdown + + // setVariable(0x08534a33, 30); + // setVariable(0x08534a42, 2); + + patchMemory(0x080e2891, "eb"); + patchMemory(0x080ea049, "05"); + patchMemory(0x08a4cb90, "00"); + + patchMemory(0x0872bc4d, "2e2f72616d2f746f2e74787400"); // Patch /home/disk2 folder + patchMemory(0x0872bc64, "2e2f72616d2f66726f6d2e74787400"); // Patch /home/disk2 folder + patchMemory(0x0872bc7d, "2e2f72616d2f2e746d7000"); // Patch /home/disk2 folder + patchMemory(0x0872bccd, "2e2f72616d00"); // Patch /home/disk2 folder + patchMemory(0x0872bcdd, "2e2f666f6f3100"); // Patch /home/disk2 folder + patchMemory(0x0872bcee, "2e2f666f6f3200"); // Patch /home/disk2 folder + patchMemory(0x0872f3de, "2e2f72616d2f746d7000"); // Patch /home/disk2 folder + patchMemory(0x08732fd3, "2e2f00"); // Patch /home/disk2 folder + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x08050ebc, gl_ProgramStringARB); + } + } + break; + case MJ4_EVO: + { + detourFunction(0x08840b61, amDongleInit); + detourFunction(0x0883f3ed, amDongleIsAvailable); + detourFunction(0x0883f40a, amDongleIsDevelop); + detourFunction(0x0883ff0e, amDongleUpdate); + + // Fixes and patches to bypss network check + amDipswContextAddr = (void *)0x0af8ff3c; // Address of amDipswContext + detourFunction(0x0883f180, amDipswInit); + detourFunction(0x0883f204, amDipswExit); + detourFunction(0x0883f279, amDipswGetData); + detourFunction(0x0883f2ef, amDipswSetLed); + + patchMemory(0x080ea0d1, "909090909090"); + detourFunction(0x080e327c, stubRetZero); // skip checks + detourFunction(0x080ee4fa, stubRetZero); + patchMemory(0x080ea0bf, "75"); + patchMemory(0x08c035b8, "00"); + + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x08051314, gl_ProgramStringARB); + } + } + break; case OUTRUN_2_SP_SDX: { if (config->showDebugMessages == 1) @@ -768,7 +1985,8 @@ int initPatch() detourFunction(0x0804d148, or2snprintf); // Fixes a bug in snprintf libc 2.39?? // Only apply these patches if skipOutrunCabinetCheck is enabled - if (config->skipOutrunCabinetCheck) { + if (config->skipOutrunCabinetCheck) + { // Bypass checks for tower and Force Feedback detourFunction(0x08103eaa, stubRetOne); detourFunction(0x08105d88, stubRetOne); @@ -796,6 +2014,141 @@ int initPatch() patchMemory(0x08054ac4, "9090909090"); } break; + case PRIMEVAL_HUNT: + { + // Security + detourFunction(0x08141770, amDongleInit); + detourFunction(0x08140229, amDongleIsAvailable); + detourFunction(0x08140c1f, amDongleUpdate); + patchMemory(0x08055264, "EB"); + // Fixes + amDipswContextAddr = (void *)0x0a96d488; // Address of amDipswContext + detourFunction(0x0813ffbc, amDipswInit); + detourFunction(0x08140040, amDipswExit); + detourFunction(0x081400b5, amDipswGetData); + detourFunction(0x0814012c, stubRetZero); + patchMemory(0x08052cb2, "9090909090"); + cacheModedShaderFiles(); + } + break; + case RAMBO: + { + // Security + detourFunction(0x082c4746, amDongleInit); + detourFunction(0x082c3201, amDongleIsAvailable); + detourFunction(0x082c3bf7, amDongleUpdate); + detourFunction(0x082c460d, amDongleUserInfoEx); + detourFunction(0x082c321e, amDongleIsDevelop); + detourFunction(0x080e4262, stubRetZero); + detourFunction(0x080e3e94, stubRetZero); + patchMemory(0x080e3f1d, "EB"); + patchMemory(0x080e3f79, "01"); + patchMemory(0x080e3e2e, "EB"); + // Fixes + amDipswContextAddr = (void *)0x082c2f94; + detourFunction(0x082c2f94, amDipswInit); + detourFunction(0x082c3018, amDipswExit); + detourFunction(0x082c308d, amDipswGetData); + detourFunction(0x082c3103, amDipswSetLed); + cacheModedShaderFiles(); + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + loadLibCg(); + cacheNnstdshader(); + patchMemory(0x08200c17, "9090909090"); // Stop the folder rename + patchMemory(0x084173e7, "66732f636f6d70696c65646d657361"); // Change folder to compiledshdmesa + patchMemory(0x080b3d71, "01"); // Compile using CGC + replaceCallAtAddress(0x082015bf, compileWithCGC); + replaceCallAtAddress(0x082012c1, compileWithCGC); + // patchMemory(0x080b3d65, "00"); // Force recompile shaders + } + } + break; + case R_TUNED: + { + // Security + detourFunction(0x08366846, amDongleInit); + detourFunction(0x08365301, amDongleIsAvailable); + detourFunction(0x08365cf7, amDongleUpdate); + // Fixes + amDipswContextAddr = (void *)0x08578be8; + detourFunction(0x08365094, amDipswInit); + detourFunction(0x08365118, amDipswExit); + detourFunction(0x08365203, amDipswSetLed); + detourFunction(0x0836518d, amDipswGetData); + patchMemory(0x8388C90, "2e2f72616d2f746f2e74787400"); // Patch /home/disk2 folder + patchMemory(0x8388CA7, "2e2f72616d2f66726f6d2e74787400"); // Patch /home/disk2 folder + patchMemory(0x8388CC0, "2e2f72616d2f2e746d7000"); // Patch /home/disk2 folder + patchMemory(0x8388D10, "2e2f72616d00"); // Patch /home/disk2 folder + patchMemory(0x8388D20, "2e2f666f6f3100"); // Patch /home/disk2 folder + patchMemory(0x8388D31, "2e2f666f6f3200"); // Patch /home/disk2 folder + patchMemory(0x83C979E, "2e2f00"); // Patch /home/disk2 folder + patchMemory(0x838C498, "2e2f524f4d5f4c414e472f656e00"); // Patch /home/disk0 folder + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + detourFunction(0x080507e8, gl_ProgramStringARB); + } + // Disable Force Feedback check? + patchMemory(0x0817f8d9, "891c2490909090"); + patchMemory(0x0817f8e5, "ebc5"); + } + break; + case SEGABOOT_2_4_SYM: + { + if (config->showDebugMessages == 1) + { + setVariable(0x0808da48, 2); // amAdtecDebugLevel + setVariable(0x0808cf8c, 2); // amAtaDebugLevel + setVariable(0x0808cf90, 2); // amBackupDebugLevel + setVariable(0x0808cf94, 2); // amChunkDataDebugLevel + setVariable(0x0808cfa0, 2); // amCreditDebugLevel + setVariable(0x0808d1f8, 2); // amDipswDebugLevel + setVariable(0x0808d1fc, 2); // amDiskDebugLevel + setVariable(0x0808d200, 2); // amDongleDebugLevel + setVariable(0x0808d204, 2); // amEepromDebugLevel + setVariable(0x0808d208, 2); // amHmDebugLevel + setVariable(0x0808d210, 2); // amJvsDebugLevel + setVariable(0x0808d214, 2); // amLibDebugLevel + setVariable(0x0808d218, 2); // amMiscDebugLevel + setVariable(0x0808d21c, 2); // amSysDataDebugLevel + setVariable(0x0808d220, 2); // bcLibDebugLevel + setVariable(0x0808cf58, 2); // g_DebugLevel + setVariable(0x0808d224, 0x0FFFFFFF); // logmask + } + + detourFunction(0x0805e8b0, amDongleInit); + detourFunction(0x0805ebc3, amDongleIsAvailable); + detourFunction(0x0805eb2a, amDongleUpdate); + detourFunction(0x0805c30b, amDipswGetData); + } + break; + case SEGA_RACE_TV: + { + // Security + detourFunction(0x084d5b40, amDongleInit); + detourFunction(0x084d45f9, amDongleIsAvailable); + detourFunction(0x084d4fef, amDongleUpdate); + // Fixes + amDipswContextAddr = (void *)0x08df9cec; + detourFunction(0x084d438c, amDipswInit); + detourFunction(0x084d4410, amDipswExit); + detourFunction(0x084d44fc, amDipswSetLed); + detourFunction(0x084d4485, amDipswGetData); + patchMemory(0x0804edb2, "9090909090"); //__intel_new_proc_init_P + + detourFunction(0x0804e594, gl_XGetProcAddressARB); + srtvElfShaderPatcher(); + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + patchMemory(0x082d3ce9, "9090"); // Force GL_NVX_conditional_render + } + } + break; case THE_HOUSE_OF_THE_DEAD_4_REVA: { if (config->showDebugMessages == 1) @@ -1122,6 +2475,8 @@ int initPatch() detourFunction(0x084b69f4, amDipswExit); detourFunction(0x084b6a69, amDipswGetData); detourFunction(0x084b6adf, amDipswSetLed); + detourFunction(0x084ba23b, stubRetOne); // amDongleDecryptEx + patchMemory(0x081896c2, "01"); // CPU patch to support AMD processors patchMemory(0x0804e4a7, "9090909090"); //__intel_new_proc_init_P @@ -1159,6 +2514,67 @@ int initPatch() patchMemory(0x0804a042, "9090909090"); //__intel_new_proc_init_P } break; + case TOO_SPICY: + { + // Security + detourFunction(0x0831cf02, amDongleInit); + detourFunction(0x0831b94d, amDongleIsAvailable); + detourFunction(0x0831c3b1, amDongleUpdate); + patchMemory(0x081f7f8f, "9090"); + patchMemory(0x081f7fa7, "9090909090909090"); + patchMemory(0x081f7fb0, "01"); + patchMemory(0x081f7fb4, "909090"); + patchMemory(0x08210f27, "9090"); + patchMemory(0x08210f3c, "9090909090909090"); + patchMemory(0x08210f45, "01"); + patchMemory(0x08210f49, "909090"); + // Fixes + amDipswContextAddr = (void *)0x0c8ed0cc; + detourFunction(0x08318f84, amDipswInit); + detourFunction(0x08319008, amDipswExit); + detourFunction(0x0831907d, amDipswGetData); + detourFunction(0x083190f4, amDipswSetLed); + detourFunction(0x081f7dba, stubRetOne); // CheckApplicationValid + + // CPU patch to support AMD processors + patchMemory(0x08202a51, "9090909090"); //__intel_new_proc_init_P + + // unlock characters + detourFunction(0x081cbcd2, stubRetOne); + + // Mesa Patches + if (getConfig()->GPUVendor != NVIDIA_GPU) + { + loadLibCg(); + cacheNnstdshader(); + patchMemory(0x081ef9d8, "01"); // Force the game to recompile the shaders using cgc + patchMemory(0x08413f04, "646d657361"); // Changes compiledshader folder to compiledshdmesa + cacheModedShaderFiles(); + replaceCallAtAddress(0x08259fe5, compileWithCGC); + replaceCallAtAddress(0x0825a089, compileWithCGC); + } + } + break; + case TOO_SPICY_TEST: + { + // Security + detourFunction(0x0806a286, amDongleInit); + detourFunction(0x08068cd1, amDongleIsAvailable); + detourFunction(0x08069735, amDongleUpdate); + patchMemory(0x08056989, "9090"); + patchMemory(0x080569a7, "01"); + patchMemory(0x080569ab, "909090"); + // Fixes + amDipswContextAddr = (void *)0x080a9988; // Address of amDipswContext + detourFunction(0x08068a64, amDipswInit); + detourFunction(0x08068ae8, amDipswExit); + detourFunction(0x08068b5d, amDipswGetData); + detourFunction(0x08068bd4, amDipswSetLed); + + // CPU patch to support AMD processors + patchMemory(0x080564c8, "9090909090"); //__intel_new_proc_init_P + } + break; case VIRTUA_FIGHTER_5: { // Security @@ -1197,119 +2613,29 @@ int initPatch() } } break; - case VIRTUA_FIGHTER_5_REVA: + case VIRTUA_FIGHTER_5_EXPORT: { // Security - detourFunction(0x084620a8, amDongleInit); - detourFunction(0x0846234d, amDongleUpdate); - detourFunction(0x08462429, amDongleIsAvailable); - detourFunction(0x08462449, amDongleIsDevelop); + detourFunction(0x084fca4c, amDongleInit); + detourFunction(0x084fcd2c, amDongleUpdate); + detourFunction(0x084fce08, amDongleIsAvailable); + detourFunction(0x084fce28, amDongleIsDevelop); // Fixes and patches to bypss network check - amDipswContextAddr = (void *)0x0b40b1a8; // Address of amDipswContext - detourFunction(0x08461ecc, amDipswInit); - detourFunction(0x08461f68, amDipswExit); - detourFunction(0x08461fde, amDipswGetData); - detourFunction(0x08462056, amDipswSetLed); - detourFunction(0x080884e2, stubRetZero); // Stub returns 0 - detourFunction(0x0809a1a0, stubRetZero); // Stub returns 0 - detourFunction(0x082fa9fc, stubRetZero); // Stub returns 0 - detourFunction(0x082fce2c, stubRetZero); // Stub returns 0 - patchMemory(0x080a6407, "b800000000"); + amDipswContextAddr = (void *)0x0bd8df28; // Address of amDipswContext + detourFunction(0x084fc870, amDipswInit); + detourFunction(0x084fc90c, amDipswExit); + detourFunction(0x084fc982, amDipswGetData); + detourFunction(0x084fc9fa, amDipswSetLed); + detourFunction(0x08094d28, stubRetZero); + patchMemory(0x080a29a5, "EB"); - // patchMemory(0x, "2e2f72616d2f746573743100"); // Patch /home/disk2 folder - // patchMemory(0x, "2e2f72616d2f746573743200"); // Patch /home/disk2 folder - patchMemory(0x08489b3b, "2e2f72616d00"); // Patch /home/disk2 folder - patchMemory(0x08489bf4, "2e2f72616d2f746d7000"); // Patch /home/disk2 folder - patchMemory(0x0852328a, "2e2f00"); // Patch /home/disk2 folder - patchMemory(0x084870d9, "2e2f00"); // Patch /home/disk1 folder - - detourFunction(0x080889c8, stubRetZero); - patchMemory(0x080a6303, "02"); - patchMemory(0x080a6356, "9090909090"); - patchMemory(0x080a6265, "ffffffff"); - patchMemory(0x080a6298, "ffffffff"); if (getConfig()->GPUVendor != NVIDIA_GPU) { - detourFunction(0x08051c4c, gl_ProgramStringARB); + detourFunction(0x0805160c, gl_ProgramStringARB); } } break; - case VIRTUA_FIGHTER_5_REVB: - { - // Security - detourFunction(0x0850fd5c, amDongleInit); - detourFunction(0x08510001, amDongleUpdate); - detourFunction(0x085100dd, amDongleIsAvailable); - detourFunction(0x085100fd, amDongleIsDevelop); - - // Fixes and patches to bypss network check - amDipswContextAddr = (void *)0x0bd36c68; // Address of amDipswContext - detourFunction(0x0850fb80, amDipswInit); - detourFunction(0x0850fc1c, amDipswExit); - detourFunction(0x0850fc92, amDipswGetData); - detourFunction(0x0850fd0a, amDipswSetLed); - detourFunction(0x080936d8, stubRetZero); // Stub returns 0 - detourFunction(0x080a800c, stubRetZero); // Stub returns 0 - detourFunction(0x08376746, stubRetZero); // Stub returns 0 - detourFunction(0x08378a38, stubRetZero); // Stub returns 0 - patchMemory(0x080b5733, "b800000000"); - - patchMemory(0x08533c38, "2e2f72616d00"); // Patch /home/disk2 folder - patchMemory(0x08538741, "2e2f72616d2f746d7000"); // Patch /home/disk2 folder - patchMemory(0x085e5993, "2e2f00"); // Patch /home/disk2 folder - patchMemory(0x08535239, "2e2f00"); // Patch /home/disk1 folder - - detourFunction(0x08093be0, stubRetZero); - patchMemory(0x080B562F, "02"); - patchMemory(0x080b5682, "9090909090"); - patchMemory(0x080B5591, "ffffffff"); - patchMemory(0x080B55C4, "ffffffff"); - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x08052088, gl_ProgramStringARB); - } - } - break; - case VIRTUA_FIGHTER_5_REVE: // Also the public REV C version - { - // Security - detourFunction(0x085c6010, amDongleInit); - detourFunction(0x085c62f0, amDongleUpdate); - detourFunction(0x085c63cc, amDongleIsAvailable); - detourFunction(0x085c63ec, amDongleIsDevelop); - - // Fixes and patches to bypss network check - amDipswContextAddr = (void *)0x0d4d2b08; // Address of amDipswContext - detourFunction(0x085c5e34, amDipswInit); - detourFunction(0x085c5ed0, amDipswExit); - detourFunction(0x085c5f46, amDipswGetData); - detourFunction(0x085c5fbe, amDipswSetLed); // Stub amDipswSetLed - detourFunction(0x080b3426, stubRetZero); // Stub returns 0 - detourFunction(0x080cb6d4, stubRetZero); // Stub returns 0 - detourFunction(0x0840889e, stubRetZero); // Stub returns 0 - detourFunction(0x0840ab90, stubRetZero); // Stub returns 0 - patchMemory(0x080e1743, "EB"); - patchMemory(0x080e17af, "b800000000"); // Patch IDK what - - patchMemory(0x085eb718, "2e2f72616d00"); // Patch /home/disk2 folder - patchMemory(0x085f1b41, "2e2f72616d2f746d7000"); // Patch /home/disk2 folder - patchMemory(0x086a196b, "2e2f00"); // Patch /home/disk2 folder - patchMemory(0x085ee110, "2e2f00"); // Patch /home/disk1 folder - - detourFunction(0x080b3938, stubRetZero); // ok - patchMemory(0x080e1663, "02"); - patchMemory(0x080e16b6, "9090909090"); - patchMemory(0x080e15bd, "ffffffff"); - patchMemory(0x080e15f7, "ffffffff"); - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x08052fbc, gl_ProgramStringARB); - } - // - patchMemory(0x080e173c, "B810000000"); - } - break; case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVA: { // Security @@ -1416,29 +2742,6 @@ int initPatch() } } break; - case VIRTUA_FIGHTER_5_EXPORT: - { - // Security - detourFunction(0x084fca4c, amDongleInit); - detourFunction(0x084fcd2c, amDongleUpdate); - detourFunction(0x084fce08, amDongleIsAvailable); - detourFunction(0x084fce28, amDongleIsDevelop); - - // Fixes and patches to bypss network check - amDipswContextAddr = (void *)0x0bd8df28; // Address of amDipswContext - detourFunction(0x084fc870, amDipswInit); - detourFunction(0x084fc90c, amDipswExit); - detourFunction(0x084fc982, amDipswGetData); - detourFunction(0x084fc9fa, amDipswSetLed); - detourFunction(0x08094d28, stubRetZero); - patchMemory(0x080a29a5, "EB"); - - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x0805160c, gl_ProgramStringARB); - } - } - break; case VIRTUA_FIGHTER_5_R: { // Security @@ -1537,938 +2840,121 @@ int initPatch() detourFunction(0x08052a70, gl_ProgramStringARB); } } - break; - case LETS_GO_JUNGLE_REVA: - { - if (config->showDebugMessages == 1) - { - setVariable(0x08c10604, 2); // amBackupDebugLevel - setVariable(0x08c10620, 2); // amCreditDebugLevel - setVariable(0x08c10878, 2); // amDipswDebugLevel - setVariable(0x08c1087c, 2); // amDongleDebugLevel - setVariable(0x08c10880, 2); // amEepromDebugLevel - setVariable(0x08c10884, 2); // amHwmonitorDebugLevel - setVariable(0x08c10888, 2); // amJvsDebugLevel - setVariable(0x08c1088c, 2); // amLibDebugLevel - setVariable(0x08c10890, 2); // amMiscDebugLevel - setVariable(0x08c10898, 2); // amSysDataDebugLevel - setVariable(0x08c108a0, 2); // bcLibDebugLevel - setVariable(0x08c10894, 2); // amOsinfoDebugLevel - setVariable(0x08c108a4, 0x0FFFFFFF); // s_logMask - detourFunction(0x08074a8c, _putConsole); // Debug Messages - } - // Security - detourFunction(0x084e9fbc, amDongleInit); - detourFunction(0x084ea378, amDongleIsAvailable); - detourFunction(0x084ea29c, amDongleUpdate); - patchMemory(0x0807b86a, "9090"); // Patch initializeArcadeBackup - // Fixes - amDipswContextAddr = (void *)0x08c43e08; // Address of amDipswContext - detourFunction(0x084e9de0, amDipswInit); - detourFunction(0x084e9e7c, amDipswExit); - detourFunction(0x084e9ef2, amDipswGetData); - detourFunction(0x084e9f6a, amDipswSetLed); - patchMemory(0x084125f0, "9090"); // No full screen - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU || getConfig()->lgjRenderWithMesa) - { - detourFunction(0x08071790, gl_MultiTexCoord2fARB); - detourFunction(0x08071800, gl_Color4ub); - detourFunction(0x08071a30, gl_Vertex3f); - detourFunction(0x08072080, gl_TexCoord2f); - detourFunction(0x08072110, cg_GLIsProfileSupported); - detourFunction(0x08071e50, gl_ProgramStringARB); - cacheModedShaderFiles(); - } - detourFunction(0x080722e0, gl_ProgramParameters4fvNV); - // patchMemory(0x083f4626, "909090909090"); - detourFunction(0x08072520, gl_XGetProcAddressARB); - } break; - case LETS_GO_JUNGLE: + case VIRTUA_FIGHTER_5_REVA: { - if (config->showDebugMessages == 1) - { - setVariable(0x08c083a4, 2); // amBackupDebugLevel - setVariable(0x08c083c0, 2); // amCreditDebugLevel - setVariable(0x08c08618, 2); // amDipswDebugLevel - setVariable(0x08c0861c, 2); // amDongleDebugLevel - setVariable(0x08c08620, 2); // amEepromDebugLevel - setVariable(0x08c08624, 2); // amHwmonitorDebugLevel - setVariable(0x08c08628, 2); // amJvsDebugLevel - setVariable(0x08c0862c, 2); // amLibDebugLevel - setVariable(0x08c08630, 2); // amMiscDebugLevel - setVariable(0x08c08638, 2); // amSysDataDebugLevel - setVariable(0x08c08640, 2); // bcLibDebugLevel - setVariable(0x08c08634, 2); // amOsinfoDebugLevel - setVariable(0x08c08644, 0x0FFFFFFF); // s_logMask - detourFunction(0x08074a8c, _putConsole); // Debug Messages - } // Security - detourFunction(0x084e50d8, amDongleInit); - detourFunction(0x084e5459, amDongleIsAvailable); - detourFunction(0x084e537d, amDongleUpdate); - patchMemory(0x0807b76a, "9090"); // Patch initializeArcadeBackup - // Fixes - amDipswContextAddr = (void *)0x08c3bba8; // Address of amDipswContext - detourFunction(0x084e4efc, amDipswInit); - detourFunction(0x084e4f98, amDipswExit); - detourFunction(0x084e500e, amDipswGetData); - detourFunction(0x084e5086, amDipswSetLed); - patchMemory(0x0840d858, "9090"); // No full screen + detourFunction(0x084620a8, amDongleInit); + detourFunction(0x0846234d, amDongleUpdate); + detourFunction(0x08462429, amDongleIsAvailable); + detourFunction(0x08462449, amDongleIsDevelop); - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU || getConfig()->lgjRenderWithMesa) - { - detourFunction(0x080716e4, gl_MultiTexCoord2fARB); - detourFunction(0x08071754, gl_Color4ub); - detourFunction(0x08071984, gl_Vertex3f); - detourFunction(0x08071fc4, gl_TexCoord2f); - detourFunction(0x08072054, cg_GLIsProfileSupported); - detourFunction(0x08071da4, gl_ProgramStringARB); - cacheModedShaderFiles(); - } - detourFunction(0x08072214, gl_ProgramParameters4fvNV); - // patchMemory(0x083ef88e, "909090909090"); - detourFunction(0x08072454, gl_XGetProcAddressARB); - } - break; - case LETS_GO_JUNGLE_SPECIAL: - { - if (config->showDebugMessages == 1) - { - setVariable(0x08c453e4, 2); // amBackupDebugLevel - setVariable(0x08c45400, 2); // amCreditDebugLevel - setVariable(0x08c45658, 2); // amDipswDebugLevel - setVariable(0x08c4565c, 2); // amDongleDebugLevel - setVariable(0x08c45660, 2); // amEepromDebugLevel - setVariable(0x08c45664, 2); // amHwmonitorDebugLevel - setVariable(0x08c45668, 2); // amJvsDebugLevel - setVariable(0x08c4566c, 2); // amLibDebugLevel - setVariable(0x08c45670, 2); // amMiscDebugLevel - setVariable(0x08c45678, 2); // amSysDataDebugLevel - setVariable(0x08c45680, 2); // bcLibDebugLevel - setVariable(0x08c45674, 2); // amOsinfoDebugLevel - setVariable(0x08c45684, 0x0FFFFFFF); // s_logMask - detourFunction(0x08075012, _putConsole); // Debug Messages - } - // Security - detourFunction(0x08510320, amDongleInit); - detourFunction(0x085106dc, amDongleIsAvailable); - detourFunction(0x08510600, amDongleUpdate); - patchMemory(0x0807e609, "909090909090"); - // Fixes - amDipswContextAddr = (void *)0x08c78be8; // Address of amDipswContext - detourFunction(0x08510144, amDipswInit); - detourFunction(0x085101e0, amDipswExit); - detourFunction(0x08510256, amDipswGetData); - detourFunction(0x085102ce, amDipswSetLed); - patchMemory(0x08438954, "9090"); // No full screen + // Fixes and patches to bypss network check + amDipswContextAddr = (void *)0x0b40b1a8; // Address of amDipswContext + detourFunction(0x08461ecc, amDipswInit); + detourFunction(0x08461f68, amDipswExit); + detourFunction(0x08461fde, amDipswGetData); + detourFunction(0x08462056, amDipswSetLed); + detourFunction(0x080884e2, stubRetZero); // Stub returns 0 + detourFunction(0x0809a1a0, stubRetZero); // Stub returns 0 + detourFunction(0x082fa9fc, stubRetZero); // Stub returns 0 + detourFunction(0x082fce2c, stubRetZero); // Stub returns 0 + patchMemory(0x080a6407, "b800000000"); - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU || getConfig()->lgjRenderWithMesa) - { - detourFunction(0x080718e0, gl_MultiTexCoord2fARB); - detourFunction(0x08071950, gl_Color4ub); - detourFunction(0x08071b80, gl_Vertex3f); - detourFunction(0x08072210, gl_TexCoord2f); - detourFunction(0x080722a0, cg_GLIsProfileSupported); - detourFunction(0x08071fd0, gl_ProgramStringARB); - cacheModedShaderFiles(); - } - detourFunction(0x08072480, gl_ProgramParameters4fvNV); - patchMemory(0x0841a98a, "909090909090"); - detourFunction(0x080726c0, gl_XGetProcAddressARB); - } - break; - case INITIALD_4_REVA: - { - if (config->showDebugMessages == 1) - { - setVariable(0x08d71470, 2); // amBackupDebugLevel - setVariable(0x08d71480, 2); // amCreditDebugLevel - setVariable(0x08d716d8, 2); // amDipswDebugLevel - setVariable(0x08d716dc, 2); // amDongleDebugLevel - setVariable(0x08d716e0, 2); // amEepromDebugLevel - setVariable(0x08d716e4, 2); // amHwmonitorDebugLevel - setVariable(0x08d716e8, 2); // amJvsDebugLevel - setVariable(0x08d716ec, 2); // amLibDebugLevel - setVariable(0x08d716f0, 2); // amMiscDebugLevel - setVariable(0x08d716f8, 2); // amSysDataDebugLevel - setVariable(0x08d71700, 2); // bcLibDebugLevel - setVariable(0x08d716f4, 2); // amOsinfoDebugLevel - setVariable(0x08d71704, 0x0FFFFFFF); // s_logMask - detourFunction(0x08524c88, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x086e20fa, amDongleInit); - detourFunction(0x086e0b45, amDongleIsAvailable); - detourFunction(0x086e15a9, amDongleUpdate); - detourFunction(0x086e1fc1, amDongleUserInfoEx); - memcpy(elfID, (void *)0x8318835, 4); // Gets gameID from the ELF - // Fixes - amDipswContextAddr = (void *)0x08da0628; // Address of amDipswContext - detourFunction(0x086e08d8, amDipswInit); - detourFunction(0x086e095c, amDipswExit); - detourFunction(0x086e09d1, amDipswGetData); - detourFunction(0x086e0a48, amDipswSetLed); // amDipswSetLED - - detourFunction(0x0821e52c, stubRetOne); // isEthLinkUp - patchMemory(0x082cb222, "c0270900"); // tickInitStoreNetwork - patchMemory(0x082cb4e9, "e950010000"); // tickWaitDHCP - patchMemory(0x082ccc68, "eb"); // Skip Kickback initialization - patchMemory(0x08799acc, "62"); // Skips initialization - patchMemory(0x08799adc, "df"); // Skips initialization - setVariable(0x085593c9, 0x000126e9); // Avoid Full Screen set from Game + // patchMemory(0x, "2e2f72616d2f746573743100"); // Patch /home/disk2 folder + // patchMemory(0x, "2e2f72616d2f746573743200"); // Patch /home/disk2 folder + patchMemory(0x08489b3b, "2e2f72616d00"); // Patch /home/disk2 folder + patchMemory(0x08489bf4, "2e2f72616d2f746d7000"); // Patch /home/disk2 folder + patchMemory(0x0852328a, "2e2f00"); // Patch /home/disk2 folder + patchMemory(0x084870d9, "2e2f00"); // Patch /home/disk1 folder + detourFunction(0x080889c8, stubRetZero); + patchMemory(0x080a6303, "02"); + patchMemory(0x080a6356, "9090909090"); + patchMemory(0x080a6265, "ffffffff"); + patchMemory(0x080a6298, "ffffffff"); if (getConfig()->GPUVendor != NVIDIA_GPU) { - detourFunction(0x08078980, gl_MultiTexCoord2fARB); - detourFunction(0x080789f0, gl_Color4ub); - detourFunction(0x08078c10, gl_Vertex3f); - detourFunction(0x08079330, gl_TexCoord2f); - detourFunction(0x080793d0, cg_GLIsProfileSupported); - patchMemory(0x085241ea, "9090"); - cacheModedShaderFiles(); - detourFunction(0x08079870, gl_XGetProcAddressARB); - detourFunction(0x08079600, gl_ProgramParameters4fvNV); + detourFunction(0x08051c4c, gl_ProgramStringARB); } - patchMemory(0x08548cb3, "31C090"); // cgCreateProgram args argument to 0; - detourFunction(0x0825637a, stubRetOne); // isExistNewerSource (forces shader recompilation) } break; - case INITIALD_4_REVB: + case VIRTUA_FIGHTER_5_REVB: { - if (config->showDebugMessages == 1) - { - setVariable(0x08d71750, 2); // amBackupDebugLevel - setVariable(0x08d71760, 2); // amCreditDebugLevel - setVariable(0x08d719b8, 2); // amDipswDebugLevel - setVariable(0x08d719bc, 2); // amDongleDebugLevel - setVariable(0x08d719c0, 2); // amEepromDebugLevel - setVariable(0x08d719c4, 2); // amHwmonitorDebugLevel - setVariable(0x08d719c8, 2); // amJvsDebugLevel - setVariable(0x08d719cc, 2); // amLibDebugLevel - setVariable(0x08d719d0, 2); // amMiscDebugLevel - setVariable(0x08d719d8, 2); // amSysDataDebugLevel - setVariable(0x08d719e0, 2); // bcLibDebugLevel - setVariable(0x08d719d4, 2); // amOsinfoDebugLevel - setVariable(0x08d719e4, 0x0FFFFFFF); // s_logMask - detourFunction(0x08524ec8, _putConsoleSeparate); // Debug Messages - } // Security - detourFunction(0x086e2336, amDongleInit); - detourFunction(0x086e0d81, amDongleIsAvailable); - detourFunction(0x086e17e5, amDongleUpdate); - detourFunction(0x086e21fd, amDongleUserInfoEx); - memcpy(elfID, (void *)0x08318a45, 4); // Gets gameID from the ELF - // Fixes - amDipswContextAddr = (void *)0x08da0908; // Address of amDipswContext - detourFunction(0x086e0b14, amDipswInit); - detourFunction(0x086e0b98, amDipswExit); - detourFunction(0x086e0c0d, amDipswGetData); - detourFunction(0x086e0c84, amDipswSetLed); // amDipswSetLED + detourFunction(0x0850fd5c, amDongleInit); + detourFunction(0x08510001, amDongleUpdate); + detourFunction(0x085100dd, amDongleIsAvailable); + detourFunction(0x085100fd, amDongleIsDevelop); - detourFunction(0x0821e6dc, stubRetOne); // isEthLinkUp - patchMemory(0x082cb412, "c0270900"); // tickInitStoreNetwork - patchMemory(0x082cb6d9, "e950010000"); // tickWaitDHCP - patchMemory(0x082cce58, "EB"); // Skip Kickback initialization - patchMemory(0x08799d8c, "52"); // Skips initialization - patchMemory(0x08799d9c, "cf"); // Skips initialization - setVariable(0x08559609, 0x000126e9); // Avoid Full Screen set from Game + // Fixes and patches to bypss network check + amDipswContextAddr = (void *)0x0bd36c68; // Address of amDipswContext + detourFunction(0x0850fb80, amDipswInit); + detourFunction(0x0850fc1c, amDipswExit); + detourFunction(0x0850fc92, amDipswGetData); + detourFunction(0x0850fd0a, amDipswSetLed); + detourFunction(0x080936d8, stubRetZero); // Stub returns 0 + detourFunction(0x080a800c, stubRetZero); // Stub returns 0 + detourFunction(0x08376746, stubRetZero); // Stub returns 0 + detourFunction(0x08378a38, stubRetZero); // Stub returns 0 + patchMemory(0x080b5733, "b800000000"); + patchMemory(0x08533c38, "2e2f72616d00"); // Patch /home/disk2 folder + patchMemory(0x08538741, "2e2f72616d2f746d7000"); // Patch /home/disk2 folder + patchMemory(0x085e5993, "2e2f00"); // Patch /home/disk2 folder + patchMemory(0x08535239, "2e2f00"); // Patch /home/disk1 folder + + detourFunction(0x08093be0, stubRetZero); + patchMemory(0x080B562F, "02"); + patchMemory(0x080b5682, "9090909090"); + patchMemory(0x080B5591, "ffffffff"); + patchMemory(0x080B55C4, "ffffffff"); if (getConfig()->GPUVendor != NVIDIA_GPU) { - detourFunction(0x080789a4, gl_MultiTexCoord2fARB); - detourFunction(0x08078a14, gl_Color4ub); - detourFunction(0x08078c34, gl_Vertex3f); - detourFunction(0x08079354, gl_TexCoord2f); - detourFunction(0x080793f4, cg_GLIsProfileSupported); - patchMemory(0x0852442a, "9090"); - cacheModedShaderFiles(); - detourFunction(0x08079894, gl_XGetProcAddressARB); - detourFunction(0x08079624, gl_ProgramParameters4fvNV); + detourFunction(0x08052088, gl_ProgramStringARB); } - patchMemory(0x08548ef3, "31C090"); // cgCreateProgram args argument to 0; - detourFunction(0x0825653a, stubRetOne); // isExistNewerSource (forces shader recompilation) } break; - case INITIALD_4_REVC: + case VIRTUA_FIGHTER_5_REVE: // Also the public REV C version { - if (config->showDebugMessages == 1) - { - setVariable(0x08d7c8f0, 2); // amBackupDebugLevel - setVariable(0x08d7c900, 2); // amCreditDebugLevel - setVariable(0x08d7cb58, 2); // amDipswDebugLevel - setVariable(0x08d7cb5c, 2); // amDongleDebugLevel - setVariable(0x08d7cb60, 2); // amEepromDebugLevel - setVariable(0x08d7cb64, 2); // amHwmonitorDebugLevel - setVariable(0x08d7cb68, 2); // amJvsDebugLevel - setVariable(0x08d7cb6c, 2); // amLibDebugLevel - setVariable(0x08d7cb70, 2); // amMiscDebugLevel - setVariable(0x08d7cb78, 2); // amSysDataDebugLevel - setVariable(0x08d7cb80, 2); // bcLibDebugLevel - setVariable(0x08d7cb74, 2); // amOsinfoDebugLevel - setVariable(0x08d7cb84, 0x0FFFFFFF); // s_logMask - detourFunction(0x0852d738, _putConsoleSeparate); // Debug Messages - } // Security - detourFunction(0x086eabd6, amDongleInit); - detourFunction(0x086e9621, amDongleIsAvailable); - detourFunction(0x086ea085, amDongleUpdate); - detourFunction(0x086eaa9d, amDongleUserInfoEx); - memcpy(elfID, (void *)0x08795338, 4); // Gets gameID from the ELF - // Fixes - amDipswContextAddr = (void *)0x08dabaa8; // Address of amDipswContext - detourFunction(0x086e93b4, amDipswInit); - detourFunction(0x086e9438, amDipswExit); - detourFunction(0x086e94ad, amDipswGetData); - detourFunction(0x086e9524, amDipswSetLed); // amDipswSetLED + detourFunction(0x085c6010, amDongleInit); + detourFunction(0x085c62f0, amDongleUpdate); + detourFunction(0x085c63cc, amDongleIsAvailable); + detourFunction(0x085c63ec, amDongleIsDevelop); - detourFunction(0x0821f0dc, stubRetOne); // isEthLinkUp - patchMemory(0x082cfe42, "c0270900"); // tickInitStoreNetwork - patchMemory(0x082d0109, "e950010000"); // tickWaitDHCP - patchMemory(0x082d1888, "EB"); // Skip Kickback initialization - patchMemory(0x087a2eec, "82"); // Skips initialization - patchMemory(0x087a2efc, "ff"); // Skips initialization - setVariable(0x08561e79, 0x000126e9); // Avoid Full Screen set from Game + // Fixes and patches to bypss network check + amDipswContextAddr = (void *)0x0d4d2b08; // Address of amDipswContext + detourFunction(0x085c5e34, amDipswInit); + detourFunction(0x085c5ed0, amDipswExit); + detourFunction(0x085c5f46, amDipswGetData); + detourFunction(0x085c5fbe, amDipswSetLed); // Stub amDipswSetLed + detourFunction(0x080b3426, stubRetZero); // Stub returns 0 + detourFunction(0x080cb6d4, stubRetZero); // Stub returns 0 + detourFunction(0x0840889e, stubRetZero); // Stub returns 0 + detourFunction(0x0840ab90, stubRetZero); // Stub returns 0 + patchMemory(0x080e1743, "EB"); + patchMemory(0x080e17af, "b800000000"); // Patch IDK what + patchMemory(0x085eb718, "2e2f72616d00"); // Patch /home/disk2 folder + patchMemory(0x085f1b41, "2e2f72616d2f746d7000"); // Patch /home/disk2 folder + patchMemory(0x086a196b, "2e2f00"); // Patch /home/disk2 folder + patchMemory(0x085ee110, "2e2f00"); // Patch /home/disk1 folder + + detourFunction(0x080b3938, stubRetZero); // ok + patchMemory(0x080e1663, "02"); + patchMemory(0x080e16b6, "9090909090"); + patchMemory(0x080e15bd, "ffffffff"); + patchMemory(0x080e15f7, "ffffffff"); if (getConfig()->GPUVendor != NVIDIA_GPU) { - detourFunction(0x080789a4, gl_MultiTexCoord2fARB); - detourFunction(0x08078a14, gl_Color4ub); - detourFunction(0x08078c34, gl_Vertex3f); - detourFunction(0x08079354, gl_TexCoord2f); - detourFunction(0x080793f4, cg_GLIsProfileSupported); - patchMemory(0x0852cc9a, "9090"); - cacheModedShaderFiles(); - detourFunction(0x08079894, gl_XGetProcAddressARB); - detourFunction(0x08079624, gl_ProgramParameters4fvNV); + detourFunction(0x08052fbc, gl_ProgramStringARB); } - patchMemory(0x08551763, "31C090"); // cgCreateProgram args argument to 0; - detourFunction(0x08256ff4, stubRetOne); // isExistNewerSource (forces shader recompilation) + // + patchMemory(0x080e173c, "B810000000"); } break; - case INITIALD_4_REVD: - { - if (config->showDebugMessages == 1) - { - setVariable(0x08d798b0, 2); // amBackupDebugLevel - setVariable(0x08d798c0, 2); // amCreditDebugLevel - setVariable(0x08d79b18, 2); // amDipswDebugLevel - setVariable(0x08d79b1c, 2); // amDongleDebugLevel - setVariable(0x08d79b20, 2); // amEepromDebugLevel - setVariable(0x08d79b24, 2); // amHwmonitorDebugLevel - setVariable(0x08d79b28, 2); // amJvsDebugLevel - setVariable(0x08d79b2c, 2); // amLibDebugLevel - setVariable(0x08d79b30, 2); // amMiscDebugLevel - setVariable(0x08d79b38, 2); // amSysDataDebugLevel - setVariable(0x08d79b40, 2); // bcLibDebugLevel - setVariable(0x08d79b34, 2); // amOsinfoDebugLevel - setVariable(0x08d79b44, 0x0FFFFFFF); // s_logMask - detourFunction(0x0852add8, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x086e8276, amDongleInit); - detourFunction(0x086e6cc1, amDongleIsAvailable); - detourFunction(0x086e7725, amDongleUpdate); - detourFunction(0x086e813d, amDongleUserInfoEx); - memcpy(elfID, (void *)0x087929d8, 4); // Gets gameID from the ELF - // Fixes - amDipswContextAddr = (void *)0x08da8a68; // Address of amDipswContext - detourFunction(0x086e6a54, amDipswInit); - detourFunction(0x086e6ad8, amDipswExit); - detourFunction(0x086e6b4d, amDipswGetData); - detourFunction(0x086e6bc4, amDipswSetLed); // amDipswSetLED - detourFunction(0x0821f5cc, stubRetOne); // isEthLinkUp - patchMemory(0x082cd3b2, "c0270900"); // tickInitStoreNetwork - patchMemory(0x082cd679, "e950010000"); // tickWaitDHCP - patchMemory(0x082cedf8, "EB"); // Skip Kickback initialization - patchMemory(0x087a024c, "f2"); // Skips initialization - patchMemory(0x087a025c, "6f"); // Skips initialization - setVariable(0x0855f519, 0x000126e9); // Avoid Full Screen set from Game - - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x080789a4, gl_MultiTexCoord2fARB); - detourFunction(0x08078a14, gl_Color4ub); - detourFunction(0x08078c34, gl_Vertex3f); - detourFunction(0x08079354, gl_TexCoord2f); - detourFunction(0x080793f4, cg_GLIsProfileSupported); - patchMemory(0x0852a33a, "9090"); - cacheModedShaderFiles(); - detourFunction(0x08079894, gl_XGetProcAddressARB); - detourFunction(0x08079624, gl_ProgramParameters4fvNV); - } - patchMemory(0x0854ee03, "31C090"); // cgCreateProgram args argument to 0; - detourFunction(0x08257470, stubRetOne); // isExistNewerSource (forces shader recompilation) - } - break; - case INITIALD_4_REVG: - { - if (config->showDebugMessages == 1) - { - setVariable(0x08dde130, 2); // amBackupDebugLevel - setVariable(0x08dde140, 2); // amCreditDebugLevel - setVariable(0x08dde398, 2); // amDipswDebugLevel - setVariable(0x08dde39c, 2); // amDongleDebugLevel - setVariable(0x08dde3a0, 2); // amEepromDebugLevel - setVariable(0x08dde3a4, 2); // amHwmonitorDebugLevel - setVariable(0x08dde3a8, 2); // amJvsDebugLevel - setVariable(0x08dde3ac, 2); // amLibDebugLevel - setVariable(0x08dde3b0, 2); // amMiscDebugLevel - setVariable(0x08dde3b8, 2); // amSysDataDebugLevel - setVariable(0x08dde3c0, 2); // bcLibDebugLevel - setVariable(0x08dde3b4, 2); // amOsinfoDebugLevel - setVariable(0x08dde3c4, 0x0FFFFFFF); // s_logMask - detourFunction(0x08564ea8, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x0872c8d6, amDongleInit); - detourFunction(0x0872b321, amDongleIsAvailable); - detourFunction(0x0872bd85, amDongleUpdate); - detourFunction(0x0872c79d, amDongleUserInfoEx); - memcpy(elfID, (void *)0x087da56c, 4); // Gets gameID from the ELF - // Fixes - amDipswContextAddr = (void *)0x08e0d7a8; // Address of amDipswContext - detourFunction(0x0872b0b4, amDipswInit); - detourFunction(0x0872b138, amDipswExit); - detourFunction(0x0872b1ad, amDipswGetData); - detourFunction(0x0872b224, amDipswSetLed); // amDipswSetLED - - detourFunction(0x0823813a, stubRetOne); // isEthLinkUp - patchMemory(0x082f4396, "c0270900"); // tickInitStoreNetwork - patchMemory(0x082f4efb, "e94d010000"); // tickWaitDHCP - patchMemory(0x082f6d5b, "EB"); // Skip Kickback initialization - patchMemory(0x087e9eac, "c2"); // Skips initialization - patchMemory(0x087e9ebc, "3f36"); // Skips initialization - setVariable(0x08599819, 0x000126e9); // Avoid Full Screen set from Game - - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x0807a298, gl_MultiTexCoord2fARB); - detourFunction(0x0807a308, gl_Color4ub); - detourFunction(0x0807a538, gl_Vertex3f); - detourFunction(0x0807ac48, gl_TexCoord2f); - detourFunction(0x0807ace8, cg_GLIsProfileSupported); - patchMemory(0x08564340, "9090"); - cacheModedShaderFiles(); - detourFunction(0x0807b1b8, gl_XGetProcAddressARB); - detourFunction(0x0807af28, gl_ProgramParameters4fvNV); - } - patchMemory(0x08588f73, "31C090"); // cgCreateProgram args argument to 0; - detourFunction(0x08271cec, stubRetOne); // isExistNewerSource (forces shader recompilation) - } - break; - case INITIALD_4_EXP_REVB: - { - if (config->showDebugMessages == 1) - { - setVariable(0x08d93b70, 2); // amBackupDebugLevel - setVariable(0x08d93b80, 2); // amCreditDebugLevel - setVariable(0x08d93dd8, 2); // amDipswDebugLevel - setVariable(0x08d93ddc, 2); // amDongleDebugLevel - setVariable(0x08d93de0, 2); // amEepromDebugLevel - setVariable(0x08d93de4, 2); // amHwmonitorDebugLevel - setVariable(0x08d93de8, 2); // amJvsDebugLevel - setVariable(0x08d93dec, 2); // amLibDebugLevel - setVariable(0x08d93df0, 2); // amMiscDebugLevel - setVariable(0x08d93df8, 2); // amSysDataDebugLevel - setVariable(0x08d93e00, 2); // bcLibDebugLevel - setVariable(0x08d93df4, 2); // amOsinfoDebugLevel - setVariable(0x08d93e04, 0x0FFFFFFF); // s_logMask - detourFunction(0x0854a778, _putConsoleSeparate); // Debug Messages (crashes game) - } - // Security - detourFunction(0x0870ee36, amDongleInit); - detourFunction(0x0870d881, amDongleIsAvailable); - detourFunction(0x0870e2e5, amDongleUpdate); - detourFunction(0x0870ecfd, amDongleUserInfoEx); - memcpy(elfID, (void *)0x087c0a61, 4); // Gets gameID from the ELF - - // Fixes - amDipswContextAddr = (void *)0x08dc2d08; - detourFunction(0x0870d614, amDipswInit); - detourFunction(0x0870d698, amDipswExit); - detourFunction(0x0870d70d, amDipswGetData); - detourFunction(0x0870d784, stubRetZero); // amDipswSetLed - detourFunction(0x0822fdde, stubRetOne); // isEthLinkUp - // patchMemory(0x082ddfcd, "e954010000"); // tickWaitDHCP - patchMemory(0x082df619, "eb60"); // tickInitAddress - detourFunction(0x0821a1fa, stubRetOne); // Skip Kickback initialization - setVariable(0x0857f0e9, 0x000126e9); // Avoid Full Screen set from Game - patchMemory(0x087bc56c, "ab"); // Skips initialization - - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x08078860, gl_MultiTexCoord2fARB); - detourFunction(0x080788d0, gl_Color4ub); - detourFunction(0x08078b00, gl_Vertex3f); - detourFunction(0x08079200, gl_TexCoord2f); - detourFunction(0x080792a0, cg_GLIsProfileSupported); - patchMemory(0x08549c10, "9090"); - patchMemory(0x0856e843, "31C090"); // cgCreateProgram args argument to 0; - cacheModedShaderFiles(); - detourFunction(0x08079730, gl_XGetProcAddressARB); - detourFunction(0x080794d0, gl_ProgramParameters4fvNV); - } - detourFunction(0x08264e7a, stubRetOne); // isExistNewerSource (forces shader recompilation) - } - break; - case INITIALD_4_EXP_REVC: - { - if (config->showDebugMessages == 1) - { - setVariable(0x08d93b70, 2); // amBackupDebugLevel - setVariable(0x08d93b80, 2); // amCreditDebugLevel - setVariable(0x08d93dd8, 2); // amDipswDebugLevel - setVariable(0x08d93ddc, 2); // amDongleDebugLevel - setVariable(0x08d93de0, 2); // amEepromDebugLevel - setVariable(0x08d93de4, 2); // amHwmonitorDebugLevel - setVariable(0x08d93de8, 2); // amJvsDebugLevel - setVariable(0x08d93dec, 2); // amLibDebugLevel - setVariable(0x08d93df0, 2); // amMiscDebugLevel - setVariable(0x08d93df8, 2); // amSysDataDebugLevel - setVariable(0x08d93e00, 2); // bcLibDebugLevel - setVariable(0x08d93df4, 2); // amOsinfoDebugLevel - setVariable(0x08d93e04, 0x0FFFFFFF); // s_logMask - detourFunction(0x0854a4f8, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x0870ebb6, amDongleInit); - detourFunction(0x0870d601, amDongleIsAvailable); - detourFunction(0x0870e065, amDongleUpdate); - detourFunction(0x0870ea7d, amDongleUserInfoEx); - memcpy(elfID, (void *)0x08337197, 4); // Gets gameID from the ELF - - // Fixes - amDipswContextAddr = (void *)0x08dc2d08; - detourFunction(0x0870d394, amDipswInit); - detourFunction(0x0870d418, amDipswExit); - detourFunction(0x0870d48d, amDipswGetData); - detourFunction(0x0870d504, stubRetZero); // amDipswSetLed - detourFunction(0x0822feae, stubRetOne); // isEthLinkUp - // patchMemory(0x082dde0d, "e954010000"); // tickWaitDHCP - patchMemory(0x082df459, "eb60"); // tickInitAddress - detourFunction(0x0821a2aa, stubRetOne); // Skip Kickback initialization - setVariable(0x0857ee69, 0x000126e9); // Avoid Full Screen set from Game - patchMemory(0x087bc2ec, "eb"); // Skips initialization - - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x08078860, gl_MultiTexCoord2fARB); - detourFunction(0x080788d0, gl_Color4ub); - detourFunction(0x08078b00, gl_Vertex3f); - detourFunction(0x08079200, gl_TexCoord2f); - detourFunction(0x080792a0, cg_GLIsProfileSupported); - patchMemory(0x0854b4a0, "9090"); - patchMemory(0x085700d3, "31C090"); // cgCreateProgram args argument to 0; - cacheModedShaderFiles(); - detourFunction(0x08079730, gl_XGetProcAddressARB); - detourFunction(0x080794d0, gl_ProgramParameters4fvNV); - } - detourFunction(0x08264f62, stubRetOne); // isExistNewerSource (forces shader recompilation) - } - break; - case INITIALD_4_EXP_REVD: - { - if (config->showDebugMessages == 1) - { - setVariable(0x08d972d0, 2); // amBackupDebugLevel - setVariable(0x08d972e0, 2); // amCreditDebugLevel - setVariable(0x08d97538, 2); // amDipswDebugLevel - setVariable(0x08d9753c, 2); // amDongleDebugLevel - setVariable(0x08d97540, 2); // amEepromDebugLevel - setVariable(0x08d97544, 2); // amHwmonitorDebugLevel - setVariable(0x08d97548, 2); // amJvsDebugLevel - setVariable(0x08d9754c, 2); // amLibDebugLevel - setVariable(0x08d97550, 2); // amMiscDebugLevel - setVariable(0x08d97554, 2); // amSysDataDebugLevel - setVariable(0x08d97558, 2); // bcLibDebugLevel - setVariable(0x08d97560, 2); // amOsinfoDebugLevel - setVariable(0x08d97564, 0x0FFFFFFF); // s_logMask - detourFunction(0x0854c008, _putConsoleSeparate); // Debug Messages (crashes game) - } - // Security - detourFunction(0x087106e6, amDongleInit); - detourFunction(0x0870f131, amDongleIsAvailable); - detourFunction(0x0870fb95, amDongleUpdate); - detourFunction(0x087105ad, amDongleUserInfoEx); - memcpy(elfID, (void *)0x08338ce7, 4); // Gets gameID from the ELF - - // Fixes - amDipswContextAddr = (void *)0x08dc6928; - detourFunction(0x0870eec4, amDipswInit); - detourFunction(0x0870ef48, amDipswExit); - detourFunction(0x0870efbd, amDipswGetData); - detourFunction(0x0870f034, stubRetZero); // amDipswSetLed - detourFunction(0x08230fde, stubRetOne); // isEthLinkUp - patchMemory(0x082df87d, "e954010000"); // tickWaitDHCP - patchMemory(0x082e0ec9, "eb60"); // tickInitAddress - detourFunction(0x0821b3ea, stubRetOne); // Skip Kickback initialization - setVariable(0x08580979, 0x000126e9); // Avoid Full Screen set from Game - patchMemory(0x087beb6c, "5b"); // Skips initialization - - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x080788ec, gl_MultiTexCoord2fARB); - detourFunction(0x0807895c, gl_Color4ub); - detourFunction(0x08078b8c, gl_Vertex3f); - detourFunction(0x0807928c, gl_TexCoord2f); - detourFunction(0x0807932c, cg_GLIsProfileSupported); - patchMemory(0x0854b4a0, "9090"); - patchMemory(0x085700d3, "31C090"); // cgCreateProgram args argument to 0; - cacheModedShaderFiles(); - detourFunction(0x080797dc, gl_XGetProcAddressARB); - detourFunction(0x0807955c, gl_ProgramParameters4fvNV); - } - detourFunction(0x08266098, stubRetOne); // isExistNewerSource (forces shader recompilation) - } - break; - case INITIALD_5_EXP: - { - if (config->showDebugMessages == 1) - { - setVariable(0x093a93f0, 2); // amBackupDebugLevel - setVariable(0x093a9400, 2); // amCreditDebugLevel - setVariable(0x093a9658, 2); // amDipswDebugLevel - setVariable(0x093a965c, 2); // amDongleDebugLevel - setVariable(0x093a9660, 2); // amEepromDebugLevel - setVariable(0x093a9664, 2); // amHwmonitorDebugLevel - setVariable(0x093a9668, 2); // amJvsDebugLevel - setVariable(0x093a966c, 2); // amLibDebugLevel - setVariable(0x093a9670, 2); // amMiscDebugLevel - setVariable(0x093a9678, 2); // amSysDataDebugLevel - setVariable(0x093a9680, 2); // bcLibDebugLevel - setVariable(0x093a9674, 2); // amOsinfoDebugLevel - setVariable(0x093a9684, 0x0FFFFFFF); // s_logMask - detourFunction(0x08745e28, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x08911dca, amDongleInit); - detourFunction(0x08910815, amDongleIsAvailable); - detourFunction(0x08911279, amDongleUpdate); - detourFunction(0x08911c91, amDongleUserInfoEx); - memcpy(elfID, (void *)0x084e2407, 4); // Get gameID from the ELF - // Fixes - amDipswContextAddr = (void *)0x093d94c8; - detourFunction(0x089105a8, amDipswInit); - detourFunction(0x0891062c, amDipswExit); - detourFunction(0x089106a1, amDipswGetData); - detourFunction(0x08910718, amDipswSetLed); // amDipswSetLed - detourFunction(0x08322248, stubRetOne); // isEthLinkUp - detourFunction(0x083084a2, stubRetOne); // Skip Kickback initialization - patchMemory(0x084429d9, "eb60"); // tickInitAddress - patchMemory(0x0843fb34, "C0270900"); // tickInitStoreNetwork - detourFunction(0x084deddc, stubRetZero); // doesNeedRollerCleaning - detourFunction(0x084dedf8, stubRetZero); // doesNeedStockerCleaning - patchMemory(0x0843f5ad, "c7c300030000"); // Moves Initializing text - patchMemory(0x089e314c, "47f3"); // Skips initialization - patchMemory(0x08789a49, "e92601000090"); // Prevents Full Screen set from the game - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x0807a3f0, gl_MultiTexCoord2fARB); - detourFunction(0x0807a470, gl_Color4ub); - detourFunction(0x0807a6b0, gl_Vertex3f); - detourFunction(0x0807ae10, gl_TexCoord2f); - detourFunction(0x0807aed0, cg_GLIsProfileSupported); - patchMemory(0x087450ef, "9090"); - cacheModedShaderFiles(); - } - - detourFunction(0x08389544, stubRetOne); // isExistNewerSource - detourFunction(0x0807b370, gl_XGetProcAddressARB); - patchMemory(0x08744f2e, "00"); // Fix cutscenes - } - break; - case INITIALD_5_EXP_20: - { - if (config->showDebugMessages == 1) - { - setVariable(0x093f6fa0, 2); // amBackupDebugLevel - setVariable(0x093f6fc0, 2); // amCreditDebugLevel - setVariable(0x093f7218, 2); // amDipswDebugLevel - setVariable(0x093f721c, 2); // amDongleDebugLevel - setVariable(0x093f7220, 2); // amEepromDebugLevel - setVariable(0x093f7224, 2); // amHwmonitorDebugLevel - setVariable(0x093f7228, 2); // amJvsDebugLevel - setVariable(0x093f722c, 2); // amLibDebugLevel - setVariable(0x093f7230, 2); // amMiscDebugLevel - setVariable(0x093f7238, 2); // amSysDataDebugLevel - setVariable(0x093f7240, 2); // bcLibDebugLevel - setVariable(0x093f7234, 2); // amOsinfoDebugLevel - setVariable(0x093f7244, 0x0FFFFFFF); // s_logMask - detourFunction(0x08762978, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x0893dd25, amDongleInit); - detourFunction(0x0893c5b1, amDongleIsAvailable); - detourFunction(0x0893d0d2, amDongleUpdate); - detourFunction(0x0893dbeb, amDongleUserInfoEx); - memcpy(elfID, (void *)0x084fdec2, 4); // Get gameID from the ELF - patchMemory(0x084fde9c, "00"); // Patch KEYCHECK - // Fixes - amDipswContextAddr = (void *)0x09427128; - detourFunction(0x0893c344, amDipswInit); - detourFunction(0x0893c3c8, amDipswExit); - detourFunction(0x0893c43d, amDipswGetData); - detourFunction(0x0893c4b3, amDipswSetLed); // amDipswSetLed - detourFunction(0x0832fca6, stubRetOne); // isEthLinkUp - patchMemory(0x08456348, "e991000000"); // tickWaitDHCP - patchMemory(0x0845843b, "eb60"); // tickInitAddress - patchMemory(0x08455584, "C0270900"); // tickInitStoreNetwork - detourFunction(0x08943eb6, stubRetZero); // amOsinfoExecDhcpNic - detourFunction(0x085135e0, stubRetZero); // isUseServerBox - patchMemory(0x084592be, "30B5E3"); // seqInitWheel - detourFunction(0x084fa3ae, stubRetZero); // doesNeedRollerCleaning - detourFunction(0x084fa3ca, stubRetZero); // doesNeedStockerCleaning - patchMemory(0x08455001, "c7c300030000"); // Moves Initializing text - patchMemory(0x08513a10, "00"); // Network init just once - patchMemory(0x08a0f78c, "95"); // Skips initialization - patchMemory(0x087a6599, "e92601000090"); // Prevents Full Screen set from the game - - // amsInit - detourFunction(0x089382e0, stubRetZero); // Eliminates amsInit Function - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x0807a6c0, gl_MultiTexCoord2fARB); - detourFunction(0x0807a740, gl_Color4ub); - detourFunction(0x0807a990, gl_Vertex3f); - detourFunction(0x0807b130, gl_TexCoord2f); - detourFunction(0x0807b1f0, cg_GLIsProfileSupported); - patchMemory(0x08761c3f, "9090"); - cacheModedShaderFiles(); - } - - detourFunction(0x08397224, stubRetOne); // isExistNewerSource - detourFunction(0x0807b6c0, gl_XGetProcAddressARB); - patchMemory(0x08761a7e, "00"); // Fix cutscenes - } - break; - case INITIALD_5_EXP_20A: - { - if (config->showDebugMessages == 1) - { - setVariable(0x093f6fa0, 2); // amBackupDebugLevel - setVariable(0x093f6fc0, 2); // amCreditDebugLevel - setVariable(0x093f7218, 2); // amDipswDebugLevel - setVariable(0x093f721c, 2); // amDongleDebugLevel - setVariable(0x093f7220, 2); // amEepromDebugLevel - setVariable(0x093f7224, 2); // amHwmonitorDebugLevel - setVariable(0x093f7228, 2); // amJvsDebugLevel - setVariable(0x093f722c, 2); // amLibDebugLevel - setVariable(0x093f7230, 2); // amMiscDebugLevel - setVariable(0x093f7238, 2); // amSysDataDebugLevel - setVariable(0x093f7240, 2); // bcLibDebugLevel - setVariable(0x093f7234, 2); // amOsinfoDebugLevel - setVariable(0x093f7244, 0x0FFFFFFF); // s_logMask - detourFunction(0x08762bc8, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x0893df75, amDongleInit); - detourFunction(0x0893c801, amDongleIsAvailable); - detourFunction(0x0893d322, amDongleUpdate); - detourFunction(0x0893de3b, amDongleUserInfoEx); - memcpy(elfID, (void *)0x084fe0f2, 4); // Get gameID from the ELF - patchMemory(0x084fe0cc, "00"); // Patch KEYCHECK - // Fixes - amDipswContextAddr = (void *)0x09427128; - detourFunction(0x0893c594, amDipswInit); - detourFunction(0x0893c618, amDipswExit); - detourFunction(0x0893c68d, amDipswGetData); - detourFunction(0x0893c703, amDipswSetLed); // amDipswSetLed - detourFunction(0x0832fe46, stubRetOne); // isEthLinkUp - patchMemory(0x084566d8, "e991000000"); // tickWaitDHCP - patchMemory(0x084587cb, "eb60"); // tickInitAddress - patchMemory(0x08455914, "C0270900"); // tickInitStoreNetwork - detourFunction(0x08944106, stubRetZero); // amOsinfoExecDhcpNic - detourFunction(0x08513810, stubRetZero); // isUseServerBox - patchMemory(0x0845964e, "40b3e3"); // seqInitWheel - detourFunction(0x084fa5de, stubRetZero); // doesNeedRollerCleaning - detourFunction(0x084fa5fa, stubRetZero); // doesNeedStockerCleaning - patchMemory(0x08455391, "c7c300030000"); // Moves Initializing text - patchMemory(0x08513c40, "00"); // Network init just once - patchMemory(0x08a0f9cc, "25"); // Skips initialization - patchMemory(0x087a67e9, "e92601000090"); // Prevents Full Screen set from the game - - // amsInit - detourFunction(0x08938530, stubRetZero); // Eliminates amsInit Function - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x0807a6c0, gl_MultiTexCoord2fARB); - detourFunction(0x0807a740, gl_Color4ub); - detourFunction(0x0807a990, gl_Vertex3f); - detourFunction(0x0807b130, gl_TexCoord2f); - detourFunction(0x0807b1f0, cg_GLIsProfileSupported); - patchMemory(0x08761e8f, "9090"); - cacheModedShaderFiles(); - } - - detourFunction(0x083973a4, stubRetOne); // isExistNewerSource - detourFunction(0x0807b6c0, gl_XGetProcAddressARB); - patchMemory(0x08761cce, "00"); // Fix cutscenes - } - break; - case INITIALD_5_JAP_REVA: // ID5 - DVP-0070A - { - if (config->showDebugMessages == 1) - { - setVariable(0x093a92d0, 2); // amBackupDebugLevel - setVariable(0x093a92e0, 2); // amCreditDebugLevel - setVariable(0x093a9538, 2); // amDipswDebugLevel - setVariable(0x093a953c, 2); // amDongleDebugLevel - setVariable(0x093a9540, 2); // amEepromDebugLevel - setVariable(0x093a9544, 2); // amHwmonitorDebugLevel - setVariable(0x093a9548, 2); // amJvsDebugLevel - setVariable(0x093a954c, 2); // amLibDebugLevel - setVariable(0x093a9550, 2); // amMiscDebugLevel - setVariable(0x093a9558, 2); // amSysDataDebugLevel - setVariable(0x093a9560, 2); // bcLibDebugLevel - setVariable(0x093a9554, 2); // amOsinfoDebugLevel - setVariable(0x093a9564, 0x0FFFFFFF); // s_logMask - detourFunction(0x08745238, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x089111da, amDongleInit); - detourFunction(0x0890fc25, amDongleIsAvailable); - detourFunction(0x08910689, amDongleUpdate); - detourFunction(0x089110a1, amDongleUserInfoEx); - memcpy(elfID, (void *)0x084e1707, 4); // Get gameID from the ELF - amDipswContextAddr = (void *)0x093d93a8; - detourFunction(0x0890f9b8, amDipswInit); - detourFunction(0x0890fa3c, amDipswExit); - detourFunction(0x0890fab1, amDipswGetData); - detourFunction(0x0890fb28, amDipswSetLed); // amDipswSetLed - detourFunction(0x08321968, stubRetOne); // isEthLinkUp - patchMemory(0x0843f068, "c0270900"); // tickInitStoreNetwork - // patchMemory(0x0843fed0, "e98d000000"); // tickWaitDHCP - detourFunction(0x08307b62, stubRetOne); // Skip Kickback initialization - detourFunction(0x084de0dc, stubRetZero); // doesNeedRollerCleaning - detourFunction(0x084de0f8, stubRetZero); // doesNeedStockerCleaning - patchMemory(0x089e308c, "BA"); // Skips initialization - patchMemory(0x08788e59, "e92601000090"); // Prevents Full Screen set from the game - - patchMemory(0x08441f99, "eb60"); // tickInitAddress - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x0807a3f0, gl_MultiTexCoord2fARB); - detourFunction(0x0807a470, gl_Color4ub); - detourFunction(0x0807a6b0, gl_Vertex3f); - detourFunction(0x0807ae10, gl_TexCoord2f); - detourFunction(0x0807aed0, cg_GLIsProfileSupported); - patchMemory(0x087444ff, "9090"); - cacheModedShaderFiles(); - } - - detourFunction(0x08388cb4, stubRetOne); // isExistNewerSource - detourFunction(0x0807b370, gl_XGetProcAddressARB); - patchMemory(0x0874433e, "00"); // Fix cutscenes - } - break; - case INITIALD_5_JAP_REVF: // ID5 - DVP-0070F - { - if (config->showDebugMessages == 1) - { - setVariable(0x093e52d4, 2); // amBackupDebugLevel - setVariable(0x093e52e0, 2); // amCreditDebugLevel - setVariable(0x093e5538, 2); // amDipswDebugLevel - setVariable(0x093e553c, 2); // amDongleDebugLevel - setVariable(0x093e5540, 2); // amEepromDebugLevel - setVariable(0x093e5544, 2); // amHwmonitorDebugLevel - setVariable(0x093e5548, 2); // amJvsDebugLevel - setVariable(0x093e554c, 2); // amLibDebugLevel - setVariable(0x093e5550, 2); // amMiscDebugLevel - setVariable(0x093e5558, 2); // amSysDataDebugLevel - setVariable(0x093e5560, 2); // bcLibDebugLevel - setVariable(0x093e5554, 2); // amOsinfoDebugLevel - setVariable(0x093e5564, 0x0FFFFFFF); // s_logMask - detourFunction(0x0875f0a8, _putConsoleSeparate); // Debug Messages - } - // Security - detourFunction(0x08937b71, amDongleInit); - detourFunction(0x089363fd, amDongleIsAvailable); - detourFunction(0x08936f1e, amDongleUpdate); - detourFunction(0x08937a37, amDongleUserInfoEx); - memcpy(elfID, (void *)0x084fa2e2, 4); // Get gameID from the ELF - patchMemory(0x084fa2bc, "00"); // Patch KEYCHECK - // Fixes - amDipswContextAddr = (void *)0x09415388; - detourFunction(0x08936190, amDipswInit); - detourFunction(0x08936214, amDipswExit); - detourFunction(0x08936289, amDipswGetData); - detourFunction(0x089362ff, amDipswSetLed); // amDipswSetLed - detourFunction(0x08330368, stubRetOne); // isEthLinkUp - patchMemory(0x084519ee, "C0270900"); // tickInitStoreNetwork - // patchMemory(0x08452848, "e991000000"); // tickWaitDHCP - detourFunction(0x08316392, stubRetOne); // Skip Kickback initialization - detourFunction(0x084f67ce, stubRetZero); // doesNeedRollerCleaning - detourFunction(0x084f67ea, stubRetZero); // doesNeedStockerCleaning - - patchMemory(0x08451501, "c7c300030000"); // Moves Initializing text - patchMemory(0x0850ffd0, "00"); // Network init just once - patchMemory(0x08a098ac, "95"); // Skips initialization - patchMemory(0x087a2cc9, "e92601000090"); // Prevents Full Screen set from the game - - patchMemory(0x0845493b, "eb60"); // tickInitAddress - detourFunction(0x0893dd02, stubRetZero); // amOsinfoExecDhcpNic - detourFunction(0x0850fba0, stubRetZero); // isUseServerBox - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x0807a42c, gl_MultiTexCoord2fARB); - detourFunction(0x0807a4ac, gl_Color4ub); - detourFunction(0x0807a6ec, gl_Vertex3f); - detourFunction(0x0807ae4c, gl_TexCoord2f); - detourFunction(0x0807af0c, cg_GLIsProfileSupported); - patchMemory(0x0875e36f, "9090"); - cacheModedShaderFiles(); - } - - detourFunction(0x08397aa4, stubRetOne); // isExistNewerSource - detourFunction(0x0807b3bc, gl_XGetProcAddressARB); - patchMemory(0x0875e1ae, "00"); // Fix cutscenes - } - break; - case SEGABOOT_2_4_SYM: - { - if (config->showDebugMessages == 1) - { - setVariable(0x0808da48, 2); // amAdtecDebugLevel - setVariable(0x0808cf8c, 2); // amAtaDebugLevel - setVariable(0x0808cf90, 2); // amBackupDebugLevel - setVariable(0x0808cf94, 2); // amChunkDataDebugLevel - setVariable(0x0808cfa0, 2); // amCreditDebugLevel - setVariable(0x0808d1f8, 2); // amDipswDebugLevel - setVariable(0x0808d1fc, 2); // amDiskDebugLevel - setVariable(0x0808d200, 2); // amDongleDebugLevel - setVariable(0x0808d204, 2); // amEepromDebugLevel - setVariable(0x0808d208, 2); // amHmDebugLevel - setVariable(0x0808d210, 2); // amJvsDebugLevel - setVariable(0x0808d214, 2); // amLibDebugLevel - setVariable(0x0808d218, 2); // amMiscDebugLevel - setVariable(0x0808d21c, 2); // amSysDataDebugLevel - setVariable(0x0808d220, 2); // bcLibDebugLevel - setVariable(0x0808cf58, 2); // g_DebugLevel - setVariable(0x0808d224, 0x0FFFFFFF); // logmask - } - - detourFunction(0x0805e8b0, amDongleInit); - detourFunction(0x0805ebc3, amDongleIsAvailable); - detourFunction(0x0805eb2a, amDongleUpdate); - detourFunction(0x0805c30b, amDipswGetData); - } - break; case VIRTUA_TENNIS_3: { if (config->showDebugMessages == 1) @@ -2753,489 +3239,6 @@ int initPatch() } } break; - case RAMBO: - { - // Security - detourFunction(0x082c4746, amDongleInit); - detourFunction(0x082c3201, amDongleIsAvailable); - detourFunction(0x082c3bf7, amDongleUpdate); - detourFunction(0x082c460d, amDongleUserInfoEx); - detourFunction(0x082c321e, amDongleIsDevelop); - detourFunction(0x080e4262, stubRetZero); - detourFunction(0x080e3e94, stubRetZero); - patchMemory(0x080e3f1d, "EB"); - patchMemory(0x080e3f79, "01"); - patchMemory(0x080e3e2e, "EB"); - // Fixes - amDipswContextAddr = (void *)0x082c2f94; - detourFunction(0x082c2f94, amDipswInit); - detourFunction(0x082c3018, amDipswExit); - detourFunction(0x082c308d, amDipswGetData); - detourFunction(0x082c3103, amDipswSetLed); - cacheModedShaderFiles(); - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - loadLibCg(); - cacheNnstdshader(); - patchMemory(0x08200c17, "9090909090"); // Stop the folder rename - patchMemory(0x084173e7, "66732f636f6d70696c65646d657361"); // Change folder to compiledshdmesa - patchMemory(0x080b3d71, "01"); // Compile using CGC - replaceCallAtAddress(0x082015bf, compileWithCGC); - replaceCallAtAddress(0x082012c1, compileWithCGC); - // patchMemory(0x080b3d65, "00"); // Force recompile shaders - } - } - break; - case TOO_SPICY: - { - // Security - detourFunction(0x0831cf02, amDongleInit); - detourFunction(0x0831b94d, amDongleIsAvailable); - detourFunction(0x0831c3b1, amDongleUpdate); - patchMemory(0x081f7f8f, "9090"); - patchMemory(0x081f7fa7, "9090909090909090"); - patchMemory(0x081f7fb0, "01"); - patchMemory(0x081f7fb4, "909090"); - patchMemory(0x08210f27, "9090"); - patchMemory(0x08210f3c, "9090909090909090"); - patchMemory(0x08210f45, "01"); - patchMemory(0x08210f49, "909090"); - // Fixes - amDipswContextAddr = (void *)0x0c8ed0cc; - detourFunction(0x08318f84, amDipswInit); - detourFunction(0x08319008, amDipswExit); - detourFunction(0x0831907d, amDipswGetData); - detourFunction(0x083190f4, amDipswSetLed); - detourFunction(0x081f7dba, stubRetOne); // CheckApplicationValid - - // CPU patch to support AMD processors - patchMemory(0x08202a51, "9090909090"); //__intel_new_proc_init_P - - // unlock characters - detourFunction(0x081cbcd2, stubRetOne); - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - loadLibCg(); - cacheNnstdshader(); - patchMemory(0x081ef9d8, "01"); // Force the game to recompile the shaders using cgc - patchMemory(0x08413f04, "646d657361"); // Changes compiledshader folder to compiledshdmesa - cacheModedShaderFiles(); - replaceCallAtAddress(0x08259fe5, compileWithCGC); - replaceCallAtAddress(0x0825a089, compileWithCGC); - } - } - break; - case TOO_SPICY_TEST: - { - // Security - detourFunction(0x0806a286, amDongleInit); - detourFunction(0x08068cd1, amDongleIsAvailable); - detourFunction(0x08069735, amDongleUpdate); - patchMemory(0x08056989, "9090"); - patchMemory(0x080569a7, "01"); - patchMemory(0x080569ab, "909090"); - // Fixes - amDipswContextAddr = (void *)0x080a9988; // Address of amDipswContext - detourFunction(0x08068a64, amDipswInit); - detourFunction(0x08068ae8, amDipswExit); - detourFunction(0x08068b5d, amDipswGetData); - detourFunction(0x08068bd4, amDipswSetLed); - - // CPU patch to support AMD processors - patchMemory(0x080564c8, "9090909090"); //__intel_new_proc_init_P - } - break; - case PRIMEVAL_HUNT: - { - // Security - detourFunction(0x08141770, amDongleInit); - detourFunction(0x08140229, amDongleIsAvailable); - detourFunction(0x08140c1f, amDongleUpdate); - patchMemory(0x08055264, "EB"); - // Fixes - amDipswContextAddr = (void *)0x0a96d488; // Address of amDipswContext - detourFunction(0x0813ffbc, amDipswInit); - detourFunction(0x08140040, amDipswExit); - detourFunction(0x081400b5, amDipswGetData); - detourFunction(0x0814012c, stubRetZero); - patchMemory(0x08052cb2, "9090909090"); - cacheModedShaderFiles(); - } - break; - case GHOST_SQUAD_EVOLUTION: - { - if (config->showDebugMessages == 1) - { - // Debug - detourFunction(0x080984fe, _putConsole); - } - // Security - detourFunction(0x08183046, amDongleInit); - detourFunction(0x08181a91, amDongleIsAvailable); - detourFunction(0x081824f5, amDongleUpdate); - detourFunction(0x080e7ee8, stubRetOne); // stub check_dongle_validate - patchMemory(0x080e7db2, "01"); - // Fixes - amDipswContextAddr = (void *)0x0aeafc28; // Address of amDipswContext - detourFunction(0x08181824, amDipswInit); - detourFunction(0x081818a8, amDipswExit); - detourFunction(0x0818191d, amDipswGetData); - detourFunction(0x08181994, stubRetZero); - patchMemory(0x080f37dd, "75"); // patch to prevent memory assignment error - // Stop the extra inputs by removing io_glut_init - detourFunction(0x080e7f94, stubRetZero); - - cacheModedShaderFiles(); - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - gsEvoElfShaderPatcher(); - detourFunction(0x0804c334, gl_ProgramStringARB); - } - } - break; - case HARLEY_DAVIDSON: - { - // Security - detourFunction(0x08395ede, amDongleInit); - detourFunction(0x083949b6, amDongleIsDevelop); - detourFunction(0x0818ba08, stubRetZero); - detourFunction(0x0818b9ce, stubRetZero); - - // Fixes - amDipswContextAddr = (void *)0x0abe35a8; - detourFunction(0x0839472c, amDipswInit); - detourFunction(0x083947b0, amDipswExit); - detourFunction(0x08394825, amDipswGetData); - detourFunction(0x08395da5, amDongleUserInfoEx); - - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - cacheModedShaderFiles(); - loadLibCg(); - cacheNnstdshader(); - patchMemory(0x082d4437, "9090909090"); // Stop the folder rename - patchMemory(0x088a6127, "66732f636f6d70696c65646d657361"); // Change folder to compiledshdmesa - patchMemory(0x082646b3, "01"); // Compile using CGC - replaceCallAtAddress(0x082d48ac, compileWithCGC); - replaceCallAtAddress(0x082d4b3b, compileWithCGC); - } - // Turns off the opponent marker at higher resolutions because it is out of place. - if (getConfig()->width > 1360) - detourFunction(0x080f19a6, stubRetZero); - } - break; - case HUMMER: - { - if (config->showDebugMessages == 1) - { - setVariable(0x0a6e9fac, 2); // amBackupDebugLevel - setVariable(0x0a6e9fc0, 2); // amCreditDebugLevel - setVariable(0x0a6ea218, 2); // amDipswDebugLevel - setVariable(0x0a6ea21c, 2); // amDongleDebugLevel - setVariable(0x0a6ea220, 2); // amEepromDebugLevel - setVariable(0x0a6ea224, 2); // amHwmonitorDebugLevel - setVariable(0x0a6ea228, 2); // amJvsDebugLevel - setVariable(0x0a6ea22c, 2); // amLibDebugLevel - setVariable(0x0a6ea230, 2); // amMiscDebugLevel - setVariable(0x0a6ea234, 2); // amOsinfoDebugLevel - setVariable(0x0a6ea238, 2); // amSysDataDebugLevel - setVariable(0x0a6ea240, 2); // bcLibDebugLevel - } - - // Security - detourFunction(0x083dcbf6, amDongleInit); - detourFunction(0x083db641, amDongleIsAvailable); - detourFunction(0x083dc0a5, amDongleUpdate); - detourFunction(0x083db65e, amDongleIsDevelop); - detourFunction(0x083dcabd, amDongleUserInfoEx); - detourFunction(0x080f4e04, stubRetMinusOne); // checkError - detourFunction(0x083dc5aa, amDongleDecryptEx); // Return 0 - detourFunction(0x083dbddd, amDongleSetIv); // Retrun 0 - - // Security Board - amDipswContextAddr = (void *)0x0a6f2c88; - detourFunction(0x083db3d4, amDipswInit); - detourFunction(0x083db458, amDipswExit); - detourFunction(0x083db4cd, amDipswGetData); - detourFunction(0x083db544, amDipswSetLed); - - // Networking - detourFunction(0x083e339d, stubRetZero); // amOsinfoModifyNetworkAdr - detourFunction(0x083e3a2f, stubRetZero); // amOsinfoModifyNetworkProperty - - // While we can't get into the test menu, immidiately return from the - // call to clSteerErrorDisp::run that complains about the calibration - // values. - patchMemory(0x082e8f48, "C3"); - // Fixes Black screen after finishing the race - patchMemory(0x08078b4c, "C3"); - - detourFunction(0x082b5e4a, stubReturn); // adx_err_callback - detourFunction(0x082d199c, stubReturn); // clSerialLindbergh::send - detourFunction(0x082d1ab4, stubReturn); // clSerialLindbergh::receive - - // Shader patching - cacheModedShaderFiles(); - detourFunction(0x0804f480, gl_XGetProcAddressARB); - } - break; - case HUMMER_SDLX: - { - if (config->showDebugMessages == 1) - { - setVariable(0x0a6eac0c, 2); // amBackupDebugLevel - setVariable(0x0a6eac20, 2); // amCreditDebugLevel - setVariable(0x0a6eae78, 2); // amDipswDebugLevel - setVariable(0x0a6eae7c, 2); // amDongleDebugLevel - setVariable(0x0a6eae80, 2); // amEepromDebugLevel - setVariable(0x0a6eae84, 2); // amHwmonitorDebugLevel - setVariable(0x0a6eae88, 2); // amJvsDebugLevel - setVariable(0x0a6eae8c, 2); // amLibDebugLevel - setVariable(0x0a6eae90, 2); // amMiscDebugLevel - setVariable(0x0a6eae94, 2); // amOsinfoDebugLevel - setVariable(0x0a6eae98, 2); // amSysDataDebugLevel - setVariable(0x0a6eaea0, 2); // bcLibDebugLevel - } - - // Security - detourFunction(0x083dd7d2, amDongleInit); - detourFunction(0x083dc21d, amDongleIsAvailable); - detourFunction(0x083dcc81, amDongleUpdate); - detourFunction(0x083dc23a, amDongleIsDevelop); - detourFunction(0x083dd699, amDongleUserInfoEx); - detourFunction(0x080f4ea8, stubRetMinusOne); // checkError - detourFunction(0x083dd186, amDongleDecryptEx); // Return 0 - detourFunction(0x083dc9b9, amDongleSetIv); // Retrun 0 - - // Security Board - amDipswContextAddr = (void *)0x0a6f38e8; - detourFunction(0x083dbfb0, amDipswInit); - detourFunction(0x083dc034, amDipswExit); - detourFunction(0x083dc0a9, amDipswGetData); - detourFunction(0x083dc120, amDipswSetLed); - - // Networking - detourFunction(0x083e3f79, stubRetZero); // amOsinfoModifyNetworkAdr - detourFunction(0x083e460b, stubRetZero); // amOsinfoModifyNetworkProperty - - // While we can't get into the test menu, immidiately return from the - // call to clSteerErrorDisp::run that complains about the calibration - // values. - patchMemory(0x082e99ec, "C3"); - // Fixes Black screen after finishing the race - patchMemory(0x08078b84, "C3"); - - detourFunction(0x082b650a, stubReturn); // adx_err_callback - detourFunction(0x082d2414, stubReturn); // clSerialLindbergh::send - detourFunction(0x082d252c, stubReturn); // clSerialLindbergh::receive - - // Shader patching - cacheModedShaderFiles(); - detourFunction(0x0804f480, gl_XGetProcAddressARB); - } - break; - case HUMMER_EXTREME: - { - if (config->showDebugMessages == 1) - { - setVariable(0x0a79a834, 2); // amAdtecDebugLevel - setVariable(0x0a79a838, 2); // amAtaDebugLevel - setVariable(0x0a79a83c, 2); // amBackupDebugLevel - setVariable(0x0a79a840, 2); // amCreditDebugLevel - setVariable(0x0a79aa98, 2); // amDipswDebugLevel - setVariable(0x0a79aa9c, 2); // amDongleDebugLevel - setVariable(0x0a79aaa0, 2); // amEepromDebugLevel - setVariable(0x0a79aaa4, 2); // amHwmonitorDebugLevel - setVariable(0x0a79aaa8, 2); // amJvsDebugLevel - setVariable(0x0a79aaac, 2); // amLibDebugLevel - setVariable(0x0a79aab0, 2); // amMiscDebugLevel - setVariable(0x0a79aab4, 2); // amOsinfoDebugLevel - setVariable(0x0a79a830, 2); // amsLibDebugLevel - setVariable(0x0a79aab8, 2); // amSysDataDebugLevel - setVariable(0x0a79aac0, 2); // bcLibDebugLevel - } - - // Security - detourFunction(0x0831c0d1, amDongleInit); - detourFunction(0x0831a95d, amDongleIsAvailable); - detourFunction(0x0831b47e, amDongleUpdate); - detourFunction(0x0831a97a, amDongleIsDevelop); - detourFunction(0x0831bf97, amDongleUserInfoEx); - detourFunction(0x0831668c, stubRetZero); // amsInit - detourFunction(0x08170654, stubRetMinusOne); // checkError - detourFunction(0x0831b982, amDongleDecryptEx); // Return 0 - detourFunction(0x0831b08b, amDongleSetIv); // Retrun 0 - patchMemory(0x082b4d51, "00"); - patchMemory(0x082b5163, "00"); - patchMemory(0x082b5306, "00"); - patchMemory(0x082b570f, "00"); - patchMemory(0x082b57c8, "909090909090"); - - // Security Board - amDipswContextAddr = (void *)0x0a7aefe8; - detourFunction(0x0831a6f0, amDipswInit); - detourFunction(0x0831a774, amDipswExit); - detourFunction(0x0831a7e9, amDipswGetData); - detourFunction(0x0831a85f, amDipswSetLed); - - // Networking - detourFunction(0x08323886, stubRetZero); // amOsinfoModifyNetworkAdr - detourFunction(0x0832386b, stubRetZero); // amOsinfoModifyNetworkProperty - - // While we can't get into the test menu, immidiately return from the - // call to clSteerErrorDisp::run that complains about the calibration - // values. - patchMemory(0x080e8b40, "C3"); - // Fixes Black screen after finishing the race - patchMemory(0x0811d0c0, "C3"); - - // Shader patching - cacheModedShaderFiles(); - detourFunction(0x0807a9dc, gl_XGetProcAddressARB); - } - break; - case HUMMER_EXTREME_MDX: - { - if (config->showDebugMessages == 1) - { - setVariable(0x0a7ae7b4, 2); // amAdtecDebugLevel - setVariable(0x0a7ae7b8, 2); // amAtaDebugLevel - setVariable(0x0a7ae7bc, 2); // amBackupDebugLevel - setVariable(0x0a7ae7c0, 2); // amCreditDebugLevel - setVariable(0x0a7aea18, 2); // amDipswDebugLevel - setVariable(0x0a7aea1c, 2); // amDongleDebugLevel - setVariable(0x0a7aea20, 2); // amEepromDebugLevel - setVariable(0x0a7aea24, 2); // amHwmonitorDebugLevel - setVariable(0x0a7aea28, 2); // amJvsDebugLevel - setVariable(0x0a7aea2c, 2); // amLibDebugLevel - setVariable(0x0a7aea30, 2); // amMiscDebugLevel - setVariable(0x0a7aea34, 2); // amOsinfoDebugLevel - setVariable(0x0a7ae7b0, 2); // amsLibDebugLevel - setVariable(0x0a7aea38, 2); // amSysDataDebugLevel - setVariable(0x0a7aea40, 2); // bcLibDebugLevel - } - - // Security - detourFunction(0x0832b411, amDongleInit); - detourFunction(0x08329c9d, amDongleIsAvailable); - detourFunction(0x0832a7be, amDongleUpdate); - detourFunction(0x08329cba, amDongleIsDevelop); - detourFunction(0x0832b2d7, amDongleUserInfoEx); - detourFunction(0x083259cc, stubRetZero); // amsInit - detourFunction(0x0817a0b6, stubRetMinusOne); // checkError - detourFunction(0x0832acc2, amDongleDecryptEx); // Return 0 - detourFunction(0x0832a3cb, amDongleSetIv); // Retrun 0 - patchMemory(0x082c2465, "00"); - patchMemory(0x082c2877, "00"); - patchMemory(0x082c2a16, "00"); - patchMemory(0x082c2e1f, "00"); - patchMemory(0x082c2ed8, "909090909090"); - - patchMemory(0x080de537, "909090909090"); - - // Security Board - amDipswContextAddr = (void *)0x0a7c2f68; - detourFunction(0x08329a30, amDipswInit); - detourFunction(0x08329ab4, amDipswExit); - detourFunction(0x08329b29, amDipswGetData); - detourFunction(0x08329b9f, amDipswSetLed); - - // Networking - detourFunction(0x08332bc6, stubRetZero); // amOsinfoModifyNetworkAdr - detourFunction(0x08332bab, stubRetZero); // amOsinfoModifyNetworkProperty - - // While we can't get into the test menu, immidiately return from the - // call to clSteerErrorDisp::run that complains about the calibration - // values. - patchMemory(0x080ebe20, "C3"); - // Fixes Black screen after finishing the race - patchMemory(0x081260f0, "C3"); - - // Shader patching - cacheModedShaderFiles(); - detourFunction(0x0807a9dc, gl_XGetProcAddressARB); - } - break; - case MJ4_REVG: - { - setVariable(0x0acf85d4, 2); - setVariable(0x0acf85d0, 2); - setVariable(0x0acf85cc, 2); - setVariable(0x0acf85c8, 2); - setVariable(0x0acf85c0, 2); - setVariable(0x0acf85bc, 2); - - // Security - detourFunction(0x08710c0a, amDongleInit); - detourFunction(0x0870f6c5, amDongleIsAvailable); - detourFunction(0x0870f6e2, amDongleIsDevelop); - detourFunction(0x087100bb, amDongleUpdate); - - // Fixes and patches to bypss network check - amDipswContextAddr = (void *)0x0ad224fc; // Address of amDipswContext - detourFunction(0x0870f458, amDipswInit); - detourFunction(0x0870f4dc, amDipswExit); - detourFunction(0x0870f551, amDipswGetData); - detourFunction(0x0870f5c7, amDipswSetLed); - - // detourFunction(0x080e286a, stubRetZero); // skip checks - // detourFunction(0x080ed7f8, stubRetZero); - // patchMemory(0x080e954b, "75"); - // patchMemory(0x08a4cb90, "00"); - // patchMemory(0x080e955d, "909090909090"); // test skip countdown - - // setVariable(0x08534a33, 30); - // setVariable(0x08534a42, 2); - - patchMemory(0x080e2891, "eb"); - patchMemory(0x080ea049, "05"); - patchMemory(0x08a4cb90, "00"); - - patchMemory(0x0872bc4d, "2e2f72616d2f746f2e74787400"); // Patch /home/disk2 folder - patchMemory(0x0872bc64, "2e2f72616d2f66726f6d2e74787400"); // Patch /home/disk2 folder - patchMemory(0x0872bc7d, "2e2f72616d2f2e746d7000"); // Patch /home/disk2 folder - patchMemory(0x0872bccd, "2e2f72616d00"); // Patch /home/disk2 folder - patchMemory(0x0872bcdd, "2e2f666f6f3100"); // Patch /home/disk2 folder - patchMemory(0x0872bcee, "2e2f666f6f3200"); // Patch /home/disk2 folder - patchMemory(0x0872f3de, "2e2f72616d2f746d7000"); // Patch /home/disk2 folder - patchMemory(0x08732fd3, "2e2f00"); // Patch /home/disk2 folder - - // Mesa Patches - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x08050ebc, gl_ProgramStringARB); - } - } - break; - case MJ4_EVO: - { - detourFunction(0x08840b61, amDongleInit); - detourFunction(0x0883f3ed, amDongleIsAvailable); - detourFunction(0x0883f40a, amDongleIsDevelop); - detourFunction(0x0883ff0e, amDongleUpdate); - - // Fixes and patches to bypss network check - amDipswContextAddr = (void *)0x0af8ff3c; // Address of amDipswContext - detourFunction(0x0883f180, amDipswInit); - detourFunction(0x0883f204, amDipswExit); - detourFunction(0x0883f279, amDipswGetData); - detourFunction(0x0883f2ef, amDipswSetLed); - - patchMemory(0x080ea0d1, "909090909090"); - detourFunction(0x080e327c, stubRetZero); // skip checks - detourFunction(0x080ee4fa, stubRetZero); - patchMemory(0x080ea0bf, "75"); - patchMemory(0x08c035b8, "00"); - - if (getConfig()->GPUVendor != NVIDIA_GPU) - { - detourFunction(0x08051314, gl_ProgramStringARB); - } - } - break; default: break; } diff --git a/src/lindbergh/resolution.c b/src/lindbergh/resolution.c index 00d4c34..ee0ca07 100644 --- a/src/lindbergh/resolution.c +++ b/src/lindbergh/resolution.c @@ -258,20 +258,21 @@ void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) } } break; - // case THE_HOUSE_OF_THE_DEAD_4_REVA: - // case THE_HOUSE_OF_THE_DEAD_4_REVA_TEST: - // case THE_HOUSE_OF_THE_DEAD_4_REVB: - // case THE_HOUSE_OF_THE_DEAD_4_REVB_TEST: - // case THE_HOUSE_OF_THE_DEAD_4_REVC: - // case THE_HOUSE_OF_THE_DEAD_4_REVC_TEST: - // { - // if (width == 640 && height == 480) - // { - // width = getConfig()->width; - // height = getConfig()->height; - // } - // } - // break; + case THE_HOUSE_OF_THE_DEAD_4_REVA: + case THE_HOUSE_OF_THE_DEAD_4_REVA_TEST: + case THE_HOUSE_OF_THE_DEAD_4_REVB: + case THE_HOUSE_OF_THE_DEAD_4_REVB_TEST: + case THE_HOUSE_OF_THE_DEAD_4_REVC: + case THE_HOUSE_OF_THE_DEAD_4_REVC_TEST: + case THE_HOUSE_OF_THE_DEAD_EX_TEST: + { + if (width == 640 && height == 480) + { + width = getConfig()->width; + height = getConfig()->height; + } + } + break; case THE_HOUSE_OF_THE_DEAD_4_SPECIAL: case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB: { @@ -1294,15 +1295,6 @@ int initResolutionPatches() { switch (getConfig()->crc32) { - case R_TUNED: - { - patchMemory(0x08051c2b, "01"); // Enable Anti Alias - patchMemory(0x08052d58, "b80a000000"); // Skips resolution set by the Dip Switches. - setVariable(0x083c7db8, getConfig()->width); - setVariable(0x083c7dbc, getConfig()->height); - patchMemory(0x083c7dc0, "00"); - } - break; case AFTER_BURNER_CLIMAX: { if (getConfig()->width == 640 && getConfig()->height == 480) @@ -1415,341 +1407,226 @@ int initResolutionPatches() hookABCGLFunctions(0x08076db8, 0x08076dd2, 0x08076b78); } break; - case SEGA_RACE_TV: + case GHOST_SQUAD_EVOLUTION: { - if (getConfig()->width == 640 && getConfig()->height == 480) + // test + // patchMemory(0x081c1d71, "38303078363030"); + setVariable(0x082c87f8, 0x00000550); + setVariable(0x082c87fc, 0x00000300); + } + break; + case HARLEY_DAVIDSON: + { + if (getConfig()->width <= 1360 && getConfig()->height <= 768) break; - if (getConfig()->keepAspectRatio) + int w = getConfig()->width; + int h = getConfig()->height; + setVariable(0x088a57e0, w); // main res + setVariable(0x088a57e4, h); + setVariable(0x088a57e8, w); + setVariable(0x088a57ec, h); + setVariable(0x088a57f0, w); + setVariable(0x088a57f4, h); + setVariable(0x088a55e0, w); // render res + patchMemory(0x08056c31, "9090909090"); + // setVariable(0x08056c2d, w); // render res + patchMemory(0x082a8500, "9090909090"); // restype + patchMemory(0x088a55e4, "14"); + patchMemory(0x082a2412, "00008040"); // Fixes white logo background. + if (getConfig()->width > 1360) { - srtvX = (getConfig()->width - (getConfig()->height / 3) * 4) / 2; - srtvW = (getConfig()->height / 3) * 4; + unsigned int idx = ((21 * h) / 768) + 1; + setVariable(0x082a250e, idx); } - else - { - srtvW = getConfig()->width; - } - srtvH = getConfig()->height; } break; - case OUTRUN_2_SP_SDX: - { - if (getConfig()->width <= 800 && getConfig()->height <= 480) - break; - // If resolution is not the native of the game this patch kind of fix the Sun when the LensGlare effect is - // shown. - if ((getConfig()->width > 800) && (getConfig()->height > 480)) - { - patchMemory(0x080e8e72, "9090909090"); // removes a call to a light function - patchMemory(0x080e8e83, "9090909090"); // removes a call to a light function - if (!getConfig()->outrunLensGlareEnabled) - { - detourFunction(0x080e8b34, stubReturn); // Completely disables the lens glare effect - } - } - setVariable(0x080b913a, 0x44200000); - setVariable(0x081dae28, 0x44200000); - setVariable(0x081dae30, 0x44200000); - } - break; - case OUTRUN_2_SP_SDX_TEST: - { - setVariable(0x0804a490, getConfig()->width); - setVariable(0x0804a4ad, getConfig()->height); - } - break; - case OUTRUN_2_SP_SDX_REVA: - { - if (getConfig()->width <= 800 && getConfig()->height <= 480) - break; - // If resolution is not the native of the game this patch kind of fix the Sun when the LensGlare effect is - // shown. - if ((getConfig()->width > 800) && (getConfig()->height > 480)) - { - patchMemory(0x080e8e06, "9090909090"); // removes a call to a light function - patchMemory(0x080e8e17, "9090909090"); // removes a call to a light function - if (!getConfig()->outrunLensGlareEnabled) - { - detourFunction(0x080e8ac8, stubReturn); // Completely disables the lens glare effect - } - } - setVariable(0x080b913a, 0x44200000); - setVariable(0x081dada8, 0x44200000); - setVariable(0x081dadb0, 0x44200000); - - // Cleans patched elf floating around - patchMemory(0x080b912e, "f043"); - patchMemory(0x080f39de, "c0ef43"); - patchMemory(0x080f3aa6, "2048"); - patchMemory(0x080f3c94, "04b91c"); - patchMemory(0x080f3cba, "20561b"); - patchMemory(0x080f40cf, "c047"); - patchMemory(0x080f40f8, "80ef43"); - patchMemory(0x080f4d80, "04b91c"); - patchMemory(0x080f4e52, "20561b"); - patchMemory(0x080fed40, "80ef43"); - patchMemory(0x080fed52, "c047"); - setVariable(0x081dadb4, 0x43f00000); - setVariable(0x081dadbc, 0x43f00000); - patchMemory(0x081e7b3e, "7e"); - patchMemory(0x081e7b46, "89"); - } - break; - case OUTRUN_2_SP_SDX_REVA_TEST: - case OUTRUN_2_SP_SDX_REVA_TEST2: - { - if (getConfig()->width <= 800 && getConfig()->height <= 480) - break; - setVariable(0x0804a490, getConfig()->width); - setVariable(0x0804a4ad, getConfig()->height); - } - break; - case THE_HOUSE_OF_THE_DEAD_4_REVA: + case HUMMER: { if (getConfig()->width <= 1280 && getConfig()->height <= 768) break; - patchMemory(0x0804d142, "9090909090"); // setresolutiontype - // patchMemory(0x084c9dbc, "0005"); - // patchMemory(0x08448458, "0005"); - // patchMemory(0x0844845c, "0003"); - setVariable(0x084c9dbc, getConfig()->width); - setVariable(0x08448458, getConfig()->width); - setVariable(0x0844845c, getConfig()->height); - patchMemory(0x08448460, "0005"); - patchMemory(0x08448464, "0003"); - patchMemory(0x0817ff6d, "e80ed5ecff"); // call crtgetresolution - patchMemory(0x08448468, "0005"); // set crtgetresolution to 640x480 - patchMemory(0x0844846c, "0003"); - - setVariable(0x08448338, getConfig()->width); - setVariable(0x0844833c, getConfig()->height); - - detourFunction(0x0804c024, glVertex3fHOD4); - detourFunction(0x0804ca54, glBindTextureGE); + replaceCallAtAddress(0x080d8b58, hummerRespatch); + replaceCallAtAddress(0x080d8b73, hummerRespatch); + replaceCallAtAddress(0x080d8b8e, hummerRespatch); + replaceCallAtAddress(0x080d8ba9, hummerRespatch); + replaceCallAtAddress(0x080d8bfa, hummerRespatch); + replaceCallAtAddress(0x080d8c15, hummerRespatch); } break; - case THE_HOUSE_OF_THE_DEAD_4_REVB: + case HUMMER_EXTREME: { if (getConfig()->width <= 1280 && getConfig()->height <= 768) break; - patchMemory(0x0804d174, "9090909090"); // setresolutiontype - setVariable(0x084c3a9c, getConfig()->width); - setVariable(0x08443118, getConfig()->width); - setVariable(0x0844311c, getConfig()->height); - patchMemory(0x08443120, "0005"); - patchMemory(0x08443124, "0003"); - patchMemory(0x0818080d, "e89eccecff"); // call crtgetresolution - patchMemory(0x08443128, "0005"); // set crtgetresolution to 640x480 - patchMemory(0x0844312c, "0003"); - - setVariable(0x08442ff8, getConfig()->width); - setVariable(0x08442ffc, getConfig()->height); - - detourFunction(0x0804c014, glVertex3fHOD4); - detourFunction(0x0804ca84, glBindTextureGE); + replaceCallAtAddress(0x08159eab, hummerRespatch); + replaceCallAtAddress(0x08159ec9, hummerRespatch); + replaceCallAtAddress(0x08159ee7, hummerRespatch); + replaceCallAtAddress(0x08159f05, hummerRespatch); + replaceCallAtAddress(0x08159f5f, hummerRespatch); + replaceCallAtAddress(0x08159f7d, hummerRespatch); } break; - case THE_HOUSE_OF_THE_DEAD_4_REVC: + case HUMMER_EXTREME_MDX: { if (getConfig()->width <= 1280 && getConfig()->height <= 768) - { - setVariable(0x084c3a9c, 1280); - return 0; - } - patchMemory(0x0804d174, "9090909090"); // setresolutiontype - setVariable(0x084c3a9c, getConfig()->width); - setVariable(0x08443118, getConfig()->width); - setVariable(0x0844311c, getConfig()->height); - patchMemory(0x08443120, "0005"); // gallwinres (2D) - patchMemory(0x08443124, "0003"); - patchMemory(0x0818080d, "e89eccecff"); // sideselect fix - patchMemory(0x08443128, "0005"); - patchMemory(0x0844312c, "0003"); + break; + replaceCallAtAddress(0x0816348b, hummerRespatch); + replaceCallAtAddress(0x081634a9, hummerRespatch); + replaceCallAtAddress(0x081634c7, hummerRespatch); + replaceCallAtAddress(0x081634e5, hummerRespatch); + replaceCallAtAddress(0x0816353f, hummerRespatch); + replaceCallAtAddress(0x0816355d, hummerRespatch); + } + break; + case HUMMER_SDLX: + { + if (getConfig()->width <= 1280 && getConfig()->height <= 768) + break; + replaceCallAtAddress(0x080d8b14, hummerRespatch); + replaceCallAtAddress(0x080d8b2f, hummerRespatch); + replaceCallAtAddress(0x080d8b4a, hummerRespatch); + replaceCallAtAddress(0x080d8b65, hummerRespatch); + replaceCallAtAddress(0x080d8bb6, hummerRespatch); + replaceCallAtAddress(0x080d8bd1, hummerRespatch); + } + break; + case INITIALD_4_EXP_REVB: + { + if (getConfig()->width == 1360 && getConfig()->height == 768) + break; + setVariable(0x0837979d, 0x0000f0e9); // Force set resolution + setVariable(0x08379893, getConfig()->width); // Set ResX + setVariable(0x08379898, getConfig()->height); // Set ResY + // Renderbuffer Resolution + setVariable(0x082560a2, getConfig()->width); // Set ResX + setVariable(0x0825609a, getConfig()->height); // Set ResY + setVariable(0x08256162, getConfig()->width); // Set ResX + setVariable(0x0825615a, getConfig()->height); // Set ResY + setVariable(0x08256222, getConfig()->width); // Set ResX + setVariable(0x0825621a, getConfig()->height); // Set ResY + setVariable(0x08256281, getConfig()->width); // Set ResX + setVariable(0x08256279, getConfig()->height); // Set ResY + setVariable(0x08256b27, getConfig()->width); // Set ResX + setVariable(0x08256b1f, getConfig()->height); // Set ResY + setVariable(0x08256bb2, getConfig()->width); // Set ResX + setVariable(0x08256baa, getConfig()->height); // Set ResY - setVariable(0x08442ff8, getConfig()->width); - setVariable(0x08442ffc, getConfig()->height); - - detourFunction(0x0804c014, glVertex3fHOD4); - detourFunction(0x0804ca84, glBindTextureGE); - } - break; - case THE_HOUSE_OF_THE_DEAD_4_SPECIAL: - { - if (getConfig()->width <= 1024 && getConfig()->height <= 768) - break; - patchMemory(0x0804d2f4, "9090909090"); // setresolutiontype - setVariable(0x084563c4, getConfig()->width); - setVariable(0x08424448, getConfig()->width); - setVariable(0x0842444c, getConfig()->height); - patchMemory(0x0815bfa9, "e8de7f0100"); // sideselect fix - patchMemory(0x08424450, "0004"); - patchMemory(0x08424454, "0003"); - } - break; - case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB: - { - if (getConfig()->width <= 1024 && getConfig()->height <= 768) - break; - patchMemory(0x0804d7e2, "9090909090"); // setresolutiontype - setVariable(0x084c35c4, getConfig()->width); - setVariable(0x08491648, getConfig()->width); - setVariable(0x0849164c, getConfig()->height); - patchMemory(0x081b268f, "e8264d0200"); // sideselect fix - patchMemory(0x08491650, "0004"); - patchMemory(0x08491654, "0003"); - } - break; - case THE_HOUSE_OF_THE_DEAD_EX: - { - } - break; - case VIRTUA_FIGHTER_5: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - return 0; - patchMemory(0x08054057, "b80a000000"); // Skips resolution set by the Dip Switches. - setVariable(0x0847cf58, getConfig()->width); - setVariable(0x0847cf5c, getConfig()->height); - replaceCallAtAddress(0x080d40c4, vf5WidthFix); - } - break; - case VIRTUA_FIGHTER_5_REVA: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x8053167, "01"); // Enable Anti Alias - patchMemory(0x080541af, "b80a000000"); // Skips resolution set by the Dip Switches. - setVariable(0x08487df8, getConfig()->width); - setVariable(0x08487dfc, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_REVB: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x08053673, "01"); // Enable Anti Alias - patchMemory(0x080546cf, "b80a000000"); // Skips resolution set by the Dip Switches. - setVariable(0x08536bb8, getConfig()->width); - setVariable(0x08536bbc, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_REVE: // Also the public REV C version - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x080546c7, "01"); // Enable Anti Alias - patchMemory(0x080557a3, "b80a000000"); // Skips resolution set by the Dip Switches. - setVariable(0x085efb18, getConfig()->width); - setVariable(0x085efb1c, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_EXPORT: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x08052b97, "01"); // Enable Anti Alias - patchMemory(0x08053c67, "b80a000000"); // Skips resolution set by the Dip Switches. - setVariable(0x085259f8, getConfig()->width); - setVariable(0x085259fc, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVA: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x08054b5e, "01"); // Enable Anti Alias - patchMemory(0x08055980, "b80a000000"); // Skips resolution set by the Dip Switches. - vf5FSwidth = (getConfig()->height * 5) / 3; - setVariable(0x088b2bd8, vf5FSwidth); - setVariable(0x088b2bdc, getConfig()->height); - setVariable(0x088b2bec, getConfig()->width); - setVariable(0x088b2bf0, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x080548c4, "01"); // Enable Anti Alias - patchMemory(0x080556e6, "b80a000000"); // Skips resolution set by the Dip Switches. - vf5FSwidth = (getConfig()->height * 5) / 3; - setVariable(0x088d2b78, vf5FSwidth); - setVariable(0x088d2b7c, getConfig()->height); - setVariable(0x088d2b8c, getConfig()->width); - setVariable(0x088d2b90, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB_6000: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x08054bfe, "01"); // Enable Anti Alias - patchMemory(0x08055a20, "b80a000000"); // Skips resolution set by the Dip Switches. - vf5FSwidth = (getConfig()->height * 5) / 3; - setVariable(0x088d53d8, vf5FSwidth); - setVariable(0x088d53dc, getConfig()->height); - setVariable(0x088d53ec, getConfig()->width); - setVariable(0x088d53f0, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_R: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x0805421a, "01"); // Enable Anti Alias - patchMemory(0x080554b0, "b80a000000"); // Skips resolution set by the Dip Switches. - vf5FSwidth = (getConfig()->height * 5) / 3; - setVariable(0x08767d58, vf5FSwidth); - setVariable(0x08767d5c, getConfig()->height); - setVariable(0x08767d6c, getConfig()->width); - setVariable(0x08767d70, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_R_REVD: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x080543aa, "01"); // Enable Anti Alias - patchMemory(0x080555f6, "b80a000000"); // Skips resolution set by the Dip Switches. - vf5FSwidth = (getConfig()->height * 5) / 3; - setVariable(0x08822b18, vf5FSwidth); - setVariable(0x08822b1c, getConfig()->height); - setVariable(0x08822b2c, getConfig()->width); - setVariable(0x08822b30, getConfig()->height); - } - break; - case VIRTUA_FIGHTER_5_R_REVG: - { - if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) - break; - patchMemory(0x0805436a, "01"); // Enable Anti Alias - patchMemory(0x0805577c, "b80a000000"); // Skips resolution set by the Dip Switches. - vf5FSwidth = (getConfig()->height * 5) / 3; - setVariable(0x0887d4d8, vf5FSwidth); - setVariable(0x0887d4dc, getConfig()->height); - setVariable(0x0887d4ec, getConfig()->width); - setVariable(0x0887d4f0, getConfig()->height); - } - break; - case LETS_GO_JUNGLE_REVA: - { - setVariable(0x082e1323, getConfig()->width); // Set ResX - setVariable(0x082e1330, getConfig()->height); // Set ResY + idDisplayTextureCAVEAddress = (void *)0x08337360 + 5; + detourFunction(0x08337360, idDisplayTexture); // FSAA - patchMemory(0x082e12ff, "01"); + patchMemory(0x0855e762, "9090"); + patchMemory(0x0857dfe9, "01"); // FSAA Enabled + setVariable(0x089ea1d0, 1); // FSAA Quality + // Fix Subtitles Position + id4NewCaptionY = ((getConfig()->height - 768.0) / 2) + 64.0; + detourFunction(0x081f0f91, yTxtPatch); + id4NewCaptionYCAVEAddress = (void *)(0x081f0f91 + 8); + // Ballon fix + idDrawBallonCAVEAddress = (void *)0x081ef2ee + 6; + id4DrawTextAddress = (void *)0x081f0454; + detourFunction(0x081ef2ee, idDrawBallon); + replaceCallAtAddress(0x081f084a, id4DrawText); + // Scale Testmode text + if (isTestMode() && getConfig()->width >= 1920) + { + patchMemory(0x0899bb78, "02"); + idTextShift = (getConfig()->width == 1920 ? 27 : ((1920 / getConfig()->width) * 27) + 2); + idTestTextAddress = (void *)0x08579e92; + replaceCallAtAddress(0x0835a1fe, idTestText); + } } break; - case LETS_GO_JUNGLE: + case INITIALD_4_EXP_REVC: { - setVariable(0x082E006b, getConfig()->width); // Set ResX - setVariable(0x082E0078, getConfig()->height); // Set ResY + if (getConfig()->width == 1360 && getConfig()->height == 768) + break; + setVariable(0x0837961d, 0x0000f0e9); // Force set resolution + setVariable(0x08379713, getConfig()->width); // Set ResX + setVariable(0x08379718, getConfig()->height); // Set ResY + // Renderbuffer Resolution + setVariable(0x08256192, getConfig()->width); // Set ResX + setVariable(0x0825618a, getConfig()->height); // Set ResY + setVariable(0x08256252, getConfig()->width); // Set ResX + setVariable(0x0825624a, getConfig()->height); // Set ResY + setVariable(0x08256312, getConfig()->width); // Set ResX + setVariable(0x0825630a, getConfig()->height); // Set ResY + setVariable(0x08256371, getConfig()->width); // Set ResX + setVariable(0x08256369, getConfig()->height); // Set ResY + setVariable(0x08256c17, getConfig()->width); // Set ResX + setVariable(0x08256c0f, getConfig()->height); // Set ResY + setVariable(0x08256ca2, getConfig()->width); // Set ResX + setVariable(0x08256c9a, getConfig()->height); // Set ResY + + idDisplayTextureCAVEAddress = (void *)0x08337200 + 5; + detourFunction(0x08337200, idDisplayTexture); // FSAA - patchMemory(0x082e0047, "01"); + patchMemory(0x0855e4e2, "9090"); + patchMemory(0x0857dd69, "01"); // FSAA Enabled + setVariable(0x089ea1d0, 1); // FSAA Quality + // Fix Subtitles + float newCaptionY = ((getConfig()->height - 768.0) / 2) + 64.0; + setVariable(0x089a7d58, *(unsigned int *)&newCaptionY); + // Fix Subtitles Position + id4NewCaptionY = ((getConfig()->height - 768.0) / 2) + 64.0; + detourFunction(0x081f1051, yTxtPatch); + id4NewCaptionYCAVEAddress = (void *)(0x081f1051 + 8); + // Ballon fix + idDrawBallonCAVEAddress = (void *)0x081ef39e + 6; + id4DrawTextAddress = (void *)0x081f0504; + detourFunction(0x081ef39e, idDrawBallon); + replaceCallAtAddress(0x081f08fc, id4DrawText); + // Scale Testmode text + if (isTestMode() && getConfig()->width >= 1920) + { + patchMemory(0x0899bb78, "02"); + idTextShift = (getConfig()->width == 1920 ? 27 : ((1920 / getConfig()->width) * 27) + 2); + idTestTextAddress = (void *)0x08579c12; + replaceCallAtAddress(0x0835a09e, idTestText); + } } break; - case LETS_GO_JUNGLE_SPECIAL: + case INITIALD_4_EXP_REVD: { - // setVariable(0x08303C4B, 0x00000780); // Set ResX - // setVariable(0x08303C58, 0x00000438); // Set ResY + if (getConfig()->width == 1360 && getConfig()->height == 768) + break; + setVariable(0x0837b12d, 0x0000f0e9); // Force set resolution + setVariable(0x0837b223, getConfig()->width); // Set ResX + setVariable(0x0837b228, getConfig()->height); // Set ResY + // Renderbuffer Resolution + setVariable(0x0825728a, getConfig()->width); // Set ResX + setVariable(0x08257282, getConfig()->height); // Set ResY + setVariable(0x0825734a, getConfig()->width); // Set ResX + setVariable(0x08257342, getConfig()->height); // Set ResY + setVariable(0x0825740a, getConfig()->width); // Set ResX + setVariable(0x08257402, getConfig()->height); // Set ResY + setVariable(0x08257469, getConfig()->width); // Set ResX + setVariable(0x08257461, getConfig()->height); // Set ResY + setVariable(0x08257d0f, getConfig()->width); // Set ResX + setVariable(0x08257d07, getConfig()->height); // Set ResY + setVariable(0x08257d9a, getConfig()->width); // Set ResX + setVariable(0x08257d92, getConfig()->height); // Set ResY + + idDisplayTextureCAVEAddress = (void *)0x08338d50 + 5; + detourFunction(0x08338d50, idDisplayTexture); + // FSAA + patchMemory(0x0855fff2, "9090"); + patchMemory(0x0857f879, "01"); // FSAA Enabled + setVariable(0x089ed930, 1); // FSAA Quality + // Fix Subtitles Position + id4NewCaptionY = ((getConfig()->height - 768.0) / 2) + 64.0; + detourFunction(0x081f2061, yTxtPatch); + id4NewCaptionYCAVEAddress = (void *)(0x081f2061 + 8); + // Ballon fix + idDrawBallonCAVEAddress = (void *)0x081f03be + 6; + id4DrawTextAddress = (void *)0x081f1524; + detourFunction(0x081f03be, idDrawBallon); + replaceCallAtAddress(0x081f191a, id4DrawText); + // Scale Testmode text + if (isTestMode() && getConfig()->width >= 1920) + { + patchMemory(0x0899f2d8, "02"); + idTextShift = (getConfig()->width == 1920 ? 27 : ((1920 / getConfig()->width) * 27) + 2); + idTestTextAddress = (void *)0x0857b722; + replaceCallAtAddress(0x0835bbee, idTestText); + } } break; case INITIALD_4_REVA: @@ -1930,147 +1807,6 @@ int initResolutionPatches() } } break; - case INITIALD_4_EXP_REVB: - { - if (getConfig()->width == 1360 && getConfig()->height == 768) - break; - setVariable(0x0837979d, 0x0000f0e9); // Force set resolution - setVariable(0x08379893, getConfig()->width); // Set ResX - setVariable(0x08379898, getConfig()->height); // Set ResY - // Renderbuffer Resolution - setVariable(0x082560a2, getConfig()->width); // Set ResX - setVariable(0x0825609a, getConfig()->height); // Set ResY - setVariable(0x08256162, getConfig()->width); // Set ResX - setVariable(0x0825615a, getConfig()->height); // Set ResY - setVariable(0x08256222, getConfig()->width); // Set ResX - setVariable(0x0825621a, getConfig()->height); // Set ResY - setVariable(0x08256281, getConfig()->width); // Set ResX - setVariable(0x08256279, getConfig()->height); // Set ResY - setVariable(0x08256b27, getConfig()->width); // Set ResX - setVariable(0x08256b1f, getConfig()->height); // Set ResY - setVariable(0x08256bb2, getConfig()->width); // Set ResX - setVariable(0x08256baa, getConfig()->height); // Set ResY - - idDisplayTextureCAVEAddress = (void *)0x08337360 + 5; - detourFunction(0x08337360, idDisplayTexture); - // FSAA - patchMemory(0x0855e762, "9090"); - patchMemory(0x0857dfe9, "01"); // FSAA Enabled - setVariable(0x089ea1d0, 1); // FSAA Quality - // Fix Subtitles Position - id4NewCaptionY = ((getConfig()->height - 768.0) / 2) + 64.0; - detourFunction(0x081f0f91, yTxtPatch); - id4NewCaptionYCAVEAddress = (void *)(0x081f0f91 + 8); - // Ballon fix - idDrawBallonCAVEAddress = (void *)0x081ef2ee + 6; - id4DrawTextAddress = (void *)0x081f0454; - detourFunction(0x081ef2ee, idDrawBallon); - replaceCallAtAddress(0x081f084a, id4DrawText); - // Scale Testmode text - if (isTestMode() && getConfig()->width >= 1920) - { - patchMemory(0x0899bb78, "02"); - idTextShift = (getConfig()->width == 1920 ? 27 : ((1920 / getConfig()->width) * 27) + 2); - idTestTextAddress = (void *)0x08579e92; - replaceCallAtAddress(0x0835a1fe, idTestText); - } - } - break; - case INITIALD_4_EXP_REVC: - { - if (getConfig()->width == 1360 && getConfig()->height == 768) - break; - setVariable(0x0837961d, 0x0000f0e9); // Force set resolution - setVariable(0x08379713, getConfig()->width); // Set ResX - setVariable(0x08379718, getConfig()->height); // Set ResY - // Renderbuffer Resolution - setVariable(0x08256192, getConfig()->width); // Set ResX - setVariable(0x0825618a, getConfig()->height); // Set ResY - setVariable(0x08256252, getConfig()->width); // Set ResX - setVariable(0x0825624a, getConfig()->height); // Set ResY - setVariable(0x08256312, getConfig()->width); // Set ResX - setVariable(0x0825630a, getConfig()->height); // Set ResY - setVariable(0x08256371, getConfig()->width); // Set ResX - setVariable(0x08256369, getConfig()->height); // Set ResY - setVariable(0x08256c17, getConfig()->width); // Set ResX - setVariable(0x08256c0f, getConfig()->height); // Set ResY - setVariable(0x08256ca2, getConfig()->width); // Set ResX - setVariable(0x08256c9a, getConfig()->height); // Set ResY - - idDisplayTextureCAVEAddress = (void *)0x08337200 + 5; - detourFunction(0x08337200, idDisplayTexture); - // FSAA - patchMemory(0x0855e4e2, "9090"); - patchMemory(0x0857dd69, "01"); // FSAA Enabled - setVariable(0x089ea1d0, 1); // FSAA Quality - // Fix Subtitles - float newCaptionY = ((getConfig()->height - 768.0) / 2) + 64.0; - setVariable(0x089a7d58, *(unsigned int *)&newCaptionY); - // Fix Subtitles Position - id4NewCaptionY = ((getConfig()->height - 768.0) / 2) + 64.0; - detourFunction(0x081f1051, yTxtPatch); - id4NewCaptionYCAVEAddress = (void *)(0x081f1051 + 8); - // Ballon fix - idDrawBallonCAVEAddress = (void *)0x081ef39e + 6; - id4DrawTextAddress = (void *)0x081f0504; - detourFunction(0x081ef39e, idDrawBallon); - replaceCallAtAddress(0x081f08fc, id4DrawText); - // Scale Testmode text - if (isTestMode() && getConfig()->width >= 1920) - { - patchMemory(0x0899bb78, "02"); - idTextShift = (getConfig()->width == 1920 ? 27 : ((1920 / getConfig()->width) * 27) + 2); - idTestTextAddress = (void *)0x08579c12; - replaceCallAtAddress(0x0835a09e, idTestText); - } - } - break; - case INITIALD_4_EXP_REVD: - { - if (getConfig()->width == 1360 && getConfig()->height == 768) - break; - setVariable(0x0837b12d, 0x0000f0e9); // Force set resolution - setVariable(0x0837b223, getConfig()->width); // Set ResX - setVariable(0x0837b228, getConfig()->height); // Set ResY - // Renderbuffer Resolution - setVariable(0x0825728a, getConfig()->width); // Set ResX - setVariable(0x08257282, getConfig()->height); // Set ResY - setVariable(0x0825734a, getConfig()->width); // Set ResX - setVariable(0x08257342, getConfig()->height); // Set ResY - setVariable(0x0825740a, getConfig()->width); // Set ResX - setVariable(0x08257402, getConfig()->height); // Set ResY - setVariable(0x08257469, getConfig()->width); // Set ResX - setVariable(0x08257461, getConfig()->height); // Set ResY - setVariable(0x08257d0f, getConfig()->width); // Set ResX - setVariable(0x08257d07, getConfig()->height); // Set ResY - setVariable(0x08257d9a, getConfig()->width); // Set ResX - setVariable(0x08257d92, getConfig()->height); // Set ResY - - idDisplayTextureCAVEAddress = (void *)0x08338d50 + 5; - detourFunction(0x08338d50, idDisplayTexture); - // FSAA - patchMemory(0x0855fff2, "9090"); - patchMemory(0x0857f879, "01"); // FSAA Enabled - setVariable(0x089ed930, 1); // FSAA Quality - // Fix Subtitles Position - id4NewCaptionY = ((getConfig()->height - 768.0) / 2) + 64.0; - detourFunction(0x081f2061, yTxtPatch); - id4NewCaptionYCAVEAddress = (void *)(0x081f2061 + 8); - // Ballon fix - idDrawBallonCAVEAddress = (void *)0x081f03be + 6; - id4DrawTextAddress = (void *)0x081f1524; - detourFunction(0x081f03be, idDrawBallon); - replaceCallAtAddress(0x081f191a, id4DrawText); - // Scale Testmode text - if (isTestMode() && getConfig()->width >= 1920) - { - patchMemory(0x0899f2d8, "02"); - idTextShift = (getConfig()->width == 1920 ? 27 : ((1920 / getConfig()->width) * 27) + 2); - idTestTextAddress = (void *)0x0857b722; - replaceCallAtAddress(0x0835bbee, idTestText); - } - } - break; case INITIALD_5_EXP: { if (getConfig()->width == 1360 && getConfig()->height == 768) @@ -2326,6 +2062,230 @@ int initResolutionPatches() } } break; + case LETS_GO_JUNGLE_REVA: + { + setVariable(0x082e1323, getConfig()->width); // Set ResX + setVariable(0x082e1330, getConfig()->height); // Set ResY + // FSAA + patchMemory(0x082e12ff, "01"); + } + break; + case LETS_GO_JUNGLE: + { + setVariable(0x082E006b, getConfig()->width); // Set ResX + setVariable(0x082E0078, getConfig()->height); // Set ResY + // FSAA + patchMemory(0x082e0047, "01"); + } + break; + case LETS_GO_JUNGLE_SPECIAL: + { + // setVariable(0x08303C4B, 0x00000780); // Set ResX + // setVariable(0x08303C58, 0x00000438); // Set ResY + } + break; + case MJ4_REVG: + { + // Not Supported yet. + // patchMemory(0x080524a1, "01"); // Enable Anti Alias + // patchMemory(0x08053668, "b80a000000"); // Skips resolution set by the Dip Switches. + // vf5FSwidth = (getConfig()->height * 4) / 3; + // setVariable(0x08901598, vf5FSwidth); + // setVariable(0x0890159c, getConfig()->height); + // setVariable(0x089015a4, vf5FSwidth); + + // setVariable(0x089015a8, getConfig()->height); + + // setVariable(0x08901544, vf5FSwidth); + // setVariable(0x08901548, getConfig()->height); + + // setVariable(0x0890158c, vf5FSwidth); + // setVariable(0x08901590, getConfig()->height); + } + break; + case OUTRUN_2_SP_SDX: + { + if (getConfig()->width <= 800 && getConfig()->height <= 480) + break; + // If resolution is not the native of the game this patch kind of fix the Sun when the LensGlare effect is + // shown. + if ((getConfig()->width > 800) && (getConfig()->height > 480)) + { + patchMemory(0x080e8e72, "9090909090"); // removes a call to a light function + patchMemory(0x080e8e83, "9090909090"); // removes a call to a light function + if (!getConfig()->outrunLensGlareEnabled) + { + detourFunction(0x080e8b34, stubReturn); // Completely disables the lens glare effect + } + } + setVariable(0x080b913a, 0x44200000); + setVariable(0x081dae28, 0x44200000); + setVariable(0x081dae30, 0x44200000); + } + break; + case OUTRUN_2_SP_SDX_TEST: + { + setVariable(0x0804a490, getConfig()->width); + setVariable(0x0804a4ad, getConfig()->height); + } + break; + case OUTRUN_2_SP_SDX_REVA: + { + if (getConfig()->width <= 800 && getConfig()->height <= 480) + break; + // If resolution is not the native of the game this patch kind of fix the Sun when the LensGlare effect is + // shown. + if ((getConfig()->width > 800) && (getConfig()->height > 480)) + { + patchMemory(0x080e8e06, "9090909090"); // removes a call to a light function + patchMemory(0x080e8e17, "9090909090"); // removes a call to a light function + if (!getConfig()->outrunLensGlareEnabled) + { + detourFunction(0x080e8ac8, stubReturn); // Completely disables the lens glare effect + } + } + setVariable(0x080b913a, 0x44200000); + setVariable(0x081dada8, 0x44200000); + setVariable(0x081dadb0, 0x44200000); + + // Cleans patched elf floating around + patchMemory(0x080b912e, "f043"); + patchMemory(0x080f39de, "c0ef43"); + patchMemory(0x080f3aa6, "2048"); + patchMemory(0x080f3c94, "04b91c"); + patchMemory(0x080f3cba, "20561b"); + patchMemory(0x080f40cf, "c047"); + patchMemory(0x080f40f8, "80ef43"); + patchMemory(0x080f4d80, "04b91c"); + patchMemory(0x080f4e52, "20561b"); + patchMemory(0x080fed40, "80ef43"); + patchMemory(0x080fed52, "c047"); + setVariable(0x081dadb4, 0x43f00000); + setVariable(0x081dadbc, 0x43f00000); + patchMemory(0x081e7b3e, "7e"); + patchMemory(0x081e7b46, "89"); + } + break; + case OUTRUN_2_SP_SDX_REVA_TEST: + case OUTRUN_2_SP_SDX_REVA_TEST2: + { + if (getConfig()->width <= 800 && getConfig()->height <= 480) + break; + setVariable(0x0804a490, getConfig()->width); + setVariable(0x0804a4ad, getConfig()->height); + } + break; + case PRIMEVAL_HUNT: + { + if (getConfig()->width <= 640 && getConfig()->height <= 480) + break; + phX = 0; + phY = 0; + phW = getConfig()->width; + phH = getConfig()->height; + int phX2, phY2, phW2, phH2; + switch (getConfig()->phMode) + { + case 0: + { + return 0; + } + case 1: // No touch screen + { + if (getConfig()->keepAspectRatio) + { + phX = (getConfig()->width - (getConfig()->height / 3) * 4) / 2; + phW = (getConfig()->height / 3) * 4; + } + phW2 = 0; + phH2 = 0; + phX2 = phW; + phY2 = 0; + } + break; + case 2: // Side by side + { + if (getConfig()->keepAspectRatio) + { + phH = ((getConfig()->width / 2) / 4) * 3; + phY = (getConfig()->height - phH) / 2; + } + phX = 0; + phW = phW / 2; + phX2 = phW; + phY2 = phY; + phW2 = phW; + phH2 = phH; + } + break; + case 3: // 3ds Mode 1 (Small screen to the right) + { + // We always force 4:3 aspect ratio for this mode. + phX = 0; + phW = (getConfig()->height / 3) * 4; + phH2 = ((getConfig()->width - phW) / 4) * 3; + + phX2 = phW; + phY2 = (phH - phH2) / 2; + phW2 = getConfig()->width - phW; + } + break; + case 4: + { + // We always force 4:3 aspect ratio for this mode. + phW = (getConfig()->height / 3) * 4; + phX2 = (getConfig()->width / 2) - ((getConfig()->width - phW) / 2); + phW2 = getConfig()->width - phW; + phY2 = 0; // phH - ((phW2 / 4) * 3); + phH2 = (phW2 / 4) * 3; + + phW = phW - phW2; + phH = phH - phH2; + phX = (getConfig()->width - (phH / 3) * 4) / 2; + phY = phH2; + } + break; + } + setVariable(0x0805b104, phX); // X 1st screen + setVariable(0x0805b0fd, phY); // Y 1st screen + setVariable(0x0805b0f5, phW); // Width 1st screen + setVariable(0x0805b0ed, phH); // Height 1st screen + + setVariable(0x0805afa2, phX2); // X 2nd screen + setVariable(0x0805af9b, phY2); // Y 2st screen + setVariable(0x0805af93, phW2); // Width 2nd screen + setVariable(0x0805af8b, phH2); // Height 2nd screen + // patchMemory(0x08052cc4, "0000"); // swap screens + detourFunction(0x0804c628, glClearColorPH); + if (getConfig()->phMode == 4) // In mode 4, the screens are inverted. + phY = 0; + } + break; + case RAMBO: + { + if (getConfig()->width <= 1360 && getConfig()->height <= 768) + break; + patchMemory(0x080c70d0, "9090909090"); // setresolutiontype + setVariable(0x08416df0, getConfig()->width); // render res + setVariable(0x08416d60, getConfig()->width); // main res + setVariable(0x08416d64, getConfig()->height); + patchMemory(0x08416d68, "5005"); // Allwinres + patchMemory(0x08416d6c, "0003"); + + patchMemory(0x080ef960, "66ff"); // 2d + patchMemory(0x0806b510, "b6"); // proper marker fix + // patchMemory(0x0806b4f6, "c3"); //get rid of shot marker + } + break; + case R_TUNED: + { + patchMemory(0x08051c2b, "01"); // Enable Anti Alias + patchMemory(0x08052d58, "b80a000000"); // Skips resolution set by the Dip Switches. + setVariable(0x083c7db8, getConfig()->width); + setVariable(0x083c7dbc, getConfig()->height); + patchMemory(0x083c7dc0, "00"); + } + break; case SEGABOOT_2_4_SYM: { patchMemory(0x08050ad3, "9090"); @@ -2351,6 +2311,255 @@ int initResolutionPatches() setVariable(0x08091252, getConfig()->height); } break; + case SEGA_RACE_TV: + { + if (getConfig()->width == 640 && getConfig()->height == 480) + break; + if (getConfig()->keepAspectRatio) + { + srtvX = (getConfig()->width - (getConfig()->height / 3) * 4) / 2; + srtvW = (getConfig()->height / 3) * 4; + } + else + { + srtvW = getConfig()->width; + } + srtvH = getConfig()->height; + } + break; + case THE_HOUSE_OF_THE_DEAD_4_REVA: + { + if (getConfig()->width <= 1280 && getConfig()->height <= 768) + break; + patchMemory(0x0804d142, "9090909090"); // setresolutiontype + // patchMemory(0x084c9dbc, "0005"); + // patchMemory(0x08448458, "0005"); + // patchMemory(0x0844845c, "0003"); + setVariable(0x084c9dbc, getConfig()->width); + setVariable(0x08448458, getConfig()->width); + setVariable(0x0844845c, getConfig()->height); + patchMemory(0x08448460, "0005"); + patchMemory(0x08448464, "0003"); + patchMemory(0x0817ff6d, "e80ed5ecff"); // call crtgetresolution + patchMemory(0x08448468, "0005"); // set crtgetresolution to 640x480 + patchMemory(0x0844846c, "0003"); + + setVariable(0x08448338, getConfig()->width); + setVariable(0x0844833c, getConfig()->height); + + detourFunction(0x0804c024, glVertex3fHOD4); + detourFunction(0x0804ca54, glBindTextureGE); + } + break; + case THE_HOUSE_OF_THE_DEAD_4_REVB: + { + if (getConfig()->width <= 1280 && getConfig()->height <= 768) + break; + patchMemory(0x0804d174, "9090909090"); // setresolutiontype + setVariable(0x084c3a9c, getConfig()->width); + setVariable(0x08443118, getConfig()->width); + setVariable(0x0844311c, getConfig()->height); + patchMemory(0x08443120, "0005"); + patchMemory(0x08443124, "0003"); + patchMemory(0x0818080d, "e89eccecff"); // call crtgetresolution + patchMemory(0x08443128, "0005"); // set crtgetresolution to 640x480 + patchMemory(0x0844312c, "0003"); + + setVariable(0x08442ff8, getConfig()->width); + setVariable(0x08442ffc, getConfig()->height); + + detourFunction(0x0804c014, glVertex3fHOD4); + detourFunction(0x0804ca84, glBindTextureGE); + } + break; + case THE_HOUSE_OF_THE_DEAD_4_REVC: + { + if (getConfig()->width <= 1280 && getConfig()->height <= 768) + { + setVariable(0x084c3a9c, 1280); + return 0; + } + patchMemory(0x0804d174, "9090909090"); // setresolutiontype + setVariable(0x084c3a9c, getConfig()->width); + setVariable(0x08443118, getConfig()->width); + setVariable(0x0844311c, getConfig()->height); + patchMemory(0x08443120, "0005"); // gallwinres (2D) + patchMemory(0x08443124, "0003"); + patchMemory(0x0818080d, "e89eccecff"); // sideselect fix + patchMemory(0x08443128, "0005"); + patchMemory(0x0844312c, "0003"); + + setVariable(0x08442ff8, getConfig()->width); + setVariable(0x08442ffc, getConfig()->height); + + detourFunction(0x0804c014, glVertex3fHOD4); + detourFunction(0x0804ca84, glBindTextureGE); + } + break; + case THE_HOUSE_OF_THE_DEAD_4_SPECIAL: + { + if (getConfig()->width <= 1024 && getConfig()->height <= 768) + break; + patchMemory(0x0804d2f4, "9090909090"); // setresolutiontype + setVariable(0x084563c4, getConfig()->width); + setVariable(0x08424448, getConfig()->width); + setVariable(0x0842444c, getConfig()->height); + patchMemory(0x0815bfa9, "e8de7f0100"); // sideselect fix + patchMemory(0x08424450, "0004"); + patchMemory(0x08424454, "0003"); + } + break; + case THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB: + { + if (getConfig()->width <= 1024 && getConfig()->height <= 768) + break; + patchMemory(0x0804d7e2, "9090909090"); // setresolutiontype + setVariable(0x084c35c4, getConfig()->width); + setVariable(0x08491648, getConfig()->width); + setVariable(0x0849164c, getConfig()->height); + patchMemory(0x081b268f, "e8264d0200"); // sideselect fix + patchMemory(0x08491650, "0004"); + patchMemory(0x08491654, "0003"); + } + break; + case THE_HOUSE_OF_THE_DEAD_EX: + { + } + break; + case TOO_SPICY: + { + patchMemory(0x08202b22, "0005"); // render res 1280 + } + break; + case VIRTUA_FIGHTER_5: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + return 0; + patchMemory(0x08054057, "b80a000000"); // Skips resolution set by the Dip Switches. + setVariable(0x0847cf58, getConfig()->width); + setVariable(0x0847cf5c, getConfig()->height); + replaceCallAtAddress(0x080d40c4, vf5WidthFix); + } + break; + case VIRTUA_FIGHTER_5_EXPORT: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x08052b97, "01"); // Enable Anti Alias + patchMemory(0x08053c67, "b80a000000"); // Skips resolution set by the Dip Switches. + setVariable(0x085259f8, getConfig()->width); + setVariable(0x085259fc, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVA: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x08054b5e, "01"); // Enable Anti Alias + patchMemory(0x08055980, "b80a000000"); // Skips resolution set by the Dip Switches. + vf5FSwidth = (getConfig()->height * 5) / 3; + setVariable(0x088b2bd8, vf5FSwidth); + setVariable(0x088b2bdc, getConfig()->height); + setVariable(0x088b2bec, getConfig()->width); + setVariable(0x088b2bf0, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x080548c4, "01"); // Enable Anti Alias + patchMemory(0x080556e6, "b80a000000"); // Skips resolution set by the Dip Switches. + vf5FSwidth = (getConfig()->height * 5) / 3; + setVariable(0x088d2b78, vf5FSwidth); + setVariable(0x088d2b7c, getConfig()->height); + setVariable(0x088d2b8c, getConfig()->width); + setVariable(0x088d2b90, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB_6000: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x08054bfe, "01"); // Enable Anti Alias + patchMemory(0x08055a20, "b80a000000"); // Skips resolution set by the Dip Switches. + vf5FSwidth = (getConfig()->height * 5) / 3; + setVariable(0x088d53d8, vf5FSwidth); + setVariable(0x088d53dc, getConfig()->height); + setVariable(0x088d53ec, getConfig()->width); + setVariable(0x088d53f0, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_R: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x0805421a, "01"); // Enable Anti Alias + patchMemory(0x080554b0, "b80a000000"); // Skips resolution set by the Dip Switches. + vf5FSwidth = (getConfig()->height * 5) / 3; + setVariable(0x08767d58, vf5FSwidth); + setVariable(0x08767d5c, getConfig()->height); + setVariable(0x08767d6c, getConfig()->width); + setVariable(0x08767d70, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_R_REVD: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x080543aa, "01"); // Enable Anti Alias + patchMemory(0x080555f6, "b80a000000"); // Skips resolution set by the Dip Switches. + vf5FSwidth = (getConfig()->height * 5) / 3; + setVariable(0x08822b18, vf5FSwidth); + setVariable(0x08822b1c, getConfig()->height); + setVariable(0x08822b2c, getConfig()->width); + setVariable(0x08822b30, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_R_REVG: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x0805436a, "01"); // Enable Anti Alias + patchMemory(0x0805577c, "b80a000000"); // Skips resolution set by the Dip Switches. + vf5FSwidth = (getConfig()->height * 5) / 3; + setVariable(0x0887d4d8, vf5FSwidth); + setVariable(0x0887d4dc, getConfig()->height); + setVariable(0x0887d4ec, getConfig()->width); + setVariable(0x0887d4f0, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_REVA: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x8053167, "01"); // Enable Anti Alias + patchMemory(0x080541af, "b80a000000"); // Skips resolution set by the Dip Switches. + setVariable(0x08487df8, getConfig()->width); + setVariable(0x08487dfc, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_REVB: + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x08053673, "01"); // Enable Anti Alias + patchMemory(0x080546cf, "b80a000000"); // Skips resolution set by the Dip Switches. + setVariable(0x08536bb8, getConfig()->width); + setVariable(0x08536bbc, getConfig()->height); + } + break; + case VIRTUA_FIGHTER_5_REVE: // Also the public REV C version + { + if ((getConfig()->width == 640 && getConfig()->height == 480) || (getConfig()->width == 1280 && getConfig()->height == 768)) + break; + patchMemory(0x080546c7, "01"); // Enable Anti Alias + patchMemory(0x080557a3, "b80a000000"); // Skips resolution set by the Dip Switches. + setVariable(0x085efb18, getConfig()->width); + setVariable(0x085efb1c, getConfig()->height); + } + break; + case VIRTUA_TENNIS_3: { if (getConfig()->width <= 1360 && getConfig()->height <= 768) @@ -2453,213 +2662,6 @@ int initResolutionPatches() setVariable(0x0806fb04, getConfig()->height); } break; - case RAMBO: - { - if (getConfig()->width <= 1360 && getConfig()->height <= 768) - break; - patchMemory(0x080c70d0, "9090909090"); // setresolutiontype - setVariable(0x08416df0, getConfig()->width); // render res - setVariable(0x08416d60, getConfig()->width); // main res - setVariable(0x08416d64, getConfig()->height); - patchMemory(0x08416d68, "5005"); // Allwinres - patchMemory(0x08416d6c, "0003"); - - patchMemory(0x080ef960, "66ff"); // 2d - patchMemory(0x0806b510, "b6"); // proper marker fix - // patchMemory(0x0806b4f6, "c3"); //get rid of shot marker - } - break; - case TOO_SPICY: - { - patchMemory(0x08202b22, "0005"); // render res 1280 - } - break; - case PRIMEVAL_HUNT: - { - if (getConfig()->width <= 640 && getConfig()->height <= 480) - break; - phX = 0; - phY = 0; - phW = getConfig()->width; - phH = getConfig()->height; - int phX2, phY2, phW2, phH2; - switch (getConfig()->phMode) - { - case 0: - { - return 0; - } - case 1: // No touch screen - { - if (getConfig()->keepAspectRatio) - { - phX = (getConfig()->width - (getConfig()->height / 3) * 4) / 2; - phW = (getConfig()->height / 3) * 4; - } - phW2 = 0; - phH2 = 0; - phX2 = phW; - phY2 = 0; - } - break; - case 2: // Side by side - { - if (getConfig()->keepAspectRatio) - { - phH = ((getConfig()->width / 2) / 4) * 3; - phY = (getConfig()->height - phH) / 2; - } - phX = 0; - phW = phW / 2; - phX2 = phW; - phY2 = phY; - phW2 = phW; - phH2 = phH; - } - break; - case 3: // 3ds Mode 1 (Small screen to the right) - { - // We always force 4:3 aspect ratio for this mode. - phX = 0; - phW = (getConfig()->height / 3) * 4; - phH2 = ((getConfig()->width - phW) / 4) * 3; - - phX2 = phW; - phY2 = (phH - phH2) / 2; - phW2 = getConfig()->width - phW; - } - break; - case 4: - { - // We always force 4:3 aspect ratio for this mode. - phW = (getConfig()->height / 3) * 4; - phX2 = (getConfig()->width / 2) - ((getConfig()->width - phW) / 2); - phW2 = getConfig()->width - phW; - phY2 = 0; // phH - ((phW2 / 4) * 3); - phH2 = (phW2 / 4) * 3; - - phW = phW - phW2; - phH = phH - phH2; - phX = (getConfig()->width - (phH / 3) * 4) / 2; - phY = phH2; - } - break; - } - setVariable(0x0805b104, phX); // X 1st screen - setVariable(0x0805b0fd, phY); // Y 1st screen - setVariable(0x0805b0f5, phW); // Width 1st screen - setVariable(0x0805b0ed, phH); // Height 1st screen - - setVariable(0x0805afa2, phX2); // X 2nd screen - setVariable(0x0805af9b, phY2); // Y 2st screen - setVariable(0x0805af93, phW2); // Width 2nd screen - setVariable(0x0805af8b, phH2); // Height 2nd screen - // patchMemory(0x08052cc4, "0000"); // swap screens - detourFunction(0x0804c628, glClearColorPH); - if (getConfig()->phMode == 4) // In mode 4, the screens are inverted. - phY = 0; - } - break; - case GHOST_SQUAD_EVOLUTION: - { - // test - // patchMemory(0x081c1d71, "38303078363030"); - setVariable(0x082c87f8, 0x00000550); - setVariable(0x082c87fc, 0x00000300); - } - break; - case HARLEY_DAVIDSON: - { - if (getConfig()->width <= 1360 && getConfig()->height <= 768) - break; - int w = getConfig()->width; - int h = getConfig()->height; - setVariable(0x088a57e0, w); // main res - setVariable(0x088a57e4, h); - setVariable(0x088a57e8, w); - setVariable(0x088a57ec, h); - setVariable(0x088a57f0, w); - setVariable(0x088a57f4, h); - setVariable(0x088a55e0, w); // render res - patchMemory(0x08056c31, "9090909090"); - // setVariable(0x08056c2d, w); // render res - patchMemory(0x082a8500, "9090909090"); // restype - patchMemory(0x088a55e4, "14"); - patchMemory(0x082a2412, "00008040"); // Fixes white logo background. - if (getConfig()->width > 1360) - { - unsigned int idx = ((21 * h) / 768) + 1; - setVariable(0x082a250e, idx); - } - } - break; - case HUMMER: - { - if (getConfig()->width <= 1280 && getConfig()->height <= 768) - break; - replaceCallAtAddress(0x080d8b58, hummerRespatch); - replaceCallAtAddress(0x080d8b73, hummerRespatch); - replaceCallAtAddress(0x080d8b8e, hummerRespatch); - replaceCallAtAddress(0x080d8ba9, hummerRespatch); - replaceCallAtAddress(0x080d8bfa, hummerRespatch); - replaceCallAtAddress(0x080d8c15, hummerRespatch); - } - break; - case HUMMER_SDLX: - { - if (getConfig()->width <= 1280 && getConfig()->height <= 768) - break; - replaceCallAtAddress(0x080d8b14, hummerRespatch); - replaceCallAtAddress(0x080d8b2f, hummerRespatch); - replaceCallAtAddress(0x080d8b4a, hummerRespatch); - replaceCallAtAddress(0x080d8b65, hummerRespatch); - replaceCallAtAddress(0x080d8bb6, hummerRespatch); - replaceCallAtAddress(0x080d8bd1, hummerRespatch); - } - break; - case HUMMER_EXTREME: - { - if (getConfig()->width <= 1280 && getConfig()->height <= 768) - break; - replaceCallAtAddress(0x08159eab, hummerRespatch); - replaceCallAtAddress(0x08159ec9, hummerRespatch); - replaceCallAtAddress(0x08159ee7, hummerRespatch); - replaceCallAtAddress(0x08159f05, hummerRespatch); - replaceCallAtAddress(0x08159f5f, hummerRespatch); - replaceCallAtAddress(0x08159f7d, hummerRespatch); - } - break; - case HUMMER_EXTREME_MDX: - { - if (getConfig()->width <= 1280 && getConfig()->height <= 768) - break; - replaceCallAtAddress(0x0816348b, hummerRespatch); - replaceCallAtAddress(0x081634a9, hummerRespatch); - replaceCallAtAddress(0x081634c7, hummerRespatch); - replaceCallAtAddress(0x081634e5, hummerRespatch); - replaceCallAtAddress(0x0816353f, hummerRespatch); - replaceCallAtAddress(0x0816355d, hummerRespatch); - } - break; - case MJ4_REVG: - { - // Not Supported yet. - // patchMemory(0x080524a1, "01"); // Enable Anti Alias - // patchMemory(0x08053668, "b80a000000"); // Skips resolution set by the Dip Switches. - // vf5FSwidth = (getConfig()->height * 4) / 3; - // setVariable(0x08901598, vf5FSwidth); - // setVariable(0x0890159c, getConfig()->height); - // setVariable(0x089015a4, vf5FSwidth); - - // setVariable(0x089015a8, getConfig()->height); - - // setVariable(0x08901544, vf5FSwidth); - // setVariable(0x08901548, getConfig()->height); - - // setVariable(0x0890158c, vf5FSwidth); - // setVariable(0x08901590, getConfig()->height); - } - break; default: break; }