[Core/MS] fixed disabled slot returned value

This commit is contained in:
ekeeke 2021-10-24 14:34:28 +02:00
parent 068769a02e
commit 236e783ec2
6 changed files with 17 additions and 2 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

@ -426,6 +426,7 @@ static unsigned char read_mapper_93c46(unsigned int address);
static unsigned char read_mapper_terebi(unsigned int address);
static unsigned char read_mapper_korea_8k(unsigned int address);
static unsigned char read_mapper_default(unsigned int address);
static unsigned char read_mapper_none(unsigned int address);
void sms_cart_init(void)
{
@ -920,7 +921,7 @@ static void mapper_reset(void)
}
/* set default Z80 memory handlers */
z80_readmem = read_mapper_default;
z80_readmem = read_mapper_none;
z80_writemem = write_mapper_none;
return;
}
@ -1567,3 +1568,14 @@ static unsigned char read_mapper_default(unsigned int address)
{
return z80_readmap[address >> 10][address & 0x03FF];
}
static unsigned char read_mapper_none(unsigned int address)
{
if (address >= 0xC000)
{
return z80_readmap[address >> 10][address & 0x03FF];
}
/* return last fetched z80 instruction / data */
return z80_last_fetch;
}

View File

@ -210,6 +210,7 @@ UINT32 z80_cycle_ratio;
#endif
Z80_Regs Z80;
UINT8 z80_last_fetch;
unsigned char *z80_readmap[64];
unsigned char *z80_writemap[64];
@ -660,7 +661,8 @@ INLINE UINT8 ROP(void)
{
unsigned pc = PCD;
PC++;
return cpu_readop(pc);
z80_last_fetch = cpu_readop(pc);
return z80_last_fetch;
}
/****************************************************************

View File

@ -50,6 +50,7 @@ typedef struct
extern Z80_Regs Z80;
extern UINT8 z80_last_fetch;
#ifdef Z80_OVERCLOCK_SHIFT
extern UINT32 z80_cycle_ratio;