CdlGetmode is GetParam, fix it according to Mednafen's implementation (#203)
authorgameblabla <gameblabla@users.noreply.github.com>
Wed, 25 Aug 2021 21:56:52 +0000 (21:56 +0000)
committerGitHub <noreply@github.com>
Wed, 25 Aug 2021 21:56:52 +0000 (00:56 +0300)
The result size for GetParam (previously Getmode) should be only 5 and done this way.

libpcsxcore/cdrom.c

index 5b53e99..6980101 100644 (file)
@@ -63,7 +63,7 @@ static unsigned char *pTransfer;
 #define CdlDemute      12
 #define CdlSetfilter   13
 #define CdlSetmode     14
-#define CdlGetmode     15
+#define CdlGetparam    15
 #define CdlGetlocL     16
 #define CdlGetlocP     17
 #define CdlReadT       18
@@ -84,7 +84,7 @@ char *CmdName[0x100]= {
     "CdlSync",     "CdlNop",       "CdlSetloc",  "CdlPlay",
     "CdlForward",  "CdlBackward",  "CdlReadN",   "CdlStandby",
     "CdlStop",     "CdlPause",     "CdlInit",    "CdlMute",
-    "CdlDemute",   "CdlSetfilter", "CdlSetmode", "CdlGetmode",
+    "CdlDemute",   "CdlSetfilter", "CdlSetmode", "CdlGetparam",
     "CdlGetlocL",  "CdlGetlocP",   "CdlReadT",   "CdlGetTN",
     "CdlGetTD",    "CdlSeekL",     "CdlSeekP",   "CdlSetclock",
     "CdlGetclock", "CdlTest",      "CdlID",      "CdlReadS",
@@ -759,13 +759,13 @@ void cdrInterrupt() {
                        no_busy_error = 1;
                        break;
 
-               case CdlGetmode:
-                       SetResultSize(6);
+               case CdlGetparam:
+                       /* Gameblabla : According to mednafen, Result size should be 5 and done this way. */
+                       SetResultSize(5);
                        cdr.Result[1] = cdr.Mode;
-                       cdr.Result[2] = cdr.File;
-                       cdr.Result[3] = cdr.Channel;
-                       cdr.Result[4] = 0;
-                       cdr.Result[5] = 0;
+                       cdr.Result[2] = 0;
+                       cdr.Result[3] = cdr.File;
+                       cdr.Result[4] = cdr.Channel;
                        no_busy_error = 1;
                        break;