From c6bcd315fbe5830889f612383053edc13bfdf902 Mon Sep 17 00:00:00 2001 From: EkeEke Date: Tue, 17 Dec 2013 17:06:13 +0100 Subject: [PATCH] [Core/MCD] fixed H-INT vector handling when using Mode 1 --- core/cd_hw/scd.c | 8 ++++---- core/mem68k.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/cd_hw/scd.c b/core/cd_hw/scd.c index 1026506..d0df6bd 100644 --- a/core/cd_hw/scd.c +++ b/core/cd_hw/scd.c @@ -1201,8 +1201,8 @@ void scd_reset(int hard) scd.dmna = 0; /* H-INT default vector */ - *(uint16 *)(m68k.memory_map[0].base + 0x70) = 0x00FF; - *(uint16 *)(m68k.memory_map[0].base + 0x72) = 0xFFFF; + *(uint16 *)(m68k.memory_map[scd.cartridge.boot].base + 0x70) = 0x00FF; + *(uint16 *)(m68k.memory_map[scd.cartridge.boot].base + 0x72) = 0xFFFF; /* Power ON initial values (MAIN-CPU side) */ scd.regs[0x00>>1].w = 0x0002; @@ -1405,7 +1405,7 @@ int scd_context_save(uint8 *state) save_param(&s68k.poll, sizeof(s68k.poll)); /* H-INT default vector */ - tmp16 = *(uint16 *)(m68k.memory_map[0].base + 0x72); + tmp16 = *(uint16 *)(m68k.memory_map[scd.cartridge.boot].base + 0x72); save_param(&tmp16, 2); /* SUB-CPU internal state */ @@ -1606,7 +1606,7 @@ int scd_context_load(uint8 *state) /* H-INT default vector */ load_param(&tmp16, 2); - *(uint16 *)(m68k.memory_map[0].base + 0x72) = tmp16; + *(uint16 *)(m68k.memory_map[scd.cartridge.boot].base + 0x72) = tmp16; /* SUB-CPU internal state */ load_param(&s68k.cycles, sizeof(s68k.cycles)); diff --git a/core/mem68k.c b/core/mem68k.c index 78f2d82..bdef7ba 100644 --- a/core/mem68k.c +++ b/core/mem68k.c @@ -482,7 +482,7 @@ unsigned int ctrl_io_read_word(unsigned int address) /* H-INT vector (word access only ?) */ if (index == 0x06) { - return *(uint16 *)(m68k.memory_map[0].base + 0x72); + return *(uint16 *)(m68k.memory_map[scd.cartridge.boot].base + 0x72); } /* Stopwatch counter (word read access only ?) */ @@ -940,7 +940,7 @@ void ctrl_io_write_word(unsigned int address, unsigned int data) case 0x06: /* H-INT vector (word access only ?) */ { - *(uint16 *)(m68k.memory_map[0].base + 0x72) = data; + *(uint16 *)(m68k.memory_map[scd.cartridge.boot].base + 0x72) = data; return; } @@ -948,7 +948,7 @@ void ctrl_io_write_word(unsigned int address, unsigned int data) { m68k_poll_sync(1<<0x0e); - /* D8-D15 ignored -> only MAIN-CPU flags are updated (Mortal Kombat) */ + /* D8-D15 ignored -> only MAIN-CPU flags are updated (Mortal Kombat) */ scd.regs[0x0e>>1].byte.h = data & 0xff; return; }