CdlSync should be NULL and return an error.
authorgameblabla <gameblabla@protonmail.com>
Sat, 25 Sep 2021 13:20:52 +0000 (15:20 +0200)
committergameblabla <gameblabla@protonmail.com>
Sat, 25 Sep 2021 13:20:52 +0000 (15:20 +0200)
This has been confirmed by both Mednafen and nocash's documentation.

libpcsxcore/cdrom.c

index 93d2fa4..c1ba796 100644 (file)
@@ -48,7 +48,7 @@ cdrStruct cdr;
 static unsigned char *pTransfer;
 
 /* CD-ROM magic numbers */
-#define CdlSync        0
+#define CdlSync        0 /* nocash documentation : "Uh, actually, returns error code 40h = Invalid Command...?" */
 #define CdlNop         1
 #define CdlSetloc      2
 #define CdlPlay        3
@@ -576,10 +576,6 @@ void cdrInterrupt() {
        cdr.Irq = 0;
 
        switch (Irq) {
-               case CdlSync:
-                       // TOOD: sometimes/always return error?
-                       break;
-
                case CdlNop:
                        if (cdr.DriveState != DRIVESTATE_LID_OPEN)
                                cdr.StatP &= ~STATUS_SHELLOPEN;
@@ -1003,6 +999,7 @@ void cdrInterrupt() {
                        start_rotating = 1;
                        break;
 
+               case CdlSync:
                default:
                        CDR_LOG_I("Invalid command: %02x\n", Irq);
                        error = ERROR_INVALIDCMD;