fixed broken OS ROM support

This commit is contained in:
ekeeke31 2011-04-08 12:04:31 +00:00
parent cb7990cc3f
commit cf7332859c
2 changed files with 30 additions and 26 deletions

View File

@ -165,31 +165,6 @@ void gen_reset(int hard_reset)
/* clear RAM */ /* clear RAM */
memset (work_ram, 0x00, sizeof (work_ram)); memset (work_ram, 0x00, sizeof (work_ram));
memset (zram, 0x00, sizeof (zram)); memset (zram, 0x00, sizeof (zram));
/* TMSS & OS ROM support */
if (config.tmss & 1)
{
/* clear TMSS register */
memset(tmss, 0x00, sizeof(tmss));
/* VDP access is locked by default */
int i;
for (i=0xc0; i<0xe0; i+=8)
{
m68k_memory_map[i].read8 = m68k_lockup_r_8;
m68k_memory_map[i].read16 = m68k_lockup_r_16;
m68k_memory_map[i].write8 = m68k_lockup_w_8;
m68k_memory_map[i].write16 = m68k_lockup_w_16;
zbank_memory_map[i].read = zbank_lockup_r;
zbank_memory_map[i].write = zbank_lockup_w;
}
/* OS ROM is mapped at $000000-$0007FF */
if (config.tmss & 2)
{
m68k_memory_map[0].base = bios_rom;
}
}
} }
else else
{ {
@ -226,6 +201,35 @@ void gen_reset(int hard_reset)
/* assume default bank is $000000-$007FFF */ /* assume default bank is $000000-$007FFF */
zbank = 0; zbank = 0;
/* TMSS & OS ROM support */
if (config.tmss & 1)
{
/* on HW reset only */
if (hard_reset)
{
/* clear TMSS register */
memset(tmss, 0x00, sizeof(tmss));
/* VDP access is locked by default */
int i;
for (i=0xc0; i<0xe0; i+=8)
{
m68k_memory_map[i].read8 = m68k_lockup_r_8;
m68k_memory_map[i].read16 = m68k_lockup_r_16;
m68k_memory_map[i].write8 = m68k_lockup_w_8;
m68k_memory_map[i].write16 = m68k_lockup_w_16;
zbank_memory_map[i].read = zbank_lockup_r;
zbank_memory_map[i].write = zbank_lockup_w;
}
/* OS ROM is mapped at $000000-$0007FF */
if (config.tmss & 2)
{
m68k_memory_map[0].base = bios_rom;
}
}
}
/* reset 68k */ /* reset 68k */
m68k_pulse_reset(); m68k_pulse_reset();
} }

View File

@ -57,7 +57,7 @@ static inline void z80_lockup_w(unsigned int address, unsigned char data)
static inline unsigned char z80_lockup_r(unsigned int address) static inline unsigned char z80_lockup_r(unsigned int address)
{ {
#ifdef LOGERROR #ifdef LOGERROR
error("Z80 lockup read %04X (%x)\n", address, Z80.pc); error("Z80 lockup read %04X (%x)\n", address, Z80.pc.w.l);
#endif #endif
if (!config.force_dtack) if (!config.force_dtack)
{ {