Added 0.030 of PicoDrive and moved license files into root
[cyclone68000.git] / Pico / PicoInt.h
diff --git a/Pico/PicoInt.h b/Pico/PicoInt.h
new file mode 100644 (file)
index 0000000..a27e73a
--- /dev/null
@@ -0,0 +1,132 @@
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <string.h>\r
+#include "Pico.h"\r
+\r
+#if defined(__GNUC__) || defined(_WIN32_WCE)\r
+#define EMU_C68K // Use the Cyclone 68000 emulator\r
+#else\r
+#define EMU_A68K // Use the 'A68K' (Make68K) Assembler 68000 emulator\r
+#endif\r
+\r
+//#define MSOUND\r
+\r
+// Disa.h also defines CPU_CALL to be fastcall or normal call\r
+#include "Disa.h"\r
+\r
+\r
+// ----------------------- 68000 CPU -----------------------\r
+#ifdef EMU_A68K\r
+// The format of the data in a68k.asm (at the _M68000_regs location)\r
+struct A68KContext\r
+{\r
+  unsigned int d[8],a[8];\r
+  unsigned int isp,srh,ccr,xc,pc,irq,sr;\r
+  int (*IrqCallback) (int nIrq);\r
+  unsigned int ppc;\r
+  void *pResetCallback;\r
+  unsigned int sfc,dfc,usp,vbr;\r
+  unsigned int AsmBank,CpuVersion;\r
+};\r
+extern "C" struct A68KContext M68000_regs;\r
+#endif\r
+\r
+#ifdef EMU_C68K\r
+#include "../Cyclone/Cyclone.h"\r
+extern struct Cyclone PicoCpu;\r
+#endif\r
+\r
+#ifdef MSOUND\r
+extern "C" {\r
+#include "ym2612.h"\r
+}\r
+#endif\r
+\r
+// ---------------------------------------------------------\r
+\r
+struct PicoVideo\r
+{\r
+  unsigned char reg[0x20];\r
+  unsigned int command; // 32-bit Command\r
+  unsigned char pending; // 1 if waiting for second half of 32-bit command\r
+  unsigned char type; // Command type (v/c/vsram read/write)\r
+  unsigned short addr; // Read/Write address\r
+  int status; // Status bits\r
+  unsigned char pad[0x14];\r
+};\r
+\r
+struct PicoMisc\r
+{\r
+  unsigned char rotate;\r
+  unsigned char z80Run;\r
+  unsigned char padSelect[2]; // Select high or low bit from joypad\r
+  short scanline; // -38 to 223\r
+  char dirtyPal; // Is the palette dirty\r
+  unsigned char hardware; // Hardware value for country\r
+  unsigned char pal; // 1=PAL 0=NTSC\r
+  unsigned char pad[0x16];\r
+};\r
+\r
+struct PicoSound\r
+{\r
+  unsigned char fmsel[2]; // FM selected register\r
+  unsigned char reg[0x100];\r
+  unsigned char pad[0x3e];\r
+};\r
+\r
+struct Pico\r
+{\r
+  unsigned char ram[0x10000]; // scratch ram\r
+  unsigned short vram[0x8000];\r
+  unsigned char zram[0x2000]; // Z80 ram\r
+  unsigned int highpal[0x40];\r
+  unsigned short cram[0x40];\r
+  unsigned short vsram[0x40];\r
+\r
+  unsigned char *rom;\r
+  unsigned int romsize;\r
+\r
+  struct PicoMisc m;\r
+  struct PicoVideo video;\r
+  struct PicoSound s;\r
+};\r
+\r
+// Draw.cpp\r
+int PicoLine(int scan);\r
+\r
+// Draw2.cpp\r
+int PicoDraw2();\r
+\r
+// Memory.cpp\r
+int PicoInitPc(unsigned int pc);\r
+unsigned short CPU_CALL PicoRead16(unsigned int a);\r
+unsigned int CPU_CALL PicoRead32(unsigned int a);\r
+int PicoMemInit();\r
+void PicoDasm(int start,int len);\r
+\r
+// Pico.cpp\r
+extern struct Pico Pico;\r
+\r
+// Sek.cpp\r
+int SekInit();\r
+int SekReset();\r
+int SekRun(int cyc);\r
+int SekInterrupt(int irq);\r
+int SekPc();\r
+void SekState(unsigned char *data);\r
+\r
+// Sine.cpp\r
+extern short Sine[];\r
+\r
+// Psnd.cpp\r
+int PsndReset();\r
+int PsndFm(int a,int d);\r
+int PsndRender();\r
+\r
+// VideoPort.cpp\r
+void PicoVideoWrite(unsigned int a,unsigned int d);\r
+unsigned int PicoVideoRead(unsigned int a);\r
+\r
+// External:\r
+extern "C" int dprintf(char *Format, ...);\r