[SCD] fixed & improved emulation of PRG-RAM write protection register (broken by previous revision): fixes Lunar - Eternal Blue (J)

This commit is contained in:
EkeEke 2013-02-02 02:32:40 +01:00
parent 7d833829e3
commit a3519baa93
2 changed files with 12 additions and 0 deletions

View File

@ -92,6 +92,12 @@ void prg_ram_dma_w(unsigned int words)
/* update DMA source address */ /* update DMA source address */
cdc.dac.w += (words << 1); cdc.dac.w += (words << 1);
/* check PRG-RAM write protected area */
if (dst_index < (scd.regs[0x02>>1].byte.h << 9))
{
return;
}
/* DMA transfer */ /* DMA transfer */
while (words--) while (words--)
{ {

View File

@ -650,6 +650,12 @@ void ctrl_io_write_byte(unsigned int address, unsigned int data)
return; return;
} }
case 0x02: /* PRG-RAM Write Protection */
{
scd.regs[0x02>>1].byte.h = data;
return;
}
case 0x03: /* Memory mode */ case 0x03: /* Memory mode */
{ {
m68k_poll_sync(0x02); m68k_poll_sync(0x02);