X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Fcz80%2Fcz80.c;h=091e2a5f9dd2474fe07461b5329901ba2883d384;hb=4c67e7ad99a5891340f92eb86f0d24e0975eca90;hp=20e8053fe93c9f3da85416e41ccc5b0c0088852f;hpb=c299a73848342a745422a2e1980ed7fcf7960f26;p=picodrive.git diff --git a/cpu/cz80/cz80.c b/cpu/cz80/cz80.c index 20e8053..091e2a5 100644 --- a/cpu/cz80/cz80.c +++ b/cpu/cz80/cz80.c @@ -15,7 +15,7 @@ #if PICODRIVE_HACKS #undef EMU_M68K -#include +#include #endif #ifndef ALIGN_DATA @@ -219,7 +219,10 @@ void Cz80_Reset(cz80_struc *CPU) #if PICODRIVE_HACKS static inline unsigned char picodrive_read(unsigned short a) { - return (a < 0x4000) ? Pico.zram[a&0x1fff] : z80_read(a); + unsigned long v = z80_read_map[a >> Z80_MEM_SHIFT]; + if (v & 0x80000000) + return ((z80_read_f *)(v << 1))(a); + return *(unsigned char *)((v << 1) + a); } #endif