mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Merge pull request #9258 from lioncash/core-log
Core: Convert logging over to fmt pt. 1
This commit is contained in:
@@ -245,13 +245,13 @@ std::vector<ARCode> LoadCodes(const IniFile& global_ini, const IniFile& local_in
|
||||
}
|
||||
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)
|
||||
PanicAlertT("The address is invalid");
|
||||
PanicAlertFmtT("The address is invalid");
|
||||
|
||||
if (!success_val)
|
||||
PanicAlertT("The value is invalid");
|
||||
PanicAlertFmtT("The value is invalid");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -316,7 +316,7 @@ static void VLogInfo(std::string_view format, fmt::format_args args)
|
||||
return;
|
||||
|
||||
std::string text = fmt::vformat(format, args);
|
||||
INFO_LOG(ACTIONREPLAY, "%s", text.c_str());
|
||||
INFO_LOG_FMT(ACTIONREPLAY, "{}", text);
|
||||
|
||||
if (use_internal_log)
|
||||
{
|
||||
@@ -403,9 +403,9 @@ static bool Subtype_RamWriteAndFill(const ARAddr& addr, const u32 data)
|
||||
|
||||
default:
|
||||
LogInfo("Bad Size");
|
||||
PanicAlertT("Action Replay Error: Invalid size "
|
||||
"(%08x : address = %08x) in Ram Write And Fill (%s)",
|
||||
addr.size, addr.gcaddr, s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay Error: Invalid size "
|
||||
"({0:08x} : address = {1:08x}) in Ram Write And Fill ({2})",
|
||||
addr.size, addr.gcaddr, s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -463,9 +463,9 @@ static bool Subtype_WriteToPointer(const ARAddr& addr, const u32 data)
|
||||
|
||||
default:
|
||||
LogInfo("Bad Size");
|
||||
PanicAlertT("Action Replay Error: Invalid size "
|
||||
"(%08x : address = %08x) in Write To Pointer (%s)",
|
||||
addr.size, addr.gcaddr, s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay Error: Invalid size "
|
||||
"({0:08x} : address = {1:08x}) in Write To Pointer ({2})",
|
||||
addr.size, addr.gcaddr, s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -525,9 +525,9 @@ static bool Subtype_AddCode(const ARAddr& addr, const u32 data)
|
||||
|
||||
default:
|
||||
LogInfo("Bad Size");
|
||||
PanicAlertT("Action Replay Error: Invalid size "
|
||||
"(%08x : address = %08x) in Add Code (%s)",
|
||||
addr.size, addr.gcaddr, s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay Error: Invalid size "
|
||||
"({0:08x} : address = {1:08x}) in Add Code ({2})",
|
||||
addr.size, addr.gcaddr, s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -540,9 +540,9 @@ static bool Subtype_MasterCodeAndWriteToCCXXXXXX(const ARAddr& addr, const u32 d
|
||||
// u8 mcode_type = (data & 0xFF0000) >> 16;
|
||||
// u8 mcode_count = (data & 0xFF00) >> 8;
|
||||
// u8 mcode_number = data & 0xFF;
|
||||
PanicAlertT("Action Replay Error: Master Code and Write To CCXXXXXX not implemented (%s)\n"
|
||||
"Master codes are not needed. Do not use master codes.",
|
||||
s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay Error: Master Code and Write To CCXXXXXX not implemented ({0})\n"
|
||||
"Master codes are not needed. Do not use master codes.",
|
||||
s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -615,8 +615,9 @@ static bool ZeroCode_FillAndSlide(const u32 val_last, const ARAddr& addr, const
|
||||
|
||||
default:
|
||||
LogInfo("Bad Size");
|
||||
PanicAlertT("Action Replay Error: Invalid size (%08x : address = %08x) in Fill and Slide (%s)",
|
||||
size, new_addr, s_current_code->name.c_str());
|
||||
PanicAlertFmtT(
|
||||
"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 true;
|
||||
@@ -670,8 +671,8 @@ static bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr& addr, const u3
|
||||
else
|
||||
{
|
||||
LogInfo("Bad Value");
|
||||
PanicAlertT("Action Replay Error: Invalid value (%08x) in Memory Copy (%s)", (data & ~0x7FFF),
|
||||
s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay Error: Invalid value ({0:08x}) in Memory Copy ({1})",
|
||||
(data & ~0x7FFF), s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -707,8 +708,8 @@ static bool NormalCode(const ARAddr& addr, const u32 data)
|
||||
|
||||
default:
|
||||
LogInfo("Bad Subtype");
|
||||
PanicAlertT("Action Replay: Normal Code 0: Invalid Subtype %08x (%s)", addr.subtype,
|
||||
s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay: Normal Code 0: Invalid Subtype {0:08x} ({1})", addr.subtype,
|
||||
s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -749,8 +750,8 @@ static bool CompareValues(const u32 val1, const u32 val2, const int type)
|
||||
|
||||
default:
|
||||
LogInfo("Unknown Compare type");
|
||||
PanicAlertT("Action Replay: Invalid Normal Code Type %08x (%s)", type,
|
||||
s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay: Invalid Normal Code Type {0:08x} ({1})", type,
|
||||
s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -781,8 +782,8 @@ static bool ConditionalCode(const ARAddr& addr, const u32 data, int* const pSkip
|
||||
|
||||
default:
|
||||
LogInfo("Bad Size");
|
||||
PanicAlertT("Action Replay: Conditional Code: Invalid Size %08x (%s)", addr.size,
|
||||
s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay: Conditional Code: Invalid Size {0:08x} ({1})", addr.size,
|
||||
s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -805,8 +806,8 @@ static bool ConditionalCode(const ARAddr& addr, const u32 data, int* const pSkip
|
||||
|
||||
default:
|
||||
LogInfo("Bad Subtype");
|
||||
PanicAlertT("Action Replay: Normal Code %i: Invalid subtype %08x (%s)", 1, addr.subtype,
|
||||
s_current_code->name.c_str());
|
||||
PanicAlertFmtT("Action Replay: Normal Code {0}: Invalid subtype {1:08x} ({2})", 1,
|
||||
addr.subtype, s_current_code->name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -889,7 +890,7 @@ static bool RunCodeLocked(const ARCode& arcode)
|
||||
{
|
||||
LogInfo(
|
||||
"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.");
|
||||
return false;
|
||||
}
|
||||
@@ -923,7 +924,7 @@ static bool RunCodeLocked(const ARCode& arcode)
|
||||
// Todo: Set register 1BB4 to 1
|
||||
LogInfo("ZCode: Executes all codes in the same row, Set register 1BB4 to 1 (zcode not "
|
||||
"supported)");
|
||||
PanicAlertT("Zero 3 code not supported");
|
||||
PanicAlertFmtT("Zero 3 code not supported");
|
||||
return false;
|
||||
|
||||
case ZCODE_04: // Fill & Slide or Memory Copy
|
||||
@@ -943,7 +944,7 @@ static bool RunCodeLocked(const ARCode& arcode)
|
||||
|
||||
default:
|
||||
LogInfo("ZCode: Unknown");
|
||||
PanicAlertT("Zero code unknown to Dolphin: %08x", zcode);
|
||||
PanicAlertFmtT("Zero code unknown to Dolphin: {0:08x}", zcode);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#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> size = volume.ReadSwapped<u32>(offset + 0x14, 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;
|
||||
}
|
||||
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!!!
|
||||
|
||||
// Call iAppLoaderEntry.
|
||||
DEBUG_LOG(MASTER_LOG, "Call iAppLoaderEntry");
|
||||
DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderEntry");
|
||||
const u32 iAppLoaderFuncAddr = is_wii ? 0x80004000 : 0x80003100;
|
||||
PowerPC::ppcState.gpr[3] = iAppLoaderFuncAddr + 0;
|
||||
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);
|
||||
|
||||
// iAppLoaderInit
|
||||
DEBUG_LOG(MASTER_LOG, "Call iAppLoaderInit");
|
||||
DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderInit");
|
||||
HLE::Patch(0x81300000, "AppLoaderReport"); // HLE OSReport for Apploader
|
||||
PowerPC::ppcState.gpr[3] = 0x81300000;
|
||||
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).
|
||||
// To give you an idea about where the stuff is located on the disc take a look at yagcd
|
||||
// ch 13.
|
||||
DEBUG_LOG(MASTER_LOG, "Call iAppLoaderMain");
|
||||
DEBUG_LOG_FMT(MASTER_LOG, "Call iAppLoaderMain");
|
||||
|
||||
PowerPC::ppcState.gpr[3] = 0x81300004;
|
||||
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.
|
||||
while (PowerPC::ppcState.gpr[3] != 0x00)
|
||||
{
|
||||
u32 iRamAddress = PowerPC::Read_U32(0x81300004);
|
||||
u32 iLength = PowerPC::Read_U32(0x81300008);
|
||||
u32 iDVDOffset = PowerPC::Read_U32(0x8130000c) << (is_wii ? 2 : 0);
|
||||
const u32 ram_address = PowerPC::Read_U32(0x81300004);
|
||||
const u32 length = PowerPC::Read_U32(0x81300008);
|
||||
const u32 dvd_offset = PowerPC::Read_U32(0x8130000c) << (is_wii ? 2 : 0);
|
||||
|
||||
INFO_LOG(MASTER_LOG, "DVDRead: offset: %08x memOffset: %08x length: %i", iDVDOffset,
|
||||
iRamAddress, iLength);
|
||||
DVDRead(volume, iDVDOffset, iRamAddress, iLength, partition);
|
||||
INFO_LOG_FMT(MASTER_LOG, "DVDRead: offset: {:08x} memOffset: {:08x} length: {}", dvd_offset,
|
||||
ram_address, length);
|
||||
DVDRead(volume, dvd_offset, ram_address, length, partition);
|
||||
|
||||
PowerPC::ppcState.gpr[3] = 0x81300004;
|
||||
PowerPC::ppcState.gpr[4] = 0x81300008;
|
||||
@@ -156,7 +157,7 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume)
|
||||
}
|
||||
|
||||
// iAppLoaderClose
|
||||
DEBUG_LOG(MASTER_LOG, "call iAppLoaderClose");
|
||||
DEBUG_LOG_FMT(MASTER_LOG, "call iAppLoaderClose");
|
||||
RunFunction(iAppLoaderClose);
|
||||
HLE::UnPatch("AppLoaderReport");
|
||||
|
||||
@@ -205,7 +206,7 @@ void CBoot::SetupGCMemory()
|
||||
// execute the apploader, function by function, using the above utility.
|
||||
bool CBoot::EmulatedBS2_GC(const DiscIO::VolumeDisc& volume)
|
||||
{
|
||||
INFO_LOG(BOOT, "Faking GC BS2...");
|
||||
INFO_LOG_FMT(BOOT, "Faking GC BS2...");
|
||||
|
||||
SetupMSR();
|
||||
SetupBAT(/*is_wii*/ false);
|
||||
@@ -330,11 +331,11 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
|
||||
serno = "123456789";
|
||||
else
|
||||
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
|
||||
{
|
||||
INFO_LOG(BOOT, "Using serial number: %s", serno.c_str());
|
||||
INFO_LOG_FMT(BOOT, "Using serial number: {}", serno);
|
||||
}
|
||||
|
||||
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});
|
||||
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;
|
||||
}
|
||||
|
||||
// Write the 256 byte setting.txt to memory.
|
||||
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
|
||||
@@ -438,7 +439,7 @@ static void WriteEmptyPlayRecord()
|
||||
// execute the apploader
|
||||
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)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
@@ -29,7 +28,7 @@ bool CBoot::BootNANDTitle(const u64 title_id)
|
||||
if (ticket.IsValid())
|
||||
console_type = ticket.GetConsoleType();
|
||||
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);
|
||||
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))
|
||||
{
|
||||
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 BootNANDTitle(wad.GetTMD().GetTitleId());
|
||||
|
||||
@@ -126,23 +126,23 @@ const char* ElfReader::GetSectionName(int section) const
|
||||
// This is just a simple elf loader, good enough to load elfs generated by devkitPPC
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
INFO_LOG(MASTER_LOG, "%i segments:", header->e_phnum);
|
||||
INFO_LOG_FMT(MASTER_LOG, "{} segments:", header->e_phnum);
|
||||
|
||||
// Copy segments into ram.
|
||||
for (int i = 0; i < header->e_phnum; i++)
|
||||
{
|
||||
Elf32_Phdr* p = segments + i;
|
||||
|
||||
INFO_LOG(MASTER_LOG, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr,
|
||||
p->p_filesz, p->p_memsz);
|
||||
INFO_LOG_FMT(MASTER_LOG, "Type: {} Vaddr: {:08x} Filesz: {} Memsz: {}", p->p_type, p->p_vaddr,
|
||||
p->p_filesz, p->p_memsz);
|
||||
|
||||
if (p->p_type == PT_LOAD)
|
||||
{
|
||||
@@ -158,11 +158,12 @@ bool ElfReader::LoadIntoMemory(bool only_in_mem1) const
|
||||
if (srcSize < dstSize)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ static GPUDeterminismMode ParseGPUDeterminismMode(const std::string& mode)
|
||||
if (mode == "fake-completion")
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ void SaveToSYSCONF(Config::LayerType layer)
|
||||
idle_entry->bytes = std::vector<u8>(2);
|
||||
else
|
||||
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);
|
||||
sysconf.Save();
|
||||
@@ -143,8 +143,8 @@ public:
|
||||
auto ini = inis.find(location.system);
|
||||
if (ini == inis.end())
|
||||
{
|
||||
ERROR_LOG(COMMON, "Config can't map system '%s' to an INI file!",
|
||||
Config::GetSystemName(location.system).c_str());
|
||||
ERROR_LOG_FMT(COMMON, "Config can't map system '{}' to an INI file!",
|
||||
Config::GetSystemName(location.system));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ static Location MapINIToRealLocation(const std::string& section, const std::stri
|
||||
if (!fail && system)
|
||||
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, "", ""};
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ private:
|
||||
if (!File::Exists(ini_path))
|
||||
{
|
||||
// TODO: PanicAlert shouldn't be used for this.
|
||||
PanicAlertT("Selected controller profile does not exist");
|
||||
PanicAlertFmtT("Selected controller profile does not exist");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ SConfig::~SConfig()
|
||||
|
||||
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;
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
|
||||
|
||||
@@ -343,7 +343,7 @@ void SConfig::LoadSettings()
|
||||
{
|
||||
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;
|
||||
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);
|
||||
m_title_name = title_database.GetTitleName(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();
|
||||
|
||||
Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
|
||||
@@ -848,12 +848,12 @@ struct SetGameMetadata
|
||||
{
|
||||
if (!wad.GetTMD().IsValid())
|
||||
{
|
||||
PanicAlertT("This WAD is not valid.");
|
||||
PanicAlertFmtT("This WAD is not valid.");
|
||||
return false;
|
||||
}
|
||||
if (!IOS::ES::IsChannel(wad.GetTMD().GetTitleId()))
|
||||
{
|
||||
PanicAlertT("This WAD is not bootable.");
|
||||
PanicAlertFmtT("This WAD is not bootable.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -871,7 +871,7 @@ struct SetGameMetadata
|
||||
const IOS::ES::TMDReader tmd = ios.GetES()->FindInstalledTMD(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;
|
||||
}
|
||||
|
||||
|
||||
+18
-18
@@ -220,7 +220,7 @@ bool Init(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
|
||||
{
|
||||
if (IsRunning())
|
||||
{
|
||||
PanicAlertT("Emu Thread already running");
|
||||
PanicAlertFmtT("Emu Thread already running");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -233,8 +233,8 @@ bool Init(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
|
||||
|
||||
Core::UpdateWantDeterminism(/*initial*/ true);
|
||||
|
||||
INFO_LOG(BOOT, "Starting core = %s mode", SConfig::GetInstance().bWii ? "Wii" : "GameCube");
|
||||
INFO_LOG(BOOT, "CPU Thread separate = %s", SConfig::GetInstance().bCPUThread ? "Yes" : "No");
|
||||
INFO_LOG_FMT(BOOT, "Starting core = {} mode", SConfig::GetInstance().bWii ? "Wii" : "GameCube");
|
||||
INFO_LOG_FMT(BOOT, "CPU Thread separate = {}", SConfig::GetInstance().bCPUThread ? "Yes" : "No");
|
||||
|
||||
Host_UpdateMainFrame(); // Disable any menus or buttons at boot
|
||||
|
||||
@@ -278,10 +278,10 @@ void Stop() // - Hammertime!
|
||||
|
||||
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
|
||||
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stop CPU").c_str());
|
||||
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "Stop CPU"));
|
||||
CPU::Stop();
|
||||
|
||||
if (_CoreParameter.bCPUThread)
|
||||
@@ -289,7 +289,7 @@ void Stop() // - Hammertime!
|
||||
// Video_EnterLoop() should now exit so that EmuThread()
|
||||
// will continue concurrently with the rest of the commands
|
||||
// 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();
|
||||
}
|
||||
@@ -412,7 +412,7 @@ static void FifoPlayerThread(const std::optional<std::string>& savestate_path,
|
||||
else
|
||||
{
|
||||
// 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();
|
||||
return;
|
||||
}
|
||||
@@ -435,7 +435,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||
if (s_on_state_changed_callback)
|
||||
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");
|
||||
@@ -510,9 +510,9 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||
Common::ScopeGuard hw_guard{[] {
|
||||
// We must set up this flag before executing HW::Shutdown()
|
||||
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();
|
||||
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
|
||||
OSD::ClearMessages();
|
||||
@@ -529,7 +529,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||
|
||||
if (!g_video_backend->Initialize(wsi))
|
||||
{
|
||||
PanicAlert("Failed to initialize video backend!");
|
||||
PanicAlertFmt("Failed to initialize video backend!");
|
||||
return;
|
||||
}
|
||||
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))
|
||||
{
|
||||
PanicAlert("Failed to initialize DSP emulation!");
|
||||
PanicAlertFmt("Failed to initialize DSP emulation!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -615,11 +615,11 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||
Fifo::RunGpuLoop();
|
||||
|
||||
// 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.
|
||||
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
|
||||
{
|
||||
@@ -628,9 +628,9 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||
}
|
||||
|
||||
#ifdef USE_GDBSTUB
|
||||
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stopping GDB ...").c_str());
|
||||
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "Stopping GDB ..."));
|
||||
gdb_deinit();
|
||||
INFO_LOG(CONSOLE, "%s", StopMessage(true, "GDB stopped.").c_str());
|
||||
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "GDB stopped."));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -656,7 +656,7 @@ void SetState(State state)
|
||||
Wiimote::Resume();
|
||||
break;
|
||||
default:
|
||||
PanicAlert("Invalid state");
|
||||
PanicAlertFmt("Invalid state");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -995,7 +995,7 @@ void UpdateWantDeterminism(bool initial)
|
||||
bool new_want_determinism = Movie::IsMovieActive() || NetPlay::IsNetPlayRunning();
|
||||
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([&] {
|
||||
s_wants_determinism = new_want_determinism;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "Core/CoreTiming.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cinttypes>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
@@ -189,9 +188,9 @@ void DoState(PointerWrap& p)
|
||||
}
|
||||
else
|
||||
{
|
||||
WARN_LOG(POWERPC,
|
||||
"Lost event from savestate because its type, \"%s\", has not been registered.",
|
||||
name.c_str());
|
||||
WARN_LOG_FMT(POWERPC,
|
||||
"Lost event from savestate because its type, \"{}\", has not been registered.",
|
||||
name);
|
||||
ev.type = s_ev_lost;
|
||||
}
|
||||
}
|
||||
@@ -260,10 +259,10 @@ void ScheduleEvent(s64 cycles_into_future, EventType* event_type, u64 userdata,
|
||||
{
|
||||
if (Core::WantsDeterminism())
|
||||
{
|
||||
ERROR_LOG(POWERPC,
|
||||
"Someone scheduled an off-thread \"%s\" event while netplay or "
|
||||
"movie play/record was active. This is likely to cause a desync.",
|
||||
event_type->name->c_str());
|
||||
ERROR_LOG_FMT(POWERPC,
|
||||
"Someone scheduled an off-thread \"{}\" event while netplay or "
|
||||
"movie play/record was active. This is likely to cause a desync.",
|
||||
*event_type->name);
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lk(s_ts_write_lock);
|
||||
@@ -329,8 +328,6 @@ void Advance()
|
||||
Event evt = std::move(s_event_queue.front());
|
||||
std::pop_heap(s_event_queue.begin(), s_event_queue.end(), std::greater<Event>());
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -358,8 +355,8 @@ void LogPendingEvents()
|
||||
std::sort(clone.begin(), clone.end());
|
||||
for (const Event& ev : clone)
|
||||
{
|
||||
INFO_LOG(POWERPC, "PENDING: Now: %" PRId64 " Pending: %" PRId64 " Type: %s", g.global_timer,
|
||||
ev.time, ev.type->name->c_str());
|
||||
INFO_LOG_FMT(POWERPC, "PENDING: Now: {} Pending: {} Type: {}", g.global_timer, ev.time,
|
||||
*ev.type->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ u16 Accelerator::ReadD3()
|
||||
m_current_address++;
|
||||
break;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ void Accelerator::WriteD3(u16 value)
|
||||
m_current_address++;
|
||||
break;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ u16 Accelerator::Read(const s16* coefs)
|
||||
m_current_address += 1;
|
||||
break;
|
||||
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;
|
||||
m_current_address += 1;
|
||||
val = 0;
|
||||
|
||||
@@ -144,12 +144,12 @@ void AnalyzeRange(u16 start_addr, u16 end_addr)
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
INFO_LOG(DSPLLE, "Finished analysis.");
|
||||
INFO_LOG_FMT(DSPLLE, "Finished analysis.");
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/File.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/StringUtil.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)
|
||||
{
|
||||
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;
|
||||
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);
|
||||
pc = i;
|
||||
disassembler.DisassembleOpcode(&code2[0], &pc, line2);
|
||||
printf("!! %04x : %04x vs %04x - %s vs %s\n", i, code1[i], code2[i], line1.c_str(),
|
||||
line2.c_str());
|
||||
WARN_LOG_FMT(AUDIO, "!! {:04x} : {:04x} vs {:04x} - {} vs {}\n", i, code1[i], code2[i],
|
||||
line1, line2);
|
||||
}
|
||||
}
|
||||
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;
|
||||
for (u16 i = min_size; i < longest.size(); i++)
|
||||
{
|
||||
u16 pc = i;
|
||||
std::string 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;
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
PanicAlert("Can't dump UCode to file '%s'!!", binary_file.c_str());
|
||||
PanicAlertFmt("Can't dump UCode to file '{}'!!", binary_file);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,9 +77,9 @@ static bool VerifyRoms()
|
||||
|
||||
if (rom_idx < 0)
|
||||
{
|
||||
if (AskYesNoT("Your DSP ROMs have incorrect hashes.\n"
|
||||
"Would you like to stop now to fix the problem?\n"
|
||||
"If you select \"No\", audio might be garbled."))
|
||||
if (AskYesNoFmtT("Your DSP ROMs have incorrect hashes.\n"
|
||||
"Would you like to stop now to fix the problem?\n"
|
||||
"If you select \"No\", audio might be garbled."))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ void DSPCore_CheckExceptions()
|
||||
else
|
||||
{
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
ERROR_LOG(DSPLLE, "Firing exception %d failed", i);
|
||||
ERROR_LOG_FMT(DSPLLE, "Firing exception {} failed", i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ std::string DSPDisassembler::DisassembleParameters(const DSPOPCTemplate& opc, u1
|
||||
break;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,12 +54,9 @@ void gdsp_mbox_write_l(Mailbox mbx, u16 val)
|
||||
g_dsp.mbox[mbx].store(new_value | 0x80000000, std::memory_order_release);
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
if (mbx == MAILBOX_DSP)
|
||||
DEBUG_LOG(DSP_MAIL, "DSP(WM) B:%i M:0x%08x (pc=0x%04x)", mbx, gdsp_mbox_peek(MAILBOX_DSP),
|
||||
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);
|
||||
const char* const type = mbx == MAILBOX_DSP ? "DSP" : "CPU";
|
||||
DEBUG_LOG_FMT(DSP_MAIL, "{}(WM) B:{} M:{:#010x} (pc={:#06x})", type, mbx, gdsp_mbox_peek(mbx),
|
||||
g_dsp.pc);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -86,12 +83,9 @@ u16 gdsp_mbox_read_l(Mailbox mbx)
|
||||
}
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
if (mbx == MAILBOX_DSP)
|
||||
DEBUG_LOG(DSP_MAIL, "DSP(RM) B:%i M:0x%08x (pc=0x%04x)", mbx, gdsp_mbox_peek(MAILBOX_DSP),
|
||||
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);
|
||||
const char* const type = mbx == MAILBOX_DSP ? "DSP" : "CPU";
|
||||
DEBUG_LOG_FMT(DSP_MAIL, "{}(RM) B:{} M:0x{:#010x} (pc={:#06x})", type, mbx, gdsp_mbox_peek(mbx),
|
||||
g_dsp.pc);
|
||||
#endif
|
||||
|
||||
return (u16)value;
|
||||
@@ -104,10 +98,10 @@ void gdsp_ifx_write(u32 addr, u16 val)
|
||||
switch (addr & 0xff)
|
||||
{
|
||||
case DSP_DIRQ:
|
||||
if (val & 0x1)
|
||||
if ((val & 1) != 0)
|
||||
Host::InterruptRequest();
|
||||
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;
|
||||
|
||||
case DSP_DMBH:
|
||||
@@ -130,16 +124,17 @@ void gdsp_ifx_write(u32 addr, u16 val)
|
||||
if (!g_dsp.ifx_regs[DSP_AMDM])
|
||||
gdsp_do_dma();
|
||||
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_DSBL] = 0;
|
||||
break;
|
||||
|
||||
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_DSMAH:
|
||||
case DSP_DSMAL:
|
||||
@@ -190,18 +185,21 @@ void gdsp_ifx_write(u32 addr, u16 val)
|
||||
default:
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
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;
|
||||
break;
|
||||
@@ -253,23 +251,29 @@ static u16 _gdsp_ifx_read(u16 addr)
|
||||
return g_dsp.accelerator->ReadD3();
|
||||
|
||||
default:
|
||||
{
|
||||
const u16 ifx_reg = g_dsp.ifx_regs[addr & 0xFF];
|
||||
|
||||
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,
|
||||
g_dsp.ifx_regs[addr & 0xFF]);
|
||||
DEBUG_LOG_FMT(DSPLLE, "{:04x} MR {} ({:04x})", g_dsp.pc, label.name, ifx_reg);
|
||||
}
|
||||
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
|
||||
{
|
||||
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 g_dsp.ifx_regs[addr & 0xFF];
|
||||
return ifx_reg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Host::CodeLoaded(addr, size);
|
||||
NOTICE_LOG(DSPLLE, "*** Copy new UCode from 0x%08x to 0x%04x (crc: %8x)", addr, dsp_addr,
|
||||
g_dsp.iram_crc);
|
||||
NOTICE_LOG_FMT(DSPLLE, "*** Copy new UCode from {:#010x} to {:#06x} (crc: {:#08x})", addr,
|
||||
dsp_addr, g_dsp.iram_crc);
|
||||
|
||||
return reinterpret_cast<u8*>(g_dsp.iram) + dsp_addr;
|
||||
}
|
||||
|
||||
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,
|
||||
addr, size);
|
||||
ERROR_LOG_FMT(DSPLLE, "*** idma_out IRAM_DSP ({:#06x}) -> RAM ({:#010x}) : size ({:#010x})",
|
||||
dsp_addr / 2, addr, size);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@@ -305,8 +309,8 @@ 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)
|
||||
{
|
||||
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,
|
||||
dsp_addr / 2, size);
|
||||
DEBUG_LOG_FMT(DSPLLE, "*** ddma_in RAM ({:#010x}) -> DRAM_DSP ({:#06x}) : size ({:#010x})", addr,
|
||||
dsp_addr / 2, size);
|
||||
|
||||
return reinterpret_cast<u8*>(g_dsp.dram) + dsp_addr;
|
||||
}
|
||||
@@ -314,29 +318,31 @@ 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)
|
||||
{
|
||||
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,
|
||||
addr, size);
|
||||
DEBUG_LOG_FMT(DSPLLE, "*** ddma_out DRAM_DSP ({:#06x}) -> RAM ({:#010x}) : size ({:#010x})",
|
||||
dsp_addr / 2, addr, size);
|
||||
|
||||
return reinterpret_cast<const u8*>(g_dsp.dram) + dsp_addr;
|
||||
}
|
||||
|
||||
static void gdsp_do_dma()
|
||||
{
|
||||
u32 addr = (g_dsp.ifx_regs[DSP_DSMAH] << 16) | g_dsp.ifx_regs[DSP_DSMAL];
|
||||
u16 ctl = g_dsp.ifx_regs[DSP_DSCR];
|
||||
u16 dsp_addr = g_dsp.ifx_regs[DSP_DSPA] * 2;
|
||||
u16 len = g_dsp.ifx_regs[DSP_DSBL];
|
||||
const u32 addr = (g_dsp.ifx_regs[DSP_DSMAH] << 16) | g_dsp.ifx_regs[DSP_DSMAL];
|
||||
const u16 ctl = g_dsp.ifx_regs[DSP_DSCR];
|
||||
const u16 dsp_addr = g_dsp.ifx_regs[DSP_DSPA] * 2;
|
||||
const u16 len = g_dsp.ifx_regs[DSP_DSBL];
|
||||
|
||||
if (len > 0x4000)
|
||||
{
|
||||
ERROR_LOG(DSPLLE,
|
||||
"DMA ERROR: PC: %04x, Control: %04x, Address: %08x, DSP Address: %04x, Size: %04x",
|
||||
g_dsp.pc, ctl, addr, dsp_addr, len);
|
||||
exit(0);
|
||||
ERROR_LOG_FMT(DSPLLE,
|
||||
"DMA ERROR: PC: {:04x}, Control: {:04x}, Address: {:08x}, DSP Address: {:04x}, "
|
||||
"Size: {:04x}",
|
||||
g_dsp.pc, ctl, addr, dsp_addr, len);
|
||||
std::exit(0);
|
||||
}
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
DEBUG_LOG(DSPLLE, "DMA pc: %04x, Control: %04x, Address: %08x, DSP Address: %04x, Size: %04x",
|
||||
g_dsp.pc, ctl, addr, dsp_addr, len);
|
||||
DEBUG_LOG_FMT(
|
||||
DSPLLE, "DMA pc: {:04x}, Control: {:04x}, Address: {:08x}, DSP Address: {:04x}, Size: {:04x}",
|
||||
g_dsp.pc, ctl, addr, dsp_addr, len);
|
||||
#endif
|
||||
|
||||
const u8* copied_data_ptr = nullptr;
|
||||
|
||||
@@ -24,7 +24,8 @@ u16 dsp_imem_read(u16 addr)
|
||||
return g_dsp.irom[addr & DSP_IROM_MASK];
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -37,14 +38,14 @@ u16 dsp_dmem_read(u16 addr)
|
||||
return g_dsp.dram[addr & DSP_DRAM_MASK];
|
||||
|
||||
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];
|
||||
|
||||
case 0xf: // Fxxx HW regs
|
||||
return gdsp_ifx_read(addr);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -62,7 +63,7 @@ void dsp_dmem_write(u16 addr, u16 val)
|
||||
break;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,8 +592,8 @@ void InitInstructionTable()
|
||||
// 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)
|
||||
{
|
||||
ERROR_LOG(DSPLLE, "opcode ext table place %zu already in use by %s when inserting %s", i,
|
||||
s_ext_op_table[i]->name, iter->name);
|
||||
ERROR_LOG_FMT(DSPLLE, "opcode ext table place {} already in use by {} when inserting {}", i,
|
||||
s_ext_op_table[i]->name, iter->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -610,7 +610,7 @@ void InitInstructionTable()
|
||||
if (s_op_table[i] == &cw)
|
||||
s_op_table[i] = &*iter;
|
||||
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);
|
||||
|
||||
@@ -42,7 +42,7 @@ void WriteCR(u16 val)
|
||||
// reset
|
||||
if (val & 1)
|
||||
{
|
||||
INFO_LOG(DSPLLE, "DSP_CONTROL RESET");
|
||||
INFO_LOG_FMT(DSPLLE, "DSP_CONTROL RESET");
|
||||
DSPCore_Reset();
|
||||
val &= ~1;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ void WriteCR(u16 val)
|
||||
{
|
||||
// HAX!
|
||||
// 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;
|
||||
val |= 0x800;
|
||||
}
|
||||
@@ -233,6 +233,6 @@ void nop(const UDSPInstruction opc)
|
||||
if (opc == 0)
|
||||
return;
|
||||
|
||||
ERROR_LOG(DSPLLE, "LLE: Unrecognized opcode 0x%04x", opc);
|
||||
ERROR_LOG_FMT(DSPLLE, "LLE: Unrecognized opcode {:#06x}", opc);
|
||||
}
|
||||
} // namespace DSP::Interpreter
|
||||
|
||||
@@ -173,7 +173,7 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
|
||||
m_gpr.PushRegs();
|
||||
ABI_CallFunctionC16(interpreter_function, inst);
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
|
||||
else
|
||||
{
|
||||
FallBackToInterpreter(inst);
|
||||
INFO_LOG(DSPLLE, "Instruction not JITed(main part): %04x", inst);
|
||||
INFO_LOG_FMT(DSPLLE, "Instruction not JITed(main part): {:04x}", inst);
|
||||
}
|
||||
|
||||
// Backlog
|
||||
@@ -359,7 +359,7 @@ void DSPEmitter::Compile(u16 start_addr)
|
||||
{
|
||||
// just a safeguard, should never happen anymore.
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user