mcd, fix cdd delayed commands while in seek latency wait
authorkub <derkub@gmail.com>
Mon, 16 Dec 2024 19:52:23 +0000 (20:52 +0100)
committerkub <derkub@gmail.com>
Mon, 16 Dec 2024 19:58:22 +0000 (20:58 +0100)
pico/cd/cdd.c

index 4ec5f1d..edabfe8 100644 (file)
@@ -742,6 +742,12 @@ void cdd_update(void)
     cdc_decoder_update(header);
   }
 
+  if (Pico_mcd->m.state_flags & PCD_ST_CDD_CMD) {
+    /* pending delayed command */
+    cdd_process();
+    Pico_mcd->m.state_flags &= ~PCD_ST_CDD_CMD;
+  }
+
   /* drive latency */
   if (cdd.latency > 0)
   {
@@ -829,12 +835,6 @@ void cdd_update(void)
       Pico_mcd->s68k_regs[0x36+0] = 0x01;
     }
   }
-
-  if (Pico_mcd->m.state_flags & PCD_ST_CDD_CMD) {
-    /* pending delayed command */
-    cdd_process();
-    Pico_mcd->m.state_flags &= ~PCD_ST_CDD_CMD;
-  }
 }
 
 #define set_reg16(r, v) { \