CdlSync should be NULL and return an error. (#199)
authorgameblabla <gameblabla@users.noreply.github.com>
Wed, 25 Aug 2021 21:22:44 +0000 (21:22 +0000)
committerGitHub <noreply@github.com>
Wed, 25 Aug 2021 21:22:44 +0000 (00:22 +0300)
This has been confirmed by both Mednafen and nocash's documentation.

libpcsxcore/cdrom.c

index 7cba92e..1e8f950 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
@@ -575,10 +575,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;
@@ -973,7 +969,7 @@ void cdrInterrupt() {
                        cdr.Result[0] = cdr.StatP;
                        start_rotating = 1;
                        break;
-
+               case CdlSync:
                default:
                        CDR_LOG_I("Invalid command: %02x\n", Irq);
                        error = ERROR_INVALIDCMD;