[Core/CD] improved MAIN-CPU/SUB-CPU synchronization when reading CDC host data and CDC transfer status from MAIN-CPU (fixes MCD-verificator CDC INIT Test #4 and CDC DMA3 Test #2)

This commit is contained in:
ekeeke 2023-11-19 16:18:38 +01:00
parent 6669d25948
commit b330eb85cf
4 changed files with 13 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

@ -368,6 +368,14 @@ unsigned int ctrl_io_read_byte(unsigned int address)
return scd.regs[0x03>>1].byte.l & 0xc7; return scd.regs[0x03>>1].byte.l & 0xc7;
} }
/* CDC Mode */
if (index == 0x04)
{
/* sync SUB-CPU with MAIN-CPU (fixes MCD-verificator CDC DMA3 Test #2) */
s68k_sync();
return scd.regs[0x04>>1].byte.h & 0xc7;
}
/* SUB-CPU communication flags */ /* SUB-CPU communication flags */
if (index == 0x0f) if (index == 0x0f)
{ {
@ -514,6 +522,11 @@ unsigned int ctrl_io_read_word(unsigned int address)
/* CDC host data (word access only ?) */ /* CDC host data (word access only ?) */
if (index == 0x08) if (index == 0x08)
{ {
/* sync SUB-CPU with MAIN-CPU if CDC data transfer is not yet enabled (fixes MCD-verificator CDC INIT Test #4) */
if (!(scd.regs[0x04>>1].byte.h & 0x40))
{
s68k_sync();
}
return cdc_host_r(); return cdc_host_r();
} }