diff --git a/genplus-gx/core/z80/z80.c b/genplus-gx/core/z80/z80.c index 1ed07fbe80..6b28ca1bbd 100644 --- a/genplus-gx/core/z80/z80.c +++ b/genplus-gx/core/z80/z80.c @@ -577,6 +577,42 @@ INLINE void BURNODD(int cycles, int opcodes, int cyclesum) #endif +void CDLog68k(uint addr, uint flags); + +void CDLogZ80(uint addr, uint flags) +{ + //in case we wrap around while reading a u16 from FFFF... + addr &= 0xFFFF; + + if(addr < 0x4000) + { + addr &= 0x1FFFF; + biz_cdcallback(addr, eCDLog_AddrType_RAMZ80, flags); + return; + } + + if(addr >= 0x8000) + { + addr = zbank | (addr & 0x7FFF); + if (zbank_memory_map[addr >> 16].write) + { + //special memory maps are hard to support here. + return; + } + + //punt to 68k mapper + CDLog68k(addr, flags); + return; + } +} + +INLINE unsigned char CDLogZ80_RM(uint addr) +{ + if(biz_cdcallback) + CDLogZ80(addr,eCDLog_Flags_DataZ80); + return z80_readmem(addr); +} + /*************************************************************** * Enter HALT state; write 1 to fake port on first execution ***************************************************************/ @@ -609,7 +645,7 @@ INLINE void BURNODD(int cycles, int opcodes, int cyclesum) /*************************************************************** * Read a byte from given memory location ***************************************************************/ -#define RM(addr) z80_readmem(addr) +#define RM(addr) CDLogZ80_RM(addr) /*************************************************************** * Write a byte to given memory location @@ -634,35 +670,6 @@ INLINE void WM16( UINT32 addr, PAIR *r ) WM((addr+1)&0xffff,r->b.h); } -void CDLog68k(uint addr, uint flags); - -void CDLogZ80(uint addr, uint flags) -{ - //in case we wrap around while reading a u16 from FFFF... - addr &= 0xFFFF; - - if(addr < 0x4000) - { - addr &= 0x1FFFF; - biz_cdcallback(addr, eCDLog_AddrType_RAMZ80, flags); - return; - } - - if(addr >= 0x8000) - { - addr = zbank | (addr & 0x7FFF); - if (zbank_memory_map[addr >> 16].write) - { - //special memory maps are hard to support here. - return; - } - - //punt to 68k mapper - CDLog68k(addr, flags); - return; - } -} - /*************************************************************** * ROP() is identical to RM() except it is used for * reading opcodes. In case of system with memory mapped I/O, diff --git a/output/dll/libgenplusgx.dll b/output/dll/libgenplusgx.dll index 8658c60e37..f9e8e32a89 100644 Binary files a/output/dll/libgenplusgx.dll and b/output/dll/libgenplusgx.dll differ