get rid of fmt dependency since we are on C++23

This commit is contained in:
irisz64
2025-07-22 11:30:37 +02:00
parent 9b169825ee
commit 8549d5a21c
173 changed files with 452 additions and 83654 deletions

View File

@@ -104,7 +104,7 @@ u32 Cop0::GetReg32(const u8 addr) {
case 31:
return openbus;
default:
Util::panic("Unsupported word read from COP0 register {}", addr);
panic("Unsupported word read from COP0 register {}", addr);
}
}
@@ -141,7 +141,7 @@ u64 Cop0::GetReg64(const u8 addr) const {
case 31:
return openbus;
default:
Util::panic("Unsupported dword read from COP0 register {}", addr);
panic("Unsupported dword read from COP0 register {}", addr);
}
}
@@ -237,7 +237,7 @@ void Cop0::SetReg32(const u8 addr, const u32 value) {
case 31:
break;
default:
Util::panic("Unsupported word write from COP0 register {}", addr);
panic("Unsupported word write from COP0 register {}", addr);
}
}
@@ -282,7 +282,7 @@ void Cop0::SetReg64(const u8 addr, const u64 value) {
ErrorEPC = (s64)value;
break;
default:
Util::panic("Unsupported dword write to COP0 register {}", addr);
panic("Unsupported dword write to COP0 register {}", addr);
}
}
@@ -386,7 +386,7 @@ void Cop0::FireException(const ExceptionCode code, const int cop, s64 pc) const
regs.cop0.cause.exceptionCode = static_cast<u8>(code);
if (regs.cop0.status.bev) {
Util::panic("BEV bit set!");
panic("BEV bit set!");
} else {
switch (code) {
case ExceptionCode::Interrupt:
@@ -416,7 +416,7 @@ void Cop0::FireException(const ExceptionCode code, const int cop, s64 pc) const
}
break;
default:
Util::panic("Unhandled exception! {}", static_cast<u8>(code));
panic("Unhandled exception! {}", static_cast<u8>(code));
}
}
@@ -437,7 +437,7 @@ void Cop0::HandleTLBException(const u64 vaddr) const {
ExceptionCode Cop0::GetTLBExceptionCode(const TLBError error, const TLBAccessType accessType) {
switch (error) {
case NONE:
Util::panic("Getting TLB exception with error NONE");
panic("Getting TLB exception with error NONE");
case INVALID:
case MISS:
return accessType == LOAD ? ExceptionCode::TLBLoad : ExceptionCode::TLBStore;
@@ -446,7 +446,7 @@ ExceptionCode Cop0::GetTLBExceptionCode(const TLBError error, const TLBAccessTyp
case DISALLOWED_ADDRESS:
return accessType == LOAD ? ExceptionCode::AddressErrorLoad : ExceptionCode::AddressErrorStore;
default:
Util::panic("Getting TLB exception for unknown error code! ({})", static_cast<u8>(error));
panic("Getting TLB exception for unknown error code! ({})", static_cast<u8>(error));
return {};
}
}
@@ -485,12 +485,12 @@ void Cop0::decode(const u32 instr) {
eret();
break;
default:
Util::panic("Unimplemented COP0 function {} {} ({:08X}) ({:016X})", mask_cop2 >> 3, mask_cop2 & 7, instr,
panic("Unimplemented COP0 function {} {} ({:08X}) ({:016X})", mask_cop2 >> 3, mask_cop2 & 7, instr,
regs.oldPC);
}
break;
default:
Util::panic("Unimplemented COP0 instruction {} {}", mask_cop >> 4, mask_cop & 7);
panic("Unimplemented COP0 instruction {} {}", mask_cop >> 4, mask_cop & 7);
}
}
@@ -505,9 +505,9 @@ bool Cop0::MapVAddr(const TLBAccessType accessType, const u64 vaddr, u32 &paddr)
}
if (regs.cop0.supervisorMode) {
Util::panic("Supervisor mode memory access, 64 bit mode");
panic("Supervisor mode memory access, 64 bit mode");
} else {
Util::panic("Unknown mode! This should never happen!");
panic("Unknown mode! This should never happen!");
}
} else {
if (regs.cop0.kernelMode) [[likely]] {
@@ -519,9 +519,9 @@ bool Cop0::MapVAddr(const TLBAccessType accessType, const u64 vaddr, u32 &paddr)
}
if (regs.cop0.supervisorMode) {
Util::panic("Supervisor mode memory access, 32 bit mode");
panic("Supervisor mode memory access, 32 bit mode");
} else {
Util::panic("Unknown mode! This should never happen!");
panic("Unknown mode! This should never happen!");
}
}
}
@@ -545,9 +545,9 @@ bool Cop0::MapVAddr32(const TLBAccessType accessType, const u64 vaddr, u32 &padd
paddr = vaddr & 0x1FFFFFFF;
return true;
case 6:
Util::panic("Unimplemented virtual mapping in KSSEG! ({:08X})", vaddr);
panic("Unimplemented virtual mapping in KSSEG! ({:08X})", vaddr);
default:
Util::panic("Should never end up in default case in map_vaddr! ({:08X})", vaddr);
panic("Should never end up in default case in map_vaddr! ({:08X})", vaddr);
}
return false;
@@ -571,10 +571,10 @@ bool Cop0::MapVAddr64(const TLBAccessType accessType, const u64 vaddr, u32 &padd
case VREGION_XKPHYS:
{
if (!regs.cop0.kernelMode) {
Util::panic("Access to XKPHYS address 0x{:016X} when outside kernel mode!", vaddr);
panic("Access to XKPHYS address 0x{:016X} when outside kernel mode!", vaddr);
}
if (const u8 high_two_bits = (vaddr >> 62) & 0b11; high_two_bits != 0b10) {
Util::panic("Access to XKPHYS address 0x{:016X} with high two bits != 0b10!", vaddr);
panic("Access to XKPHYS address 0x{:016X} with high two bits != 0b10!", vaddr);
}
const u8 subsegment = (vaddr >> 59) & 0b11;
bool cached = subsegment != 2; // do something with this eventually
@@ -592,16 +592,16 @@ bool Cop0::MapVAddr64(const TLBAccessType accessType, const u64 vaddr, u32 &padd
// Identical to kseg0 in 32 bit mode.
// Unmapped translation. Subtract the base address of the space to get the physical address.
paddr = vaddr - START_VREGION_KSEG0; // Implies cutting off the high 32 bits
Util::trace("CKSEG0: Translated 0x{:016X} to 0x{:08X}", vaddr, paddr);
trace("CKSEG0: Translated 0x{:016X} to 0x{:08X}", vaddr, paddr);
return true;
case VREGION_CKSEG1:
// Identical to kseg1 in 32 bit mode.
// Unmapped translation. Subtract the base address of the space to get the physical address.
paddr = vaddr - START_VREGION_KSEG1; // Implies cutting off the high 32 bits
Util::trace("KSEG1: Translated 0x{:016X} to 0x{:08X}", vaddr, paddr);
trace("KSEG1: Translated 0x{:016X} to 0x{:08X}", vaddr, paddr);
return true;
case VREGION_CKSSEG:
Util::panic("Resolving virtual address 0x{:016X} (VREGION_CKSSEG) in 64 bit mode", vaddr);
panic("Resolving virtual address 0x{:016X} (VREGION_CKSSEG) in 64 bit mode", vaddr);
case VREGION_CKSEG3:
return ProbeTLB(accessType, vaddr, paddr);
case VREGION_XBAD1:
@@ -610,7 +610,7 @@ bool Cop0::MapVAddr64(const TLBAccessType accessType, const u64 vaddr, u32 &padd
regs.cop0.tlbError = DISALLOWED_ADDRESS;
return false;
default:
Util::panic("Resolving virtual address 0x{:016X} in 64 bit mode", vaddr);
panic("Resolving virtual address 0x{:016X} in 64 bit mode", vaddr);
}
return false;