#include <stdlib.h>\r
#include <string.h>\r
#include "Pico.h"\r
+#include "carthw/carthw.h"\r
\r
//\r
#define USE_POLL_DETECT\r
#define SekPcS68k (PicoCpuCS68k.pc-PicoCpuCS68k.membase)\r
#define SekSetStop(x) { PicoCpuCM68k.state_flags&=~1; if (x) { PicoCpuCM68k.state_flags|=1; PicoCpuCM68k.cycles=0; } }\r
#define SekSetStopS68k(x) { PicoCpuCS68k.state_flags&=~1; if (x) { PicoCpuCS68k.state_flags|=1; PicoCpuCS68k.cycles=0; } }\r
+#define SekIsStoppedS68k() (PicoCpuCS68k.state_flags&1)\r
#define SekShouldInterrupt (PicoCpuCM68k.irq > (PicoCpuCM68k.srh&7))\r
\r
#define SekInterrupt(i) PicoCpuCM68k.irq=i\r
PicoCpuFS68k.execinfo &= ~FM68K_HALTED; \\r
if (x) { PicoCpuFS68k.execinfo |= FM68K_HALTED; PicoCpuFS68k.io_cycle_counter = 0; } \\r
}\r
+#define SekIsStoppedS68k() (PicoCpuFS68k.execinfo&FM68K_HALTED)\r
#define SekShouldInterrupt fm68k_would_interrupt()\r
\r
#define SekInterrupt(irq) PicoCpuFM68k.interrupts[0]=irq\r
if(x) { SET_CYCLES(0); PicoCpuMS68k.stopped=STOP_LEVEL_STOP; } \\r
else PicoCpuMS68k.stopped=0; \\r
}\r
+#define SekIsStoppedS68k() (PicoCpuMS68k.stopped==STOP_LEVEL_STOP)\r
#define SekShouldInterrupt (CPU_INT_LEVEL > FLAG_INT_MASK)\r
\r
#define SekInterrupt(irq) { \\r
PICO_INTERNAL_ASM unsigned int PicoRead32(unsigned int a);\r
PICO_INTERNAL void PicoMemSetup(void);\r
PICO_INTERNAL_ASM void PicoMemReset(void);\r
+PICO_INTERNAL void PicoMemResetHooks(void);\r
PICO_INTERNAL int PadRead(int i);\r
PICO_INTERNAL unsigned char z80_read(unsigned short a);\r
#ifndef _USE_CZ80\r
#else\r
PICO_INTERNAL_ASM void z80_write(unsigned int a, unsigned char data);\r
#endif\r
+extern unsigned int (*PicoRead16Hook)(unsigned int a, int realsize);\r
+extern void (*PicoWrite8Hook) (unsigned int a,unsigned int d,int realsize);\r
+extern void (*PicoWrite16Hook)(unsigned int a,unsigned int d,int realsize);\r
\r
// cd/Memory.c\r
PICO_INTERNAL void PicoMemSetupCD(void);\r
extern struct PicoSRAM SRam;\r
extern int emustatus;\r
extern int z80startCycle, z80stopCycle; // in 68k cycles\r
+extern void (*PicoResetHook)(void);\r
+extern void (*PicoLineHook)(void);\r
PICO_INTERNAL int CheckDMA(void);\r
\r
// cd/Pico.c\r
// VideoPort.c\r
PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d);\r
PICO_INTERNAL_ASM unsigned int PicoVideoRead(unsigned int a);\r
+extern int (*PicoDmaHook)(unsigned int source, int len, unsigned short **srcp, unsigned short **limitp);\r
\r
// Misc.c\r
PICO_INTERNAL void SRAMWriteEEPROM(unsigned int d);\r
#define EL_LOGMASK 0\r
#endif\r
\r
-#define EL_HVCNT 0x0001 /* hv counter reads */\r
-#define EL_SR 0x0002 /* SR reads */\r
-#define EL_INTS 0x0004 /* ints and acks */\r
-#define EL_YM2612R 0x0008 /* 68k ym2612 reads */\r
-#define EL_INTSW 0x0010 /* log irq switching on/off */\r
-#define EL_ASVDP 0x0020 /* VDP accesses during active scan */\r
-#define EL_VDPDMA 0x0040 /* VDP DMA transfers and their timing */\r
-#define EL_BUSREQ 0x0080 /* z80 busreq r/w or reset w */\r
-#define EL_Z80BNK 0x0100 /* z80 i/o through bank area */\r
-#define EL_SRAMIO 0x0200 /* sram i/o */\r
-#define EL_EEPROM 0x0400 /* eeprom debug */\r
-#define EL_UIO 0x0800 /* unmapped i/o */\r
-#define EL_IO 0x1000 /* all i/o (TODO) */\r
-\r
-#define EL_STATUS 0x4000 /* status messages */\r
-#define EL_ANOMALY 0x8000 /* some unexpected conditions (during emulation) */\r
+#define EL_HVCNT 0x00000001 /* hv counter reads */\r
+#define EL_SR 0x00000002 /* SR reads */\r
+#define EL_INTS 0x00000004 /* ints and acks */\r
+#define EL_YM2612R 0x00000008 /* 68k ym2612 reads */\r
+#define EL_INTSW 0x00000010 /* log irq switching on/off */\r
+#define EL_ASVDP 0x00000020 /* VDP accesses during active scan */\r
+#define EL_VDPDMA 0x00000040 /* VDP DMA transfers and their timing */\r
+#define EL_BUSREQ 0x00000080 /* z80 busreq r/w or reset w */\r
+#define EL_Z80BNK 0x00000100 /* z80 i/o through bank area */\r
+#define EL_SRAMIO 0x00000200 /* sram i/o */\r
+#define EL_EEPROM 0x00000400 /* eeprom debug */\r
+#define EL_UIO 0x00000800 /* unmapped i/o */\r
+#define EL_IO 0x00001000 /* all i/o */\r
+#define EL_CDPOLL 0x00002000 /* MCD: log poll detection */\r
+#define EL_SVP 0x00004000 /* SVP stuff */\r
+\r
+#define EL_STATUS 0x40000000 /* status messages */\r
+#define EL_ANOMALY 0x80000000 /* some unexpected conditions (during emulation) */\r
\r
#if EL_LOGMASK\r
extern void lprintf(const char *fmt, ...);\r