From b10249af7d01ffbfc325c807179cf49154abc042 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 17 Apr 2022 20:25:41 +1000 Subject: [PATCH] CdRom: Remove Speed field/add accessor instead This way it doesn't break save states. --- pcsx2/CDVD/CdRom.cpp | 6 +++++- pcsx2/CDVD/CdRom.h | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pcsx2/CDVD/CdRom.cpp b/pcsx2/CDVD/CdRom.cpp index 8c032c980f..bc10462801 100644 --- a/pcsx2/CDVD/CdRom.cpp +++ b/pcsx2/CDVD/CdRom.cpp @@ -131,6 +131,11 @@ uint sectorSeekReadDelay = 0x800; // for calculated seek delays static void AddIrqQueue(u8 irq, u32 ecycle); +static __fi int GetCDSpeed() +{ + return 1 + ((cdr.Mode >> 7) & 0x1); +} + static __fi void StartReading(u32 type) { cdr.Reading = type; @@ -862,7 +867,6 @@ void cdrWrite1(u8 rt) cdr.Mode = cdr.Param[0]; cdr.Ctrl |= 0x80; cdr.Stat = NoIntr; - cdr.Speed = 1 + ((cdr.Mode >> 7) & 0x1); if (cdr.Mode & MODE_CDDA) { StopCdda(); diff --git a/pcsx2/CDVD/CdRom.h b/pcsx2/CDVD/CdRom.h index c4e6406d0e..0197f5529e 100644 --- a/pcsx2/CDVD/CdRom.h +++ b/pcsx2/CDVD/CdRom.h @@ -69,7 +69,6 @@ struct cdrStruct u8 SetSectorSeek[4]; u8 Track; int Play; - int Speed; int CurTrack; int Mode, File, Channel, Muted; int Reset;