X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FMemory.c;h=b0aa7afa2806ff637164b2e92d75c425ec8959e5;hb=9112b6ce9fd42ee46adb7e8148e587a7f60e35f4;hp=7b30e4a366614bf58a2a4ebe48526ecf8907ab30;hpb=1dceadaee482ad3ca6f5ccbef57ea93893f45e82;p=picodrive.git diff --git a/Pico/Memory.c b/Pico/Memory.c index 7b30e4a..b0aa7af 100644 --- a/Pico/Memory.c +++ b/Pico/Memory.c @@ -45,7 +45,7 @@ void log_io(unsigned int addr, int bits, int rw); #define log_io(...) #endif -#if defined(EMU_C68K) || defined(EMU_A68K) +#if defined(EMU_C68K) static __inline int PicoMemBase(u32 pc) { int membase=0; @@ -69,10 +69,6 @@ static __inline int PicoMemBase(u32 pc) #endif -#ifdef EMU_A68K -extern u8 *OP_ROM=NULL,*OP_RAM=NULL; -#endif - static u32 CPU_CALL PicoCheckPc(u32 pc) { u32 ret=0; @@ -90,11 +86,6 @@ static u32 CPU_CALL PicoCheckPc(u32 pc) PicoCpu.membase-=pc&0xff000000; ret = PicoCpu.membase+pc; -#elif defined(EMU_A68K) - OP_ROM=(u8 *)PicoMemBase(pc); - - // don't bother calling us back unless it's outside the 64k segment - M68000_regs.AsmBank=(pc>>16); #endif return ret; } @@ -498,8 +489,8 @@ static void CPU_CALL PicoWrite32(u32 a,u32 d) // ----------------------------------------------------------------- PICO_INTERNAL void PicoMemSetup(void) { -#ifdef EMU_C68K // Setup memory callbacks: +#ifdef EMU_C68K PicoCpu.checkpc=PicoCheckPc; PicoCpu.fetch8 =PicoCpu.read8 =PicoRead8; PicoCpu.fetch16=PicoCpu.read16=PicoRead16; @@ -508,43 +499,16 @@ PICO_INTERNAL void PicoMemSetup(void) PicoCpu.write16=PicoWrite16; PicoCpu.write32=PicoWrite32; #endif +#ifdef EMU_F68K + PicoCpuM68k.read_byte =PicoRead8; + PicoCpuM68k.read_word =PicoRead16; + PicoCpuM68k.read_long =PicoRead32; + PicoCpuM68k.write_byte=PicoWrite8; + PicoCpuM68k.write_word=PicoWrite16; + PicoCpuM68k.write_long=PicoWrite32; +#endif } -#ifdef EMU_A68K -struct A68KInter -{ - u32 unknown; - u8 (__fastcall *Read8) (u32 a); - u16 (__fastcall *Read16)(u32 a); - u32 (__fastcall *Read32)(u32 a); - void (__fastcall *Write8) (u32 a,u8 d); - void (__fastcall *Write16) (u32 a,u16 d); - void (__fastcall *Write32) (u32 a,u32 d); - void (__fastcall *ChangePc)(u32 a); - u8 (__fastcall *PcRel8) (u32 a); - u16 (__fastcall *PcRel16)(u32 a); - u32 (__fastcall *PcRel32)(u32 a); - u16 (__fastcall *Dir16)(u32 a); - u32 (__fastcall *Dir32)(u32 a); -}; - -struct A68KInter a68k_memory_intf= -{ - 0, - PicoRead8, - PicoRead16, - PicoRead32, - PicoWrite8, - PicoWrite16, - PicoWrite32, - PicoCheckPc, - PicoRead8, - PicoRead16, - PicoRead32, - PicoRead16, // unused - PicoRead32, // unused -}; -#endif #ifdef EMU_M68K unsigned int m68k_read_pcrelative_CD8 (unsigned int a); @@ -720,7 +684,7 @@ PICO_INTERNAL_ASM void z80_write(unsigned char data, unsigned short a) if ((a>>13)==2) // 0x4000-0x5fff (Charles MacDonald) { - if(PicoOpt&1) emustatus|=YM2612Write(a, data); + if(PicoOpt&1) emustatus|=YM2612Write(a, data) & 1; return; }