mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 00:39:23 +01:00
Merge pull request #10922 from Pokechu22/apploader-hle-no-replace
Boot_BS2Emu: Create an actual function for AppLoaderReport
This commit is contained in:
commit
4b6ad977c6
@ -148,7 +148,7 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume,
|
|||||||
// TODO - Make Apploader(or just RunFunction()) debuggable!!!
|
// TODO - Make Apploader(or just RunFunction()) debuggable!!!
|
||||||
|
|
||||||
// Call iAppLoaderEntry.
|
// Call iAppLoaderEntry.
|
||||||
DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderEntry");
|
DEBUG_LOG_FMT(BOOT, "Call iAppLoaderEntry");
|
||||||
const u32 iAppLoaderFuncAddr = is_wii ? 0x80004000 : 0x80003100;
|
const u32 iAppLoaderFuncAddr = is_wii ? 0x80004000 : 0x80003100;
|
||||||
PowerPC::ppcState.gpr[3] = iAppLoaderFuncAddr + 0;
|
PowerPC::ppcState.gpr[3] = iAppLoaderFuncAddr + 0;
|
||||||
PowerPC::ppcState.gpr[4] = iAppLoaderFuncAddr + 4;
|
PowerPC::ppcState.gpr[4] = iAppLoaderFuncAddr + 4;
|
||||||
@ -159,15 +159,16 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume,
|
|||||||
const u32 iAppLoaderClose = PowerPC::Read_U32(iAppLoaderFuncAddr + 8);
|
const u32 iAppLoaderClose = PowerPC::Read_U32(iAppLoaderFuncAddr + 8);
|
||||||
|
|
||||||
// iAppLoaderInit
|
// iAppLoaderInit
|
||||||
DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderInit");
|
DEBUG_LOG_FMT(BOOT, "Call iAppLoaderInit");
|
||||||
HLE::Patch(0x81300000, "AppLoaderReport"); // HLE OSReport for Apploader
|
PowerPC::HostWrite_U32(0x4E800020, 0x81300000); // Write BLR
|
||||||
|
HLE::Patch(0x81300000, "AppLoaderReport"); // HLE OSReport for Apploader
|
||||||
PowerPC::ppcState.gpr[3] = 0x81300000;
|
PowerPC::ppcState.gpr[3] = 0x81300000;
|
||||||
RunFunction(iAppLoaderInit);
|
RunFunction(iAppLoaderInit);
|
||||||
|
|
||||||
// iAppLoaderMain - Here we load the apploader, the DOL (the exe) and the FST (filesystem).
|
// iAppLoaderMain - Here we load the apploader, the DOL (the exe) and the FST (filesystem).
|
||||||
// To give you an idea about where the stuff is located on the disc take a look at yagcd
|
// To give you an idea about where the stuff is located on the disc take a look at yagcd
|
||||||
// ch 13.
|
// ch 13.
|
||||||
DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderMain");
|
DEBUG_LOG_FMT(BOOT, "Call iAppLoaderMain");
|
||||||
|
|
||||||
PowerPC::ppcState.gpr[3] = 0x81300004;
|
PowerPC::ppcState.gpr[3] = 0x81300004;
|
||||||
PowerPC::ppcState.gpr[4] = 0x81300008;
|
PowerPC::ppcState.gpr[4] = 0x81300008;
|
||||||
@ -185,7 +186,7 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume,
|
|||||||
const u32 length = PowerPC::Read_U32(0x81300008);
|
const u32 length = PowerPC::Read_U32(0x81300008);
|
||||||
const u32 dvd_offset = PowerPC::Read_U32(0x8130000c) << (is_wii ? 2 : 0);
|
const u32 dvd_offset = PowerPC::Read_U32(0x8130000c) << (is_wii ? 2 : 0);
|
||||||
|
|
||||||
INFO_LOG_FMT(MASTER_LOG, "DVDRead: offset: {:08x} memOffset: {:08x} length: {}", dvd_offset,
|
INFO_LOG_FMT(BOOT, "DVDRead: offset: {:08x} memOffset: {:08x} length: {}", dvd_offset,
|
||||||
ram_address, length);
|
ram_address, length);
|
||||||
DVDRead(volume, dvd_offset, ram_address, length, partition);
|
DVDRead(volume, dvd_offset, ram_address, length, partition);
|
||||||
|
|
||||||
@ -199,7 +200,7 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// iAppLoaderClose
|
// iAppLoaderClose
|
||||||
DEBUG_LOG_FMT(MASTER_LOG, "call iAppLoaderClose");
|
DEBUG_LOG_FMT(BOOT, "call iAppLoaderClose");
|
||||||
RunFunction(iAppLoaderClose);
|
RunFunction(iAppLoaderClose);
|
||||||
HLE::UnPatch("AppLoaderReport");
|
HLE::UnPatch("AppLoaderReport");
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ const char* ElfReader::GetSectionName(int section) const
|
|||||||
// This is just a simple elf loader, good enough to load elfs generated by devkitPPC
|
// This is just a simple elf loader, good enough to load elfs generated by devkitPPC
|
||||||
bool ElfReader::LoadIntoMemory(bool only_in_mem1) const
|
bool ElfReader::LoadIntoMemory(bool only_in_mem1) const
|
||||||
{
|
{
|
||||||
INFO_LOG_FMT(MASTER_LOG, "String section: {}", header->e_shstrndx);
|
INFO_LOG_FMT(BOOT, "String section: {}", header->e_shstrndx);
|
||||||
|
|
||||||
if (bRelocate)
|
if (bRelocate)
|
||||||
{
|
{
|
||||||
@ -133,14 +133,14 @@ bool ElfReader::LoadIntoMemory(bool only_in_mem1) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_LOG_FMT(MASTER_LOG, "{} segments:", header->e_phnum);
|
INFO_LOG_FMT(BOOT, "{} segments:", header->e_phnum);
|
||||||
|
|
||||||
// Copy segments into ram.
|
// Copy segments into ram.
|
||||||
for (int i = 0; i < header->e_phnum; i++)
|
for (int i = 0; i < header->e_phnum; i++)
|
||||||
{
|
{
|
||||||
Elf32_Phdr* p = segments + i;
|
Elf32_Phdr* p = segments + i;
|
||||||
|
|
||||||
INFO_LOG_FMT(MASTER_LOG, "Type: {} Vaddr: {:08x} Filesz: {} Memsz: {}", p->p_type, p->p_vaddr,
|
INFO_LOG_FMT(BOOT, "Type: {} Vaddr: {:08x} Filesz: {} Memsz: {}", p->p_type, p->p_vaddr,
|
||||||
p->p_filesz, p->p_memsz);
|
p->p_filesz, p->p_memsz);
|
||||||
|
|
||||||
if (p->p_type == PT_LOAD)
|
if (p->p_type == PT_LOAD)
|
||||||
@ -157,12 +157,11 @@ bool ElfReader::LoadIntoMemory(bool only_in_mem1) const
|
|||||||
if (srcSize < dstSize)
|
if (srcSize < dstSize)
|
||||||
Memory::Memset(writeAddr + srcSize, 0, dstSize - srcSize); // zero out bss
|
Memory::Memset(writeAddr + srcSize, 0, dstSize - srcSize); // zero out bss
|
||||||
|
|
||||||
INFO_LOG_FMT(MASTER_LOG, "Loadable Segment Copied to {:08x}, size {:08x}", writeAddr,
|
INFO_LOG_FMT(BOOT, "Loadable Segment Copied to {:08x}, size {:08x}", writeAddr, p->p_memsz);
|
||||||
p->p_memsz);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_LOG_FMT(MASTER_LOG, "Done loading.");
|
INFO_LOG_FMT(BOOT, "Done loading.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ constexpr std::array<Hook, 23> os_patches{{
|
|||||||
|
|
||||||
{"GeckoCodehandler", HLE_Misc::GeckoCodeHandlerICacheFlush, HookType::Start, HookFlag::Fixed},
|
{"GeckoCodehandler", HLE_Misc::GeckoCodeHandlerICacheFlush, HookType::Start, HookFlag::Fixed},
|
||||||
{"GeckoHandlerReturnTrampoline", HLE_Misc::GeckoReturnTrampoline, HookType::Replace, HookFlag::Fixed},
|
{"GeckoHandlerReturnTrampoline", HLE_Misc::GeckoReturnTrampoline, HookType::Replace, HookFlag::Fixed},
|
||||||
{"AppLoaderReport", HLE_OS::HLE_GeneralDebugPrint, HookType::Replace, HookFlag::Fixed} // apploader needs OSReport-like function
|
{"AppLoaderReport", HLE_OS::HLE_GeneralDebugPrint, HookType::Start, HookFlag::Fixed} // apploader needs OSReport-like function
|
||||||
}};
|
}};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user