diff --git a/Data/User/GameConfig/GBZP08.ini b/Data/User/GameConfig/GBZP08.ini index 24b2623f64..d03534d7bf 100644 --- a/Data/User/GameConfig/GBZP08.ini +++ b/Data/User/GameConfig/GBZP08.ini @@ -5,66 +5,66 @@ EmulationStateId = 5 EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. -+$Can always save -+04153E00 38000037 -+04153A50 60000000 -+$Zero saves -+0233B832 00000000 -+$Have all maps -+022961C2 0000FFFF -+$Have all files -+022961C0 0000FFFB -+022961C6 0000FFFF -+$Timers don't decrease -+043835C0 00015F91 -+$Infinite Ammo (All slots) -+04152D34 3BC00063 -+04152D60 60000000 -+$Infinite health (REBECCA) -+0431CA4C 00000100 -+$Infinite Ammo [All Slots] (R) -+023272EA 00000063 -+023272EE 00000063 -+023272F2 00000063 -+023272F6 00000063 -+023272FA 00000063 -+023272FE 00000063 -+$Slot 1/2: Hunting gun (R) -+023272E8 00000005 -+$Slot 1/2: Shotgun (R) -+023272E8 00000006 -+$Slot 1/2: Grenade Launcher (R) -+023272E8 00000007 -+$Slot 1/2: Sub-machine gun (R) -+023272E8 0000000B -+$Slot 1/2: Rocket Launcher (R) -+023272E8 00000017 -+$Slot 3: Magnum Revolver (R) -+023272F0 00000016 -+$Slot 4: Moltov cocktails (R) -+023272F4 0000000E -+$Infinite health (BILLY) -+0231CC76 00000100 -+$Slot 1/2: Hunting gun (B) -+02327308 00000005 -+$Slot 1/2: Shotgun (B) -+02327308 00000006 -+$Slot 1/2: Grenade Launcher (B) -+02327308 00000007 -+$Slot 1/2: Sub-machine gun (B) -+02327308 0000000B -+$Slot 1/2: Rocket Launcher (B) -+02327308 00000017 -+$Slot 3: Magnum Revolver (B) -+02327310 00000016 -+$Infinite Ammo [All Slots] (B) -+0232730A 00000063 -+0232730E 00000063 -+02327312 00000063 -+02327316 00000063 -+0232731A 00000063 -+0232731E 00000063 -+$Slot 4: Moltov cocktails (B) -+02327214 0000000E +$Can always save +04153E00 38000037 +04153A50 60000000 +$Zero saves +0233B832 00000000 +$Have all maps +022961C2 0000FFFF +$Have all files +022961C0 0000FFFB +022961C6 0000FFFF +$Timers don't decrease +043835C0 00015F91 +$Infinite Ammo (All slots) +04152D34 3BC00063 +04152D60 60000000 +$Infinite health (REBECCA) +0431CA4C 00000100 +$Infinite Ammo [All Slots] (R) +023272EA 00000063 +023272EE 00000063 +023272F2 00000063 +023272F6 00000063 +023272FA 00000063 +023272FE 00000063 +$Slot 1/2: Hunting gun (R) +023272E8 00000005 +$Slot 1/2: Shotgun (R) +023272E8 00000006 +$Slot 1/2: Grenade Launcher (R) +023272E8 00000007 +$Slot 1/2: Sub-machine gun (R) +023272E8 0000000B +$Slot 1/2: Rocket Launcher (R) +023272E8 00000017 +$Slot 3: Magnum Revolver (R) +023272F0 00000016 +$Slot 4: Moltov cocktails (R) +023272F4 0000000E +$Infinite health (BILLY) +0231CC76 00000100 +$Slot 1/2: Hunting gun (B) +02327308 00000005 +$Slot 1/2: Shotgun (B) +02327308 00000006 +$Slot 1/2: Grenade Launcher (B) +02327308 00000007 +$Slot 1/2: Sub-machine gun (B) +02327308 0000000B +$Slot 1/2: Rocket Launcher (B) +02327308 00000017 +$Slot 3: Magnum Revolver (B) +02327310 00000016 +$Infinite Ammo [All Slots] (B) +0232730A 00000063 +0232730E 00000063 +02327312 00000063 +02327316 00000063 +0232731A 00000063 +0232731E 00000063 +$Slot 4: Moltov cocktails (B) +02327214 0000000E [Video] ProjectionHack = 0 diff --git a/Data/User/GameConfig/GGSPA4.ini b/Data/User/GameConfig/GGSPA4.ini index a2073ecc52..7a85c1c966 100644 --- a/Data/User/GameConfig/GGSPA4.ini +++ b/Data/User/GameConfig/GGSPA4.ini @@ -8,111 +8,111 @@ EmulationStateId = 4 EmulationIssues = [OnFrame] [ActionReplay] -+$Infinite Health -+425577DC 02D90064 -+6C5577DC 81000000 -+425577DC 015C0064 -+425577DC 02310064 -+$Infinite Oxygen -+025666B6 00000DAC -+$No Reload -+325B08F6 0000000F -+025B08FA 00000019 -+2A5B08F6 00000010 -+025B08FA 0000000F -+$Max Grip Level -+025666E8 0000012C -+$Have Infinite Rations -+025668FA 00000005 -+$Have Infinite Medicine -+025668FE 00000001 -+$Have Infinite Bandages -+02566900 0000000A -+$Have Infinite Pentazem -+02566902 0000000A -+$Have Body Armor -+02566906 00000001 -+$Have Mine Detector -+0256690A 00000001 -+$Have RP Sensor -+0256692A 00000001 -+$Have Gas Mask -+0256690E 00000001 -+$Have Night Vision Goggles -+02566910 00000001 -+$Have Thermal Goggles -+02566912 00000001 -+$Have Scope -+02566914 00000001 -+$Have Digital Camera -+02566916 00000001 -+$Have Rope -+02566920 00000001 -+$Have Handkerchief -+0256694A 00000001 -+$Have Box 1 -+02566918 00000001 -+$Have Box 2 -+02566924 00000001 -+$Have Box 3 -+02566926 00000001 -+$Have Ketchup -+02566928 00000001 -+$Have SOCOM Suppressor -+02566932 00000001 -+$Have MO Disc -+0256693C 00000001 -+$Have Level 99 Keycard -+0256691C 00000063 -+$Have Bandana -+02566938 00000001 -+$Have Stealth Suit -+02566908 00000001 -+$Have M9 (Infinite Ammo) -+0256686A 0000002E -+$Have SOCOM (Infinite Ammo) -+0256686E 0000003D -+$Have PSG1 (Infinite Ammo) -+02566870 0000003D -+$Have Nikita (Infinite Ammo) -+02566874 00000028 -+$Have Stinger (Infinite Ammo) -+02566876 00000028 -+$Have Claymore (Infinite Ammo) -+02566878 00000010 -+$Have C4 (Infinite Ammo) -+0256687A 00000010 -+$Have Chaff Grenade (Infinite Ammo) -+0256687C 00000014 -+$Have Stun Grenade (Infinite Ammo) -+0256687E 00000014 -+$Have Grenade (Infinite Ammo) -+0256688A 00000014 -+$Have FAMAS (Infinite Ammo) -+0256688C 000000D3 -+$Have PSG1-T (Infinite Ammo) -+0256688E 0000003D -+$Have Book (Infinite Ammo) -+02566892 00000005 -+$Have Magazine (Infinite Ammo) -+02566888 00000064 -+$Have No PAL Key -+0256694C 00000000 -+$Have Warm (Yellow) PAL Key -+0256694C 00000001 -+$Have Cold (Blue) PAL Key -+0256694C 00000002 -+$Have Hot (Red) PAL Key -+0256694C 00000003 -+$Low Total Game Time -+045666F4 000000A0 -+$Saved 0 Times -+025666F2 00000000 -+$Continued 0 Times -+025666EC 00000000 -+$999 Kills -+02566700 000003E7 -+$0 Rations Used -+02567B4C 00000000 +$Infinite Health +425577DC 02D90064 +6C5577DC 81000000 +425577DC 015C0064 +425577DC 02310064 +$Infinite Oxygen +025666B6 00000DAC +$No Reload +325B08F6 0000000F +025B08FA 00000019 +2A5B08F6 00000010 +025B08FA 0000000F +$Max Grip Level +025666E8 0000012C +$Have Infinite Rations +025668FA 00000005 +$Have Infinite Medicine +025668FE 00000001 +$Have Infinite Bandages +02566900 0000000A +$Have Infinite Pentazem +02566902 0000000A +$Have Body Armor +02566906 00000001 +$Have Mine Detector +0256690A 00000001 +$Have RP Sensor +0256692A 00000001 +$Have Gas Mask +0256690E 00000001 +$Have Night Vision Goggles +02566910 00000001 +$Have Thermal Goggles +02566912 00000001 +$Have Scope +02566914 00000001 +$Have Digital Camera +02566916 00000001 +$Have Rope +02566920 00000001 +$Have Handkerchief +0256694A 00000001 +$Have Box 1 +02566918 00000001 +$Have Box 2 +02566924 00000001 +$Have Box 3 +02566926 00000001 +$Have Ketchup +02566928 00000001 +$Have SOCOM Suppressor +02566932 00000001 +$Have MO Disc +0256693C 00000001 +$Have Level 99 Keycard +0256691C 00000063 +$Have Bandana +02566938 00000001 +$Have Stealth Suit +02566908 00000001 +$Have M9 (Infinite Ammo) +0256686A 0000002E +$Have SOCOM (Infinite Ammo) +0256686E 0000003D +$Have PSG1 (Infinite Ammo) +02566870 0000003D +$Have Nikita (Infinite Ammo) +02566874 00000028 +$Have Stinger (Infinite Ammo) +02566876 00000028 +$Have Claymore (Infinite Ammo) +02566878 00000010 +$Have C4 (Infinite Ammo) +0256687A 00000010 +$Have Chaff Grenade (Infinite Ammo) +0256687C 00000014 +$Have Stun Grenade (Infinite Ammo) +0256687E 00000014 +$Have Grenade (Infinite Ammo) +0256688A 00000014 +$Have FAMAS (Infinite Ammo) +0256688C 000000D3 +$Have PSG1-T (Infinite Ammo) +0256688E 0000003D +$Have Book (Infinite Ammo) +02566892 00000005 +$Have Magazine (Infinite Ammo) +02566888 00000064 +$Have No PAL Key +0256694C 00000000 +$Have Warm (Yellow) PAL Key +0256694C 00000001 +$Have Cold (Blue) PAL Key +0256694C 00000002 +$Have Hot (Red) PAL Key +0256694C 00000003 +$Low Total Game Time +045666F4 000000A0 +$Saved 0 Times +025666F2 00000000 +$Continued 0 Times +025666EC 00000000 +$999 Kills +02566700 000003E7 +$0 Rations Used +02567B4C 00000000 [Video] ProjectionHack = 0 diff --git a/Data/User/GameConfig/GWWP01.ini b/Data/User/GameConfig/GWWP01.ini index 43854a4209..fb9c11b925 100644 --- a/Data/User/GameConfig/GWWP01.ini +++ b/Data/User/GameConfig/GWWP01.ini @@ -5,42 +5,42 @@ EmulationStateId = 5 EmulationIssues = [OnFrame] Add memory patches to be applied every frame here. [ActionReplay] Add action replay cheats here. -+$Infinite/max health -+04114244 3800000E -+$Lots of coins -+04030764 38007FFF -+$All levels open -+041D8BEC FFFFFFFF -+$Moon Jump (Hold A) -+04111B74 3D803E00 -+04111B78 618C01CE -+0A439104 00000100 -+04111B7C 919E0208 -+0A439104 00000000 -+04111B7C 60000000 -+$All levels open and complete + GBA games -+041D8BEC FFFFFFFF -+041D8BF4 FFFFFFFF -+041D8BF8 FFFFFFFF -+021D8BFC 0000FFFF -+041D8C04 FFFFFFFF -+041D8C08 FFFFFFFF -+021D8C0C 0000FFFF -+041D8C24 FFFFFFFF -+041D8C28 FFFFFFFF -+021D8C2C 0000FFFF -+041D8C34 FFFFFFFF -+041D8C38 FFFFFFFF -+021D8C3C 0000FFFF -+041D8C54 FFFFFFFF -+041D8C58 FFFFFFFF -+021D8C5C 0000FFFF -+041D8C64 FFFFFFFF -+041D8C68 FFFFFFFF -+021D8C6C 0000FFFF -+041D8C84 FFFFFFFF -+041D8C88 FFFFFFFF -+021D8C8C 0000FFFF -+041D8C94 FFFFFFFF -+041D8C98 FFFFFFFF -+021D8C9C 0000FFFF \ No newline at end of file +$Infinite/max health +04114244 3800000E +$Lots of coins +04030764 38007FFF +$All levels open +041D8BEC FFFFFFFF +$Moon Jump (Hold A) +04111B74 3D803E00 +04111B78 618C01CE +0A439104 00000100 +04111B7C 919E0208 +0A439104 00000000 +04111B7C 60000000 +$All levels open and complete GBA games +041D8BEC FFFFFFFF +041D8BF4 FFFFFFFF +041D8BF8 FFFFFFFF +021D8BFC 0000FFFF +041D8C04 FFFFFFFF +041D8C08 FFFFFFFF +021D8C0C 0000FFFF +041D8C24 FFFFFFFF +041D8C28 FFFFFFFF +021D8C2C 0000FFFF +041D8C34 FFFFFFFF +041D8C38 FFFFFFFF +021D8C3C 0000FFFF +041D8C54 FFFFFFFF +041D8C58 FFFFFFFF +021D8C5C 0000FFFF +041D8C64 FFFFFFFF +041D8C68 FFFFFFFF +021D8C6C 0000FFFF +041D8C84 FFFFFFFF +041D8C88 FFFFFFFF +021D8C8C 0000FFFF +041D8C94 FFFFFFFF +041D8C98 FFFFFFFF +021D8C9C 0000FFFF \ No newline at end of file diff --git a/Source/Core/Core/Src/Boot/Boot.cpp b/Source/Core/Core/Src/Boot/Boot.cpp index 9a1b4fed85..5a9880533e 100644 --- a/Source/Core/Core/Src/Boot/Boot.cpp +++ b/Source/Core/Core/Src/Boot/Boot.cpp @@ -47,6 +47,8 @@ #include "../ConfigManager.h" #include "VolumeCreator.h" // DiscIO #include "NANDContentLoader.h" +#include "Hash.h" +#include "CommonPaths.h" void CBoot::Load_FST(bool _bIsWii) { @@ -140,11 +142,41 @@ bool CBoot::LoadMapFromFilename(const std::string &_rFilename, const char *_game // It does not initialize the hardware or anything else like BS1 does. bool CBoot::Load_BS2(const std::string& _rBootROMFilename) { + const u32 USA = 0x1FCE3FD6; + const u32 USA_v1_1 = 0x4D5935D1; + const u32 JAP = 0x87424396; + const u32 PAL = 0xA0EA7341; + //const u32 PanasonicQJ = 0xAEA8265C; + //const u32 PanasonicQU = 0x94015753; + // Load the whole ROM dump std::string data; if (!File::ReadFileToString(false, _rBootROMFilename.c_str(), data)) return false; + u32 ipl_hash = HashAdler32((const u8*)data.data(), data.size()); + std::string ipl_region; + switch (ipl_hash) + { + case USA: + case USA_v1_1: + ipl_region = USA_DIR; + break; + case JAP: + ipl_region = JAP_DIR; + break; + case PAL: + ipl_region = EUR_DIR; + break; + default: + PanicAlert("IPL with unknown hash %x", ipl_hash); + break; + } + + std::string BootRegion = _rBootROMFilename.substr(_rBootROMFilename.find_last_of(DIR_SEP) - 3, 3); + if (BootRegion != ipl_region) + PanicAlert("%s ipl found in %s directory, the disc may not be recognized", ipl_region.c_str(), BootRegion.c_str()); + // Run the descrambler over the encrypted section containing BS1/BS2 CEXIIPL::Descrambler((u8*)data.data()+0x100, 0x1AFE00);