From eb6f0a7258fcc28f1fcd07f435fdf674b05079a2 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 1 Aug 2017 15:28:06 +0200 Subject: [PATCH] Boot: Remove volume parameter from SetupWiiMemory --- Source/Core/Core/Boot/Boot.cpp | 2 +- Source/Core/Core/Boot/Boot.h | 2 +- Source/Core/Core/Boot/Boot_BS2Emu.cpp | 10 ++++------ Source/Core/Core/Boot/Boot_WiiWAD.cpp | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 1b32f5854b..052f4eabe0 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -332,7 +332,7 @@ bool CBoot::BootUp(std::unique_ptr boot) HID4.SBE = 1; // Because there is no TMD to get the requested system (IOS) version from, // we default to IOS58, which is the version used by the Homebrew Channel. - SetupWiiMemory(nullptr, 0x000000010000003a); + SetupWiiMemory(0x000000010000003a); } else { diff --git a/Source/Core/Core/Boot/Boot.h b/Source/Core/Core/Boot/Boot.h index 333f0e4fc5..041a27f294 100644 --- a/Source/Core/Core/Boot/Boot.h +++ b/Source/Core/Core/Boot/Boot.h @@ -108,7 +108,7 @@ private: static bool Load_BS2(const std::string& boot_rom_filename); static void SetupGCMemory(); - static bool SetupWiiMemory(const DiscIO::Volume* volume, u64 ios_title_id); + static bool SetupWiiMemory(u64 ios_title_id); }; class BootExecutableReader diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp index 21503de918..b3e3fb3fa0 100644 --- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp +++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp @@ -216,7 +216,7 @@ bool CBoot::EmulatedBS2_GC(const DiscIO::Volume* volume) return RunApploader(/*is_wii*/ false, *volume); } -bool CBoot::SetupWiiMemory(const DiscIO::Volume* volume, u64 ios_title_id) +bool CBoot::SetupWiiMemory(u64 ios_title_id) { static const std::map region_settings = { {DiscIO::Region::NTSC_J, {"JPN", "NTSC", "JP", "LJ"}}, @@ -282,10 +282,6 @@ bool CBoot::SetupWiiMemory(const DiscIO::Volume* volume, u64 ios_title_id) 0x80000060 Copyright code */ - // When booting a WAD or the system menu, there will probably not be a disc inserted - if (volume) - DVDRead(*volume, 0x00000000, 0x00000000, 0x20, DiscIO::PARTITION_NONE); // Game Code - Memory::Write_U32(0x0D15EA5E, 0x00000020); // Another magic word Memory::Write_U32(0x00000001, 0x00000024); // Unknown Memory::Write_U32(Memory::REALRAM_SIZE, 0x00000028); // MEM1 size 24MB @@ -345,9 +341,11 @@ bool CBoot::EmulatedBS2_Wii(const DiscIO::Volume* volume) if (!tmd.IsValid()) return false; - if (!SetupWiiMemory(volume, tmd.GetIOSId())) + if (!SetupWiiMemory(tmd.GetIOSId())) return false; + DVDRead(*volume, 0x00000000, 0x00000000, 0x20, DiscIO::PARTITION_NONE); // Game Code + // This is some kind of consistency check that is compared to the 0x00 // values as the game boots. This location keeps the 4 byte ID for as long // as the game is running. The 6 byte ID at 0x00 is overwritten sometime diff --git a/Source/Core/Core/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Boot/Boot_WiiWAD.cpp index cb2f3e9c10..145ae48a1f 100644 --- a/Source/Core/Core/Boot/Boot_WiiWAD.cpp +++ b/Source/Core/Core/Boot/Boot_WiiWAD.cpp @@ -94,7 +94,7 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename) IOS::HLE::CreateVirtualFATFilesystem(); // setup Wii memory - if (!SetupWiiMemory(nullptr, ContentLoader.GetTMD().GetIOSId())) + if (!SetupWiiMemory(ContentLoader.GetTMD().GetIOSId())) return false; IOS::HLE::Device::ES::LoadWAD(_pFilename);