Skip to content

Commit

Permalink
mcd, fix md+ not looping when cd drive unused
Browse files Browse the repository at this point in the history
  • Loading branch information
irixxxx committed Jan 22, 2025
1 parent bac44b1 commit 3360000
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pico/cd/mcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ PICO_INTERNAL void PicoPowerMCD(void)
Pico_mcd->s68k_regs[3] = 1; // 2M word RAM mode, m68k access
if (Pico.romsize == 0) // no HINT vector from gate array for MSU
memset(Pico_mcd->bios + 0x70, 0xff, 4);
pcd_event_schedule_s68k(PCD_EVENT_CDC, 12500000/75);
}

void pcd_soft_reset(void)
Expand Down Expand Up @@ -171,13 +172,13 @@ static void pcd_cdc_event(unsigned int now)
Pico_mcd->s68k_regs[0x4b] = 0xf0;
}

msd_update();

if ((Pico_mcd->s68k_regs[0x33] & PCDS_IEN4) && (Pico_mcd->s68k_regs[0x37] & 4)) {
elprintf(EL_INTS|EL_CD, "s68k: cdd irq 4");
pcd_irq_s68k(4, 1);
}

msd_update();

pcd_event_schedule(now, PCD_EVENT_CDC, 12500000/75);
}

Expand Down
1 change: 1 addition & 0 deletions pico/cd/megasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static void cdd_play(s32 lba)

cdd_play_audio(Pico_msd.index, Pico_msd.currentlba);
Pico_msd.state |= MSD_ST_PLAY;
Pico_msd.state &= ~MSD_ST_PAUSE;
}

static void cdd_pause(void)
Expand Down
4 changes: 0 additions & 4 deletions pico/cd/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,6 @@ void s68k_reg_write8(u32 a, u32 d)
u32 d_old = Pico_mcd->s68k_regs[0x37];
Pico_mcd->s68k_regs[0x37] = d & 7;
if ((d ^ d_old) & 4) {
// ??
if (d & 4)
pcd_event_schedule_s68k(PCD_EVENT_CDC, 12500000/75);

if ((d & 4) && (Pico_mcd->s68k_regs[0x33] & PCDS_IEN4)) {
elprintf(EL_INTS, "cdd export irq 4");
pcd_irq_s68k(4, 1);
Expand Down

0 comments on commit 3360000

Please sign in to comment.