diff --git a/Xenon/Base/Config.cpp b/Xenon/Base/Config.cpp index 15b538c..32af117 100644 --- a/Xenon/Base/Config.cpp +++ b/Xenon/Base/Config.cpp @@ -177,7 +177,7 @@ void saveConfig(const std::filesystem::path &path) { data["General"]["VSync"] = vsyncEnabled; data["General"]["QuitOnWindowClosure"] = shouldQuitOnWindowClosure; data["General"]["LogLevel"].comments().push_back("# Controls the current log level output filter"); - data["General"]["LogLevel"] = (int)currentLogLevel; + data["General"]["LogLevel"] = static_cast(currentLogLevel); data["General"]["LogAdvanced"] = islogAdvanced; // SMC. diff --git a/Xenon/Base/Thread.cpp b/Xenon/Base/Thread.cpp index 2647dfc..792c591 100644 --- a/Xenon/Base/Thread.cpp +++ b/Xenon/Base/Thread.cpp @@ -43,12 +43,12 @@ void SetCurrentThreadRealtime(const std::chrono::nanoseconds period_ns) { struct mach_timebase_info timebase {}; mach_timebase_info(&timebase); const auto ticks_per_ns = - static_cast(timebase.denom) / static_cast(timebase.numer); + static_cast(timebase.denom) / static_cast(timebase.numer); const auto period_ticks = - static_cast(static_cast(period_ns.count()) * ticks_per_ns); + static_cast(static_cast(period_ns.count()) * ticks_per_ns); const auto computation_ticks = - static_cast(static_cast(computation_ns.count()) * ticks_per_ns); + static_cast(static_cast(computation_ns.count()) * ticks_per_ns); thread_time_constraint_policy policy = { .period = period_ticks, diff --git a/Xenon/Base/Types.h b/Xenon/Base/Types.h index 3137258..7991912 100644 --- a/Xenon/Base/Types.h +++ b/Xenon/Base/Types.h @@ -2,7 +2,7 @@ #pragma once -#include +#include #include // Vali0004: Helper macro to make me sane when doing RAII @@ -107,7 +107,7 @@ template // Associative container size_t cSize = c.size(); if (cSize <= idx) [[unlikely]] { - assert_fail_debug_msg(std::format("Range check failed! (index: {}{})", idx, cSize != max_v ? std::format(", size: {}", cSize) : "")); + assert_fail_debug_msg(fmt::format("Range check failed! (index: {}{})", idx, cSize != max_v ? fmt::format(", size: {}", cSize) : "")); } auto it = std::begin(std::forward(c)); std::advance(it, idx); @@ -123,7 +123,7 @@ template if constexpr ((requires() { c.size(); })) cSize = c.size(); if (found == c.end()) [[unlikely]] { - assert_fail_debug_msg(std::format("Range check failed! (index: {}{})", idx, cSize != max_v ? std::format(", size: {}", cSize) : "")); + assert_fail_debug_msg(fmt::format("Range check failed! (index: {}{})", idx, cSize != max_v ? fmt::format(", size: {}", cSize) : "")); } return found->second; } diff --git a/Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/SMC.cpp b/Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/SMC.cpp index 07901e7..b9c48e1 100644 --- a/Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/SMC.cpp +++ b/Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/SMC.cpp @@ -1,4 +1,4 @@ -// Copyright 2025 XeEmulator Project +// Copyright 2025 Xenon Emulator Project #include "SMC.h" diff --git a/Xenon/Core/XCPU/Interpreter/Interpreter_Helpers.cpp b/Xenon/Core/XCPU/Interpreter/Interpreter_Helpers.cpp index d4859f8..cb8dfbf 100644 --- a/Xenon/Core/XCPU/Interpreter/Interpreter_Helpers.cpp +++ b/Xenon/Core/XCPU/Interpreter/Interpreter_Helpers.cpp @@ -37,9 +37,9 @@ u32 PPCInterpreter::CRCompU(PPU_STATE *ppuState, u64 num1, u64 num2) { u32 PPCInterpreter::CRCompS32(PPU_STATE *ppuState, u32 num1, u32 num2) { u32 CR = 0; - if ((long)num1 < (long)num2) + if (static_cast(num1) < static_cast(num2)) BSET(CR, 4, CR_BIT_LT); - else if ((long)num1 > (long)num2) + else if (static_cast(num1) > static_cast(num2)) BSET(CR, 4, CR_BIT_GT); else BSET(CR, 4, CR_BIT_EQ); diff --git a/Xenon/Core/XCPU/Interpreter/PPC_LS.cpp b/Xenon/Core/XCPU/Interpreter/PPC_LS.cpp index a197505..19d1746 100644 --- a/Xenon/Core/XCPU/Interpreter/PPC_LS.cpp +++ b/Xenon/Core/XCPU/Interpreter/PPC_LS.cpp @@ -1041,7 +1041,7 @@ void PPCInterpreter::PPCInterpreter_lfd(PPU_STATE *ppuState) { if (_ex & PPU_EX_DATASEGM || _ex & PPU_EX_DATASTOR) return; - FPRi(frd).valueAsDouble = static_cast(data); + FPRi(frd).valueAsDouble = static_cast(data); } // Load Floating-Point Single (x'C000 0000') @@ -1062,5 +1062,5 @@ void PPCInterpreter::PPCInterpreter_lfs(PPU_STATE *ppuState) { if (_ex & PPU_EX_DATASEGM || _ex & PPU_EX_DATASTOR) return; - FPRi(frd).valueAsDouble = static_cast(singlePresFP.valueAsFloat); + FPRi(frd).valueAsDouble = static_cast(singlePresFP.valueAsFloat); } diff --git a/Xenon/Core/XCPU/Interpreter/PPC_System.cpp b/Xenon/Core/XCPU/Interpreter/PPC_System.cpp index bfc715f..8857cdc 100644 --- a/Xenon/Core/XCPU/Interpreter/PPC_System.cpp +++ b/Xenon/Core/XCPU/Interpreter/PPC_System.cpp @@ -154,8 +154,8 @@ void PPCInterpreter::PPCInterpreter_rfid(PPU_STATE *ppuState) { void PPCInterpreter::PPCInterpreter_tw(PPU_STATE *ppuState) { X_FORM_TO_rA_rB; - long a = (long)ppuState->ppuThread[ppuState->currentThread].GPR[rA]; - long b = (long)ppuState->ppuThread[ppuState->currentThread].GPR[rB]; + sl32 a = static_cast(ppuState->ppuThread[ppuState->currentThread].GPR[rA]); + sl32 b = static_cast(ppuState->ppuThread[ppuState->currentThread].GPR[rB]); if ((a < b && BGET(TO, 5, 0)) || (a > b && BGET(TO, 5, 1)) || (a == b && BGET(TO, 5, 2)) || (static_cast(a) < static_cast(b) && BGET(TO, 5, 3)) || @@ -168,10 +168,10 @@ void PPCInterpreter::PPCInterpreter_twi(PPU_STATE *ppuState) { D_FORM_TO_rA_SI; SI = EXTS(SI, 16); - long a = (long)ppuState->ppuThread[ppuState->currentThread].GPR[rA]; + sl32 a = static_cast(ppuState->ppuThread[ppuState->currentThread].GPR[rA]); - if ((a < (long)SI && BGET(TO, 5, 0)) || (a > (long)SI && BGET(TO, 5, 1)) || - (a == (long)SI && BGET(TO, 5, 2)) || (static_cast(a) < SI && BGET(TO, 5, 3)) || + if ((a < static_cast(SI) && BGET(TO, 5, 0)) || (a > static_cast(SI) && BGET(TO, 5, 1)) || + (a == static_cast(SI) && BGET(TO, 5, 2)) || (static_cast(a) < SI && BGET(TO, 5, 3)) || (static_cast(a) > SI && BGET(TO, 5, 4))) { ppcInterpreterTrap(ppuState, static_cast(SI)); } diff --git a/Xenon/Core/XCPU/PPU/PowerPC.h b/Xenon/Core/XCPU/PPU/PowerPC.h index 566ea7f..a0100a8 100644 --- a/Xenon/Core/XCPU/PPU/PowerPC.h +++ b/Xenon/Core/XCPU/PPU/PowerPC.h @@ -446,13 +446,13 @@ typedef struct SOCSECENG_BLOCK { // Addr = 80000200_00024000 union SFPRegister // Single Precision { - float valueAsFloat; + f32 valueAsFloat; u32 valueAsU32; }; union FPRegister // Double Precision { - double valueAsDouble; + f64 valueAsDouble; u64 valueAsU64; }; diff --git a/Xenon/Render/Renderer.cpp b/Xenon/Render/Renderer.cpp index 086412c..b04289f 100644 --- a/Xenon/Render/Renderer.cpp +++ b/Xenon/Render/Renderer.cpp @@ -70,7 +70,7 @@ void Render::Renderer::Start() { LOG_ERROR(System, "Failed to initialize SDL: {}", SDL_GetError()); } - std::string title = std::format("Xenon {}", Base::VERSION); + const std::string title = fmt::format("Xenon {}", Base::VERSION); // SDL3 window properties. SDL_PropertiesID props = SDL_CreateProperties(); SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, title.c_str());