From 2f3b5e9a32215541003e206138986341debd0875 Mon Sep 17 00:00:00 2001 From: rixnobis Date: Fri, 9 Oct 2026 18:19:08 +0000 Subject: [PATCH] [Chores] Format code --- src/core/DynaRec_aa64/recompiler.cc | 2 +- src/core/cdrom.cc | 17 ++++---- src/core/isoffi.lua | 8 +--- src/core/psxinterpreter.cc | 2 +- src/core/r3000a.cc | 2 +- src/core/r3000a.h | 5 ++- src/core/sstate.cc | 68 ++++++++++++++--------------- src/core/sstate.h | 17 ++++---- src/gui/gui.cc | 4 +- src/lua/fileffimeta.lua | 4 +- src/spu/spu.cc | 2 +- 11 files changed, 63 insertions(+), 68 deletions(-) diff --git a/src/core/DynaRec_aa64/recompiler.cc b/src/core/DynaRec_aa64/recompiler.cc index 84d7f1737c..1902eb1dd9 100644 --- a/src/core/DynaRec_aa64/recompiler.cc +++ b/src/core/DynaRec_aa64/recompiler.cc @@ -571,7 +571,7 @@ DynarecCallback DynaRecCPU::recompile(DynarecCallback* callback, uint32_t pc, bo } gen.Ldr(x0, MemOperand(contextPointer, CYCLE_OFFSET)); // Fetch cycle count from memory - gen.Add(x0, x0, (count + extra * PCSX::Emulator::ROM_EXTRA_BIAS) * PCSX::Emulator::BIAS); // Add block cycles + gen.Add(x0, x0, (count + extra * PCSX::Emulator::ROM_EXTRA_BIAS) * PCSX::Emulator::BIAS); // Add block cycles gen.Str(x0, MemOperand(contextPointer, CYCLE_OFFSET)); // Store cycles back to memory // Link block else return to dispatcher diff --git a/src/core/cdrom.cc b/src/core/cdrom.cc index de2424e1d4..556ce3f1c0 100644 --- a/src/core/cdrom.cc +++ b/src/core/cdrom.cc @@ -335,8 +335,8 @@ class CDRomImpl final : public PCSX::CDRom { regs.pc, regs.cycle, causeValue); } else { PCSX::g_system->log(PCSX::LogClass::CDROM, - "CD-Rom: %08x.%08x] cause %d queued or masked, no IRQ yet\n", - regs.pc, regs.cycle, causeValue); + "CD-Rom: %08x.%08x] cause %d queued or masked, no IRQ yet\n", regs.pc, + regs.cycle, causeValue); } } } @@ -861,8 +861,7 @@ class CDRomImpl final : public PCSX::CDRom { maybeTriggerIRQ(cause, response); m_seekPosition = maybeMSF.value(); m_setLocPending = true; - PCSX::g_emulator->m_cdromLogger->recordAccess(m_seekPosition.toLBA(), - PCSX::CDRomLogger::AccessType::Seek, + PCSX::g_emulator->m_cdromLogger->recordAccess(m_seekPosition.toLBA(), PCSX::CDRomLogger::AccessType::Seek, PCSX::g_emulator->m_cpu->m_regs.cycle); } else { maybeEnqueueError(1, 0x10); @@ -1066,9 +1065,9 @@ class CDRomImpl final : public PCSX::CDRom { // the read in flight. SCPH-9002: Setloc, ReadN and Nop resent every ~1.6 ms still reach // INT1, in about the time a single ReadN takes. bool reading = (m_readingType == ReadingType::Normal) || (m_readingType == ReadingType::Streaming); - if (reading && ((m_readingState == ReadingState::Seeking) || - ((m_readingState == ReadingState::Reading) && - (m_seekPosition.toLBA() == m_currentPosition.toLBA())))) { + if (reading && + ((m_readingState == ReadingState::Seeking) || + ((m_readingState == ReadingState::Reading) && (m_seekPosition.toLBA() == m_currentPosition.toLBA())))) { m_readingType = ReadingType::Normal; QueueElement response; response.pushPayloadData(getStatus()); @@ -1522,8 +1521,8 @@ class CDRomImpl final : public PCSX::CDRom { case 0x22: { // Region string, plain text with no status byte. A SCPH-9002 answers "for Europe"; // follow the emulated video standard for the rest. - const bool pal = PCSX::g_emulator->settings.get() == - PCSX::Emulator::PSX_TYPE_PAL; + const bool pal = + PCSX::g_emulator->settings.get() == PCSX::Emulator::PSX_TYPE_PAL; QueueElement response; response.pushPayloadData(pal ? std::string_view("for Europe") : std::string_view("for U/C")); maybeTriggerIRQ(Cause::Acknowledge, response); diff --git a/src/core/isoffi.lua b/src/core/isoffi.lua index b68142ad22..0034fbc348 100644 --- a/src/core/isoffi.lua +++ b/src/core/isoffi.lua @@ -192,12 +192,8 @@ local function createIsoWrapper(wrapper) if mode == nil then mode = 'GUESS' end return Support.File._createFileWrapper(C.fileisoOpen(self._wrapper, lba, size, mode)) end, - getTD = function(self, tn) - return C.getIsoTD(self._wrapper, tn) - end, - getTN = function(self) - return C.getIsoTN(self._wrapper) - end, + getTD = function(self, tn) return C.getIsoTD(self._wrapper, tn) end, + getTN = function(self) return C.getIsoTN(self._wrapper) end, } return iso end diff --git a/src/core/psxinterpreter.cc b/src/core/psxinterpreter.cc index db70ad4c25..363e28addc 100644 --- a/src/core/psxinterpreter.cc +++ b/src/core/psxinterpreter.cc @@ -337,7 +337,7 @@ class InterpretedCPU final : public PCSX::R3000Acpu { }; inline uint32_t InterpretedCPU::branchBase() { - auto& pending = m_delayedLoadInfo[m_currentDelayedLoad ^ 1]; + auto &pending = m_delayedLoadInfo[m_currentDelayedLoad ^ 1]; return pending.pcActive ? pending.pcValue : m_regs.pc; } diff --git a/src/core/r3000a.cc b/src/core/r3000a.cc index 065fd42597..981401720b 100644 --- a/src/core/r3000a.cc +++ b/src/core/r3000a.cc @@ -392,7 +392,7 @@ void PCSX::R3000Acpu::branchTest() { // A branch in the delay slot of a taken branch leaves its own jump pending here, and the next // instruction is that branch's delay slot. The interrupt is taken on that delay slot: EPC is the // branch with BD set, and the pending jump is dropped, since returning runs the branch again. - for (auto &pending : m_delayedLoadInfo) { + for (auto& pending : m_delayedLoadInfo) { if (!pending.pcActive) continue; pending.pcActive = false; pending.fromLink = false; diff --git a/src/core/r3000a.h b/src/core/r3000a.h index 1cd76552bc..99df9ed9be 100644 --- a/src/core/r3000a.h +++ b/src/core/r3000a.h @@ -196,7 +196,8 @@ struct psxRegisters { uint8_t iCacheCode[0x1000]; uint32_t getFutureCycle(std::chrono::nanoseconds delay) const { return cycle + durationToCycles(delay); } std::chrono::nanoseconds getFutureTime(uint32_t futureCycle) const { - return std::chrono::nanoseconds(int64_t(int32_t(futureCycle - cycle)) * 1'000'000'000 / Emulator::m_psxClockSpeed); + return std::chrono::nanoseconds(int64_t(int32_t(futureCycle - cycle)) * 1'000'000'000 / + Emulator::m_psxClockSpeed); } static constexpr uint32_t durationToCycles(std::chrono::nanoseconds duration) { return duration.count() * Emulator::m_psxClockSpeed / 1'000'000'000; @@ -367,7 +368,7 @@ class R3000Acpu { psxRegisters m_regs; float m_scheduleScales[static_cast(Schedule::CDRDMA) + 1] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}; bool m_shellStarted = false; virtual void Reset() { diff --git a/src/core/sstate.cc b/src/core/sstate.cc index 950cff93b1..1c8b3a7901 100644 --- a/src/core/sstate.cc +++ b/src/core/sstate.cc @@ -154,9 +154,9 @@ PCSX::SaveStates::SaveState PCSX::SaveStates::constructSaveState() { CDXAFirstSector{cd->m_xaFirstSector}, CDSoundMapEnabled{cd->m_soundMapEnabled}, CDCurrentPosition{CDMSF{CDMSFMinute{cd->m_currentPosition.m}, CDMSFSecond{cd->m_currentPosition.s}, - CDMSFFrame{cd->m_currentPosition.f}}}, + CDMSFFrame{cd->m_currentPosition.f}}}, CDSeekPosition{CDMSF{CDMSFMinute{cd->m_seekPosition.m}, CDMSFSecond{cd->m_seekPosition.s}, - CDMSFFrame{cd->m_seekPosition.f}}}, + CDMSFFrame{cd->m_seekPosition.f}}}, CDLastLocP{cd->m_lastLocP}, CDLastLocL{cd->m_lastLocL}, CDSeed{cd->m_seed}, @@ -165,41 +165,41 @@ PCSX::SaveStates::SaveState PCSX::SaveStates::constructSaveState() { CDLidCloseScheduled{cd->m_lidCloseScheduled}, CDLidCloseAtCycles{cd->m_lidCloseAtCycles}, CDCommandFifo{CDQueueElement{ - CDQueuePayload{cd->m_commandFifo.payload}, - CDQueueValue{cd->m_commandFifo.value}, - CDQueueValueRead{cd->m_commandFifo.valueRead}, - CDQueueHasValue{cd->m_commandFifo.hasValue}, - CDQueueHitMax{cd->m_commandFifo.hitMax}, - CDQueuePayloadSize{cd->m_commandFifo.payloadSize}, - CDQueuePayloadIndex{cd->m_commandFifo.payloadIndex}, - }}, + CDQueuePayload{cd->m_commandFifo.payload}, + CDQueueValue{cd->m_commandFifo.value}, + CDQueueValueRead{cd->m_commandFifo.valueRead}, + CDQueueHasValue{cd->m_commandFifo.hasValue}, + CDQueueHitMax{cd->m_commandFifo.hitMax}, + CDQueuePayloadSize{cd->m_commandFifo.payloadSize}, + CDQueuePayloadIndex{cd->m_commandFifo.payloadIndex}, + }}, CDCommandExecuting{CDQueueElement{ - CDQueuePayload{cd->m_commandExecuting.payload}, - CDQueueValue{cd->m_commandExecuting.value}, - CDQueueValueRead{cd->m_commandExecuting.valueRead}, - CDQueueHasValue{cd->m_commandExecuting.hasValue}, - CDQueueHitMax{cd->m_commandExecuting.hitMax}, - CDQueuePayloadSize{cd->m_commandExecuting.payloadSize}, - CDQueuePayloadIndex{cd->m_commandExecuting.payloadIndex}, - }}, + CDQueuePayload{cd->m_commandExecuting.payload}, + CDQueueValue{cd->m_commandExecuting.value}, + CDQueueValueRead{cd->m_commandExecuting.valueRead}, + CDQueueHasValue{cd->m_commandExecuting.hasValue}, + CDQueueHitMax{cd->m_commandExecuting.hitMax}, + CDQueuePayloadSize{cd->m_commandExecuting.payloadSize}, + CDQueuePayloadIndex{cd->m_commandExecuting.payloadIndex}, + }}, CDResponseFifo0{CDQueueElement{ - CDQueuePayload{cd->m_responseFifo[0].payload}, - CDQueueValue{cd->m_responseFifo[0].value}, - CDQueueValueRead{cd->m_responseFifo[0].valueRead}, - CDQueueHasValue{cd->m_responseFifo[0].hasValue}, - CDQueueHitMax{cd->m_responseFifo[0].hitMax}, - CDQueuePayloadSize{cd->m_responseFifo[0].payloadSize}, - CDQueuePayloadIndex{cd->m_responseFifo[0].payloadIndex}, - }}, + CDQueuePayload{cd->m_responseFifo[0].payload}, + CDQueueValue{cd->m_responseFifo[0].value}, + CDQueueValueRead{cd->m_responseFifo[0].valueRead}, + CDQueueHasValue{cd->m_responseFifo[0].hasValue}, + CDQueueHitMax{cd->m_responseFifo[0].hitMax}, + CDQueuePayloadSize{cd->m_responseFifo[0].payloadSize}, + CDQueuePayloadIndex{cd->m_responseFifo[0].payloadIndex}, + }}, CDResponseFifo1{CDQueueElement{ - CDQueuePayload{cd->m_responseFifo[1].payload}, - CDQueueValue{cd->m_responseFifo[1].value}, - CDQueueValueRead{cd->m_responseFifo[1].valueRead}, - CDQueueHasValue{cd->m_responseFifo[1].hasValue}, - CDQueueHitMax{cd->m_responseFifo[1].hitMax}, - CDQueuePayloadSize{cd->m_responseFifo[1].payloadSize}, - CDQueuePayloadIndex{cd->m_responseFifo[1].payloadIndex}, - }}, + CDQueuePayload{cd->m_responseFifo[1].payload}, + CDQueueValue{cd->m_responseFifo[1].value}, + CDQueueValueRead{cd->m_responseFifo[1].valueRead}, + CDQueueHasValue{cd->m_responseFifo[1].hasValue}, + CDQueueHitMax{cd->m_responseFifo[1].hitMax}, + CDQueuePayloadSize{cd->m_responseFifo[1].payloadSize}, + CDQueuePayloadIndex{cd->m_responseFifo[1].payloadIndex}, + }}, CDXALeft{CDADPCM{CDADPCMY0{cd->m_xa.left.y0}, CDADPCMY1{cd->m_xa.left.y1}}}, CDXARight{CDADPCM{CDADPCMY0{cd->m_xa.right.y0}, CDADPCMY1{cd->m_xa.right.y1}}}, }, diff --git a/src/core/sstate.h b/src/core/sstate.h index 5175ab4f92..7c9742578a 100644 --- a/src/core/sstate.h +++ b/src/core/sstate.h @@ -266,8 +266,8 @@ typedef Protobuf::FieldRef CDQueueHa typedef Protobuf::FieldRef CDQueueHitMax; typedef Protobuf::FieldRef CDQueuePayloadSize; typedef Protobuf::FieldRef CDQueuePayloadIndex; -typedef Protobuf::Message +typedef Protobuf::Message CDQueueElement; typedef Protobuf::FieldRef CDMSFMinute; typedef Protobuf::FieldRef CDMSFSecond; @@ -329,11 +329,11 @@ typedef Protobuf::MessageField CDXARight; typedef Protobuf::Message< TYPESTRING("CDRom"), CDDataFIFO, CDDataFIFOIndex, CDDataFIFOSize, CDDataFIFOPending, CDRegisterAddress, CDMotorOn, CDSpeedChanged, CDInvalidLocL, CDDataRequested, CDSubheaderFilter, CDRealtime, CDReadingState, CDStartPlaying, - CDReadingType, CDAutoPause, CDReport, CDSetLocPending, CDMuted, CDPeakFlag, CDPlayTrack, CDPlayStartCycle, - CDStatus, CDSpeed, CDReadSpan, CDInterruptCauseMask, CDATV, CDATVPending, CDADPCMMuted, CDMode, CDFilterFile, - CDFilterChannel, CDXAEnded, CDXAFirstSector, CDSoundMapEnabled, CDCurrentPosition, CDSeekPosition, CDLastLocP, - CDLastLocL, CDSeed, CDLidOpen, CDWasLidOpened, CDLidCloseScheduled, CDLidCloseAtCycles, CDCommandFifo, - CDCommandExecuting, CDResponseFifo0, CDResponseFifo1, CDXALeft, CDXARight> + CDReadingType, CDAutoPause, CDReport, CDSetLocPending, CDMuted, CDPeakFlag, CDPlayTrack, CDPlayStartCycle, CDStatus, + CDSpeed, CDReadSpan, CDInterruptCauseMask, CDATV, CDATVPending, CDADPCMMuted, CDMode, CDFilterFile, CDFilterChannel, + CDXAEnded, CDXAFirstSector, CDSoundMapEnabled, CDCurrentPosition, CDSeekPosition, CDLastLocP, CDLastLocL, CDSeed, + CDLidOpen, CDWasLidOpened, CDLidCloseScheduled, CDLidCloseAtCycles, CDCommandFifo, CDCommandExecuting, + CDResponseFifo0, CDResponseFifo1, CDXALeft, CDXARight> CDRom; typedef Protobuf::MessageField CDRomField; @@ -344,7 +344,8 @@ typedef Protobuf::Message + CDQueueElement, CDMSF, CDADPCM, CDRom, Hardware, Rcnt, Counters, MDEC, PCdrvFile, Call, + CallStack, CallStacks, SaveState> ProtoFile; SaveState constructSaveState(); diff --git a/src/gui/gui.cc b/src/gui/gui.cc index 6fd79aa1ac..891ecf3b25 100644 --- a/src/gui/gui.cc +++ b/src/gui/gui.cc @@ -2290,8 +2290,8 @@ which may include additional checks. Also will make the boot time substantially faster by not displaying the logo.)")); auto bios = settings.get().string(); - ImGui::InputText(_("BIOS file"), const_cast(reinterpret_cast(bios.c_str())), bios.length() + 1, - ImGuiInputTextFlags_ReadOnly); + ImGui::InputText(_("BIOS file"), const_cast(reinterpret_cast(bios.c_str())), + bios.length() + 1, ImGuiInputTextFlags_ReadOnly); ImGui::SameLine(); selectBiosDialog = ImGui::Button("..."); if (ImGui::Checkbox(_("Enable Debugger"), &debugSettings.get().value)) { diff --git a/src/lua/fileffimeta.lua b/src/lua/fileffimeta.lua index b8eb5a85af..d29f218332 100644 --- a/src/lua/fileffimeta.lua +++ b/src/lua/fileffimeta.lua @@ -70,9 +70,7 @@ local bufferMeta = { elseif index == 'pbSlice' then return Support._internal.createPBSliceFromBuffer(buffer) elseif index == 'cast' then - return function(buffer, ctype) - return ffi.cast(ctype, buffer.data) - end + return function(buffer, ctype) return ffi.cast(ctype, buffer.data) end end error('Unknown index `' .. index .. '` for LuaBuffer') end, diff --git a/src/spu/spu.cc b/src/spu/spu.cc index 68ddf392bb..f71399f179 100644 --- a/src/spu/spu.cc +++ b/src/spu/spu.cc @@ -23,9 +23,9 @@ #include #include -#include "spu/adsr.h" #include "core/psxemulator.h" #include "core/r3000a.h" +#include "spu/adsr.h" #include "spu/externals.h" #include "spu/interface.h"