Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/DynaRec_aa64/recompiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 8 additions & 9 deletions src/core/cdrom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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::SettingVideo>() ==
PCSX::Emulator::PSX_TYPE_PAL;
const bool pal =
PCSX::g_emulator->settings.get<PCSX::Emulator::SettingVideo>() == 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);
Expand Down
8 changes: 2 additions & 6 deletions src/core/isoffi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/psxinterpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/r3000a.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/core/r3000a.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -367,7 +368,7 @@ class R3000Acpu {

psxRegisters m_regs;
float m_scheduleScales[static_cast<unsigned>(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() {
Expand Down
68 changes: 34 additions & 34 deletions src/core/sstate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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}}},
},
Expand Down
17 changes: 9 additions & 8 deletions src/core/sstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ typedef Protobuf::FieldRef<Protobuf::Bool, TYPESTRING("has_value"), 4> CDQueueHa
typedef Protobuf::FieldRef<Protobuf::Bool, TYPESTRING("hit_max"), 5> CDQueueHitMax;
typedef Protobuf::FieldRef<Protobuf::UInt8, TYPESTRING("payload_size"), 6> CDQueuePayloadSize;
typedef Protobuf::FieldRef<Protobuf::UInt8, TYPESTRING("payload_index"), 7> CDQueuePayloadIndex;
typedef Protobuf::Message<TYPESTRING("CDQueueElement"), CDQueuePayload, CDQueueValue, CDQueueValueRead,
CDQueueHasValue, CDQueueHitMax, CDQueuePayloadSize, CDQueuePayloadIndex>
typedef Protobuf::Message<TYPESTRING("CDQueueElement"), CDQueuePayload, CDQueueValue, CDQueueValueRead, CDQueueHasValue,
CDQueueHitMax, CDQueuePayloadSize, CDQueuePayloadIndex>
CDQueueElement;
typedef Protobuf::FieldRef<Protobuf::UInt8, TYPESTRING("m"), 1> CDMSFMinute;
typedef Protobuf::FieldRef<Protobuf::UInt8, TYPESTRING("s"), 2> CDMSFSecond;
Expand Down Expand Up @@ -329,11 +329,11 @@ typedef Protobuf::MessageField<CDADPCM, TYPESTRING("xaRight"), 49> 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<CDRom, TYPESTRING("cdrom"), 15> CDRomField;

Expand All @@ -344,7 +344,8 @@ typedef Protobuf::Message<TYPESTRING("SaveState"), SaveStateInfoField, Thumbnail

typedef Protobuf::ProtoFile<SaveStateInfo, Thumbnail, Memory, DelaySlotInfo, Registers, GPU, ADPCMDecode, XA,
::PCSX::SPU::Chan::Data, ::PCSX::SPU::ADSRInfo, ::PCSX::SPU::ADSRInfoEx, Channel, SPU, SIO,
CDQueueElement, CDMSF, CDADPCM, CDRom, Hardware, Rcnt, Counters, MDEC, PCdrvFile, Call, CallStack, CallStacks, SaveState>
CDQueueElement, CDMSF, CDADPCM, CDRom, Hardware, Rcnt, Counters, MDEC, PCdrvFile, Call,
CallStack, CallStacks, SaveState>
ProtoFile;

SaveState constructSaveState();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<Emulator::SettingBios>().string();
ImGui::InputText(_("BIOS file"), const_cast<char*>(reinterpret_cast<const char*>(bios.c_str())), bios.length() + 1,
ImGuiInputTextFlags_ReadOnly);
ImGui::InputText(_("BIOS file"), const_cast<char*>(reinterpret_cast<const char*>(bios.c_str())),
bios.length() + 1, ImGuiInputTextFlags_ReadOnly);
ImGui::SameLine();
selectBiosDialog = ImGui::Button("...");
if (ImGui::Checkbox(_("Enable Debugger"), &debugSettings.get<Emulator::DebugSettings::Debug>().value)) {
Expand Down
4 changes: 1 addition & 3 deletions src/lua/fileffimeta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/spu/spu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#include <cstdlib>
#include <thread>

#include "spu/adsr.h"
#include "core/psxemulator.h"
#include "core/r3000a.h"
#include "spu/adsr.h"
#include "spu/externals.h"
#include "spu/interface.h"

Expand Down
Loading