diff --git a/Externals/Bochs_disasm/Bochs_disasm.vcproj b/Externals/Bochs_disasm/Bochs_disasm.vcproj index ea70c75150..7d8c26fe7b 100644 --- a/Externals/Bochs_disasm/Bochs_disasm.vcproj +++ b/Externals/Bochs_disasm/Bochs_disasm.vcproj @@ -234,6 +234,7 @@ /> m_pData, pContent->m_Size); + // setup wii mem + if (!SetupWiiMemory(ContentLoader.GetCountry())) + return false; + + // DOL + const DiscIO::SNANDContent* pContent = ContentLoader.GetContentByIndex(ContentLoader.GetBootIndex()); + if (pContent == NULL) + return false; + + WII_IPC_HLE_Interface::SetDefaultContentFile(_pFilename); + + CDolLoader DolLoader(pContent->m_pData, pContent->m_Size); PC = DolLoader.GetEntryPoint() | 0x80000000; // Pass the "#002 check" @@ -80,17 +80,17 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename) if (pVolume != NULL) PatchEngine::LoadPatches(pVolume->GetUniqueID().c_str()); - return true; + return true; } bool CBoot::Install_WiiWAD(const char* _pFilename) -{ +{ if (!IsWiiWAD(_pFilename)) return false; - const DiscIO::INANDContentLoader& ContentLoader = DiscIO::CNANDContentManager::Access().GetNANDLoader(_pFilename); - if (ContentLoader.IsValid() == false) - return false; + const DiscIO::INANDContentLoader& ContentLoader = DiscIO::CNANDContentManager::Access().GetNANDLoader(_pFilename); + if (ContentLoader.IsValid() == false) + return false; u64 TitleID = ContentLoader.GetTitleID(); u32 TitleID_HI = (u32)(TitleID >> 32); @@ -102,16 +102,16 @@ bool CBoot::Install_WiiWAD(const char* _pFilename) sprintf(ContentPath, "%stitle/%08x/%08x/content/", File::GetUserPath(D_WIIUSER_IDX), TitleID_HI, TitleID_LO); File::CreateFullPath(ContentPath); - std::string TMDFileName(ContentPath); + std::string TMDFileName(ContentPath); TMDFileName += "title.tmd"; - FILE* pTMDFile = fopen(TMDFileName.c_str(), "wb"); - if (pTMDFile == NULL) { + FILE* pTMDFile = fopen(TMDFileName.c_str(), "wb"); + if (pTMDFile == NULL) { PanicAlert("WAD installation failed: error creating %s", TMDFileName.c_str()); - return false; + return false; } - fwrite(ContentLoader.GetTmdHeader(), DiscIO::INANDContentLoader::TMD_HEADER_SIZE, 1, pTMDFile); + fwrite(ContentLoader.GetTmdHeader(), DiscIO::INANDContentLoader::TMD_HEADER_SIZE, 1, pTMDFile); for (u32 i = 0; i < ContentLoader.GetContentSize(); i++) { @@ -160,9 +160,9 @@ bool CBoot::Install_WiiWAD(const char* _pFilename) sprintf(TicketFileName, "%sticket/%08x/%08x.tik", File::GetUserPath(D_WIIUSER_IDX), TitleID_HI, TitleID_LO); FILE* pTicketFile = fopen(TicketFileName, "wb"); - if (pTicketFile == NULL) { + if (pTicketFile == NULL) { PanicAlert("WAD installation failed: error creating %s", TicketFileName); - return false; + return false; } DiscIO::WiiWAD Wad(_pFilename); diff --git a/Source/Core/Core/Src/HLE/HLE.cpp b/Source/Core/Core/Src/HLE/HLE.cpp index b1985a5291..abcd3c738e 100644 --- a/Source/Core/Core/Src/HLE/HLE.cpp +++ b/Source/Core/Core/Src/HLE/HLE.cpp @@ -43,53 +43,53 @@ enum struct SPatch { - char m_szPatchName[128]; + char m_szPatchName[128]; TPatchFunction PatchFunction; int returnType; }; static const SPatch OSPatches[] = { - { "FAKE_TO_SKIP_0", HLE_Misc::UnimplementedFunction }, + { "FAKE_TO_SKIP_0", HLE_Misc::UnimplementedFunction }, // speedup - { "OSProtectRange", HLE_Misc::UnimplementedFunctionFalse }, + { "OSProtectRange", HLE_Misc::UnimplementedFunctionFalse }, //{ "THPPlayerGetState", HLE_Misc:THPPlayerGetState }, // debug out is very nice ;) - { "OSReport", HLE_OS::HLE_GeneralDebugPrint }, - { "OSPanic", HLE_OS::HLE_OSPanic }, - { "vprintf", HLE_OS::HLE_GeneralDebugPrint }, - { "printf", HLE_OS::HLE_GeneralDebugPrint }, - { "puts", HLE_OS::HLE_GeneralDebugPrint }, // gcc-optimized printf? - { "___blank(char *,...)", HLE_OS::HLE_GeneralDebugPrint }, // used for early init things (normally) - { "___blank", HLE_OS::HLE_GeneralDebugPrint }, - { "__write_console", HLE_OS::HLE_write_console }, // used by sysmenu (+more?) + { "OSReport", HLE_OS::HLE_GeneralDebugPrint }, + { "OSPanic", HLE_OS::HLE_OSPanic }, + { "vprintf", HLE_OS::HLE_GeneralDebugPrint }, + { "printf", HLE_OS::HLE_GeneralDebugPrint }, + { "puts", HLE_OS::HLE_GeneralDebugPrint }, // gcc-optimized printf? + { "___blank(char *,...)", HLE_OS::HLE_GeneralDebugPrint }, // used for early init things (normally) + { "___blank", HLE_OS::HLE_GeneralDebugPrint }, + { "__write_console", HLE_OS::HLE_write_console }, // used by sysmenu (+more?) // wii only - { "__OSInitAudioSystem", HLE_Misc::UnimplementedFunction }, + { "__OSInitAudioSystem", HLE_Misc::UnimplementedFunction }, // Super Monkey Ball - no longer needed. - //{ ".evil_vec_cosine", HLE_Misc::SMB_EvilVecCosine }, - //{ ".evil_normalize", HLE_Misc::SMB_EvilNormalize }, - //{ ".evil_vec_setlength", HLE_Misc::SMB_evil_vec_setlength }, - //{ ".evil_vec_something", HLE_Misc::FZero_evil_vec_normalize }, - { "PanicAlert", HLE_Misc::HLEPanicAlert }, - //{ ".sqrt_internal_needs_cr1", HLE_Misc::SMB_sqrt_internal }, - //{ ".rsqrt_internal_needs_cr1", HLE_Misc::SMB_rsqrt_internal }, + //{ ".evil_vec_cosine", HLE_Misc::SMB_EvilVecCosine }, + //{ ".evil_normalize", HLE_Misc::SMB_EvilNormalize }, + //{ ".evil_vec_setlength", HLE_Misc::SMB_evil_vec_setlength }, + //{ ".evil_vec_something", HLE_Misc::FZero_evil_vec_normalize }, + { "PanicAlert", HLE_Misc::HLEPanicAlert }, + //{ ".sqrt_internal_needs_cr1", HLE_Misc::SMB_sqrt_internal }, + //{ ".rsqrt_internal_needs_cr1", HLE_Misc::SMB_rsqrt_internal }, //{ ".atan2", HLE_Misc::SMB_atan2}, - //{ ".sqrt_fz", HLE_Misc::FZ_sqrt}, + //{ ".sqrt_fz", HLE_Misc::FZ_sqrt}, // F-zero still isn't working correctly, but these aren't really helping. - //{ ".sqrt_internal_fz", HLE_Misc::FZ_sqrt_internal }, - //{ ".rsqrt_internal_fz", HLE_Misc::FZ_rsqrt_internal }, + //{ ".sqrt_internal_fz", HLE_Misc::FZ_sqrt_internal }, + //{ ".rsqrt_internal_fz", HLE_Misc::FZ_rsqrt_internal }, - //{ ".kill_infinites", HLE_Misc::FZero_kill_infinites }, + //{ ".kill_infinites", HLE_Misc::FZero_kill_infinites }, // special // { "GXPeekZ", HLE_Misc::GXPeekZ}, - // { "GXPeekARGB", HLE_Misc::GXPeekARGB}, + // { "GXPeekARGB", HLE_Misc::GXPeekARGB}, }; static const SPatch OSBreakPoints[] = @@ -162,10 +162,7 @@ void Execute(u32 _CurrentPC, u32 _Instruction) u32 GetOrigInstruction(u32 addr) { std::map::const_iterator iter = orig_instruction.find(addr); - if (iter != orig_instruction.end()) - return iter->second; - else - return 0; + return (iter != orig_instruction.end()) ? iter->second : 0; } } // end of namespace HLE diff --git a/Source/Core/DSPCore/DSPCore.vcproj b/Source/Core/DSPCore/DSPCore.vcproj index a532fb8094..e00ebbbbaa 100644 --- a/Source/Core/DSPCore/DSPCore.vcproj +++ b/Source/Core/DSPCore/DSPCore.vcproj @@ -1,7 +1,7 @@