[Core/MCD] fixed access to "write-only" communication flags from Main-CPU & SUB-CPU (verified on real hardware by Notaz)

This commit is contained in:
EkeEke 2013-10-21 00:25:08 +02:00 committed by twinaphex
parent 20dd11e558
commit 5fbde4e187
2 changed files with 10 additions and 20 deletions

View File

@ -703,13 +703,8 @@ static void scd_write_byte(unsigned int address, unsigned int data)
return; return;
} }
case 0x0e: /* MAIN-CPU communication flags, normally read-only (Space Ace, Dragon's Lair) */ case 0x0e: /* SUB-CPU communication flags */
{ case 0x0f: /* !LWR is ignored (Space Ace, Dragon's Lair) */
/* ROR8 operation */
data = (data >> 1) | ((data << 7) & 1);
}
case 0x0f: /* SUB-CPU communication flags */
{ {
s68k_poll_sync(1<<0x0f); s68k_poll_sync(1<<0x0f);
scd.regs[0x0f>>1].byte.l = data; scd.regs[0x0f>>1].byte.l = data;
@ -990,12 +985,12 @@ static void scd_write_word(unsigned int address, unsigned int data)
return; return;
} }
case 0x0e: /* SUB-CPU communication flags */ case 0x0e: /* CPU Communication flags */
{ {
s68k_poll_sync(1<<0x0f); s68k_poll_sync(1<<0x0f);
/* MSB is read-only */ /* D8-D15 ignored -> only SUB-CPU flags are updated */
scd.regs[0x0f>>1].byte.l = data; scd.regs[0x0f>>1].byte.l = data & 0xff;
return; return;
} }

View File

@ -730,13 +730,8 @@ void ctrl_io_write_byte(unsigned int address, unsigned int data)
return; return;
} }
case 0x0f: /* SUB-CPU communication flags, normally read-only (Space Ace, Dragon's Lair) */
{
/* ROL8 operation */
data = (data << 1) | ((data >> 7) & 1);
}
case 0x0e: /* MAIN-CPU communication flags */ case 0x0e: /* MAIN-CPU communication flags */
case 0x0f: /* !LWR is ignored (Space Ace, Dragon's Lair) */
{ {
m68k_poll_sync(1<<0x0e); m68k_poll_sync(1<<0x0e);
scd.regs[0x0e>>1].byte.h = data; scd.regs[0x0e>>1].byte.h = data;
@ -949,12 +944,12 @@ void ctrl_io_write_word(unsigned int address, unsigned int data)
return; return;
} }
case 0x0e: /* MAIN-CPU communication flags */ case 0x0e: /* CPU communication flags */
{ {
m68k_poll_sync(1<<0x0e); m68k_poll_sync(1<<0x0e);
/* LSB is read-only (Mortal Kombat) */ /* D8-D15 ignored -> only MAIN-CPU flags are updated (Mortal Kombat) */
scd.regs[0x0e>>1].byte.h = data; scd.regs[0x0e>>1].byte.h = data & 0xff;
return; return;
} }