mcd, fix audio crash after end of last track

This commit is contained in:
kub 2023-07-05 19:54:40 +00:00
parent ae4d881a2f
commit 05d2acaeb2
3 changed files with 10 additions and 9 deletions

View file

@ -700,6 +700,13 @@ void cdd_update(void)
/* reading disc */
if (cdd.status == CD_PLAY)
{
if (cdd.index >= cdd.toc.last)
{
/* end of disc */
cdd.status = CD_END;
return;
}
/* track type */
if (!is_audio(cdd.index))
{
@ -714,7 +721,7 @@ void cdd_update(void)
/* data track sector read is controlled by CDC */
cdd.lba += cdc_decoder_update(header);
}
else if (cdd.index < cdd.toc.last)
else
{
uint8 header[4] = { 0, };
@ -731,12 +738,6 @@ void cdd_update(void)
/* next audio block is automatically read */
cdd.lba++;
}
else
{
/* end of disc */
cdd.status = CD_END;
return;
}
/* check end of current track */
if (cdd.lba >= cdd.toc.tracks[cdd.index].end)

View file

@ -57,7 +57,7 @@ PICO_INTERNAL void PicoPowerMCD(void)
Pico_mcd->m.state_flags = PCD_ST_S68K_RST;
Pico_mcd->m.busreq = 2; // busreq on, s68k in reset
Pico_mcd->s68k_regs[3] = 1; // 2M word RAM mode, m68k access
if (Pico.romsize <= 0x20000)
if (Pico.romsize <= 0x20000) // hack to detect BIOS, no GA HINT vector for MSU
memset(Pico.rom + 0x70, 0xff, 4);
}

View file

@ -1235,8 +1235,8 @@ PICO_INTERNAL void PicoMemSetupCD(void)
// MSU cartridge. Fake BIOS detection
cpu68k_map_set(m68k_read8_map, 0x400000, 0x41ffff, PicoReadM68k8_bios, 1);
cpu68k_map_set(m68k_read16_map, 0x400000, 0x41ffff, PicoReadM68k16_bios, 1);
// RAM cart
} else {
// RAM cart
cpu68k_map_set(m68k_read8_map, 0x400000, 0x7fffff, PicoReadM68k8_ramc, 1);
cpu68k_map_set(m68k_read16_map, 0x400000, 0x7fffff, PicoReadM68k16_ramc, 1);
cpu68k_map_set(m68k_write8_map, 0x400000, 0x7fffff, PicoWriteM68k8_ramc, 1);