cdrom: don't report read too early
authornotaz <notasas@gmail.com>
Sat, 5 Nov 2022 20:51:37 +0000 (22:51 +0200)
committernotaz <notasas@gmail.com>
Sat, 5 Nov 2022 21:16:11 +0000 (23:16 +0200)
libretro/pcsx_rearmed#706

libpcsxcore/cdrom.c

index 145ca32..0f1479e 100644 (file)
@@ -1284,8 +1284,6 @@ static void cdrReadInterrupt(void)
        u8 subqPos[3];
        int read_ok;
 
-       SetPlaySeekRead(cdr.StatP, STATUS_READ | STATUS_ROTATING);
-
        memcpy(subqPos, cdr.SetSectorPlay, sizeof(subqPos));
        msfiAdd(subqPos, cdr.SubqForwardSectors);
        UpdateSubq(subqPos);
@@ -1295,6 +1293,9 @@ static void cdrReadInterrupt(void)
                return;
        }
 
+       // note: CdlGetlocL should work as soon as STATUS_READ is indicated
+       SetPlaySeekRead(cdr.StatP, STATUS_READ | STATUS_ROTATING);
+
        read_ok = ReadTrack(cdr.SetSectorPlay);
        if (read_ok)
                buf = CDR_getBuffer();