X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FPicoInt.h;h=85b25790508c1d555f3d16cb43c2aff2922e5c84;hb=5de27868df4df82d38901a804ec6fb32eb6ab5a6;hp=1a7df25f9f3baca397abbeb1d239d33ee075fef4;hpb=7d0143a2de0f5551c90b29c1b1ee94e9c52b0952;p=picodrive.git diff --git a/Pico/PicoInt.h b/Pico/PicoInt.h index 1a7df25..85b2579 100644 --- a/Pico/PicoInt.h +++ b/Pico/PicoInt.h @@ -13,6 +13,7 @@ #include #include #include "Pico.h" +#include "carthw/carthw.h" // #define USE_POLL_DETECT @@ -48,6 +49,7 @@ extern struct Cyclone PicoCpuCM68k, PicoCpuCS68k; #define SekPcS68k (PicoCpuCS68k.pc-PicoCpuCS68k.membase) #define SekSetStop(x) { PicoCpuCM68k.state_flags&=~1; if (x) { PicoCpuCM68k.state_flags|=1; PicoCpuCM68k.cycles=0; } } #define SekSetStopS68k(x) { PicoCpuCS68k.state_flags&=~1; if (x) { PicoCpuCS68k.state_flags|=1; PicoCpuCS68k.cycles=0; } } +#define SekIsStoppedS68k() (PicoCpuCS68k.state_flags&1) #define SekShouldInterrupt (PicoCpuCM68k.irq > (PicoCpuCM68k.srh&7)) #define SekInterrupt(i) PicoCpuCM68k.irq=i @@ -79,6 +81,7 @@ extern M68K_CONTEXT PicoCpuFM68k, PicoCpuFS68k; PicoCpuFS68k.execinfo &= ~FM68K_HALTED; \ if (x) { PicoCpuFS68k.execinfo |= FM68K_HALTED; PicoCpuFS68k.io_cycle_counter = 0; } \ } +#define SekIsStoppedS68k() (PicoCpuFS68k.execinfo&FM68K_HALTED) #define SekShouldInterrupt fm68k_would_interrupt() #define SekInterrupt(irq) PicoCpuFM68k.interrupts[0]=irq @@ -111,6 +114,7 @@ extern m68ki_cpu_core PicoCpuMM68k, PicoCpuMS68k; if(x) { SET_CYCLES(0); PicoCpuMS68k.stopped=STOP_LEVEL_STOP; } \ else PicoCpuMS68k.stopped=0; \ } +#define SekIsStoppedS68k() (PicoCpuMS68k.stopped==STOP_LEVEL_STOP) #define SekShouldInterrupt (CPU_INT_LEVEL > FLAG_INT_MASK) #define SekInterrupt(irq) { \ @@ -381,6 +385,7 @@ PICO_INTERNAL int PicoInitPc(unsigned int pc); PICO_INTERNAL_ASM unsigned int PicoRead32(unsigned int a); PICO_INTERNAL void PicoMemSetup(void); PICO_INTERNAL_ASM void PicoMemReset(void); +PICO_INTERNAL void PicoMemResetHooks(void); PICO_INTERNAL int PadRead(int i); PICO_INTERNAL unsigned char z80_read(unsigned short a); #ifndef _USE_CZ80 @@ -390,6 +395,9 @@ PICO_INTERNAL unsigned short z80_read16(unsigned short a); #else PICO_INTERNAL_ASM void z80_write(unsigned int a, unsigned char data); #endif +extern unsigned int (*PicoRead16Hook)(unsigned int a, int realsize); +extern void (*PicoWrite8Hook) (unsigned int a,unsigned int d,int realsize); +extern void (*PicoWrite16Hook)(unsigned int a,unsigned int d,int realsize); // cd/Memory.c PICO_INTERNAL void PicoMemSetupCD(void); @@ -401,6 +409,8 @@ extern struct Pico Pico; extern struct PicoSRAM SRam; extern int emustatus; extern int z80startCycle, z80stopCycle; // in 68k cycles +extern void (*PicoResetHook)(void); +extern void (*PicoLineHook)(void); PICO_INTERNAL int CheckDMA(void); // cd/Pico.c @@ -427,6 +437,7 @@ extern int PsndLen_exc_add; // VideoPort.c PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d); PICO_INTERNAL_ASM unsigned int PicoVideoRead(unsigned int a); +extern int (*PicoDmaHook)(unsigned int source, int len, unsigned short **srcp, unsigned short **limitp); // Misc.c PICO_INTERNAL void SRAMWriteEEPROM(unsigned int d); @@ -466,22 +477,24 @@ PICO_INTERNAL void z80_exit(void); #define EL_LOGMASK 0 #endif -#define EL_HVCNT 0x0001 /* hv counter reads */ -#define EL_SR 0x0002 /* SR reads */ -#define EL_INTS 0x0004 /* ints and acks */ -#define EL_YM2612R 0x0008 /* 68k ym2612 reads */ -#define EL_INTSW 0x0010 /* log irq switching on/off */ -#define EL_ASVDP 0x0020 /* VDP accesses during active scan */ -#define EL_VDPDMA 0x0040 /* VDP DMA transfers and their timing */ -#define EL_BUSREQ 0x0080 /* z80 busreq r/w or reset w */ -#define EL_Z80BNK 0x0100 /* z80 i/o through bank area */ -#define EL_SRAMIO 0x0200 /* sram i/o */ -#define EL_EEPROM 0x0400 /* eeprom debug */ -#define EL_UIO 0x0800 /* unmapped i/o */ -#define EL_IO 0x1000 /* all i/o (TODO) */ - -#define EL_STATUS 0x4000 /* status messages */ -#define EL_ANOMALY 0x8000 /* some unexpected conditions (during emulation) */ +#define EL_HVCNT 0x00000001 /* hv counter reads */ +#define EL_SR 0x00000002 /* SR reads */ +#define EL_INTS 0x00000004 /* ints and acks */ +#define EL_YM2612R 0x00000008 /* 68k ym2612 reads */ +#define EL_INTSW 0x00000010 /* log irq switching on/off */ +#define EL_ASVDP 0x00000020 /* VDP accesses during active scan */ +#define EL_VDPDMA 0x00000040 /* VDP DMA transfers and their timing */ +#define EL_BUSREQ 0x00000080 /* z80 busreq r/w or reset w */ +#define EL_Z80BNK 0x00000100 /* z80 i/o through bank area */ +#define EL_SRAMIO 0x00000200 /* sram i/o */ +#define EL_EEPROM 0x00000400 /* eeprom debug */ +#define EL_UIO 0x00000800 /* unmapped i/o */ +#define EL_IO 0x00001000 /* all i/o */ +#define EL_CDPOLL 0x00002000 /* MCD: log poll detection */ +#define EL_SVP 0x00004000 /* SVP stuff */ + +#define EL_STATUS 0x40000000 /* status messages */ +#define EL_ANOMALY 0x80000000 /* some unexpected conditions (during emulation) */ #if EL_LOGMASK extern void lprintf(const char *fmt, ...);