cdd.latency = 0;
/* reset track index */
- cdd.index = 0;
+ cdd.index = -1;
/* reset logical block address */
cdd.lba = 0;
}
}
- if (Pico_mcd->s68k_regs[0x4b] & 0x1) {
+ if (Pico_mcd->m.state_flags & PCD_ST_CDD_CMD) {
/* pending delayed command */
cdd_process();
- Pico_mcd->s68k_regs[0x4b] &= ~0x1;
+ Pico_mcd->m.state_flags &= ~PCD_ST_CDD_CMD;
}
}
(Pico_mcd->s68k_regs[0x48+0] * 10 + Pico_mcd->s68k_regs[0x48+1]) - 150;
/* if drive is currently reading, another block or 2 are decoded before the seek starts */
- if (cdd.status == CD_PLAY && !(Pico_mcd->s68k_regs[0x4b] & 0x1)) {
- Pico_mcd->s68k_regs[0x4b] |= 0x1;
+ if (cdd.status == CD_PLAY && !(Pico_mcd->m.state_flags & PCD_ST_CDD_CMD)) {
+ Pico_mcd->m.state_flags |= PCD_ST_CDD_CMD;
return;
}
}
/* block transfer always starts 3 blocks earlier */
- cdd.latency -= 3;
lba -= 3;
/* get track index */
(Pico_mcd->s68k_regs[0x48+0] * 10 + Pico_mcd->s68k_regs[0x48+1]) - 150;
/* if drive is currently reading, another block or 2 are decoded before the seek starts */
- if (cdd.status == CD_PLAY && !(Pico_mcd->s68k_regs[0x4b] & 0x1)) {
- Pico_mcd->s68k_regs[0x4b] |= 0x1;
+ if (cdd.status == CD_PLAY && !(Pico_mcd->m.state_flags & PCD_ST_CDD_CMD)) {
+ Pico_mcd->m.state_flags |= PCD_ST_CDD_CMD;
return;
}
case 0x06: /* Pause */
{
- /* TODO another block is decoded before pausing? */
+ /* if drive is currently reading, another block or 2 are decoded before the seek starts */
+ if (cdd.status == CD_PLAY && !(Pico_mcd->m.state_flags & PCD_ST_CDD_CMD)) {
+ Pico_mcd->m.state_flags |= PCD_ST_CDD_CMD;
+ return;
+ }
/* no audio track playing */
Pico_mcd->s68k_regs[0x36+0] = 0x01;
#define PCD_ST_S68K_SLEEP 4\r
#define PCD_ST_S68K_POLL 16\r
#define PCD_ST_M68K_POLL 32\r
+#define PCD_ST_CDD_CMD 64\r
#define PCD_ST_S68K_IFL2 0x100\r
\r
struct mcd_misc\r