Merge pull request #9258 from lioncash/core-log
Core: Convert logging over to fmt pt. 1
This commit is contained in:
commit
eff566b318
|
@ -245,13 +245,13 @@ std::vector<ARCode> LoadCodes(const IniFile& global_ini, const IniFile& local_in
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PanicAlertT("Action Replay Error: invalid AR code line: %s", line.c_str());
|
PanicAlertFmtT("Action Replay Error: invalid AR code line: {0}", line);
|
||||||
|
|
||||||
if (!success_addr)
|
if (!success_addr)
|
||||||
PanicAlertT("The address is invalid");
|
PanicAlertFmtT("The address is invalid");
|
||||||
|
|
||||||
if (!success_val)
|
if (!success_val)
|
||||||
PanicAlertT("The value is invalid");
|
PanicAlertFmtT("The value is invalid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -316,7 +316,7 @@ static void VLogInfo(std::string_view format, fmt::format_args args)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string text = fmt::vformat(format, args);
|
std::string text = fmt::vformat(format, args);
|
||||||
INFO_LOG(ACTIONREPLAY, "%s", text.c_str());
|
INFO_LOG_FMT(ACTIONREPLAY, "{}", text);
|
||||||
|
|
||||||
if (use_internal_log)
|
if (use_internal_log)
|
||||||
{
|
{
|
||||||
|
@ -403,9 +403,9 @@ static bool Subtype_RamWriteAndFill(const ARAddr& addr, const u32 data)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("Bad Size");
|
LogInfo("Bad Size");
|
||||||
PanicAlertT("Action Replay Error: Invalid size "
|
PanicAlertFmtT("Action Replay Error: Invalid size "
|
||||||
"(%08x : address = %08x) in Ram Write And Fill (%s)",
|
"({0:08x} : address = {1:08x}) in Ram Write And Fill ({2})",
|
||||||
addr.size, addr.gcaddr, s_current_code->name.c_str());
|
addr.size, addr.gcaddr, s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,9 +463,9 @@ static bool Subtype_WriteToPointer(const ARAddr& addr, const u32 data)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("Bad Size");
|
LogInfo("Bad Size");
|
||||||
PanicAlertT("Action Replay Error: Invalid size "
|
PanicAlertFmtT("Action Replay Error: Invalid size "
|
||||||
"(%08x : address = %08x) in Write To Pointer (%s)",
|
"({0:08x} : address = {1:08x}) in Write To Pointer ({2})",
|
||||||
addr.size, addr.gcaddr, s_current_code->name.c_str());
|
addr.size, addr.gcaddr, s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -525,9 +525,9 @@ static bool Subtype_AddCode(const ARAddr& addr, const u32 data)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("Bad Size");
|
LogInfo("Bad Size");
|
||||||
PanicAlertT("Action Replay Error: Invalid size "
|
PanicAlertFmtT("Action Replay Error: Invalid size "
|
||||||
"(%08x : address = %08x) in Add Code (%s)",
|
"({0:08x} : address = {1:08x}) in Add Code ({2})",
|
||||||
addr.size, addr.gcaddr, s_current_code->name.c_str());
|
addr.size, addr.gcaddr, s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -540,9 +540,9 @@ static bool Subtype_MasterCodeAndWriteToCCXXXXXX(const ARAddr& addr, const u32 d
|
||||||
// u8 mcode_type = (data & 0xFF0000) >> 16;
|
// u8 mcode_type = (data & 0xFF0000) >> 16;
|
||||||
// u8 mcode_count = (data & 0xFF00) >> 8;
|
// u8 mcode_count = (data & 0xFF00) >> 8;
|
||||||
// u8 mcode_number = data & 0xFF;
|
// u8 mcode_number = data & 0xFF;
|
||||||
PanicAlertT("Action Replay Error: Master Code and Write To CCXXXXXX not implemented (%s)\n"
|
PanicAlertFmtT("Action Replay Error: Master Code and Write To CCXXXXXX not implemented ({0})\n"
|
||||||
"Master codes are not needed. Do not use master codes.",
|
"Master codes are not needed. Do not use master codes.",
|
||||||
s_current_code->name.c_str());
|
s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,8 +615,9 @@ static bool ZeroCode_FillAndSlide(const u32 val_last, const ARAddr& addr, const
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("Bad Size");
|
LogInfo("Bad Size");
|
||||||
PanicAlertT("Action Replay Error: Invalid size (%08x : address = %08x) in Fill and Slide (%s)",
|
PanicAlertFmtT(
|
||||||
size, new_addr, s_current_code->name.c_str());
|
"Action Replay Error: Invalid size ({0:08x} : address = {1:08x}) in Fill and Slide ({2})",
|
||||||
|
size, new_addr, s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -670,8 +671,8 @@ static bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr& addr, const u3
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogInfo("Bad Value");
|
LogInfo("Bad Value");
|
||||||
PanicAlertT("Action Replay Error: Invalid value (%08x) in Memory Copy (%s)", (data & ~0x7FFF),
|
PanicAlertFmtT("Action Replay Error: Invalid value ({0:08x}) in Memory Copy ({1})",
|
||||||
s_current_code->name.c_str());
|
(data & ~0x7FFF), s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -707,8 +708,8 @@ static bool NormalCode(const ARAddr& addr, const u32 data)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("Bad Subtype");
|
LogInfo("Bad Subtype");
|
||||||
PanicAlertT("Action Replay: Normal Code 0: Invalid Subtype %08x (%s)", addr.subtype,
|
PanicAlertFmtT("Action Replay: Normal Code 0: Invalid Subtype {0:08x} ({1})", addr.subtype,
|
||||||
s_current_code->name.c_str());
|
s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -749,8 +750,8 @@ static bool CompareValues(const u32 val1, const u32 val2, const int type)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("Unknown Compare type");
|
LogInfo("Unknown Compare type");
|
||||||
PanicAlertT("Action Replay: Invalid Normal Code Type %08x (%s)", type,
|
PanicAlertFmtT("Action Replay: Invalid Normal Code Type {0:08x} ({1})", type,
|
||||||
s_current_code->name.c_str());
|
s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -781,8 +782,8 @@ static bool ConditionalCode(const ARAddr& addr, const u32 data, int* const pSkip
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("Bad Size");
|
LogInfo("Bad Size");
|
||||||
PanicAlertT("Action Replay: Conditional Code: Invalid Size %08x (%s)", addr.size,
|
PanicAlertFmtT("Action Replay: Conditional Code: Invalid Size {0:08x} ({1})", addr.size,
|
||||||
s_current_code->name.c_str());
|
s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -805,8 +806,8 @@ static bool ConditionalCode(const ARAddr& addr, const u32 data, int* const pSkip
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("Bad Subtype");
|
LogInfo("Bad Subtype");
|
||||||
PanicAlertT("Action Replay: Normal Code %i: Invalid subtype %08x (%s)", 1, addr.subtype,
|
PanicAlertFmtT("Action Replay: Normal Code {0}: Invalid subtype {1:08x} ({2})", 1,
|
||||||
s_current_code->name.c_str());
|
addr.subtype, s_current_code->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -889,7 +890,7 @@ static bool RunCodeLocked(const ARCode& arcode)
|
||||||
{
|
{
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"This action replay simulator does not support codes that modify Action Replay itself.");
|
"This action replay simulator does not support codes that modify Action Replay itself.");
|
||||||
PanicAlertT(
|
PanicAlertFmtT(
|
||||||
"This action replay simulator does not support codes that modify Action Replay itself.");
|
"This action replay simulator does not support codes that modify Action Replay itself.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -923,7 +924,7 @@ static bool RunCodeLocked(const ARCode& arcode)
|
||||||
// Todo: Set register 1BB4 to 1
|
// Todo: Set register 1BB4 to 1
|
||||||
LogInfo("ZCode: Executes all codes in the same row, Set register 1BB4 to 1 (zcode not "
|
LogInfo("ZCode: Executes all codes in the same row, Set register 1BB4 to 1 (zcode not "
|
||||||
"supported)");
|
"supported)");
|
||||||
PanicAlertT("Zero 3 code not supported");
|
PanicAlertFmtT("Zero 3 code not supported");
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case ZCODE_04: // Fill & Slide or Memory Copy
|
case ZCODE_04: // Fill & Slide or Memory Copy
|
||||||
|
@ -943,7 +944,7 @@ static bool RunCodeLocked(const ARCode& arcode)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogInfo("ZCode: Unknown");
|
LogInfo("ZCode: Unknown");
|
||||||
PanicAlertT("Zero code unknown to Dolphin: %08x", zcode);
|
PanicAlertFmtT("Zero code unknown to Dolphin: {0:08x}", zcode);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under GPLv2+
|
// Licensed under GPLv2+
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -97,9 +98,9 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume)
|
||||||
const std::optional<u32> entry = volume.ReadSwapped<u32>(offset + 0x10, partition);
|
const std::optional<u32> entry = volume.ReadSwapped<u32>(offset + 0x10, partition);
|
||||||
const std::optional<u32> size = volume.ReadSwapped<u32>(offset + 0x14, partition);
|
const std::optional<u32> size = volume.ReadSwapped<u32>(offset + 0x14, partition);
|
||||||
const std::optional<u32> trailer = volume.ReadSwapped<u32>(offset + 0x18, partition);
|
const std::optional<u32> trailer = volume.ReadSwapped<u32>(offset + 0x18, partition);
|
||||||
if (!entry || !size || !trailer || *entry == (u32)-1 || *size + *trailer == (u32)-1)
|
if (!entry || !size || !trailer || *entry == UINT32_MAX || *size + *trailer == UINT32_MAX)
|
||||||
{
|
{
|
||||||
INFO_LOG(BOOT, "Invalid apploader. Your disc image is probably corrupted.");
|
INFO_LOG_FMT(BOOT, "Invalid apploader. Your disc image is probably corrupted.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
DVDRead(volume, offset + 0x20, 0x01200000, *size + *trailer, partition);
|
DVDRead(volume, offset + 0x20, 0x01200000, *size + *trailer, partition);
|
||||||
|
@ -107,7 +108,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(MASTER_LOG, "Call iAppLoaderEntry");
|
DEBUG_LOG_FMT(MASTER_LOG, "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;
|
||||||
|
@ -118,7 +119,7 @@ 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(MASTER_LOG, "Call iAppLoaderInit");
|
DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderInit");
|
||||||
HLE::Patch(0x81300000, "AppLoaderReport"); // HLE OSReport for Apploader
|
HLE::Patch(0x81300000, "AppLoaderReport"); // HLE OSReport for Apploader
|
||||||
PowerPC::ppcState.gpr[3] = 0x81300000;
|
PowerPC::ppcState.gpr[3] = 0x81300000;
|
||||||
RunFunction(iAppLoaderInit);
|
RunFunction(iAppLoaderInit);
|
||||||
|
@ -126,7 +127,7 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume)
|
||||||
// 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(MASTER_LOG, "Call iAppLoaderMain");
|
DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderMain");
|
||||||
|
|
||||||
PowerPC::ppcState.gpr[3] = 0x81300004;
|
PowerPC::ppcState.gpr[3] = 0x81300004;
|
||||||
PowerPC::ppcState.gpr[4] = 0x81300008;
|
PowerPC::ppcState.gpr[4] = 0x81300008;
|
||||||
|
@ -140,13 +141,13 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume)
|
||||||
// iAppLoaderMain returns 0 when there are no more sections to copy.
|
// iAppLoaderMain returns 0 when there are no more sections to copy.
|
||||||
while (PowerPC::ppcState.gpr[3] != 0x00)
|
while (PowerPC::ppcState.gpr[3] != 0x00)
|
||||||
{
|
{
|
||||||
u32 iRamAddress = PowerPC::Read_U32(0x81300004);
|
const u32 ram_address = PowerPC::Read_U32(0x81300004);
|
||||||
u32 iLength = PowerPC::Read_U32(0x81300008);
|
const u32 length = PowerPC::Read_U32(0x81300008);
|
||||||
u32 iDVDOffset = PowerPC::Read_U32(0x8130000c) << (is_wii ? 2 : 0);
|
const u32 dvd_offset = PowerPC::Read_U32(0x8130000c) << (is_wii ? 2 : 0);
|
||||||
|
|
||||||
INFO_LOG(MASTER_LOG, "DVDRead: offset: %08x memOffset: %08x length: %i", iDVDOffset,
|
INFO_LOG_FMT(MASTER_LOG, "DVDRead: offset: {:08x} memOffset: {:08x} length: {}", dvd_offset,
|
||||||
iRamAddress, iLength);
|
ram_address, length);
|
||||||
DVDRead(volume, iDVDOffset, iRamAddress, iLength, partition);
|
DVDRead(volume, dvd_offset, ram_address, length, partition);
|
||||||
|
|
||||||
PowerPC::ppcState.gpr[3] = 0x81300004;
|
PowerPC::ppcState.gpr[3] = 0x81300004;
|
||||||
PowerPC::ppcState.gpr[4] = 0x81300008;
|
PowerPC::ppcState.gpr[4] = 0x81300008;
|
||||||
|
@ -156,7 +157,7 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume)
|
||||||
}
|
}
|
||||||
|
|
||||||
// iAppLoaderClose
|
// iAppLoaderClose
|
||||||
DEBUG_LOG(MASTER_LOG, "call iAppLoaderClose");
|
DEBUG_LOG_FMT(MASTER_LOG, "call iAppLoaderClose");
|
||||||
RunFunction(iAppLoaderClose);
|
RunFunction(iAppLoaderClose);
|
||||||
HLE::UnPatch("AppLoaderReport");
|
HLE::UnPatch("AppLoaderReport");
|
||||||
|
|
||||||
|
@ -205,7 +206,7 @@ void CBoot::SetupGCMemory()
|
||||||
// execute the apploader, function by function, using the above utility.
|
// execute the apploader, function by function, using the above utility.
|
||||||
bool CBoot::EmulatedBS2_GC(const DiscIO::VolumeDisc& volume)
|
bool CBoot::EmulatedBS2_GC(const DiscIO::VolumeDisc& volume)
|
||||||
{
|
{
|
||||||
INFO_LOG(BOOT, "Faking GC BS2...");
|
INFO_LOG_FMT(BOOT, "Faking GC BS2...");
|
||||||
|
|
||||||
SetupMSR();
|
SetupMSR();
|
||||||
SetupBAT(/*is_wii*/ false);
|
SetupBAT(/*is_wii*/ false);
|
||||||
|
@ -330,11 +331,11 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
|
||||||
serno = "123456789";
|
serno = "123456789";
|
||||||
else
|
else
|
||||||
serno = Common::SettingsHandler::GenerateSerialNumber();
|
serno = Common::SettingsHandler::GenerateSerialNumber();
|
||||||
INFO_LOG(BOOT, "No previous serial number found, generated one instead: %s", serno.c_str());
|
INFO_LOG_FMT(BOOT, "No previous serial number found, generated one instead: {}", serno);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
INFO_LOG(BOOT, "Using serial number: %s", serno.c_str());
|
INFO_LOG_FMT(BOOT, "Using serial number: {}", serno);
|
||||||
}
|
}
|
||||||
|
|
||||||
gen.AddSetting("AREA", region_setting.area);
|
gen.AddSetting("AREA", region_setting.area);
|
||||||
|
@ -351,14 +352,14 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
|
||||||
settings_file_path, {rw_mode, rw_mode, rw_mode});
|
settings_file_path, {rw_mode, rw_mode, rw_mode});
|
||||||
if (!settings_file || !settings_file->Write(gen.GetBytes().data(), gen.GetBytes().size()))
|
if (!settings_file || !settings_file->Write(gen.GetBytes().data(), gen.GetBytes().size()))
|
||||||
{
|
{
|
||||||
PanicAlertT("SetupWiiMemory: Can't create setting.txt file");
|
PanicAlertFmtT("SetupWiiMemory: Can't create setting.txt file");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the 256 byte setting.txt to memory.
|
// Write the 256 byte setting.txt to memory.
|
||||||
Memory::CopyToEmu(0x3800, gen.GetBytes().data(), gen.GetBytes().size());
|
Memory::CopyToEmu(0x3800, gen.GetBytes().data(), gen.GetBytes().size());
|
||||||
|
|
||||||
INFO_LOG(BOOT, "Setup Wii Memory...");
|
INFO_LOG_FMT(BOOT, "Setup Wii Memory...");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Set hardcoded global variables to Wii memory. These are partly collected from
|
Set hardcoded global variables to Wii memory. These are partly collected from
|
||||||
|
@ -438,7 +439,7 @@ static void WriteEmptyPlayRecord()
|
||||||
// execute the apploader
|
// execute the apploader
|
||||||
bool CBoot::EmulatedBS2_Wii(const DiscIO::VolumeDisc& volume)
|
bool CBoot::EmulatedBS2_Wii(const DiscIO::VolumeDisc& volume)
|
||||||
{
|
{
|
||||||
INFO_LOG(BOOT, "Faking Wii BS2...");
|
INFO_LOG_FMT(BOOT, "Faking Wii BS2...");
|
||||||
if (volume.GetVolumeType() != DiscIO::Platform::WiiDisc)
|
if (volume.GetVolumeType() != DiscIO::Platform::WiiDisc)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
// Licensed under GPLv2+
|
// Licensed under GPLv2+
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include <cinttypes>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
@ -29,7 +28,7 @@ bool CBoot::BootNANDTitle(const u64 title_id)
|
||||||
if (ticket.IsValid())
|
if (ticket.IsValid())
|
||||||
console_type = ticket.GetConsoleType();
|
console_type = ticket.GetConsoleType();
|
||||||
else
|
else
|
||||||
ERROR_LOG(BOOT, "No ticket was found for %016" PRIx64, title_id);
|
ERROR_LOG_FMT(BOOT, "No ticket was found for {:016x}", title_id);
|
||||||
SetupWiiMemory(console_type);
|
SetupWiiMemory(console_type);
|
||||||
return es->LaunchTitle(title_id);
|
return es->LaunchTitle(title_id);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +37,7 @@ bool CBoot::Boot_WiiWAD(const DiscIO::VolumeWAD& wad)
|
||||||
{
|
{
|
||||||
if (!WiiUtils::InstallWAD(*IOS::HLE::GetIOS(), wad, WiiUtils::InstallType::Temporary))
|
if (!WiiUtils::InstallWAD(*IOS::HLE::GetIOS(), wad, WiiUtils::InstallType::Temporary))
|
||||||
{
|
{
|
||||||
PanicAlertT("Cannot boot this WAD because it could not be installed to the NAND.");
|
PanicAlertFmtT("Cannot boot this WAD because it could not be installed to the NAND.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return BootNANDTitle(wad.GetTMD().GetTitleId());
|
return BootNANDTitle(wad.GetTMD().GetTitleId());
|
||||||
|
|
|
@ -126,22 +126,22 @@ 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(MASTER_LOG, "String section: %i", header->e_shstrndx);
|
INFO_LOG_FMT(MASTER_LOG, "String section: {}", header->e_shstrndx);
|
||||||
|
|
||||||
if (bRelocate)
|
if (bRelocate)
|
||||||
{
|
{
|
||||||
PanicAlert("Error: Dolphin doesn't know how to load a relocatable elf.");
|
PanicAlertFmt("Error: Dolphin doesn't know how to load a relocatable elf.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_LOG(MASTER_LOG, "%i segments:", header->e_phnum);
|
INFO_LOG_FMT(MASTER_LOG, "{} 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(MASTER_LOG, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr,
|
INFO_LOG_FMT(MASTER_LOG, "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)
|
||||||
|
@ -158,11 +158,12 @@ 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(MASTER_LOG, "Loadable Segment Copied to %08x, size %08x", writeAddr, p->p_memsz);
|
INFO_LOG_FMT(MASTER_LOG, "Loadable Segment Copied to {:08x}, size {:08x}", writeAddr,
|
||||||
|
p->p_memsz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_LOG(MASTER_LOG, "Done loading.");
|
INFO_LOG_FMT(MASTER_LOG, "Done loading.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ static GPUDeterminismMode ParseGPUDeterminismMode(const std::string& mode)
|
||||||
if (mode == "fake-completion")
|
if (mode == "fake-completion")
|
||||||
return GPUDeterminismMode::FakeCompletion;
|
return GPUDeterminismMode::FakeCompletion;
|
||||||
|
|
||||||
NOTICE_LOG(BOOT, "Unknown GPU determinism mode %s", mode.c_str());
|
NOTICE_LOG_FMT(BOOT, "Unknown GPU determinism mode {}", mode);
|
||||||
return GPUDeterminismMode::Auto;
|
return GPUDeterminismMode::Auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ void SaveToSYSCONF(Config::LayerType layer)
|
||||||
idle_entry->bytes = std::vector<u8>(2);
|
idle_entry->bytes = std::vector<u8>(2);
|
||||||
else
|
else
|
||||||
idle_entry->bytes[0] = 0;
|
idle_entry->bytes[0] = 0;
|
||||||
NOTICE_LOG(CORE, "Disabling WC24 'standby' (shutdown to idle) to avoid hanging on shutdown");
|
NOTICE_LOG_FMT(CORE, "Disabling WC24 'standby' (shutdown to idle) to avoid hanging on shutdown");
|
||||||
|
|
||||||
IOS::HLE::RestoreBTInfoSection(&sysconf);
|
IOS::HLE::RestoreBTInfoSection(&sysconf);
|
||||||
sysconf.Save();
|
sysconf.Save();
|
||||||
|
@ -143,8 +143,8 @@ public:
|
||||||
auto ini = inis.find(location.system);
|
auto ini = inis.find(location.system);
|
||||||
if (ini == inis.end())
|
if (ini == inis.end())
|
||||||
{
|
{
|
||||||
ERROR_LOG(COMMON, "Config can't map system '%s' to an INI file!",
|
ERROR_LOG_FMT(COMMON, "Config can't map system '{}' to an INI file!",
|
||||||
Config::GetSystemName(location.system).c_str());
|
Config::GetSystemName(location.system));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ static Location MapINIToRealLocation(const std::string& section, const std::stri
|
||||||
if (!fail && system)
|
if (!fail && system)
|
||||||
return {*system, config_section, key};
|
return {*system, config_section, key};
|
||||||
|
|
||||||
WARN_LOG(CORE, "Unknown game INI option in section %s: %s", section.c_str(), key.c_str());
|
WARN_LOG_FMT(CORE, "Unknown game INI option in section {}: {}", section, key);
|
||||||
return {Config::System::Main, "", ""};
|
return {Config::System::Main, "", ""};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ private:
|
||||||
if (!File::Exists(ini_path))
|
if (!File::Exists(ini_path))
|
||||||
{
|
{
|
||||||
// TODO: PanicAlert shouldn't be used for this.
|
// TODO: PanicAlert shouldn't be used for this.
|
||||||
PanicAlertT("Selected controller profile does not exist");
|
PanicAlertFmtT("Selected controller profile does not exist");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ SConfig::~SConfig()
|
||||||
|
|
||||||
void SConfig::SaveSettings()
|
void SConfig::SaveSettings()
|
||||||
{
|
{
|
||||||
NOTICE_LOG(BOOT, "Saving settings to %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
|
NOTICE_LOG_FMT(BOOT, "Saving settings to {}", File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
|
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ void SConfig::LoadSettings()
|
||||||
{
|
{
|
||||||
Config::Load();
|
Config::Load();
|
||||||
|
|
||||||
INFO_LOG(BOOT, "Loading Settings from %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
|
INFO_LOG_FMT(BOOT, "Loading Settings from {}", File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||||
|
|
||||||
|
@ -690,7 +690,7 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::stri
|
||||||
const DiscIO::Language language = GetLanguageAdjustedForRegion(bWii, region);
|
const DiscIO::Language language = GetLanguageAdjustedForRegion(bWii, region);
|
||||||
m_title_name = title_database.GetTitleName(m_gametdb_id, language);
|
m_title_name = title_database.GetTitleName(m_gametdb_id, language);
|
||||||
m_title_description = title_database.Describe(m_gametdb_id, language);
|
m_title_description = title_database.Describe(m_gametdb_id, language);
|
||||||
NOTICE_LOG(CORE, "Active title: %s", m_title_description.c_str());
|
NOTICE_LOG_FMT(CORE, "Active title: {}", m_title_description);
|
||||||
Host_TitleChanged();
|
Host_TitleChanged();
|
||||||
|
|
||||||
Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
|
Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
|
||||||
|
@ -848,12 +848,12 @@ struct SetGameMetadata
|
||||||
{
|
{
|
||||||
if (!wad.GetTMD().IsValid())
|
if (!wad.GetTMD().IsValid())
|
||||||
{
|
{
|
||||||
PanicAlertT("This WAD is not valid.");
|
PanicAlertFmtT("This WAD is not valid.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!IOS::ES::IsChannel(wad.GetTMD().GetTitleId()))
|
if (!IOS::ES::IsChannel(wad.GetTMD().GetTitleId()))
|
||||||
{
|
{
|
||||||
PanicAlertT("This WAD is not bootable.");
|
PanicAlertFmtT("This WAD is not bootable.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,7 +871,7 @@ struct SetGameMetadata
|
||||||
const IOS::ES::TMDReader tmd = ios.GetES()->FindInstalledTMD(nand_title.id);
|
const IOS::ES::TMDReader tmd = ios.GetES()->FindInstalledTMD(nand_title.id);
|
||||||
if (!tmd.IsValid() || !IOS::ES::IsChannel(nand_title.id))
|
if (!tmd.IsValid() || !IOS::ES::IsChannel(nand_title.id))
|
||||||
{
|
{
|
||||||
PanicAlertT("This title cannot be booted.");
|
PanicAlertFmtT("This title cannot be booted.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,7 +220,7 @@ bool Init(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
|
||||||
{
|
{
|
||||||
if (IsRunning())
|
if (IsRunning())
|
||||||
{
|
{
|
||||||
PanicAlertT("Emu Thread already running");
|
PanicAlertFmtT("Emu Thread already running");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,8 +233,8 @@ bool Init(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
|
||||||
|
|
||||||
Core::UpdateWantDeterminism(/*initial*/ true);
|
Core::UpdateWantDeterminism(/*initial*/ true);
|
||||||
|
|
||||||
INFO_LOG(BOOT, "Starting core = %s mode", SConfig::GetInstance().bWii ? "Wii" : "GameCube");
|
INFO_LOG_FMT(BOOT, "Starting core = {} mode", SConfig::GetInstance().bWii ? "Wii" : "GameCube");
|
||||||
INFO_LOG(BOOT, "CPU Thread separate = %s", SConfig::GetInstance().bCPUThread ? "Yes" : "No");
|
INFO_LOG_FMT(BOOT, "CPU Thread separate = {}", SConfig::GetInstance().bCPUThread ? "Yes" : "No");
|
||||||
|
|
||||||
Host_UpdateMainFrame(); // Disable any menus or buttons at boot
|
Host_UpdateMainFrame(); // Disable any menus or buttons at boot
|
||||||
|
|
||||||
|
@ -278,10 +278,10 @@ void Stop() // - Hammertime!
|
||||||
|
|
||||||
Fifo::EmulatorState(false);
|
Fifo::EmulatorState(false);
|
||||||
|
|
||||||
INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----");
|
INFO_LOG_FMT(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----");
|
||||||
|
|
||||||
// Stop the CPU
|
// Stop the CPU
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stop CPU").c_str());
|
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "Stop CPU"));
|
||||||
CPU::Stop();
|
CPU::Stop();
|
||||||
|
|
||||||
if (_CoreParameter.bCPUThread)
|
if (_CoreParameter.bCPUThread)
|
||||||
|
@ -289,7 +289,7 @@ void Stop() // - Hammertime!
|
||||||
// Video_EnterLoop() should now exit so that EmuThread()
|
// Video_EnterLoop() should now exit so that EmuThread()
|
||||||
// will continue concurrently with the rest of the commands
|
// will continue concurrently with the rest of the commands
|
||||||
// in this function. We no longer rely on Postmessage.
|
// in this function. We no longer rely on Postmessage.
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Wait for Video Loop to exit ...").c_str());
|
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "Wait for Video Loop to exit ..."));
|
||||||
|
|
||||||
g_video_backend->Video_ExitLoop();
|
g_video_backend->Video_ExitLoop();
|
||||||
}
|
}
|
||||||
|
@ -412,7 +412,7 @@ static void FifoPlayerThread(const std::optional<std::string>& savestate_path,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// FIFO log does not contain any frames, cannot continue.
|
// FIFO log does not contain any frames, cannot continue.
|
||||||
PanicAlert("FIFO file is invalid, cannot playback.");
|
PanicAlertFmt("FIFO file is invalid, cannot playback.");
|
||||||
FifoPlayer::GetInstance().Close();
|
FifoPlayer::GetInstance().Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||||
if (s_on_state_changed_callback)
|
if (s_on_state_changed_callback)
|
||||||
s_on_state_changed_callback(State::Uninitialized);
|
s_on_state_changed_callback(State::Uninitialized);
|
||||||
|
|
||||||
INFO_LOG(CONSOLE, "Stop\t\t---- Shutdown complete ----");
|
INFO_LOG_FMT(CONSOLE, "Stop\t\t---- Shutdown complete ----");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
Common::SetCurrentThreadName("Emuthread - Starting");
|
Common::SetCurrentThreadName("Emuthread - Starting");
|
||||||
|
@ -510,9 +510,9 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||||
Common::ScopeGuard hw_guard{[] {
|
Common::ScopeGuard hw_guard{[] {
|
||||||
// We must set up this flag before executing HW::Shutdown()
|
// We must set up this flag before executing HW::Shutdown()
|
||||||
s_hardware_initialized = false;
|
s_hardware_initialized = false;
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(false, "Shutting down HW").c_str());
|
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(false, "Shutting down HW"));
|
||||||
HW::Shutdown();
|
HW::Shutdown();
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(false, "HW shutdown").c_str());
|
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(false, "HW shutdown"));
|
||||||
|
|
||||||
// Clear on screen messages that haven't expired
|
// Clear on screen messages that haven't expired
|
||||||
OSD::ClearMessages();
|
OSD::ClearMessages();
|
||||||
|
@ -529,7 +529,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||||
|
|
||||||
if (!g_video_backend->Initialize(wsi))
|
if (!g_video_backend->Initialize(wsi))
|
||||||
{
|
{
|
||||||
PanicAlert("Failed to initialize video backend!");
|
PanicAlertFmt("Failed to initialize video backend!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Common::ScopeGuard video_guard{[] { g_video_backend->Shutdown(); }};
|
Common::ScopeGuard video_guard{[] { g_video_backend->Shutdown(); }};
|
||||||
|
@ -546,7 +546,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||||
|
|
||||||
if (!DSP::GetDSPEmulator()->Initialize(core_parameter.bWii, core_parameter.bDSPThread))
|
if (!DSP::GetDSPEmulator()->Initialize(core_parameter.bWii, core_parameter.bDSPThread))
|
||||||
{
|
{
|
||||||
PanicAlert("Failed to initialize DSP emulation!");
|
PanicAlertFmt("Failed to initialize DSP emulation!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,11 +615,11 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||||
Fifo::RunGpuLoop();
|
Fifo::RunGpuLoop();
|
||||||
|
|
||||||
// We have now exited the Video Loop
|
// We have now exited the Video Loop
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(false, "Video Loop Ended").c_str());
|
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(false, "Video Loop Ended"));
|
||||||
|
|
||||||
// Join with the CPU thread.
|
// Join with the CPU thread.
|
||||||
s_cpu_thread.join();
|
s_cpu_thread.join();
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(true, "CPU thread stopped.").c_str());
|
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "CPU thread stopped."));
|
||||||
}
|
}
|
||||||
else // SingleCore mode
|
else // SingleCore mode
|
||||||
{
|
{
|
||||||
|
@ -628,9 +628,9 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_GDBSTUB
|
#ifdef USE_GDBSTUB
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stopping GDB ...").c_str());
|
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "Stopping GDB ..."));
|
||||||
gdb_deinit();
|
gdb_deinit();
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(true, "GDB stopped.").c_str());
|
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "GDB stopped."));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -656,7 +656,7 @@ void SetState(State state)
|
||||||
Wiimote::Resume();
|
Wiimote::Resume();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PanicAlert("Invalid state");
|
PanicAlertFmt("Invalid state");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -995,7 +995,7 @@ void UpdateWantDeterminism(bool initial)
|
||||||
bool new_want_determinism = Movie::IsMovieActive() || NetPlay::IsNetPlayRunning();
|
bool new_want_determinism = Movie::IsMovieActive() || NetPlay::IsNetPlayRunning();
|
||||||
if (new_want_determinism != s_wants_determinism || initial)
|
if (new_want_determinism != s_wants_determinism || initial)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(COMMON, "Want determinism <- %s", new_want_determinism ? "true" : "false");
|
NOTICE_LOG_FMT(COMMON, "Want determinism <- {}", new_want_determinism ? "true" : "false");
|
||||||
|
|
||||||
RunAsCPUThread([&] {
|
RunAsCPUThread([&] {
|
||||||
s_wants_determinism = new_want_determinism;
|
s_wants_determinism = new_want_determinism;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include "Core/CoreTiming.h"
|
#include "Core/CoreTiming.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cinttypes>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
@ -189,9 +188,9 @@ void DoState(PointerWrap& p)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WARN_LOG(POWERPC,
|
WARN_LOG_FMT(POWERPC,
|
||||||
"Lost event from savestate because its type, \"%s\", has not been registered.",
|
"Lost event from savestate because its type, \"{}\", has not been registered.",
|
||||||
name.c_str());
|
name);
|
||||||
ev.type = s_ev_lost;
|
ev.type = s_ev_lost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,10 +259,10 @@ void ScheduleEvent(s64 cycles_into_future, EventType* event_type, u64 userdata,
|
||||||
{
|
{
|
||||||
if (Core::WantsDeterminism())
|
if (Core::WantsDeterminism())
|
||||||
{
|
{
|
||||||
ERROR_LOG(POWERPC,
|
ERROR_LOG_FMT(POWERPC,
|
||||||
"Someone scheduled an off-thread \"%s\" event while netplay or "
|
"Someone scheduled an off-thread \"{}\" event while netplay or "
|
||||||
"movie play/record was active. This is likely to cause a desync.",
|
"movie play/record was active. This is likely to cause a desync.",
|
||||||
event_type->name->c_str());
|
*event_type->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lk(s_ts_write_lock);
|
std::lock_guard<std::mutex> lk(s_ts_write_lock);
|
||||||
|
@ -329,8 +328,6 @@ void Advance()
|
||||||
Event evt = std::move(s_event_queue.front());
|
Event evt = std::move(s_event_queue.front());
|
||||||
std::pop_heap(s_event_queue.begin(), s_event_queue.end(), std::greater<Event>());
|
std::pop_heap(s_event_queue.begin(), s_event_queue.end(), std::greater<Event>());
|
||||||
s_event_queue.pop_back();
|
s_event_queue.pop_back();
|
||||||
// NOTICE_LOG(POWERPC, "[Scheduler] %-20s (%lld, %lld)", evt.type->name->c_str(),
|
|
||||||
// g.global_timer, evt.time);
|
|
||||||
evt.type->callback(evt.userdata, g.global_timer - evt.time);
|
evt.type->callback(evt.userdata, g.global_timer - evt.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,8 +355,8 @@ void LogPendingEvents()
|
||||||
std::sort(clone.begin(), clone.end());
|
std::sort(clone.begin(), clone.end());
|
||||||
for (const Event& ev : clone)
|
for (const Event& ev : clone)
|
||||||
{
|
{
|
||||||
INFO_LOG(POWERPC, "PENDING: Now: %" PRId64 " Pending: %" PRId64 " Type: %s", g.global_timer,
|
INFO_LOG_FMT(POWERPC, "PENDING: Now: {} Pending: {} Type: {}", g.global_timer, ev.time,
|
||||||
ev.time, ev.type->name->c_str());
|
*ev.type->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ u16 Accelerator::ReadD3()
|
||||||
m_current_address++;
|
m_current_address++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERROR_LOG(DSPLLE, "dsp_read_aram_d3() - unknown format 0x%x", m_sample_format);
|
ERROR_LOG_FMT(DSPLLE, "dsp_read_aram_d3() - unknown format {:#x}", m_sample_format);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ void Accelerator::WriteD3(u16 value)
|
||||||
m_current_address++;
|
m_current_address++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERROR_LOG(DSPLLE, "dsp_write_aram_d3() - unknown format 0x%x", m_sample_format);
|
ERROR_LOG_FMT(DSPLLE, "dsp_write_aram_d3() - unknown format {:#x}", m_sample_format);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ u16 Accelerator::Read(const s16* coefs)
|
||||||
m_current_address += 1;
|
m_current_address += 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERROR_LOG(DSPLLE, "dsp_read_accelerator() - unknown format 0x%x", m_sample_format);
|
ERROR_LOG_FMT(DSPLLE, "dsp_read_accelerator() - unknown format {:#x}", m_sample_format);
|
||||||
step_size_bytes = 2;
|
step_size_bytes = 2;
|
||||||
m_current_address += 1;
|
m_current_address += 1;
|
||||||
val = 0;
|
val = 0;
|
||||||
|
|
|
@ -144,12 +144,12 @@ void AnalyzeRange(u16 start_addr, u16 end_addr)
|
||||||
}
|
}
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
INFO_LOG(DSPLLE, "Idle skip location found at %02x (sigNum:%zu)", addr, s + 1);
|
INFO_LOG_FMT(DSPLLE, "Idle skip location found at {:02x} (sigNum:{})", addr, s + 1);
|
||||||
code_flags[addr] |= CODE_IDLE_SKIP;
|
code_flags[addr] |= CODE_IDLE_SKIP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
INFO_LOG(DSPLLE, "Finished analysis.");
|
INFO_LOG_FMT(DSPLLE, "Finished analysis.");
|
||||||
}
|
}
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/File.h"
|
#include "Common/File.h"
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
|
#include "Common/Logging/Log.h"
|
||||||
#include "Common/MsgHandler.h"
|
#include "Common/MsgHandler.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
#include "Common/Swap.h"
|
#include "Common/Swap.h"
|
||||||
|
@ -66,7 +67,7 @@ bool Disassemble(const std::vector<u16>& code, bool line_numbers, std::string& t
|
||||||
bool Compare(const std::vector<u16>& code1, const std::vector<u16>& code2)
|
bool Compare(const std::vector<u16>& code1, const std::vector<u16>& code2)
|
||||||
{
|
{
|
||||||
if (code1.size() != code2.size())
|
if (code1.size() != code2.size())
|
||||||
printf("Size difference! 1=%zu 2=%zu\n", code1.size(), code2.size());
|
WARN_LOG_FMT(AUDIO, "Size difference! 1={} 2={}\n", code1.size(), code2.size());
|
||||||
u32 count_equal = 0;
|
u32 count_equal = 0;
|
||||||
const u16 min_size = static_cast<u16>(std::min(code1.size(), code2.size()));
|
const u16 min_size = static_cast<u16>(std::min(code1.size(), code2.size()));
|
||||||
|
|
||||||
|
@ -85,23 +86,23 @@ bool Compare(const std::vector<u16>& code1, const std::vector<u16>& code2)
|
||||||
disassembler.DisassembleOpcode(&code1[0], &pc, line1);
|
disassembler.DisassembleOpcode(&code1[0], &pc, line1);
|
||||||
pc = i;
|
pc = i;
|
||||||
disassembler.DisassembleOpcode(&code2[0], &pc, line2);
|
disassembler.DisassembleOpcode(&code2[0], &pc, line2);
|
||||||
printf("!! %04x : %04x vs %04x - %s vs %s\n", i, code1[i], code2[i], line1.c_str(),
|
WARN_LOG_FMT(AUDIO, "!! {:04x} : {:04x} vs {:04x} - {} vs {}\n", i, code1[i], code2[i],
|
||||||
line2.c_str());
|
line1, line2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (code2.size() != code1.size())
|
if (code2.size() != code1.size())
|
||||||
{
|
{
|
||||||
printf("Extra code words:\n");
|
DEBUG_LOG_FMT(AUDIO, "Extra code words:\n");
|
||||||
const std::vector<u16>& longest = code1.size() > code2.size() ? code1 : code2;
|
const std::vector<u16>& longest = code1.size() > code2.size() ? code1 : code2;
|
||||||
for (u16 i = min_size; i < longest.size(); i++)
|
for (u16 i = min_size; i < longest.size(); i++)
|
||||||
{
|
{
|
||||||
u16 pc = i;
|
u16 pc = i;
|
||||||
std::string line;
|
std::string line;
|
||||||
disassembler.DisassembleOpcode(&longest[0], &pc, line);
|
disassembler.DisassembleOpcode(&longest[0], &pc, line);
|
||||||
printf("!! %s\n", line.c_str());
|
DEBUG_LOG_FMT(AUDIO, "!! {}\n", line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("Equal instruction words: %i / %i\n", count_equal, min_size);
|
DEBUG_LOG_FMT(AUDIO, "Equal instruction words: {} / {}\n", count_equal, min_size);
|
||||||
return code1.size() == code2.size() && code1.size() == count_equal;
|
return code1.size() == code2.size() && code1.size() == count_equal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +156,7 @@ bool DumpDSPCode(const u8* code_be, size_t size_in_bytes, u32 crc)
|
||||||
|
|
||||||
if (!File::IOFile(binary_file, "wb").WriteBytes(code_be, size_in_bytes))
|
if (!File::IOFile(binary_file, "wb").WriteBytes(code_be, size_in_bytes))
|
||||||
{
|
{
|
||||||
PanicAlert("Can't dump UCode to file '%s'!!", binary_file.c_str());
|
PanicAlertFmt("Can't dump UCode to file '{}'!!", binary_file);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ static bool VerifyRoms()
|
||||||
|
|
||||||
if (rom_idx < 0)
|
if (rom_idx < 0)
|
||||||
{
|
{
|
||||||
if (AskYesNoT("Your DSP ROMs have incorrect hashes.\n"
|
if (AskYesNoFmtT("Your DSP ROMs have incorrect hashes.\n"
|
||||||
"Would you like to stop now to fix the problem?\n"
|
"Would you like to stop now to fix the problem?\n"
|
||||||
"If you select \"No\", audio might be garbled."))
|
"If you select \"No\", audio might be garbled."))
|
||||||
return false;
|
return false;
|
||||||
|
@ -254,7 +254,7 @@ void DSPCore_CheckExceptions()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
ERROR_LOG(DSPLLE, "Firing exception %d failed", i);
|
ERROR_LOG_FMT(DSPLLE, "Firing exception {} failed", i);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ std::string DSPDisassembler::DisassembleParameters(const DSPOPCTemplate& opc, u1
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERROR_LOG(DSPLLE, "Unknown parameter type: %x", opc.params[j].type);
|
ERROR_LOG_FMT(DSPLLE, "Unknown parameter type: {:x}", opc.params[j].type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,11 +54,8 @@ void gdsp_mbox_write_l(Mailbox mbx, u16 val)
|
||||||
g_dsp.mbox[mbx].store(new_value | 0x80000000, std::memory_order_release);
|
g_dsp.mbox[mbx].store(new_value | 0x80000000, std::memory_order_release);
|
||||||
|
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
if (mbx == MAILBOX_DSP)
|
const char* const type = mbx == MAILBOX_DSP ? "DSP" : "CPU";
|
||||||
DEBUG_LOG(DSP_MAIL, "DSP(WM) B:%i M:0x%08x (pc=0x%04x)", mbx, gdsp_mbox_peek(MAILBOX_DSP),
|
DEBUG_LOG_FMT(DSP_MAIL, "{}(WM) B:{} M:{:#010x} (pc={:#06x})", type, mbx, gdsp_mbox_peek(mbx),
|
||||||
g_dsp.pc);
|
|
||||||
else
|
|
||||||
DEBUG_LOG(DSP_MAIL, "CPU(WM) B:%i M:0x%08x (pc=0x%04x)", mbx, gdsp_mbox_peek(MAILBOX_CPU),
|
|
||||||
g_dsp.pc);
|
g_dsp.pc);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -86,11 +83,8 @@ u16 gdsp_mbox_read_l(Mailbox mbx)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
if (mbx == MAILBOX_DSP)
|
const char* const type = mbx == MAILBOX_DSP ? "DSP" : "CPU";
|
||||||
DEBUG_LOG(DSP_MAIL, "DSP(RM) B:%i M:0x%08x (pc=0x%04x)", mbx, gdsp_mbox_peek(MAILBOX_DSP),
|
DEBUG_LOG_FMT(DSP_MAIL, "{}(RM) B:{} M:0x{:#010x} (pc={:#06x})", type, mbx, gdsp_mbox_peek(mbx),
|
||||||
g_dsp.pc);
|
|
||||||
else
|
|
||||||
DEBUG_LOG(DSP_MAIL, "CPU(RM) B:%i M:0x%08x (pc=0x%04x)", mbx, gdsp_mbox_peek(MAILBOX_CPU),
|
|
||||||
g_dsp.pc);
|
g_dsp.pc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -104,10 +98,10 @@ void gdsp_ifx_write(u32 addr, u16 val)
|
||||||
switch (addr & 0xff)
|
switch (addr & 0xff)
|
||||||
{
|
{
|
||||||
case DSP_DIRQ:
|
case DSP_DIRQ:
|
||||||
if (val & 0x1)
|
if ((val & 1) != 0)
|
||||||
Host::InterruptRequest();
|
Host::InterruptRequest();
|
||||||
else
|
else
|
||||||
WARN_LOG(DSPLLE, "Unknown Interrupt Request pc=%04x (%04x)", g_dsp.pc, val);
|
WARN_LOG_FMT(DSPLLE, "Unknown Interrupt Request pc={:#06x} ({:#06x})", g_dsp.pc, val);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSP_DMBH:
|
case DSP_DMBH:
|
||||||
|
@ -130,16 +124,17 @@ void gdsp_ifx_write(u32 addr, u16 val)
|
||||||
if (!g_dsp.ifx_regs[DSP_AMDM])
|
if (!g_dsp.ifx_regs[DSP_AMDM])
|
||||||
gdsp_do_dma();
|
gdsp_do_dma();
|
||||||
else
|
else
|
||||||
NOTICE_LOG(DSPLLE, "Masked DMA skipped");
|
NOTICE_LOG_FMT(DSPLLE, "Masked DMA skipped");
|
||||||
g_dsp.ifx_regs[DSP_DSCR] &= ~4;
|
g_dsp.ifx_regs[DSP_DSCR] &= ~4;
|
||||||
g_dsp.ifx_regs[DSP_DSBL] = 0;
|
g_dsp.ifx_regs[DSP_DSBL] = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSP_GAIN:
|
case DSP_GAIN:
|
||||||
if (val)
|
if (val != 0)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(DSPLLE, "Gain Written: 0x%04x", val);
|
DEBUG_LOG(DSPLLE, "Gain Written: {:#06x}", val);
|
||||||
}
|
}
|
||||||
|
[[fallthrough]];
|
||||||
case DSP_DSPA:
|
case DSP_DSPA:
|
||||||
case DSP_DSMAH:
|
case DSP_DSMAH:
|
||||||
case DSP_DSMAL:
|
case DSP_DSMAL:
|
||||||
|
@ -190,18 +185,21 @@ void gdsp_ifx_write(u32 addr, u16 val)
|
||||||
default:
|
default:
|
||||||
if ((addr & 0xff) >= 0xa0)
|
if ((addr & 0xff) >= 0xa0)
|
||||||
{
|
{
|
||||||
if (pdlabels[(addr & 0xFF) - 0xa0].name && pdlabels[(addr & 0xFF) - 0xa0].description)
|
const u32 index = (addr & 0xFF) - 0xa0;
|
||||||
|
const auto& label = pdlabels[index];
|
||||||
|
|
||||||
|
if (label.name && label.description)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(DSPLLE, "%04x MW %s (%04x)", g_dsp.pc, pdlabels[(addr & 0xFF) - 0xa0].name, val);
|
DEBUG_LOG_FMT(DSPLLE, "{:04x} MW {} ({:04x})", g_dsp.pc, label.name, val);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE, "%04x MW %04x (%04x)", g_dsp.pc, addr, val);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} MW {:04x} ({:04x})", g_dsp.pc, addr, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE, "%04x MW %04x (%04x)", g_dsp.pc, addr, val);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} MW {:04x} ({:04x})", g_dsp.pc, addr, val);
|
||||||
}
|
}
|
||||||
g_dsp.ifx_regs[addr & 0xFF] = val;
|
g_dsp.ifx_regs[addr & 0xFF] = val;
|
||||||
break;
|
break;
|
||||||
|
@ -253,23 +251,29 @@ static u16 _gdsp_ifx_read(u16 addr)
|
||||||
return g_dsp.accelerator->ReadD3();
|
return g_dsp.accelerator->ReadD3();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
|
const u16 ifx_reg = g_dsp.ifx_regs[addr & 0xFF];
|
||||||
|
|
||||||
if ((addr & 0xff) >= 0xa0)
|
if ((addr & 0xff) >= 0xa0)
|
||||||
{
|
{
|
||||||
if (pdlabels[(addr & 0xFF) - 0xa0].name && pdlabels[(addr & 0xFF) - 0xa0].description)
|
const u32 index = (addr & 0xFF) - 0xa0;
|
||||||
|
const auto& label = pdlabels[index];
|
||||||
|
|
||||||
|
if (label.name && label.description)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(DSPLLE, "%04x MR %s (%04x)", g_dsp.pc, pdlabels[(addr & 0xFF) - 0xa0].name,
|
DEBUG_LOG_FMT(DSPLLE, "{:04x} MR {} ({:04x})", g_dsp.pc, label.name, ifx_reg);
|
||||||
g_dsp.ifx_regs[addr & 0xFF]);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE, "%04x MR %04x (%04x)", g_dsp.pc, addr, g_dsp.ifx_regs[addr & 0xFF]);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} MR {:04x} ({:04x})", g_dsp.pc, addr, ifx_reg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE, "%04x MR %04x (%04x)", g_dsp.pc, addr, g_dsp.ifx_regs[addr & 0xFF]);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} MR {:04x} ({:04x})", g_dsp.pc, addr, ifx_reg);
|
||||||
|
}
|
||||||
|
return ifx_reg;
|
||||||
}
|
}
|
||||||
return g_dsp.ifx_regs[addr & 0xFF];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,16 +291,16 @@ static const u8* gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size)
|
||||||
Common::WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false);
|
Common::WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false);
|
||||||
|
|
||||||
Host::CodeLoaded(addr, size);
|
Host::CodeLoaded(addr, size);
|
||||||
NOTICE_LOG(DSPLLE, "*** Copy new UCode from 0x%08x to 0x%04x (crc: %8x)", addr, dsp_addr,
|
NOTICE_LOG_FMT(DSPLLE, "*** Copy new UCode from {:#010x} to {:#06x} (crc: {:#08x})", addr,
|
||||||
g_dsp.iram_crc);
|
dsp_addr, g_dsp.iram_crc);
|
||||||
|
|
||||||
return reinterpret_cast<u8*>(g_dsp.iram) + dsp_addr;
|
return reinterpret_cast<u8*>(g_dsp.iram) + dsp_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u8* gdsp_idma_out(u16 dsp_addr, u32 addr, u32 size)
|
static const u8* gdsp_idma_out(u16 dsp_addr, u32 addr, u32 size)
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE, "*** idma_out IRAM_DSP (0x%04x) -> RAM (0x%08x) : size (0x%08x)", dsp_addr / 2,
|
ERROR_LOG_FMT(DSPLLE, "*** idma_out IRAM_DSP ({:#06x}) -> RAM ({:#010x}) : size ({:#010x})",
|
||||||
addr, size);
|
dsp_addr / 2, addr, size);
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -305,7 +309,7 @@ static const u8* gdsp_idma_out(u16 dsp_addr, u32 addr, u32 size)
|
||||||
static const u8* gdsp_ddma_in(u16 dsp_addr, u32 addr, u32 size)
|
static const u8* gdsp_ddma_in(u16 dsp_addr, u32 addr, u32 size)
|
||||||
{
|
{
|
||||||
Host::DMAToDSP(g_dsp.dram + dsp_addr / 2, addr, size);
|
Host::DMAToDSP(g_dsp.dram + dsp_addr / 2, addr, size);
|
||||||
DEBUG_LOG(DSPLLE, "*** ddma_in RAM (0x%08x) -> DRAM_DSP (0x%04x) : size (0x%08x)", addr,
|
DEBUG_LOG_FMT(DSPLLE, "*** ddma_in RAM ({:#010x}) -> DRAM_DSP ({:#06x}) : size ({:#010x})", addr,
|
||||||
dsp_addr / 2, size);
|
dsp_addr / 2, size);
|
||||||
|
|
||||||
return reinterpret_cast<u8*>(g_dsp.dram) + dsp_addr;
|
return reinterpret_cast<u8*>(g_dsp.dram) + dsp_addr;
|
||||||
|
@ -314,28 +318,30 @@ static const u8* gdsp_ddma_in(u16 dsp_addr, u32 addr, u32 size)
|
||||||
static const u8* gdsp_ddma_out(u16 dsp_addr, u32 addr, u32 size)
|
static const u8* gdsp_ddma_out(u16 dsp_addr, u32 addr, u32 size)
|
||||||
{
|
{
|
||||||
Host::DMAFromDSP(g_dsp.dram + dsp_addr / 2, addr, size);
|
Host::DMAFromDSP(g_dsp.dram + dsp_addr / 2, addr, size);
|
||||||
DEBUG_LOG(DSPLLE, "*** ddma_out DRAM_DSP (0x%04x) -> RAM (0x%08x) : size (0x%08x)", dsp_addr / 2,
|
DEBUG_LOG_FMT(DSPLLE, "*** ddma_out DRAM_DSP ({:#06x}) -> RAM ({:#010x}) : size ({:#010x})",
|
||||||
addr, size);
|
dsp_addr / 2, addr, size);
|
||||||
|
|
||||||
return reinterpret_cast<const u8*>(g_dsp.dram) + dsp_addr;
|
return reinterpret_cast<const u8*>(g_dsp.dram) + dsp_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gdsp_do_dma()
|
static void gdsp_do_dma()
|
||||||
{
|
{
|
||||||
u32 addr = (g_dsp.ifx_regs[DSP_DSMAH] << 16) | g_dsp.ifx_regs[DSP_DSMAL];
|
const u32 addr = (g_dsp.ifx_regs[DSP_DSMAH] << 16) | g_dsp.ifx_regs[DSP_DSMAL];
|
||||||
u16 ctl = g_dsp.ifx_regs[DSP_DSCR];
|
const u16 ctl = g_dsp.ifx_regs[DSP_DSCR];
|
||||||
u16 dsp_addr = g_dsp.ifx_regs[DSP_DSPA] * 2;
|
const u16 dsp_addr = g_dsp.ifx_regs[DSP_DSPA] * 2;
|
||||||
u16 len = g_dsp.ifx_regs[DSP_DSBL];
|
const u16 len = g_dsp.ifx_regs[DSP_DSBL];
|
||||||
|
|
||||||
if (len > 0x4000)
|
if (len > 0x4000)
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE,
|
ERROR_LOG_FMT(DSPLLE,
|
||||||
"DMA ERROR: PC: %04x, Control: %04x, Address: %08x, DSP Address: %04x, Size: %04x",
|
"DMA ERROR: PC: {:04x}, Control: {:04x}, Address: {:08x}, DSP Address: {:04x}, "
|
||||||
|
"Size: {:04x}",
|
||||||
g_dsp.pc, ctl, addr, dsp_addr, len);
|
g_dsp.pc, ctl, addr, dsp_addr, len);
|
||||||
exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
DEBUG_LOG(DSPLLE, "DMA pc: %04x, Control: %04x, Address: %08x, DSP Address: %04x, Size: %04x",
|
DEBUG_LOG_FMT(
|
||||||
|
DSPLLE, "DMA pc: {:04x}, Control: {:04x}, Address: {:08x}, DSP Address: {:04x}, Size: {:04x}",
|
||||||
g_dsp.pc, ctl, addr, dsp_addr, len);
|
g_dsp.pc, ctl, addr, dsp_addr, len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ u16 dsp_imem_read(u16 addr)
|
||||||
return g_dsp.irom[addr & DSP_IROM_MASK];
|
return g_dsp.irom[addr & DSP_IROM_MASK];
|
||||||
|
|
||||||
default: // Unmapped/non-existing memory
|
default: // Unmapped/non-existing memory
|
||||||
ERROR_LOG(DSPLLE, "%04x DSP ERROR: Executing from invalid (%04x) memory", g_dsp.pc, addr);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} DSP ERROR: Executing from invalid ({:04x}) memory", g_dsp.pc,
|
||||||
|
addr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,14 +38,14 @@ u16 dsp_dmem_read(u16 addr)
|
||||||
return g_dsp.dram[addr & DSP_DRAM_MASK];
|
return g_dsp.dram[addr & DSP_DRAM_MASK];
|
||||||
|
|
||||||
case 0x1: // 1xxx COEF
|
case 0x1: // 1xxx COEF
|
||||||
DEBUG_LOG(DSPLLE, "%04x : Coefficient Read @ %04x", g_dsp.pc, addr);
|
DEBUG_LOG_FMT(DSPLLE, "{:04x} : Coefficient Read @ {:04x}", g_dsp.pc, addr);
|
||||||
return g_dsp.coef[addr & DSP_COEF_MASK];
|
return g_dsp.coef[addr & DSP_COEF_MASK];
|
||||||
|
|
||||||
case 0xf: // Fxxx HW regs
|
case 0xf: // Fxxx HW regs
|
||||||
return gdsp_ifx_read(addr);
|
return gdsp_ifx_read(addr);
|
||||||
|
|
||||||
default: // Unmapped/non-existing memory
|
default: // Unmapped/non-existing memory
|
||||||
ERROR_LOG(DSPLLE, "%04x DSP ERROR: Read from UNKNOWN (%04x) memory", g_dsp.pc, addr);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} DSP ERROR: Read from UNKNOWN ({:04x}) memory", g_dsp.pc, addr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +63,7 @@ void dsp_dmem_write(u16 addr, u16 val)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: // Unmapped/non-existing memory
|
default: // Unmapped/non-existing memory
|
||||||
ERROR_LOG(DSPLLE, "%04x DSP ERROR: Write to UNKNOWN (%04x) memory", g_dsp.pc, addr);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} DSP ERROR: Write to UNKNOWN ({:04x}) memory", g_dsp.pc, addr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -592,7 +592,7 @@ void InitInstructionTable()
|
||||||
// If the entry already in the table is a strict subset, allow it
|
// If the entry already in the table is a strict subset, allow it
|
||||||
if ((s_ext_op_table[i]->opcode_mask | iter->opcode_mask) != s_ext_op_table[i]->opcode_mask)
|
if ((s_ext_op_table[i]->opcode_mask | iter->opcode_mask) != s_ext_op_table[i]->opcode_mask)
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE, "opcode ext table place %zu already in use by %s when inserting %s", i,
|
ERROR_LOG_FMT(DSPLLE, "opcode ext table place {} already in use by {} when inserting {}", i,
|
||||||
s_ext_op_table[i]->name, iter->name);
|
s_ext_op_table[i]->name, iter->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -610,7 +610,7 @@ void InitInstructionTable()
|
||||||
if (s_op_table[i] == &cw)
|
if (s_op_table[i] == &cw)
|
||||||
s_op_table[i] = &*iter;
|
s_op_table[i] = &*iter;
|
||||||
else
|
else
|
||||||
ERROR_LOG(DSPLLE, "opcode table place %zu already in use for %s", i, iter->name);
|
ERROR_LOG_FMT(DSPLLE, "opcode table place {} already in use for {}", i, iter->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeBackLogIdx.fill(-1);
|
writeBackLogIdx.fill(-1);
|
||||||
|
|
|
@ -42,7 +42,7 @@ void WriteCR(u16 val)
|
||||||
// reset
|
// reset
|
||||||
if (val & 1)
|
if (val & 1)
|
||||||
{
|
{
|
||||||
INFO_LOG(DSPLLE, "DSP_CONTROL RESET");
|
INFO_LOG_FMT(DSPLLE, "DSP_CONTROL RESET");
|
||||||
DSPCore_Reset();
|
DSPCore_Reset();
|
||||||
val &= ~1;
|
val &= ~1;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ void WriteCR(u16 val)
|
||||||
{
|
{
|
||||||
// HAX!
|
// HAX!
|
||||||
// OSInitAudioSystem ucode should send this mail - not DSP core itself
|
// OSInitAudioSystem ucode should send this mail - not DSP core itself
|
||||||
INFO_LOG(DSPLLE, "DSP_CONTROL INIT");
|
INFO_LOG_FMT(DSPLLE, "DSP_CONTROL INIT");
|
||||||
g_init_hax = true;
|
g_init_hax = true;
|
||||||
val |= 0x800;
|
val |= 0x800;
|
||||||
}
|
}
|
||||||
|
@ -233,6 +233,6 @@ void nop(const UDSPInstruction opc)
|
||||||
if (opc == 0)
|
if (opc == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ERROR_LOG(DSPLLE, "LLE: Unrecognized opcode 0x%04x", opc);
|
ERROR_LOG_FMT(DSPLLE, "LLE: Unrecognized opcode {:#06x}", opc);
|
||||||
}
|
}
|
||||||
} // namespace DSP::Interpreter
|
} // namespace DSP::Interpreter
|
||||||
|
|
|
@ -173,7 +173,7 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
|
||||||
m_gpr.PushRegs();
|
m_gpr.PushRegs();
|
||||||
ABI_CallFunctionC16(interpreter_function, inst);
|
ABI_CallFunctionC16(interpreter_function, inst);
|
||||||
m_gpr.PopRegs();
|
m_gpr.PopRegs();
|
||||||
INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x", inst);
|
INFO_LOG_FMT(DSPLLE, "Instruction not JITed(ext part): {:04x}", inst);
|
||||||
ext_is_jit = false;
|
ext_is_jit = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FallBackToInterpreter(inst);
|
FallBackToInterpreter(inst);
|
||||||
INFO_LOG(DSPLLE, "Instruction not JITed(main part): %04x", inst);
|
INFO_LOG_FMT(DSPLLE, "Instruction not JITed(main part): {:04x}", inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backlog
|
// Backlog
|
||||||
|
@ -359,7 +359,7 @@ void DSPEmitter::Compile(u16 start_addr)
|
||||||
{
|
{
|
||||||
// just a safeguard, should never happen anymore.
|
// just a safeguard, should never happen anymore.
|
||||||
// if it does we might get stuck over in RunForCycles.
|
// if it does we might get stuck over in RunForCycles.
|
||||||
ERROR_LOG(DSPLLE, "Block at 0x%04x has zero size", start_addr);
|
ERROR_LOG_FMT(DSPLLE, "Block at {:#06x} has zero size", start_addr);
|
||||||
m_block_size[start_addr] = 1;
|
m_block_size[start_addr] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -957,7 +957,7 @@ void DSPJitRegCache::GetXReg(X64Reg reg)
|
||||||
{
|
{
|
||||||
if (m_xregs[reg].guest_reg == DSP_REG_STATIC)
|
if (m_xregs[reg].guest_reg == DSP_REG_STATIC)
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE, "Trying to get statically used XReg %d", reg);
|
ERROR_LOG_FMT(DSPLLE, "Trying to get statically used XReg {}", reg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -973,7 +973,7 @@ void DSPJitRegCache::PutXReg(X64Reg reg)
|
||||||
{
|
{
|
||||||
if (m_xregs[reg].guest_reg == DSP_REG_STATIC)
|
if (m_xregs[reg].guest_reg == DSP_REG_STATIC)
|
||||||
{
|
{
|
||||||
ERROR_LOG(DSPLLE, "Trying to put statically used XReg %d", reg);
|
ERROR_LOG_FMT(DSPLLE, "Trying to put statically used XReg {}", reg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
|
#include "Common/Logging/Log.h"
|
||||||
#include "Core/DSP/DSPCore.h"
|
#include "Core/DSP/DSPCore.h"
|
||||||
#include "Core/DSP/DSPHWInterface.h"
|
#include "Core/DSP/DSPHWInterface.h"
|
||||||
#include "Core/DSP/Jit/x64/DSPEmitter.h"
|
#include "Core/DSP/Jit/x64/DSPEmitter.h"
|
||||||
|
@ -554,7 +555,7 @@ void DSPEmitter::dmem_write_imm(u16 address, X64Reg value)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: // Unmapped/non-existing memory
|
default: // Unmapped/non-existing memory
|
||||||
ERROR_LOG(DSPLLE, "%04x DSP ERROR: Write to UNKNOWN (%04x) memory", g_dsp.pc, address);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} DSP ERROR: Write to UNKNOWN ({:04x}) memory", g_dsp.pc, address);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -642,7 +643,7 @@ void DSPEmitter::dmem_read_imm(u16 address)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: // Unmapped/non-existing memory
|
default: // Unmapped/non-existing memory
|
||||||
ERROR_LOG(DSPLLE, "%04x DSP ERROR: Read from UNKNOWN (%04x) memory", g_dsp.pc, address);
|
ERROR_LOG_FMT(DSPLLE, "{:04x} DSP ERROR: Read from UNKNOWN ({:04x}) memory", g_dsp.pc, address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "Common/Logging/Log.h"
|
||||||
#include "Core/DSP/DSPTables.h"
|
#include "Core/DSP/DSPTables.h"
|
||||||
|
|
||||||
namespace DSP
|
namespace DSP
|
||||||
|
@ -47,7 +48,7 @@ void LabelMap::RegisterLabel(std::string label, u16 lval, LabelType type)
|
||||||
const std::optional<u16> old_value = GetLabelValue(label);
|
const std::optional<u16> old_value = GetLabelValue(label);
|
||||||
if (old_value && old_value != lval)
|
if (old_value && old_value != lval)
|
||||||
{
|
{
|
||||||
printf("WARNING: Redefined label %s to %04x - old value %04x\n", label.c_str(), lval,
|
WARN_LOG_FMT(AUDIO, "Redefined label {} to {:04x} - old value {:04x}\n", label, lval,
|
||||||
*old_value);
|
*old_value);
|
||||||
DeleteLabel(label);
|
DeleteLabel(label);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +66,7 @@ void LabelMap::DeleteLabel(std::string_view label)
|
||||||
labels.erase(iter);
|
labels.erase(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<u16> LabelMap::GetLabelValue(const std::string& name, LabelType type) const
|
std::optional<u16> LabelMap::GetLabelValue(std::string_view name, LabelType type) const
|
||||||
{
|
{
|
||||||
for (const auto& label : labels)
|
for (const auto& label : labels)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +78,7 @@ std::optional<u16> LabelMap::GetLabelValue(const std::string& name, LabelType ty
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("WARNING: Wrong label type requested. %s\n", name.c_str());
|
WARN_LOG_FMT(AUDIO, "Wrong label type requested. {}\n", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
void RegisterDefaults();
|
void RegisterDefaults();
|
||||||
void RegisterLabel(std::string label, u16 lval, LabelType type = LABEL_VALUE);
|
void RegisterLabel(std::string label, u16 lval, LabelType type = LABEL_VALUE);
|
||||||
void DeleteLabel(std::string_view label);
|
void DeleteLabel(std::string_view label);
|
||||||
std::optional<u16> GetLabelValue(const std::string& label, LabelType type = LABEL_ANY) const;
|
std::optional<u16> GetLabelValue(std::string_view name, LabelType type = LABEL_ANY) const;
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -100,52 +100,52 @@ bool GetCallstack(std::vector<CallstackEntry>& output)
|
||||||
|
|
||||||
void PrintCallstack()
|
void PrintCallstack()
|
||||||
{
|
{
|
||||||
printf("== STACK TRACE - SP = %08x ==", PowerPC::ppcState.gpr[1]);
|
fmt::print("== STACK TRACE - SP = {:08x} ==", PowerPC::ppcState.gpr[1]);
|
||||||
|
|
||||||
if (LR == 0)
|
if (LR == 0)
|
||||||
{
|
{
|
||||||
printf(" LR = 0 - this is bad");
|
fmt::print(" LR = 0 - this is bad");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_symbolDB.GetDescription(PC) != g_symbolDB.GetDescription(LR))
|
if (g_symbolDB.GetDescription(PC) != g_symbolDB.GetDescription(LR))
|
||||||
{
|
{
|
||||||
printf(" * %s [ LR = %08x ]", g_symbolDB.GetDescription(LR).c_str(), LR);
|
fmt::print(" * {} [ LR = {:08x} ]", g_symbolDB.GetDescription(LR), LR);
|
||||||
}
|
}
|
||||||
|
|
||||||
WalkTheStack([](u32 func_addr) {
|
WalkTheStack([](u32 func_addr) {
|
||||||
std::string func_desc = g_symbolDB.GetDescription(func_addr);
|
std::string func_desc = g_symbolDB.GetDescription(func_addr);
|
||||||
if (func_desc.empty() || func_desc == "Invalid")
|
if (func_desc.empty() || func_desc == "Invalid")
|
||||||
func_desc = "(unknown)";
|
func_desc = "(unknown)";
|
||||||
printf(" * %s [ addr = %08x ]", func_desc.c_str(), func_addr);
|
fmt::print(" * {} [ addr = {:08x} ]", func_desc, func_addr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintCallstack(Common::Log::LOG_TYPE type, Common::Log::LOG_LEVELS level)
|
void PrintCallstack(Common::Log::LOG_TYPE type, Common::Log::LOG_LEVELS level)
|
||||||
{
|
{
|
||||||
GENERIC_LOG(type, level, "== STACK TRACE - SP = %08x ==", PowerPC::ppcState.gpr[1]);
|
GENERIC_LOG_FMT(type, level, "== STACK TRACE - SP = {:08x} ==", PowerPC::ppcState.gpr[1]);
|
||||||
|
|
||||||
if (LR == 0)
|
if (LR == 0)
|
||||||
{
|
{
|
||||||
GENERIC_LOG(type, level, " LR = 0 - this is bad");
|
GENERIC_LOG_FMT(type, level, " LR = 0 - this is bad");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_symbolDB.GetDescription(PC) != g_symbolDB.GetDescription(LR))
|
if (g_symbolDB.GetDescription(PC) != g_symbolDB.GetDescription(LR))
|
||||||
{
|
{
|
||||||
GENERIC_LOG(type, level, " * %s [ LR = %08x ]", g_symbolDB.GetDescription(LR).c_str(), LR);
|
GENERIC_LOG_FMT(type, level, " * {} [ LR = {:08x} ]", g_symbolDB.GetDescription(LR), LR);
|
||||||
}
|
}
|
||||||
|
|
||||||
WalkTheStack([type, level](u32 func_addr) {
|
WalkTheStack([type, level](u32 func_addr) {
|
||||||
std::string func_desc = g_symbolDB.GetDescription(func_addr);
|
std::string func_desc = g_symbolDB.GetDescription(func_addr);
|
||||||
if (func_desc.empty() || func_desc == "Invalid")
|
if (func_desc.empty() || func_desc == "Invalid")
|
||||||
func_desc = "(unknown)";
|
func_desc = "(unknown)";
|
||||||
GENERIC_LOG(type, level, " * %s [ addr = %08x ]", func_desc.c_str(), func_addr);
|
GENERIC_LOG_FMT(type, level, " * {} [ addr = {:08x} ]", func_desc, func_addr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintDataBuffer(Common::Log::LOG_TYPE type, const u8* data, size_t size,
|
void PrintDataBuffer(Common::Log::LOG_TYPE type, const u8* data, size_t size,
|
||||||
const std::string& title)
|
std::string_view title)
|
||||||
{
|
{
|
||||||
GENERIC_LOG(type, Common::Log::LDEBUG, "%s", title.c_str());
|
GENERIC_LOG_FMT(type, Common::Log::LDEBUG, "{}", title);
|
||||||
for (u32 j = 0; j < size;)
|
for (u32 j = 0; j < size;)
|
||||||
{
|
{
|
||||||
std::string hex_line;
|
std::string hex_line;
|
||||||
|
@ -156,7 +156,7 @@ void PrintDataBuffer(Common::Log::LOG_TYPE type, const u8* data, size_t size,
|
||||||
if (j >= size)
|
if (j >= size)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
GENERIC_LOG(type, Common::Log::LDEBUG, " Data: %s", hex_line.c_str());
|
GENERIC_LOG_FMT(type, Common::Log::LDEBUG, " Data: {}", hex_line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
@ -22,7 +23,7 @@ bool GetCallstack(std::vector<CallstackEntry>& output);
|
||||||
void PrintCallstack();
|
void PrintCallstack();
|
||||||
void PrintCallstack(Common::Log::LOG_TYPE type, Common::Log::LOG_LEVELS level);
|
void PrintCallstack(Common::Log::LOG_TYPE type, Common::Log::LOG_LEVELS level);
|
||||||
void PrintDataBuffer(Common::Log::LOG_TYPE type, const u8* data, size_t size,
|
void PrintDataBuffer(Common::Log::LOG_TYPE type, const u8* data, size_t size,
|
||||||
const std::string& title);
|
std::string_view title);
|
||||||
void AddAutoBreakpoints();
|
void AddAutoBreakpoints();
|
||||||
|
|
||||||
} // namespace Dolphin_Debugger
|
} // namespace Dolphin_Debugger
|
||||||
|
|
|
@ -329,33 +329,33 @@ void RSOView::LoadSections()
|
||||||
|
|
||||||
void RSOView::LoadImports()
|
void RSOView::LoadImports()
|
||||||
{
|
{
|
||||||
std::size_t size = m_header.GetImportsSize();
|
const std::size_t size = m_header.GetImportsSize();
|
||||||
if (size % sizeof(RSOImport) != 0)
|
if (size % sizeof(RSOImport) != 0)
|
||||||
WARN_LOG(SYMBOLS, "RSO Imports Table has an incoherent size (%08zx)", size);
|
WARN_LOG_FMT(SYMBOLS, "RSO Imports Table has an incoherent size ({:08x})", size);
|
||||||
m_imports.Load(m_header.GetImportsOffset(), size / sizeof(RSOImport));
|
m_imports.Load(m_header.GetImportsOffset(), size / sizeof(RSOImport));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSOView::LoadExports()
|
void RSOView::LoadExports()
|
||||||
{
|
{
|
||||||
std::size_t size = m_header.GetExportsSize();
|
const std::size_t size = m_header.GetExportsSize();
|
||||||
if (size % sizeof(RSOExport) != 0)
|
if (size % sizeof(RSOExport) != 0)
|
||||||
WARN_LOG(SYMBOLS, "RSO Exports Table has an incoherent size (%08zx)", size);
|
WARN_LOG_FMT(SYMBOLS, "RSO Exports Table has an incoherent size ({:08x})", size);
|
||||||
m_exports.Load(m_header.GetExportsOffset(), size / sizeof(RSOExport));
|
m_exports.Load(m_header.GetExportsOffset(), size / sizeof(RSOExport));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSOView::LoadInternals()
|
void RSOView::LoadInternals()
|
||||||
{
|
{
|
||||||
std::size_t size = m_header.GetInternalsSize();
|
const std::size_t size = m_header.GetInternalsSize();
|
||||||
if (size % sizeof(RSOInternalsEntry) != 0)
|
if (size % sizeof(RSOInternalsEntry) != 0)
|
||||||
WARN_LOG(SYMBOLS, "RSO Internals Relocation Table has an incoherent size (%08zx)", size);
|
WARN_LOG_FMT(SYMBOLS, "RSO Internals Relocation Table has an incoherent size ({:08x})", size);
|
||||||
m_imports.Load(m_header.GetInternalsOffset(), size / sizeof(RSOInternalsEntry));
|
m_imports.Load(m_header.GetInternalsOffset(), size / sizeof(RSOInternalsEntry));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSOView::LoadExternals()
|
void RSOView::LoadExternals()
|
||||||
{
|
{
|
||||||
std::size_t size = m_header.GetExternalsSize();
|
const std::size_t size = m_header.GetExternalsSize();
|
||||||
if (size % sizeof(RSOExternalsEntry) != 0)
|
if (size % sizeof(RSOExternalsEntry) != 0)
|
||||||
WARN_LOG(SYMBOLS, "RSO Externals Relocation Table has an incoherent size (%08zx)", size);
|
WARN_LOG_FMT(SYMBOLS, "RSO Externals Relocation Table has an incoherent size ({:08x})", size);
|
||||||
m_imports.Load(m_header.GetExternalsOffset(), size / sizeof(RSOExternalsEntry));
|
m_imports.Load(m_header.GetExternalsOffset(), size / sizeof(RSOExternalsEntry));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ void RSOView::Apply(PPCSymbolDB* symbol_db) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEBUG_LOG(SYMBOLS, "RSO(%s): %zu symbols applied", GetName().c_str(), GetExportsCount());
|
DEBUG_LOG_FMT(SYMBOLS, "RSO({}): {} symbols applied", GetName(), GetExportsCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 RSOView::GetNextEntry() const
|
u32 RSOView::GetNextEntry() const
|
||||||
|
@ -528,11 +528,11 @@ std::string RSOView::GetName(const RSOExport& rso_export) const
|
||||||
|
|
||||||
u32 RSOView::GetProlog() const
|
u32 RSOView::GetProlog() const
|
||||||
{
|
{
|
||||||
u32 section_index = m_header.GetPrologSectionIndex();
|
const u32 section_index = m_header.GetPrologSectionIndex();
|
||||||
if (section_index == 0)
|
if (section_index == 0)
|
||||||
WARN_LOG(SYMBOLS, "RSO doesn't have a prolog function");
|
WARN_LOG_FMT(SYMBOLS, "RSO doesn't have a prolog function");
|
||||||
else if (section_index >= m_sections.Count())
|
else if (section_index >= m_sections.Count())
|
||||||
WARN_LOG(SYMBOLS, "RSO prolog section index out of bound");
|
WARN_LOG_FMT(SYMBOLS, "RSO prolog section index out of bound");
|
||||||
else
|
else
|
||||||
return GetSection(section_index).offset + m_header.GetPrologSectionOffset();
|
return GetSection(section_index).offset + m_header.GetPrologSectionOffset();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -540,11 +540,11 @@ u32 RSOView::GetProlog() const
|
||||||
|
|
||||||
u32 RSOView::GetEpilog() const
|
u32 RSOView::GetEpilog() const
|
||||||
{
|
{
|
||||||
u32 section_index = m_header.GetEpilogSectionIndex();
|
const u32 section_index = m_header.GetEpilogSectionIndex();
|
||||||
if (section_index == 0)
|
if (section_index == 0)
|
||||||
WARN_LOG(SYMBOLS, "RSO doesn't have an epilog function");
|
WARN_LOG_FMT(SYMBOLS, "RSO doesn't have an epilog function");
|
||||||
else if (section_index >= m_sections.Count())
|
else if (section_index >= m_sections.Count())
|
||||||
WARN_LOG(SYMBOLS, "RSO epilog section index out of bound");
|
WARN_LOG_FMT(SYMBOLS, "RSO epilog section index out of bound");
|
||||||
else
|
else
|
||||||
return GetSection(section_index).offset + m_header.GetEpilogSectionOffset();
|
return GetSection(section_index).offset + m_header.GetEpilogSectionOffset();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -552,11 +552,11 @@ u32 RSOView::GetEpilog() const
|
||||||
|
|
||||||
u32 RSOView::GetUnresolved() const
|
u32 RSOView::GetUnresolved() const
|
||||||
{
|
{
|
||||||
u32 section_index = m_header.GetUnresolvedSectionIndex();
|
const u32 section_index = m_header.GetUnresolvedSectionIndex();
|
||||||
if (section_index == 0)
|
if (section_index == 0)
|
||||||
WARN_LOG(SYMBOLS, "RSO doesn't have a unresolved function");
|
WARN_LOG_FMT(SYMBOLS, "RSO doesn't have a unresolved function");
|
||||||
else if (section_index >= m_sections.Count())
|
else if (section_index >= m_sections.Count())
|
||||||
WARN_LOG(SYMBOLS, "RSO unresolved section index out of bound");
|
WARN_LOG_FMT(SYMBOLS, "RSO unresolved section index out of bound");
|
||||||
else
|
else
|
||||||
return GetSection(section_index).offset + m_header.GetUnresolvedSectionOffset();
|
return GetSection(section_index).offset + m_header.GetUnresolvedSectionOffset();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -567,7 +567,7 @@ bool RSOChainView::Load(u32 address)
|
||||||
// Load node
|
// Load node
|
||||||
RSOView node;
|
RSOView node;
|
||||||
node.LoadHeader(address);
|
node.LoadHeader(address);
|
||||||
DEBUG_LOG(SYMBOLS, "RSOChain node name: %s", node.GetName().c_str());
|
DEBUG_LOG_FMT(SYMBOLS, "RSOChain node name: {}", node.GetName());
|
||||||
m_chain.emplace_front(std::move(node));
|
m_chain.emplace_front(std::move(node));
|
||||||
|
|
||||||
if (LoadNextChain(m_chain.front()) && LoadPrevChain(m_chain.front()))
|
if (LoadNextChain(m_chain.front()) && LoadPrevChain(m_chain.front()))
|
||||||
|
@ -613,8 +613,8 @@ bool RSOChainView::LoadNextChain(const RSOView& view)
|
||||||
|
|
||||||
if (prev_address != next_node.GetPrevEntry())
|
if (prev_address != next_node.GetPrevEntry())
|
||||||
{
|
{
|
||||||
ERROR_LOG(SYMBOLS, "RSOChain has an incoherent previous link %08x != %08x in %s",
|
ERROR_LOG_FMT(SYMBOLS, "RSOChain has an incoherent previous link {:08x} != {:08x} in {}",
|
||||||
prev_address, next_node.GetPrevEntry(), next_node.GetName().c_str());
|
prev_address, next_node.GetPrevEntry(), next_node.GetName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,8 +638,8 @@ bool RSOChainView::LoadPrevChain(const RSOView& view)
|
||||||
|
|
||||||
if (next_address != prev_node.GetNextEntry())
|
if (next_address != prev_node.GetNextEntry())
|
||||||
{
|
{
|
||||||
ERROR_LOG(SYMBOLS, "RSOChain has an incoherent next link %08x != %08x in %s", next_address,
|
ERROR_LOG_FMT(SYMBOLS, "RSOChain has an incoherent next link {:08x} != {:08x} in {}",
|
||||||
prev_node.GetNextEntry(), prev_node.GetName().c_str());
|
next_address, prev_node.GetNextEntry(), prev_node.GetName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,13 +121,14 @@ static Installation InstallCodeHandlerLocked()
|
||||||
std::string data;
|
std::string data;
|
||||||
if (!File::ReadFileToString(File::GetSysDirectory() + GECKO_CODE_HANDLER, data))
|
if (!File::ReadFileToString(File::GetSysDirectory() + GECKO_CODE_HANDLER, data))
|
||||||
{
|
{
|
||||||
ERROR_LOG(ACTIONREPLAY, "Could not enable cheats because " GECKO_CODE_HANDLER " was missing.");
|
ERROR_LOG_FMT(ACTIONREPLAY,
|
||||||
|
"Could not enable cheats because " GECKO_CODE_HANDLER " was missing.");
|
||||||
return Installation::Failed;
|
return Installation::Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.size() > INSTALLER_END_ADDRESS - INSTALLER_BASE_ADDRESS - CODE_SIZE)
|
if (data.size() > INSTALLER_END_ADDRESS - INSTALLER_BASE_ADDRESS - CODE_SIZE)
|
||||||
{
|
{
|
||||||
ERROR_LOG(ACTIONREPLAY, GECKO_CODE_HANDLER " is too big. The file may be corrupt.");
|
ERROR_LOG_FMT(ACTIONREPLAY, GECKO_CODE_HANDLER " is too big. The file may be corrupt.");
|
||||||
return Installation::Failed;
|
return Installation::Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +148,7 @@ static Installation InstallCodeHandlerLocked()
|
||||||
// Patch MMIO address
|
// Patch MMIO address
|
||||||
if (PowerPC::HostRead_U32(INSTALLER_BASE_ADDRESS + h) == (0x3f000000u | ((mmio_addr ^ 1) << 8)))
|
if (PowerPC::HostRead_U32(INSTALLER_BASE_ADDRESS + h) == (0x3f000000u | ((mmio_addr ^ 1) << 8)))
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Patching MMIO access at %08x", INSTALLER_BASE_ADDRESS + h);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Patching MMIO access at {:08x}", INSTALLER_BASE_ADDRESS + h);
|
||||||
PowerPC::HostWrite_U32(0x3f000000u | mmio_addr << 8, INSTALLER_BASE_ADDRESS + h);
|
PowerPC::HostWrite_U32(0x3f000000u | mmio_addr << 8, INSTALLER_BASE_ADDRESS + h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,10 +176,10 @@ static Installation InstallCodeHandlerLocked()
|
||||||
// If the code is not going to fit in the space we have left then we have to skip it
|
// If the code is not going to fit in the space we have left then we have to skip it
|
||||||
if (next_address + active_code.codes.size() * CODE_SIZE > end_address)
|
if (next_address + active_code.codes.size() * CODE_SIZE > end_address)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY,
|
NOTICE_LOG_FMT(ACTIONREPLAY,
|
||||||
"Too many GeckoCodes! Ran out of storage space in Game RAM. Could "
|
"Too many GeckoCodes! Ran out of storage space in Game RAM. Could "
|
||||||
"not write: \"%s\". Need %zu bytes, only %u remain.",
|
"not write: \"{}\". Need {} bytes, only {} remain.",
|
||||||
active_code.name.c_str(), active_code.codes.size() * CODE_SIZE,
|
active_code.name, active_code.codes.size() * CODE_SIZE,
|
||||||
end_address - next_address);
|
end_address - next_address);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -191,7 +192,7 @@ static Installation InstallCodeHandlerLocked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WARN_LOG(ACTIONREPLAY, "GeckoCodes: Using %u of %u bytes", next_address - start_address,
|
WARN_LOG_FMT(ACTIONREPLAY, "GeckoCodes: Using {} of {} bytes", next_address - start_address,
|
||||||
end_address - start_address);
|
end_address - start_address);
|
||||||
|
|
||||||
// Stop code. Tells the handler that this is the end of the list.
|
// Stop code. Tells the handler that this is the end of the list.
|
||||||
|
@ -275,9 +276,9 @@ void RunCodeHandler()
|
||||||
PowerPC::HostWrite_U64(rPS(i).PS0AsU64(), SP + 24 + 2 * i * sizeof(u64));
|
PowerPC::HostWrite_U64(rPS(i).PS0AsU64(), SP + 24 + 2 * i * sizeof(u64));
|
||||||
PowerPC::HostWrite_U64(rPS(i).PS1AsU64(), SP + 24 + (2 * i + 1) * sizeof(u64));
|
PowerPC::HostWrite_U64(rPS(i).PS1AsU64(), SP + 24 + (2 * i + 1) * sizeof(u64));
|
||||||
}
|
}
|
||||||
DEBUG_LOG(ACTIONREPLAY,
|
DEBUG_LOG_FMT(ACTIONREPLAY,
|
||||||
"GeckoCodes: Initiating phantom branch-and-link. "
|
"GeckoCodes: Initiating phantom branch-and-link. "
|
||||||
"PC = 0x%08X, SP = 0x%08X, SFP = 0x%08X",
|
"PC = {:#010x}, SP = {:#010x}, SFP = {:#010x}",
|
||||||
PC, SP, SFP);
|
PC, SP, SFP);
|
||||||
LR = HLE_TRAMPOLINE_ADDRESS;
|
LR = HLE_TRAMPOLINE_ADDRESS;
|
||||||
PC = NPC = ENTRY_POINT;
|
PC = NPC = ENTRY_POINT;
|
||||||
|
|
|
@ -104,7 +104,7 @@ static void CheckKR(const char* name, kern_return_t kr)
|
||||||
{
|
{
|
||||||
if (kr)
|
if (kr)
|
||||||
{
|
{
|
||||||
PanicAlert("%s failed: kr=%x", name, kr);
|
PanicAlertFmt("{} failed: kr={:x}", name, kr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,13 +159,13 @@ static void ExceptionThread(mach_port_t port)
|
||||||
|
|
||||||
if (msg_in.Head.msgh_id != 2406)
|
if (msg_in.Head.msgh_id != 2406)
|
||||||
{
|
{
|
||||||
PanicAlert("unknown message received");
|
PanicAlertFmt("unknown message received");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg_in.flavor != x86_THREAD_STATE64)
|
if (msg_in.flavor != x86_THREAD_STATE64)
|
||||||
{
|
{
|
||||||
PanicAlert("unknown flavor %d (expected %d)", msg_in.flavor, x86_THREAD_STATE64);
|
PanicAlertFmt("unknown flavor {} (expected {})", msg_in.flavor, x86_THREAD_STATE64);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "Common/File.h"
|
#include "Common/File.h"
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
#include "Common/Hash.h"
|
#include "Common/Hash.h"
|
||||||
|
#include "Common/MsgHandler.h"
|
||||||
#include "Common/NandPaths.h"
|
#include "Common/NandPaths.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
#include "Common/Timer.h"
|
#include "Common/Timer.h"
|
||||||
|
@ -228,8 +229,8 @@ void Init(const BootParameters& boot)
|
||||||
md5thread.detach();
|
md5thread.detach();
|
||||||
if (strncmp(tmpHeader.gameID.data(), SConfig::GetInstance().GetGameID().c_str(), 6))
|
if (strncmp(tmpHeader.gameID.data(), SConfig::GetInstance().GetGameID().c_str(), 6))
|
||||||
{
|
{
|
||||||
PanicAlertT("The recorded game (%s) is not the same as the selected game (%s)",
|
PanicAlertFmtT("The recorded game ({0}) is not the same as the selected game ({1})",
|
||||||
tmpHeader.gameID.data(), SConfig::GetInstance().GetGameID().c_str());
|
tmpHeader.gameID.data(), SConfig::GetInstance().GetGameID());
|
||||||
EndPlayInput(false);
|
EndPlayInput(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,9 +370,9 @@ void SignalDiscChange(const std::string& new_path)
|
||||||
constexpr size_t maximum_length = sizeof(DTMHeader::discChange);
|
constexpr size_t maximum_length = sizeof(DTMHeader::discChange);
|
||||||
if (filename.length() > maximum_length)
|
if (filename.length() > maximum_length)
|
||||||
{
|
{
|
||||||
PanicAlertT("The disc change to \"%s\" could not be saved in the .dtm file.\n"
|
PanicAlertFmtT("The disc change to \"{0}\" could not be saved in the .dtm file.\n"
|
||||||
"The filename of the disc image must not be longer than 40 characters.",
|
"The filename of the disc image must not be longer than 40 characters.",
|
||||||
filename.c_str());
|
filename);
|
||||||
}
|
}
|
||||||
s_discChange = filename;
|
s_discChange = filename;
|
||||||
s_bDiscChange = true;
|
s_bDiscChange = true;
|
||||||
|
@ -884,7 +885,7 @@ bool PlayInput(const std::string& movie_path, std::optional<std::string>* savest
|
||||||
|
|
||||||
if (!IsMovieHeader(tmpHeader.filetype))
|
if (!IsMovieHeader(tmpHeader.filetype))
|
||||||
{
|
{
|
||||||
PanicAlertT("Invalid recording file");
|
PanicAlertFmtT("Invalid recording file");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -941,7 +942,7 @@ void LoadInput(const std::string& movie_path)
|
||||||
File::IOFile t_record;
|
File::IOFile t_record;
|
||||||
if (!t_record.Open(movie_path, "r+b"))
|
if (!t_record.Open(movie_path, "r+b"))
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to read %s", movie_path.c_str());
|
PanicAlertFmtT("Failed to read {0}", movie_path);
|
||||||
EndPlayInput(false);
|
EndPlayInput(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -950,7 +951,7 @@ void LoadInput(const std::string& movie_path)
|
||||||
|
|
||||||
if (!IsMovieHeader(tmpHeader.filetype))
|
if (!IsMovieHeader(tmpHeader.filetype))
|
||||||
{
|
{
|
||||||
PanicAlertT("Savestate movie %s is corrupted, movie recording stopping...", movie_path.c_str());
|
PanicAlertFmtT("Savestate movie {0} is corrupted, movie recording stopping...", movie_path);
|
||||||
EndPlayInput(false);
|
EndPlayInput(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -973,10 +974,10 @@ void LoadInput(const std::string& movie_path)
|
||||||
// This can only happen if the user manually deletes data from the dtm.
|
// This can only happen if the user manually deletes data from the dtm.
|
||||||
if (s_currentByte > totalSavedBytes)
|
if (s_currentByte > totalSavedBytes)
|
||||||
{
|
{
|
||||||
PanicAlertT("Warning: You loaded a save whose movie ends before the current frame in the save "
|
PanicAlertFmtT(
|
||||||
"(byte %u < %u) (frame %u < %u). You should load another save before continuing.",
|
"Warning: You loaded a save whose movie ends before the current frame in the save "
|
||||||
(u32)totalSavedBytes + 256, (u32)s_currentByte + 256, (u32)tmpHeader.frameCount,
|
"(byte {0} < {1}) (frame {2} < {3}). You should load another save before continuing.",
|
||||||
(u32)s_currentFrame);
|
totalSavedBytes + 256, s_currentByte + 256, tmpHeader.frameCount, s_currentFrame);
|
||||||
afterEnd = true;
|
afterEnd = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,11 +999,11 @@ void LoadInput(const std::string& movie_path)
|
||||||
else if (s_currentByte > s_temp_input.size())
|
else if (s_currentByte > s_temp_input.size())
|
||||||
{
|
{
|
||||||
afterEnd = true;
|
afterEnd = true;
|
||||||
PanicAlertT("Warning: You loaded a save that's after the end of the current movie. (byte %u "
|
PanicAlertFmtT(
|
||||||
"> %zu) (input %u > %u). You should load another save before continuing, or load "
|
"Warning: You loaded a save that's after the end of the current movie. (byte {0} "
|
||||||
|
"> {1}) (input {2} > {3}). You should load another save before continuing, or load "
|
||||||
"this state with read-only mode off.",
|
"this state with read-only mode off.",
|
||||||
(u32)s_currentByte + 256, s_temp_input.size() + 256, (u32)s_currentInputCount,
|
s_currentByte + 256, s_temp_input.size() + 256, s_currentInputCount, s_totalInputCount);
|
||||||
(u32)s_totalInputCount);
|
|
||||||
}
|
}
|
||||||
else if (s_currentByte > 0 && !s_temp_input.empty())
|
else if (s_currentByte > 0 && !s_temp_input.empty())
|
||||||
{
|
{
|
||||||
|
@ -1024,7 +1025,7 @@ void LoadInput(const std::string& movie_path)
|
||||||
const size_t byte_offset = static_cast<size_t>(mismatch_index) + sizeof(DTMHeader);
|
const size_t byte_offset = static_cast<size_t>(mismatch_index) + sizeof(DTMHeader);
|
||||||
|
|
||||||
// TODO: more detail
|
// TODO: more detail
|
||||||
PanicAlertT("Warning: You loaded a save whose movie mismatches on byte %zu (0x%zX). "
|
PanicAlertFmtT("Warning: You loaded a save whose movie mismatches on byte {0} ({1:#x}). "
|
||||||
"You should load another save before continuing, or load this state with "
|
"You should load another save before continuing, or load this state with "
|
||||||
"read-only mode off. Otherwise you'll probably get a desync.",
|
"read-only mode off. Otherwise you'll probably get a desync.",
|
||||||
byte_offset, byte_offset);
|
byte_offset, byte_offset);
|
||||||
|
@ -1040,33 +1041,32 @@ void LoadInput(const std::string& movie_path)
|
||||||
ControllerState movPadState;
|
ControllerState movPadState;
|
||||||
memcpy(&movPadState, &s_temp_input[frame * sizeof(ControllerState)],
|
memcpy(&movPadState, &s_temp_input[frame * sizeof(ControllerState)],
|
||||||
sizeof(ControllerState));
|
sizeof(ControllerState));
|
||||||
PanicAlertT(
|
PanicAlertFmtT(
|
||||||
"Warning: You loaded a save whose movie mismatches on frame %td. You should load "
|
"Warning: You loaded a save whose movie mismatches on frame {0}. You should load "
|
||||||
"another save before continuing, or load this state with read-only mode off. "
|
"another save before continuing, or load this state with read-only mode off. "
|
||||||
"Otherwise you'll probably get a desync.\n\n"
|
"Otherwise you'll probably get a desync.\n\n"
|
||||||
"More information: The current movie is %d frames long and the savestate's movie "
|
"More information: The current movie is {1} frames long and the savestate's movie "
|
||||||
"is %d frames long.\n\n"
|
"is {2} frames long.\n\n"
|
||||||
"On frame %td, the current movie presses:\n"
|
"On frame {3}, the current movie presses:\n"
|
||||||
"Start=%d, A=%d, B=%d, X=%d, Y=%d, Z=%d, DUp=%d, DDown=%d, DLeft=%d, DRight=%d, "
|
"Start={4}, A={5}, B={6}, X={7}, Y={8}, Z={9}, DUp={10}, DDown={11}, DLeft={12}, "
|
||||||
"L=%d, R=%d, LT=%d, RT=%d, AnalogX=%d, AnalogY=%d, CX=%d, CY=%d, Connected=%d"
|
"DRight={13}, L={14}, R={15}, LT={16}, RT={17}, AnalogX={18}, AnalogY={19}, CX={20}, "
|
||||||
|
"CY={21}, Connected={22}"
|
||||||
"\n\n"
|
"\n\n"
|
||||||
"On frame %td, the savestate's movie presses:\n"
|
"On frame {23}, the savestate's movie presses:\n"
|
||||||
"Start=%d, A=%d, B=%d, X=%d, Y=%d, Z=%d, DUp=%d, DDown=%d, DLeft=%d, DRight=%d, "
|
"Start={24}, A={25}, B={26}, X={27}, Y={28}, Z={29}, DUp={30}, DDown={31}, "
|
||||||
"L=%d, R=%d, LT=%d, RT=%d, AnalogX=%d, AnalogY=%d, CX=%d, CY=%d, Connected=%d",
|
"DLeft={32}, DRight={33}, L={34}, R={35}, LT={36}, RT={37}, AnalogX={38}, "
|
||||||
frame, (int)s_totalFrames, (int)tmpHeader.frameCount, frame, (int)curPadState.Start,
|
"AnalogY={39}, CX={40}, CY={41}, Connected={42}",
|
||||||
(int)curPadState.A, (int)curPadState.B, (int)curPadState.X, (int)curPadState.Y,
|
frame, s_totalFrames, tmpHeader.frameCount, frame, curPadState.Start, curPadState.A,
|
||||||
(int)curPadState.Z, (int)curPadState.DPadUp, (int)curPadState.DPadDown,
|
curPadState.B, curPadState.X, curPadState.Y, curPadState.Z, curPadState.DPadUp,
|
||||||
(int)curPadState.DPadLeft, (int)curPadState.DPadRight, (int)curPadState.L,
|
curPadState.DPadDown, curPadState.DPadLeft, curPadState.DPadRight, curPadState.L,
|
||||||
(int)curPadState.R, (int)curPadState.TriggerL, (int)curPadState.TriggerR,
|
curPadState.R, curPadState.TriggerL, curPadState.TriggerR, curPadState.AnalogStickX,
|
||||||
(int)curPadState.AnalogStickX, (int)curPadState.AnalogStickY,
|
curPadState.AnalogStickY, curPadState.CStickX, curPadState.CStickY,
|
||||||
(int)curPadState.CStickX, (int)curPadState.CStickY, (int)curPadState.is_connected,
|
curPadState.is_connected, frame, movPadState.Start, movPadState.A, movPadState.B,
|
||||||
frame, (int)movPadState.Start, (int)movPadState.A, (int)movPadState.B,
|
movPadState.X, movPadState.Y, movPadState.Z, movPadState.DPadUp, movPadState.DPadDown,
|
||||||
(int)movPadState.X, (int)movPadState.Y, (int)movPadState.Z, (int)movPadState.DPadUp,
|
movPadState.DPadLeft, movPadState.DPadRight, movPadState.L, movPadState.R,
|
||||||
(int)movPadState.DPadDown, (int)movPadState.DPadLeft, (int)movPadState.DPadRight,
|
movPadState.TriggerL, movPadState.TriggerR, movPadState.AnalogStickX,
|
||||||
(int)movPadState.L, (int)movPadState.R, (int)movPadState.TriggerL,
|
movPadState.AnalogStickY, movPadState.CStickX, movPadState.CStickY,
|
||||||
(int)movPadState.TriggerR, (int)movPadState.AnalogStickX,
|
curPadState.is_connected);
|
||||||
(int)movPadState.AnalogStickY, (int)movPadState.CStickX, (int)movPadState.CStickY,
|
|
||||||
(int)curPadState.is_connected);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1122,7 +1122,7 @@ void PlayController(GCPadStatus* PadStatus, int controllerID)
|
||||||
|
|
||||||
if (s_currentByte + sizeof(ControllerState) > s_temp_input.size())
|
if (s_currentByte + sizeof(ControllerState) > s_temp_input.size())
|
||||||
{
|
{
|
||||||
PanicAlertT("Premature movie end in PlayController. %u + %zu > %zu", (u32)s_currentByte,
|
PanicAlertFmtT("Premature movie end in PlayController. {0} + {1} > {2}", s_currentByte,
|
||||||
sizeof(ControllerState), s_temp_input.size());
|
sizeof(ControllerState), s_temp_input.size());
|
||||||
EndPlayInput(!s_bReadOnly);
|
EndPlayInput(!s_bReadOnly);
|
||||||
return;
|
return;
|
||||||
|
@ -1187,7 +1187,7 @@ void PlayController(GCPadStatus* PadStatus, int controllerID)
|
||||||
if (!DVDInterface::AutoChangeDisc())
|
if (!DVDInterface::AutoChangeDisc())
|
||||||
{
|
{
|
||||||
CPU::Break();
|
CPU::Break();
|
||||||
PanicAlertT("Change the disc to %s", s_discChange.c_str());
|
PanicAlertFmtT("Change the disc to {0}", s_discChange);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1208,7 +1208,7 @@ bool PlayWiimote(int wiimote, WiimoteCommon::DataReportBuilder& rpt, int ext,
|
||||||
|
|
||||||
if (s_currentByte > s_temp_input.size())
|
if (s_currentByte > s_temp_input.size())
|
||||||
{
|
{
|
||||||
PanicAlertT("Premature movie end in PlayWiimote. %u > %zu", (u32)s_currentByte,
|
PanicAlertFmtT("Premature movie end in PlayWiimote. {0} > {1}", s_currentByte,
|
||||||
s_temp_input.size());
|
s_temp_input.size());
|
||||||
EndPlayInput(!s_bReadOnly);
|
EndPlayInput(!s_bReadOnly);
|
||||||
return false;
|
return false;
|
||||||
|
@ -1219,10 +1219,10 @@ bool PlayWiimote(int wiimote, WiimoteCommon::DataReportBuilder& rpt, int ext,
|
||||||
|
|
||||||
if (size != sizeInMovie)
|
if (size != sizeInMovie)
|
||||||
{
|
{
|
||||||
PanicAlertT("Fatal desync. Aborting playback. (Error in PlayWiimote: %u != %u, byte %u.)%s",
|
PanicAlertFmtT(
|
||||||
(u32)sizeInMovie, (u32)size, (u32)s_currentByte,
|
"Fatal desync. Aborting playback. (Error in PlayWiimote: {0} != {1}, byte {2}.){3}",
|
||||||
(s_controllers & 0xF) ?
|
sizeInMovie, size, s_currentByte,
|
||||||
" Try re-creating the recording with all GameCube controllers "
|
(s_controllers & 0xF) ? " Try re-creating the recording with all GameCube controllers "
|
||||||
"disabled (in Configure > GameCube > Device Settings)." :
|
"disabled (in Configure > GameCube > Device Settings)." :
|
||||||
"");
|
"");
|
||||||
EndPlayInput(!s_bReadOnly);
|
EndPlayInput(!s_bReadOnly);
|
||||||
|
@ -1233,7 +1233,7 @@ bool PlayWiimote(int wiimote, WiimoteCommon::DataReportBuilder& rpt, int ext,
|
||||||
|
|
||||||
if (s_currentByte + size > s_temp_input.size())
|
if (s_currentByte + size > s_temp_input.size())
|
||||||
{
|
{
|
||||||
PanicAlertT("Premature movie end in PlayWiimote. %u + %d > %zu", (u32)s_currentByte, size,
|
PanicAlertFmtT("Premature movie end in PlayWiimote. {0} + {1} > {2}", s_currentByte, size,
|
||||||
s_temp_input.size());
|
s_temp_input.size());
|
||||||
EndPlayInput(!s_bReadOnly);
|
EndPlayInput(!s_bReadOnly);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -309,7 +309,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
MessageId mid;
|
MessageId mid;
|
||||||
packet >> mid;
|
packet >> mid;
|
||||||
|
|
||||||
INFO_LOG(NETPLAY, "Got server message: %x", mid);
|
INFO_LOG_FMT(NETPLAY, "Got server message: {:x}", mid);
|
||||||
|
|
||||||
switch (mid)
|
switch (mid)
|
||||||
{
|
{
|
||||||
|
@ -320,8 +320,8 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
packet >> player.name;
|
packet >> player.name;
|
||||||
packet >> player.revision;
|
packet >> player.revision;
|
||||||
|
|
||||||
INFO_LOG(NETPLAY, "Player %s (%d) using %s joined", player.name.c_str(), player.pid,
|
INFO_LOG_FMT(NETPLAY, "Player {} ({}) using {} joined", player.name, player.pid,
|
||||||
player.revision.c_str());
|
player.revision);
|
||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard<std::recursive_mutex> lkp(m_crit.players);
|
std::lock_guard<std::recursive_mutex> lkp(m_crit.players);
|
||||||
|
@ -346,7 +346,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const auto& player = it->second;
|
const auto& player = it->second;
|
||||||
INFO_LOG(NETPLAY, "Player %s (%d) left", player.name.c_str(), pid);
|
INFO_LOG_FMT(NETPLAY, "Player {} ({}) left", player.name, pid);
|
||||||
m_dialog->OnPlayerDisconnect(player.name);
|
m_dialog->OnPlayerDisconnect(player.name);
|
||||||
m_players.erase(m_players.find(pid));
|
m_players.erase(m_players.find(pid));
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
// don't need lock to read in this thread
|
// don't need lock to read in this thread
|
||||||
const Player& player = m_players[pid];
|
const Player& player = m_players[pid];
|
||||||
|
|
||||||
INFO_LOG(NETPLAY, "Player %s (%d) wrote: %s", player.name.c_str(), player.pid, msg.c_str());
|
INFO_LOG_FMT(NETPLAY, "Player {} ({}) wrote: {}", player.name, player.pid, msg);
|
||||||
|
|
||||||
// add to gui
|
// add to gui
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
|
@ -596,7 +596,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
packet >> netplay_name;
|
packet >> netplay_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_LOG(NETPLAY, "Game changed to %s", netplay_name.c_str());
|
INFO_LOG_FMT(NETPLAY, "Game changed to {}", netplay_name);
|
||||||
|
|
||||||
// update gui
|
// update gui
|
||||||
m_dialog->OnMsgChangeGame(m_selected_game, netplay_name);
|
m_dialog->OnMsgChangeGame(m_selected_game, netplay_name);
|
||||||
|
@ -641,7 +641,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
packet >> m_current_game;
|
packet >> m_current_game;
|
||||||
packet >> m_net_settings.m_CPUthread;
|
packet >> m_net_settings.m_CPUthread;
|
||||||
|
|
||||||
INFO_LOG(NETPLAY, "Start of game %s", m_selected_game.game_id.c_str());
|
INFO_LOG_FMT(NETPLAY, "Start of game {}", m_selected_game.game_id);
|
||||||
|
|
||||||
{
|
{
|
||||||
std::underlying_type_t<PowerPC::CPUCore> core;
|
std::underlying_type_t<PowerPC::CPUCore> core;
|
||||||
|
@ -735,7 +735,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
case NP_MSG_STOP_GAME:
|
case NP_MSG_STOP_GAME:
|
||||||
case NP_MSG_DISABLE_GAME:
|
case NP_MSG_DISABLE_GAME:
|
||||||
{
|
{
|
||||||
INFO_LOG(NETPLAY, "Game stopped");
|
INFO_LOG_FMT(NETPLAY, "Game stopped");
|
||||||
|
|
||||||
StopGame();
|
StopGame();
|
||||||
m_dialog->OnMsgStopGame();
|
m_dialog->OnMsgStopGame();
|
||||||
|
@ -792,7 +792,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
player = it->second.name;
|
player = it->second.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_LOG(NETPLAY, "Player %s (%d) desynced!", player.c_str(), pid_to_blame);
|
INFO_LOG_FMT(NETPLAY, "Player {} ({}) desynced!", player, pid_to_blame);
|
||||||
|
|
||||||
m_dialog->OnDesync(frame, player);
|
m_dialog->OnDesync(frame, player);
|
||||||
}
|
}
|
||||||
|
@ -851,7 +851,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
(is_slot_a ? "A." : "B.") + region + (mc251 ? ".251" : "") + ".raw";
|
(is_slot_a ? "A." : "B.") + region + (mc251 ? ".251" : "") + ".raw";
|
||||||
if (File::Exists(path) && !File::Delete(path))
|
if (File::Exists(path) && !File::Delete(path))
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to delete NetPlay memory card. Verify your write permissions.");
|
PanicAlertFmtT("Failed to delete NetPlay memory card. Verify your write permissions.");
|
||||||
SyncSaveDataResponse(false);
|
SyncSaveDataResponse(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -876,7 +876,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
if ((File::Exists(path) && !File::DeleteDirRecursively(path + DIR_SEP)) ||
|
if ((File::Exists(path) && !File::DeleteDirRecursively(path + DIR_SEP)) ||
|
||||||
!File::CreateFullPath(path + DIR_SEP))
|
!File::CreateFullPath(path + DIR_SEP))
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to reset NetPlay GCI folder. Verify your write permissions.");
|
PanicAlertFmtT("Failed to reset NetPlay GCI folder. Verify your write permissions.");
|
||||||
SyncSaveDataResponse(false);
|
SyncSaveDataResponse(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -906,7 +906,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
|
|
||||||
if (File::Exists(path) && !File::DeleteDirRecursively(path))
|
if (File::Exists(path) && !File::DeleteDirRecursively(path))
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to reset NetPlay NAND folder. Verify your write permissions.");
|
PanicAlertFmtT("Failed to reset NetPlay NAND folder. Verify your write permissions.");
|
||||||
SyncSaveDataResponse(false);
|
SyncSaveDataResponse(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -932,7 +932,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
|
|
||||||
if (!buffer || !file || !file->Write(buffer->data(), buffer->size()))
|
if (!buffer || !file || !file->Write(buffer->data(), buffer->size()))
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to write Mii data.");
|
PanicAlertFmtT("Failed to write Mii data.");
|
||||||
SyncSaveDataResponse(false);
|
SyncSaveDataResponse(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1013,7 +1013,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
if (!save->WriteHeader(header) || !save->WriteBkHeader(bk_header) ||
|
if (!save->WriteHeader(header) || !save->WriteBkHeader(bk_header) ||
|
||||||
!save->WriteFiles(files))
|
!save->WriteFiles(files))
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to write Wii save.");
|
PanicAlertFmtT("Failed to write Wii save.");
|
||||||
SyncSaveDataResponse(false);
|
SyncSaveDataResponse(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1025,7 +1025,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
PanicAlertT("Unknown SYNC_SAVE_DATA message received with id: %d", sub_id);
|
PanicAlertFmtT("Unknown SYNC_SAVE_DATA message received with id: {0}", sub_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1059,7 +1059,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
|
|
||||||
m_sync_gecko_codes_success_count = 0;
|
m_sync_gecko_codes_success_count = 0;
|
||||||
|
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Receiving %d Gecko codelines", m_sync_gecko_codes_count);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Receiving {} Gecko codelines", m_sync_gecko_codes_count);
|
||||||
|
|
||||||
// Check if no codes to sync, if so return as finished
|
// Check if no codes to sync, if so return as finished
|
||||||
if (m_sync_gecko_codes_count == 0)
|
if (m_sync_gecko_codes_count == 0)
|
||||||
|
@ -1068,8 +1068,10 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
SyncCodeResponse(true);
|
SyncCodeResponse(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_dialog->AppendChat(Common::GetStringT("Synchronizing Gecko codes..."));
|
m_dialog->AppendChat(Common::GetStringT("Synchronizing Gecko codes..."));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SYNC_CODES_DATA_GECKO:
|
case SYNC_CODES_DATA_GECKO:
|
||||||
|
@ -1094,7 +1096,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
packet >> new_code.address;
|
packet >> new_code.address;
|
||||||
packet >> new_code.data;
|
packet >> new_code.data;
|
||||||
|
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Received %08x %08x", new_code.address, new_code.data);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Received {:08x} {:08x}", new_code.address, new_code.data);
|
||||||
|
|
||||||
gcode.codes.push_back(std::move(new_code));
|
gcode.codes.push_back(std::move(new_code));
|
||||||
|
|
||||||
|
@ -1128,7 +1130,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
|
|
||||||
m_sync_ar_codes_success_count = 0;
|
m_sync_ar_codes_success_count = 0;
|
||||||
|
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Receiving %d AR codelines", m_sync_ar_codes_count);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Receiving {} AR codelines", m_sync_ar_codes_count);
|
||||||
|
|
||||||
// Check if no codes to sync, if so return as finished
|
// Check if no codes to sync, if so return as finished
|
||||||
if (m_sync_ar_codes_count == 0)
|
if (m_sync_ar_codes_count == 0)
|
||||||
|
@ -1137,8 +1139,10 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
SyncCodeResponse(true);
|
SyncCodeResponse(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_dialog->AppendChat(Common::GetStringT("Synchronizing AR codes..."));
|
m_dialog->AppendChat(Common::GetStringT("Synchronizing AR codes..."));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SYNC_CODES_DATA_AR:
|
case SYNC_CODES_DATA_AR:
|
||||||
|
@ -1163,7 +1167,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
packet >> new_code.cmd_addr;
|
packet >> new_code.cmd_addr;
|
||||||
packet >> new_code.value;
|
packet >> new_code.value;
|
||||||
|
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Received %08x %08x", new_code.cmd_addr, new_code.value);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Received {:08x} {:08x}", new_code.cmd_addr, new_code.value);
|
||||||
arcode.ops.push_back(new_code);
|
arcode.ops.push_back(new_code);
|
||||||
|
|
||||||
if (++m_sync_ar_codes_success_count >= m_sync_ar_codes_count)
|
if (++m_sync_ar_codes_success_count >= m_sync_ar_codes_count)
|
||||||
|
@ -1238,7 +1242,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
PanicAlertT("Unknown message received with id : %d", mid);
|
PanicAlertFmtT("Unknown message received with id : {0}", mid);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1500,7 +1504,7 @@ bool NetPlayClient::StartGame(const std::string& path)
|
||||||
|
|
||||||
if (m_is_running.IsSet())
|
if (m_is_running.IsSet())
|
||||||
{
|
{
|
||||||
PanicAlertT("Game is already running!");
|
PanicAlertFmtT("Game is already running!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1609,7 +1613,7 @@ bool NetPlayClient::DecompressPacketIntoFile(sf::Packet& packet, const std::stri
|
||||||
File::IOFile file(file_path, "wb");
|
File::IOFile file(file_path, "wb");
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to open file \"%s\". Verify your write permissions.", file_path.c_str());
|
PanicAlertFmtT("Failed to open file \"{0}\". Verify your write permissions.", file_path);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1633,13 +1637,13 @@ bool NetPlayClient::DecompressPacketIntoFile(sf::Packet& packet, const std::stri
|
||||||
if (lzo1x_decompress(in_buffer.data(), cur_len, out_buffer.data(), &new_len, nullptr) !=
|
if (lzo1x_decompress(in_buffer.data(), cur_len, out_buffer.data(), &new_len, nullptr) !=
|
||||||
LZO_E_OK)
|
LZO_E_OK)
|
||||||
{
|
{
|
||||||
PanicAlertT("Internal LZO Error - decompression failed");
|
PanicAlertFmtT("Internal LZO Error - decompression failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file.WriteBytes(out_buffer.data(), new_len))
|
if (!file.WriteBytes(out_buffer.data(), new_len))
|
||||||
{
|
{
|
||||||
PanicAlertT("Error writing file: %s", file_path.c_str());
|
PanicAlertFmtT("Error writing file: {0}", file_path);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1675,7 +1679,7 @@ std::optional<std::vector<u8>> NetPlayClient::DecompressPacketIntoBuffer(sf::Pac
|
||||||
|
|
||||||
if (lzo1x_decompress(in_buffer.data(), cur_len, &out_buffer[i], &new_len, nullptr) != LZO_E_OK)
|
if (lzo1x_decompress(in_buffer.data(), cur_len, &out_buffer[i], &new_len, nullptr) != LZO_E_OK)
|
||||||
{
|
{
|
||||||
PanicAlertT("Internal LZO Error - decompression failed");
|
PanicAlertFmtT("Internal LZO Error - decompression failed");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1782,16 +1786,16 @@ void NetPlayClient::OnConnectFailed(u8 reason)
|
||||||
switch (reason)
|
switch (reason)
|
||||||
{
|
{
|
||||||
case TraversalConnectFailedClientDidntRespond:
|
case TraversalConnectFailedClientDidntRespond:
|
||||||
PanicAlertT("Traversal server timed out connecting to the host");
|
PanicAlertFmtT("Traversal server timed out connecting to the host");
|
||||||
break;
|
break;
|
||||||
case TraversalConnectFailedClientFailure:
|
case TraversalConnectFailedClientFailure:
|
||||||
PanicAlertT("Server rejected traversal attempt");
|
PanicAlertFmtT("Server rejected traversal attempt");
|
||||||
break;
|
break;
|
||||||
case TraversalConnectFailedNoSuchClient:
|
case TraversalConnectFailedNoSuchClient:
|
||||||
PanicAlertT("Invalid host");
|
PanicAlertFmtT("Invalid host");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PanicAlertT("Unknown error %x", reason);
|
PanicAlertFmtT("Unknown error {0:x}", reason);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2006,7 +2010,7 @@ bool NetPlayClient::WiimoteUpdate(int _number, u8* data, const std::size_t size,
|
||||||
// If it still mismatches, it surely desynced
|
// If it still mismatches, it surely desynced
|
||||||
if (nw.report_id != reporting_mode)
|
if (nw.report_id != reporting_mode)
|
||||||
{
|
{
|
||||||
PanicAlertT("Netplay has desynced. There is no way to recover from this.");
|
PanicAlertFmtT("Netplay has desynced. There is no way to recover from this.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2504,7 +2508,7 @@ bool Wiimote::NetPlay_GetButtonPress(int wiimote, bool pressed)
|
||||||
{
|
{
|
||||||
return data[0];
|
return data[0];
|
||||||
}
|
}
|
||||||
PanicAlertT("Netplay has desynced in NetPlay_GetButtonPress()");
|
PanicAlertFmtT("Netplay has desynced in NetPlay_GetButtonPress()");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ NetPlayServer::NetPlayServer(const u16 port, const bool forward_port, NetPlayUI*
|
||||||
//--use server time
|
//--use server time
|
||||||
if (enet_initialize() != 0)
|
if (enet_initialize() != 0)
|
||||||
{
|
{
|
||||||
PanicAlertT("Enet Didn't Initialize");
|
PanicAlertFmtT("Enet Didn't Initialize");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pad_map.fill(0);
|
m_pad_map.fill(0);
|
||||||
|
@ -275,7 +275,7 @@ void NetPlayServer::ThreadFunc()
|
||||||
{
|
{
|
||||||
// Actual client initialization is deferred to the receive event, so here
|
// Actual client initialization is deferred to the receive event, so here
|
||||||
// we'll just log the new connection.
|
// we'll just log the new connection.
|
||||||
INFO_LOG(NETPLAY, "Peer connected from: %x:%u", netEvent.peer->address.host,
|
INFO_LOG_FMT(NETPLAY, "Peer connected from: {:x}:{}", netEvent.peer->address.host,
|
||||||
netEvent.peer->address.port);
|
netEvent.peer->address.port);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -678,7 +678,7 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, Client& player)
|
||||||
MessageId mid;
|
MessageId mid;
|
||||||
packet >> mid;
|
packet >> mid;
|
||||||
|
|
||||||
INFO_LOG(NETPLAY, "Got client message: %x", mid);
|
INFO_LOG_FMT(NETPLAY, "Got client message: {:x}", mid);
|
||||||
|
|
||||||
// don't need lock because this is the only thread that modifies the players
|
// don't need lock because this is the only thread that modifies the players
|
||||||
// only need locks for writes to m_players in this thread
|
// only need locks for writes to m_players in this thread
|
||||||
|
@ -1121,8 +1121,8 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, Client& player)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
PanicAlertT(
|
PanicAlertFmtT(
|
||||||
"Unknown SYNC_GECKO_CODES message with id:%d received from player:%d Kicking player!",
|
"Unknown SYNC_GECKO_CODES message with id:{0} received from player:{1} Kicking player!",
|
||||||
sub_id, player.pid);
|
sub_id, player.pid);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1130,7 +1130,7 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, Client& player)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
PanicAlertT("Unknown message with id:%d received from player:%d Kicking player!", mid,
|
PanicAlertFmtT("Unknown message with id:{0} received from player:{1} Kicking player!", mid,
|
||||||
player.pid);
|
player.pid);
|
||||||
// unknown message, kick the client
|
// unknown message, kick the client
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1232,7 +1232,7 @@ bool NetPlayServer::RequestStartGame()
|
||||||
m_start_pending = true;
|
m_start_pending = true;
|
||||||
if (!SyncSaveData())
|
if (!SyncSaveData())
|
||||||
{
|
{
|
||||||
PanicAlertT("Error synchronizing save data!");
|
PanicAlertFmtT("Error synchronizing save data!");
|
||||||
m_start_pending = false;
|
m_start_pending = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1245,7 +1245,7 @@ bool NetPlayServer::RequestStartGame()
|
||||||
m_start_pending = true;
|
m_start_pending = true;
|
||||||
if (!SyncCodes())
|
if (!SyncCodes())
|
||||||
{
|
{
|
||||||
PanicAlertT("Error synchronizing cheat codes!");
|
PanicAlertFmtT("Error synchronizing cheat codes!");
|
||||||
m_start_pending = false;
|
m_start_pending = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1638,7 +1638,7 @@ bool NetPlayServer::SyncCodes()
|
||||||
const auto game = m_dialog->FindGameFile(m_selected_game_identifier);
|
const auto game = m_dialog->FindGameFile(m_selected_game_identifier);
|
||||||
if (game == nullptr)
|
if (game == nullptr)
|
||||||
{
|
{
|
||||||
PanicAlertT("Selected game doesn't exist in game list!");
|
PanicAlertFmtT("Selected game doesn't exist in game list!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1672,16 +1672,16 @@ bool NetPlayServer::SyncCodes()
|
||||||
u16 codelines = 0;
|
u16 codelines = 0;
|
||||||
for (const Gecko::GeckoCode& active_code : s_active_codes)
|
for (const Gecko::GeckoCode& active_code : s_active_codes)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Indexing %s", active_code.name.c_str());
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Indexing {}", active_code.name);
|
||||||
for (const Gecko::GeckoCode::Code& code : active_code.codes)
|
for (const Gecko::GeckoCode::Code& code : active_code.codes)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "%08x %08x", code.address, code.data);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "{:08x} {:08x}", code.address, code.data);
|
||||||
codelines++;
|
codelines++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output codelines to send
|
// Output codelines to send
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Sending %d Gecko codelines", codelines);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Sending {} Gecko codelines", codelines);
|
||||||
|
|
||||||
// Send initial packet. Notify of the sync operation and total number of lines being sent.
|
// Send initial packet. Notify of the sync operation and total number of lines being sent.
|
||||||
{
|
{
|
||||||
|
@ -1700,10 +1700,10 @@ bool NetPlayServer::SyncCodes()
|
||||||
// Iterate through the active code vector and send each codeline
|
// Iterate through the active code vector and send each codeline
|
||||||
for (const Gecko::GeckoCode& active_code : s_active_codes)
|
for (const Gecko::GeckoCode& active_code : s_active_codes)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Sending %s", active_code.name.c_str());
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Sending {}", active_code.name);
|
||||||
for (const Gecko::GeckoCode::Code& code : active_code.codes)
|
for (const Gecko::GeckoCode::Code& code : active_code.codes)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "%08x %08x", code.address, code.data);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "{:08x} {:08x}", code.address, code.data);
|
||||||
pac << code.address;
|
pac << code.address;
|
||||||
pac << code.data;
|
pac << code.data;
|
||||||
}
|
}
|
||||||
|
@ -1722,16 +1722,16 @@ bool NetPlayServer::SyncCodes()
|
||||||
u16 codelines = 0;
|
u16 codelines = 0;
|
||||||
for (const ActionReplay::ARCode& active_code : s_active_codes)
|
for (const ActionReplay::ARCode& active_code : s_active_codes)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Indexing %s", active_code.name.c_str());
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Indexing {}", active_code.name);
|
||||||
for (const ActionReplay::AREntry& op : active_code.ops)
|
for (const ActionReplay::AREntry& op : active_code.ops)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "%08x %08x", op.cmd_addr, op.value);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "{:08x} {:08x}", op.cmd_addr, op.value);
|
||||||
codelines++;
|
codelines++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output codelines to send
|
// Output codelines to send
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Sending %d AR codelines", codelines);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Sending {} AR codelines", codelines);
|
||||||
|
|
||||||
// Send initial packet. Notify of the sync operation and total number of lines being sent.
|
// Send initial packet. Notify of the sync operation and total number of lines being sent.
|
||||||
{
|
{
|
||||||
|
@ -1750,10 +1750,10 @@ bool NetPlayServer::SyncCodes()
|
||||||
// Iterate through the active code vector and send each codeline
|
// Iterate through the active code vector and send each codeline
|
||||||
for (const ActionReplay::ARCode& active_code : s_active_codes)
|
for (const ActionReplay::ARCode& active_code : s_active_codes)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "Sending %s", active_code.name.c_str());
|
NOTICE_LOG_FMT(ACTIONREPLAY, "Sending {}", active_code.name);
|
||||||
for (const ActionReplay::AREntry& op : active_code.ops)
|
for (const ActionReplay::AREntry& op : active_code.ops)
|
||||||
{
|
{
|
||||||
NOTICE_LOG(ACTIONREPLAY, "%08x %08x", op.cmd_addr, op.value);
|
NOTICE_LOG_FMT(ACTIONREPLAY, "{:08x} {:08x}", op.cmd_addr, op.value);
|
||||||
pac << op.cmd_addr;
|
pac << op.cmd_addr;
|
||||||
pac << op.value;
|
pac << op.value;
|
||||||
}
|
}
|
||||||
|
@ -1778,7 +1778,7 @@ bool NetPlayServer::CompressFileIntoPacket(const std::string& file_path, sf::Pac
|
||||||
File::IOFile file(file_path, "rb");
|
File::IOFile file(file_path, "rb");
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to open file \"%s\".", file_path.c_str());
|
PanicAlertFmtT("Failed to open file \"{0}\".", file_path);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1812,14 +1812,14 @@ bool NetPlayServer::CompressFileIntoPacket(const std::string& file_path, sf::Pac
|
||||||
|
|
||||||
if (!file.ReadBytes(in_buffer.data(), cur_len))
|
if (!file.ReadBytes(in_buffer.data(), cur_len))
|
||||||
{
|
{
|
||||||
PanicAlertT("Error reading file: %s", file_path.c_str());
|
PanicAlertFmtT("Error reading file: {0}", file_path.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lzo1x_1_compress(in_buffer.data(), cur_len, out_buffer.data(), &out_len, wrkmem.data()) !=
|
if (lzo1x_1_compress(in_buffer.data(), cur_len, out_buffer.data(), &out_len, wrkmem.data()) !=
|
||||||
LZO_E_OK)
|
LZO_E_OK)
|
||||||
{
|
{
|
||||||
PanicAlertT("Internal LZO Error - compression failed");
|
PanicAlertFmtT("Internal LZO Error - compression failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1874,7 +1874,7 @@ bool NetPlayServer::CompressBufferIntoPacket(const std::vector<u8>& in_buffer, s
|
||||||
if (lzo1x_1_compress(&in_buffer[i], cur_len, out_buffer.data(), &out_len, wrkmem.data()) !=
|
if (lzo1x_1_compress(&in_buffer[i], cur_len, out_buffer.data(), &out_len, wrkmem.data()) !=
|
||||||
LZO_E_OK)
|
LZO_E_OK)
|
||||||
{
|
{
|
||||||
PanicAlertT("Internal LZO Error - compression failed");
|
PanicAlertFmtT("Internal LZO Error - compression failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -243,9 +243,9 @@ bool ApplyFramePatches()
|
||||||
// where we can try again after the CPU hopefully returns back to the normal instruction flow.
|
// where we can try again after the CPU hopefully returns back to the normal instruction flow.
|
||||||
if (!MSR.DR || !MSR.IR || !IsStackSane())
|
if (!MSR.DR || !MSR.IR || !IsStackSane())
|
||||||
{
|
{
|
||||||
DEBUG_LOG(
|
DEBUG_LOG_FMT(ACTIONREPLAY,
|
||||||
ACTIONREPLAY,
|
"Need to retry later. CPU configuration is currently incorrect. PC = {:#010x}, "
|
||||||
"Need to retry later. CPU configuration is currently incorrect. PC = 0x%08X, MSR = 0x%08X",
|
"MSR = {:#010x}",
|
||||||
PC, MSR.Hex);
|
PC, MSR.Hex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -381,7 +381,7 @@ static void CompressAndDumpState(CompressAndDumpState_args save_args)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lzo1x_1_compress(buffer_data + i, cur_len, out, &out_len, wrkmem) != LZO_E_OK)
|
if (lzo1x_1_compress(buffer_data + i, cur_len, out, &out_len, wrkmem) != LZO_E_OK)
|
||||||
PanicAlertT("Internal LZO Error - compression failed");
|
PanicAlertFmtT("Internal LZO Error - compression failed");
|
||||||
|
|
||||||
// The size of the data to write is 'out_len'
|
// The size of the data to write is 'out_len'
|
||||||
f.WriteArray((lzo_uint32*)&out_len, 1);
|
f.WriteArray((lzo_uint32*)&out_len, 1);
|
||||||
|
@ -532,7 +532,7 @@ static void LoadFileStateData(const std::string& filename, std::vector<u8>& ret_
|
||||||
if (res != LZO_E_OK)
|
if (res != LZO_E_OK)
|
||||||
{
|
{
|
||||||
// This doesn't seem to happen anymore.
|
// This doesn't seem to happen anymore.
|
||||||
PanicAlertT("Internal LZO Error - decompression failed (%d) (%li, %li) \n"
|
PanicAlertFmtT("Internal LZO Error - decompression failed ({0}) ({1}, {2}) \n"
|
||||||
"Try loading the state again",
|
"Try loading the state again",
|
||||||
res, i, new_len);
|
res, i, new_len);
|
||||||
return;
|
return;
|
||||||
|
@ -543,12 +543,12 @@ static void LoadFileStateData(const std::string& filename, std::vector<u8>& ret_
|
||||||
}
|
}
|
||||||
else // uncompressed
|
else // uncompressed
|
||||||
{
|
{
|
||||||
const size_t size = (size_t)(f.GetSize() - sizeof(StateHeader));
|
const auto size = static_cast<size_t>(f.GetSize() - sizeof(StateHeader));
|
||||||
buffer.resize(size);
|
buffer.resize(size);
|
||||||
|
|
||||||
if (!f.ReadBytes(&buffer[0], size))
|
if (!f.ReadBytes(&buffer[0], size))
|
||||||
{
|
{
|
||||||
PanicAlert("wtf? reading bytes: %zu", size);
|
PanicAlertFmt("Error reading bytes: {0}", size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -638,7 +638,7 @@ void SetOnAfterLoadCallback(AfterLoadCallbackFunc callback)
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
if (lzo_init() != LZO_E_OK)
|
if (lzo_init() != LZO_E_OK)
|
||||||
PanicAlertT("Internal LZO Error - lzo_init() failed");
|
PanicAlertFmtT("Internal LZO Error - lzo_init() failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shutdown()
|
void Shutdown()
|
||||||
|
@ -727,12 +727,12 @@ void UndoLoadState()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PanicAlertT("No undo.dtm found, aborting undo load state to prevent movie desyncs");
|
PanicAlertFmtT("No undo.dtm found, aborting undo load state to prevent movie desyncs");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PanicAlertT("There is nothing to undo!");
|
PanicAlertFmtT("There is nothing to undo!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ void SysConf::Load()
|
||||||
"/shared2/sys/SYSCONF", IOS::HLE::FS::Mode::Read);
|
"/shared2/sys/SYSCONF", IOS::HLE::FS::Mode::Read);
|
||||||
if (!file || file->GetStatus()->size != SYSCONF_SIZE || !LoadFromFile(*file))
|
if (!file || file->GetStatus()->size != SYSCONF_SIZE || !LoadFromFile(*file))
|
||||||
{
|
{
|
||||||
WARN_LOG(CORE, "No valid SYSCONF detected. Creating a new one.");
|
WARN_LOG_FMT(CORE, "No valid SYSCONF detected. Creating a new one.");
|
||||||
InsertDefaultEntries();
|
InsertDefaultEntries();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,8 +118,8 @@ bool SysConf::LoadFromFile(const IOS::HLE::FS::FileHandle& file)
|
||||||
data.resize(GetNonArrayEntrySize(type));
|
data.resize(GetNonArrayEntrySize(type));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERROR_LOG(CORE, "Unknown entry type %d in SYSCONF for %s (offset %u)", static_cast<u8>(type),
|
ERROR_LOG_FMT(CORE, "Unknown entry type {} in SYSCONF for {} (offset {})",
|
||||||
name.c_str(), offset);
|
static_cast<u8>(type), name, offset);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ static void InitializeDeterministicWiiSaves(FS::FileSystem* session_fs)
|
||||||
if (!CopyNandFile(sync_fs, Common::GetMiiDatabasePath(), session_fs,
|
if (!CopyNandFile(sync_fs, Common::GetMiiDatabasePath(), session_fs,
|
||||||
Common::GetMiiDatabasePath()))
|
Common::GetMiiDatabasePath()))
|
||||||
{
|
{
|
||||||
WARN_LOG(CORE, "Failed to copy Mii database to the NAND");
|
WARN_LOG_FMT(CORE, "Failed to copy Mii database to the NAND");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -162,7 +162,7 @@ static void InitializeDeterministicWiiSaves(FS::FileSystem* session_fs)
|
||||||
if (!CopyNandFile(configured_fs.get(), Common::GetMiiDatabasePath(), session_fs,
|
if (!CopyNandFile(configured_fs.get(), Common::GetMiiDatabasePath(), session_fs,
|
||||||
Common::GetMiiDatabasePath()))
|
Common::GetMiiDatabasePath()))
|
||||||
{
|
{
|
||||||
WARN_LOG(CORE, "Failed to copy Mii database to the NAND");
|
WARN_LOG_FMT(CORE, "Failed to copy Mii database to the NAND");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,19 +173,19 @@ void InitializeWiiRoot(bool use_temporary)
|
||||||
if (use_temporary)
|
if (use_temporary)
|
||||||
{
|
{
|
||||||
s_temp_wii_root = File::GetUserPath(D_USER_IDX) + "WiiSession" DIR_SEP;
|
s_temp_wii_root = File::GetUserPath(D_USER_IDX) + "WiiSession" DIR_SEP;
|
||||||
WARN_LOG(IOS_FS, "Using temporary directory %s for minimal Wii FS", s_temp_wii_root.c_str());
|
WARN_LOG_FMT(IOS_FS, "Using temporary directory {} for minimal Wii FS", s_temp_wii_root);
|
||||||
|
|
||||||
// If directory exists, make a backup
|
// If directory exists, make a backup
|
||||||
if (File::Exists(s_temp_wii_root))
|
if (File::Exists(s_temp_wii_root))
|
||||||
{
|
{
|
||||||
const std::string backup_path =
|
const std::string backup_path =
|
||||||
s_temp_wii_root.substr(0, s_temp_wii_root.size() - 1) + ".backup" DIR_SEP;
|
s_temp_wii_root.substr(0, s_temp_wii_root.size() - 1) + ".backup" DIR_SEP;
|
||||||
WARN_LOG(IOS_FS, "Temporary Wii FS directory exists, moving to backup...");
|
WARN_LOG_FMT(IOS_FS, "Temporary Wii FS directory exists, moving to backup...");
|
||||||
|
|
||||||
// If backup exists, delete it as we don't want a mess
|
// If backup exists, delete it as we don't want a mess
|
||||||
if (File::Exists(backup_path))
|
if (File::Exists(backup_path))
|
||||||
{
|
{
|
||||||
WARN_LOG(IOS_FS, "Temporary Wii FS backup directory exists, deleting...");
|
WARN_LOG_FMT(IOS_FS, "Temporary Wii FS backup directory exists, deleting...");
|
||||||
File::DeleteDirRecursively(backup_path);
|
File::DeleteDirRecursively(backup_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ void InitializeWiiFileSystemContents()
|
||||||
// Because we do not require the system menu to be run, WiiConnect24 files must be copied
|
// Because we do not require the system menu to be run, WiiConnect24 files must be copied
|
||||||
// to the NAND manually.
|
// to the NAND manually.
|
||||||
if (!CopySysmenuFilesToFS(fs.get(), File::GetSysDirectory() + WII_USER_DIR, ""))
|
if (!CopySysmenuFilesToFS(fs.get(), File::GetSysDirectory() + WII_USER_DIR, ""))
|
||||||
WARN_LOG(CORE, "Failed to copy initial System Menu files to the NAND");
|
WARN_LOG_FMT(CORE, "Failed to copy initial System Menu files to the NAND");
|
||||||
|
|
||||||
if (s_temp_wii_root.empty())
|
if (s_temp_wii_root.empty())
|
||||||
return;
|
return;
|
||||||
|
@ -307,7 +307,7 @@ void CleanUpWiiFileSystemContents()
|
||||||
if (!CopyNandFile(ios->GetFS().get(), Common::GetMiiDatabasePath(), configured_fs.get(),
|
if (!CopyNandFile(ios->GetFS().get(), Common::GetMiiDatabasePath(), configured_fs.get(),
|
||||||
Common::GetMiiDatabasePath()))
|
Common::GetMiiDatabasePath()))
|
||||||
{
|
{
|
||||||
WARN_LOG(CORE, "Failed to copy Mii database to the NAND");
|
WARN_LOG_FMT(CORE, "Failed to copy Mii database to the NAND");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const u64 title_id : ios->GetES()->GetInstalledTitles())
|
for (const u64 title_id : ios->GetES()->GetInstalledTitles())
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <cinttypes>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -52,7 +51,7 @@ static bool ImportWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad,
|
||||||
{
|
{
|
||||||
if (!wad.GetTicket().IsValid() || !wad.GetTMD().IsValid())
|
if (!wad.GetTicket().IsValid() || !wad.GetTMD().IsValid())
|
||||||
{
|
{
|
||||||
PanicAlertT("WAD installation failed: The selected file is not a valid WAD.");
|
PanicAlertFmtT("WAD installation failed: The selected file is not a valid WAD.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +72,10 @@ static bool ImportWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad,
|
||||||
verify_signature)) < 0)
|
verify_signature)) < 0)
|
||||||
{
|
{
|
||||||
if (ret != IOS::HLE::IOSC_FAIL_CHECKVALUE)
|
if (ret != IOS::HLE::IOSC_FAIL_CHECKVALUE)
|
||||||
PanicAlertT("WAD installation failed: Could not initialise title import (error %d).", ret);
|
{
|
||||||
|
PanicAlertFmtT("WAD installation failed: Could not initialise title import (error {0}).",
|
||||||
|
ret);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +89,7 @@ static bool ImportWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad,
|
||||||
es->ImportContentData(context, 0, data.data(), static_cast<u32>(data.size())) < 0 ||
|
es->ImportContentData(context, 0, data.data(), static_cast<u32>(data.size())) < 0 ||
|
||||||
es->ImportContentEnd(context, 0) < 0)
|
es->ImportContentEnd(context, 0) < 0)
|
||||||
{
|
{
|
||||||
PanicAlertT("WAD installation failed: Could not import content %08x.", content.id);
|
PanicAlertFmtT("WAD installation failed: Could not import content {0:08x}.", content.id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +99,7 @@ static bool ImportWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad,
|
||||||
if ((contents_imported && es->ImportTitleDone(context) < 0) ||
|
if ((contents_imported && es->ImportTitleDone(context) < 0) ||
|
||||||
(!contents_imported && es->ImportTitleCancel(context) < 0))
|
(!contents_imported && es->ImportTitleCancel(context) < 0))
|
||||||
{
|
{
|
||||||
PanicAlertT("WAD installation failed: Could not finalise title import.");
|
PanicAlertFmtT("WAD installation failed: Could not finalise title import.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,8 +165,8 @@ bool InstallWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad, InstallType
|
||||||
const bool has_another_version =
|
const bool has_another_version =
|
||||||
installed_tmd.IsValid() && installed_tmd.GetTitleVersion() != wad.GetTMD().GetTitleVersion();
|
installed_tmd.IsValid() && installed_tmd.GetTitleVersion() != wad.GetTMD().GetTitleVersion();
|
||||||
if (has_another_version &&
|
if (has_another_version &&
|
||||||
!AskYesNoT("A different version of this title is already installed on the NAND.\n\n"
|
!AskYesNoFmtT("A different version of this title is already installed on the NAND.\n\n"
|
||||||
"Installed version: %u\nWAD version: %u\n\n"
|
"Installed version: {0}\nWAD version: {1}\n\n"
|
||||||
"Installing this WAD will replace it irreversibly. Continue?",
|
"Installing this WAD will replace it irreversibly. Continue?",
|
||||||
installed_tmd.GetTitleVersion(), wad.GetTMD().GetTitleVersion()))
|
installed_tmd.GetTitleVersion(), wad.GetTMD().GetTitleVersion()))
|
||||||
{
|
{
|
||||||
|
@ -309,7 +311,7 @@ OnlineSystemUpdater::ParseTitlesResponse(const std::vector<u8>& response) const
|
||||||
pugi::xml_parse_result result = doc.load_buffer(response.data(), response.size());
|
pugi::xml_parse_result result = doc.load_buffer(response.data(), response.size());
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "ParseTitlesResponse: Could not parse response");
|
ERROR_LOG_FMT(CORE, "ParseTitlesResponse: Could not parse response");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,14 +319,14 @@ OnlineSystemUpdater::ParseTitlesResponse(const std::vector<u8>& response) const
|
||||||
const pugi::xml_node node = doc.select_node("//GetSystemUpdateResponse").node();
|
const pugi::xml_node node = doc.select_node("//GetSystemUpdateResponse").node();
|
||||||
if (!node)
|
if (!node)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "ParseTitlesResponse: Could not find response node");
|
ERROR_LOG_FMT(CORE, "ParseTitlesResponse: Could not find response node");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const int code = node.child("ErrorCode").text().as_int();
|
const int code = node.child("ErrorCode").text().as_int();
|
||||||
if (code != 0)
|
if (code != 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "ParseTitlesResponse: Non-zero error code (%d)", code);
|
ERROR_LOG_FMT(CORE, "ParseTitlesResponse: Non-zero error code ({})", code);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,7 +338,7 @@ OnlineSystemUpdater::ParseTitlesResponse(const std::vector<u8>& response) const
|
||||||
info.content_prefix_url = ReplaceAll(info.content_prefix_url, "https://", "http://");
|
info.content_prefix_url = ReplaceAll(info.content_prefix_url, "https://", "http://");
|
||||||
if (info.content_prefix_url.empty())
|
if (info.content_prefix_url.empty())
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "ParseTitlesResponse: Empty content prefix URL");
|
ERROR_LOG_FMT(CORE, "ParseTitlesResponse: Empty content prefix URL");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,7 +429,7 @@ UpdateResult OnlineSystemUpdater::DoOnlineUpdate()
|
||||||
const UpdateResult res = InstallTitleFromNUS(info.content_prefix_url, title, &updated_titles);
|
const UpdateResult res = InstallTitleFromNUS(info.content_prefix_url, title, &updated_titles);
|
||||||
if (res != UpdateResult::Succeeded)
|
if (res != UpdateResult::Succeeded)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to update %016" PRIx64 " -- aborting update", title.id);
|
ERROR_LOG_FMT(CORE, "Failed to update {:016x} -- aborting update", title.id);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,10 +438,10 @@ UpdateResult OnlineSystemUpdater::DoOnlineUpdate()
|
||||||
|
|
||||||
if (updated_titles.empty())
|
if (updated_titles.empty())
|
||||||
{
|
{
|
||||||
NOTICE_LOG(CORE, "Update finished - Already up-to-date");
|
NOTICE_LOG_FMT(CORE, "Update finished - Already up-to-date");
|
||||||
return UpdateResult::AlreadyUpToDate;
|
return UpdateResult::AlreadyUpToDate;
|
||||||
}
|
}
|
||||||
NOTICE_LOG(CORE, "Update finished - %zu updates installed", updated_titles.size());
|
NOTICE_LOG_FMT(CORE, "Update finished - {} updates installed", updated_titles.size());
|
||||||
return UpdateResult::Succeeded;
|
return UpdateResult::Succeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,13 +456,13 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||||
if (!ShouldInstallTitle(title) || updated_titles->find(title.id) != updated_titles->end())
|
if (!ShouldInstallTitle(title) || updated_titles->find(title.id) != updated_titles->end())
|
||||||
return UpdateResult::Succeeded;
|
return UpdateResult::Succeeded;
|
||||||
|
|
||||||
NOTICE_LOG(CORE, "Updating title %016" PRIx64, title.id);
|
NOTICE_LOG_FMT(CORE, "Updating title {:016x}", title.id);
|
||||||
|
|
||||||
// Download the ticket and certificates.
|
// Download the ticket and certificates.
|
||||||
const auto ticket = DownloadTicket(prefix_url, title);
|
const auto ticket = DownloadTicket(prefix_url, title);
|
||||||
if (ticket.first.empty() || ticket.second.empty())
|
if (ticket.first.empty() || ticket.second.empty())
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to download ticket and certs");
|
ERROR_LOG_FMT(CORE, "Failed to download ticket and certs");
|
||||||
return UpdateResult::DownloadFailed;
|
return UpdateResult::DownloadFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +471,7 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||||
const auto es = m_ios.GetES();
|
const auto es = m_ios.GetES();
|
||||||
if ((ret = es->ImportTicket(ticket.first, ticket.second)) < 0)
|
if ((ret = es->ImportTicket(ticket.first, ticket.second)) < 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to import ticket: error %d", ret);
|
ERROR_LOG_FMT(CORE, "Failed to import ticket: error {}", ret);
|
||||||
return UpdateResult::ImportFailed;
|
return UpdateResult::ImportFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +479,7 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||||
const auto tmd = DownloadTMD(prefix_url, title);
|
const auto tmd = DownloadTMD(prefix_url, title);
|
||||||
if (!tmd.first.IsValid())
|
if (!tmd.first.IsValid())
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to download TMD");
|
ERROR_LOG_FMT(CORE, "Failed to download TMD");
|
||||||
return UpdateResult::DownloadFailed;
|
return UpdateResult::DownloadFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,11 +489,11 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||||
{
|
{
|
||||||
if (!es->FindInstalledTMD(ios_id).IsValid())
|
if (!es->FindInstalledTMD(ios_id).IsValid())
|
||||||
{
|
{
|
||||||
WARN_LOG(CORE, "Importing required system title %016" PRIx64 " first", ios_id);
|
WARN_LOG_FMT(CORE, "Importing required system title {:016x} first", ios_id);
|
||||||
const UpdateResult res = InstallTitleFromNUS(prefix_url, {ios_id, 0}, updated_titles);
|
const UpdateResult res = InstallTitleFromNUS(prefix_url, {ios_id, 0}, updated_titles);
|
||||||
if (res != UpdateResult::Succeeded)
|
if (res != UpdateResult::Succeeded)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to import required system title %016" PRIx64, ios_id);
|
ERROR_LOG_FMT(CORE, "Failed to import required system title {:016x}", ios_id);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -501,7 +503,7 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||||
IOS::HLE::Device::ES::Context context;
|
IOS::HLE::Device::ES::Context context;
|
||||||
if ((ret = es->ImportTitleInit(context, tmd.first.GetBytes(), tmd.second)) < 0)
|
if ((ret = es->ImportTitleInit(context, tmd.first.GetBytes(), tmd.second)) < 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to initialise title import: error %d", ret);
|
ERROR_LOG_FMT(CORE, "Failed to initialise title import: error {}", ret);
|
||||||
return UpdateResult::ImportFailed;
|
return UpdateResult::ImportFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,21 +523,22 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||||
|
|
||||||
if ((ret = es->ImportContentBegin(context, title.id, content.id)) < 0)
|
if ((ret = es->ImportContentBegin(context, title.id, content.id)) < 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to initialise import for content %08x: error %d", content.id, ret);
|
ERROR_LOG_FMT(CORE, "Failed to initialise import for content {:08x}: error {}", content.id,
|
||||||
|
ret);
|
||||||
return UpdateResult::ImportFailed;
|
return UpdateResult::ImportFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::optional<std::vector<u8>> data = DownloadContent(prefix_url, title, content.id);
|
const std::optional<std::vector<u8>> data = DownloadContent(prefix_url, title, content.id);
|
||||||
if (!data)
|
if (!data)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to download content %08x", content.id);
|
ERROR_LOG_FMT(CORE, "Failed to download content {:08x}", content.id);
|
||||||
return UpdateResult::DownloadFailed;
|
return UpdateResult::DownloadFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (es->ImportContentData(context, 0, data->data(), static_cast<u32>(data->size())) < 0 ||
|
if (es->ImportContentData(context, 0, data->data(), static_cast<u32>(data->size())) < 0 ||
|
||||||
es->ImportContentEnd(context, 0) < 0)
|
es->ImportContentEnd(context, 0) < 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to import content %08x", content.id);
|
ERROR_LOG_FMT(CORE, "Failed to import content {:08x}", content.id);
|
||||||
return UpdateResult::ImportFailed;
|
return UpdateResult::ImportFailed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -546,7 +549,7 @@ UpdateResult OnlineSystemUpdater::InstallTitleFromNUS(const std::string& prefix_
|
||||||
if ((all_contents_imported && (ret = es->ImportTitleDone(context)) < 0) ||
|
if ((all_contents_imported && (ret = es->ImportTitleDone(context)) < 0) ||
|
||||||
(!all_contents_imported && (ret = es->ImportTitleCancel(context)) < 0))
|
(!all_contents_imported && (ret = es->ImportTitleCancel(context)) < 0))
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to finalise title import: error %d", ret);
|
ERROR_LOG_FMT(CORE, "Failed to finalise title import: error {}", ret);
|
||||||
return UpdateResult::ImportFailed;
|
return UpdateResult::ImportFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -674,7 +677,7 @@ UpdateResult DiscSystemUpdater::DoDiscUpdate()
|
||||||
|
|
||||||
if (update_partition == partitions.cend())
|
if (update_partition == partitions.cend())
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Could not find any update partition");
|
ERROR_LOG_FMT(CORE, "Could not find any update partition");
|
||||||
return UpdateResult::MissingUpdatePartition;
|
return UpdateResult::MissingUpdatePartition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -688,7 +691,7 @@ UpdateResult DiscSystemUpdater::UpdateFromManifest(std::string_view manifest_nam
|
||||||
const DiscIO::FileSystem* disc_fs = m_volume->GetFileSystem(m_partition);
|
const DiscIO::FileSystem* disc_fs = m_volume->GetFileSystem(m_partition);
|
||||||
if (!disc_fs)
|
if (!disc_fs)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Could not read the update partition file system");
|
ERROR_LOG_FMT(CORE, "Could not read the update partition file system");
|
||||||
return UpdateResult::DiscReadFailed;
|
return UpdateResult::DiscReadFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,7 +699,7 @@ UpdateResult DiscSystemUpdater::UpdateFromManifest(std::string_view manifest_nam
|
||||||
if (!update_manifest ||
|
if (!update_manifest ||
|
||||||
(update_manifest->GetSize() - sizeof(ManifestHeader)) % sizeof(Entry) != 0)
|
(update_manifest->GetSize() - sizeof(ManifestHeader)) % sizeof(Entry) != 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Invalid or missing update manifest");
|
ERROR_LOG_FMT(CORE, "Invalid or missing update manifest");
|
||||||
return UpdateResult::DiscReadFailed;
|
return UpdateResult::DiscReadFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -712,7 +715,7 @@ UpdateResult DiscSystemUpdater::UpdateFromManifest(std::string_view manifest_nam
|
||||||
if (entry.size() != DiscIO::ReadFile(*m_volume, m_partition, update_manifest.get(),
|
if (entry.size() != DiscIO::ReadFile(*m_volume, m_partition, update_manifest.get(),
|
||||||
entry.data(), entry.size(), offset))
|
entry.data(), entry.size(), offset))
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to read update information from update manifest");
|
ERROR_LOG_FMT(CORE, "Failed to read update information from update manifest");
|
||||||
return UpdateResult::DiscReadFailed;
|
return UpdateResult::DiscReadFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,7 +732,7 @@ UpdateResult DiscSystemUpdater::UpdateFromManifest(std::string_view manifest_nam
|
||||||
const UpdateResult res = ProcessEntry(type, attrs, {title_id, title_version}, path);
|
const UpdateResult res = ProcessEntry(type, attrs, {title_id, title_version}, path);
|
||||||
if (res != UpdateResult::Succeeded && res != UpdateResult::AlreadyUpToDate)
|
if (res != UpdateResult::Succeeded && res != UpdateResult::AlreadyUpToDate)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Failed to update %016" PRIx64 " -- aborting update", title_id);
|
ERROR_LOG_FMT(CORE, "Failed to update {:016x} -- aborting update", title_id);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,7 +765,7 @@ UpdateResult DiscSystemUpdater::ProcessEntry(u32 type, std::bitset<32> attrs,
|
||||||
auto blob = DiscIO::VolumeFileBlobReader::Create(*m_volume, m_partition, path);
|
auto blob = DiscIO::VolumeFileBlobReader::Create(*m_volume, m_partition, path);
|
||||||
if (!blob)
|
if (!blob)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "Could not find %s", std::string(path).c_str());
|
ERROR_LOG_FMT(CORE, "Could not find {}", path);
|
||||||
return UpdateResult::DiscReadFailed;
|
return UpdateResult::DiscReadFailed;
|
||||||
}
|
}
|
||||||
const DiscIO::VolumeWAD wad{std::move(blob)};
|
const DiscIO::VolumeWAD wad{std::move(blob)};
|
||||||
|
@ -792,7 +795,8 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
|
||||||
Common::RootUserPath(Common::FROM_CONFIGURED_ROOT) + "/sys/replace";
|
Common::RootUserPath(Common::FROM_CONFIGURED_ROOT) + "/sys/replace";
|
||||||
if (File::Exists(sys_replace_path))
|
if (File::Exists(sys_replace_path))
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "CheckNAND: NAND was used with old versions, so it is likely to be damaged");
|
ERROR_LOG_FMT(CORE,
|
||||||
|
"CheckNAND: NAND was used with old versions, so it is likely to be damaged");
|
||||||
if (repair)
|
if (repair)
|
||||||
File::Delete(sys_replace_path);
|
File::Delete(sys_replace_path);
|
||||||
else
|
else
|
||||||
|
@ -804,7 +808,7 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
|
||||||
const File::FileInfo rfl_db(rfl_db_path);
|
const File::FileInfo rfl_db(rfl_db_path);
|
||||||
if (rfl_db.Exists() && rfl_db.GetSize() == 0)
|
if (rfl_db.Exists() && rfl_db.GetSize() == 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "CheckNAND: RFL_DB.dat exists but is empty");
|
ERROR_LOG_FMT(CORE, "CheckNAND: RFL_DB.dat exists but is empty");
|
||||||
if (repair)
|
if (repair)
|
||||||
File::Delete(rfl_db_path);
|
File::Delete(rfl_db_path);
|
||||||
else
|
else
|
||||||
|
@ -823,7 +827,7 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
|
||||||
if (File::IsDirectory(dir))
|
if (File::IsDirectory(dir))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ERROR_LOG(CORE, "CheckNAND: Missing dir %s for title %016" PRIx64, dir.c_str(), title_id);
|
ERROR_LOG_FMT(CORE, "CheckNAND: Missing dir {} for title {:016x}", dir, title_id);
|
||||||
if (repair)
|
if (repair)
|
||||||
File::CreateDir(dir);
|
File::CreateDir(dir);
|
||||||
else
|
else
|
||||||
|
@ -834,7 +838,7 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
|
||||||
const auto ticket = es->FindSignedTicket(title_id);
|
const auto ticket = es->FindSignedTicket(title_id);
|
||||||
if (!IOS::ES::IsDiscTitle(title_id) && !ticket.IsValid())
|
if (!IOS::ES::IsDiscTitle(title_id) && !ticket.IsValid())
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "CheckNAND: Missing ticket for title %016" PRIx64, title_id);
|
ERROR_LOG_FMT(CORE, "CheckNAND: Missing ticket for title {:016x}", title_id);
|
||||||
result.titles_to_remove.insert(title_id);
|
result.titles_to_remove.insert(title_id);
|
||||||
if (repair)
|
if (repair)
|
||||||
File::DeleteDirRecursively(title_dir);
|
File::DeleteDirRecursively(title_dir);
|
||||||
|
@ -847,11 +851,11 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
|
||||||
{
|
{
|
||||||
if (File::ScanDirectoryTree(content_dir, false).children.empty())
|
if (File::ScanDirectoryTree(content_dir, false).children.empty())
|
||||||
{
|
{
|
||||||
WARN_LOG(CORE, "CheckNAND: Missing TMD for title %016" PRIx64, title_id);
|
WARN_LOG_FMT(CORE, "CheckNAND: Missing TMD for title {:016x}", title_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "CheckNAND: Missing TMD for title %016" PRIx64, title_id);
|
ERROR_LOG_FMT(CORE, "CheckNAND: Missing TMD for title {:016x}", title_id);
|
||||||
result.titles_to_remove.insert(title_id);
|
result.titles_to_remove.insert(title_id);
|
||||||
if (repair)
|
if (repair)
|
||||||
File::DeleteDirRecursively(title_dir);
|
File::DeleteDirRecursively(title_dir);
|
||||||
|
@ -869,7 +873,7 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
|
||||||
if (is_installed && installed_contents != tmd.GetContents() &&
|
if (is_installed && installed_contents != tmd.GetContents() &&
|
||||||
(tmd.GetTitleFlags() & IOS::ES::TitleFlags::TITLE_TYPE_DATA) == 0)
|
(tmd.GetTitleFlags() & IOS::ES::TitleFlags::TITLE_TYPE_DATA) == 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(CORE, "CheckNAND: Missing contents for title %016" PRIx64, title_id);
|
ERROR_LOG_FMT(CORE, "CheckNAND: Missing contents for title {:016x}", title_id);
|
||||||
result.titles_to_remove.insert(title_id);
|
result.titles_to_remove.insert(title_id);
|
||||||
if (repair)
|
if (repair)
|
||||||
File::DeleteDirRecursively(title_dir);
|
File::DeleteDirRecursively(title_dir);
|
||||||
|
|
Loading…
Reference in New Issue