drop unmaintained mips code
[picodrive.git] / pico / pico_int.h
index f439d6a..89cccc7 100644 (file)
@@ -211,20 +211,13 @@ extern struct DrZ80 drZ80;
 \r
 #define Z80_STATE_SIZE 0x60\r
 \r
-extern unsigned int last_z80_sync;\r
-extern int z80_cycle_cnt;        /* 'done' z80 cycles before z80_run() */\r
-extern int z80_cycle_aim;\r
-extern int z80_scanline;\r
-extern int z80_scanline_cycles;  /* cycles done until z80_scanline */\r
-\r
 #define z80_resetCycles() \\r
-  last_z80_sync = SekCyclesDone(); \\r
-  z80_cycle_cnt = z80_cycle_aim = z80_scanline = z80_scanline_cycles = 0;\r
+  timing.z80c_cnt = timing.z80c_aim = timing.z80_scanline = 0\r
 \r
 #define z80_cyclesDone() \\r
-  (z80_cycle_aim - z80_cyclesLeft)\r
+  (timing.z80c_aim - z80_cyclesLeft)\r
 \r
-#define cycles_68k_to_z80(x) ((x)*957 >> 11)\r
+#define cycles_68k_to_z80(x) ((x) * 3823 >> 13)\r
 \r
 // ----------------------- SH2 CPU -----------------------\r
 \r
@@ -283,6 +276,7 @@ extern SH2 sh2s[2];
 #define OSC_NTSC 53693100\r
 #define OSC_PAL  53203424\r
 \r
+// PicoVideo.debug_p\r
 #define PVD_KILL_A    (1 << 0)\r
 #define PVD_KILL_B    (1 << 1)\r
 #define PVD_KILL_S_LO (1 << 2)\r
@@ -292,6 +286,20 @@ extern SH2 sh2s[2];
 #define PVD_FORCE_B   (1 << 6)\r
 #define PVD_FORCE_S   (1 << 7)\r
 \r
+// PicoVideo.status, not part of real SR\r
+#define SR_PAL        (1 << 0)\r
+#define SR_DMA        (1 << 1)\r
+#define SR_HB         (1 << 2)\r
+#define SR_VB         (1 << 3)\r
+#define SR_ODD        (1 << 4)\r
+#define SR_C          (1 << 5)\r
+#define SR_SOVR       (1 << 6)\r
+#define SR_F          (1 << 7)\r
+#define SR_FULL       (1 << 8)\r
+#define SR_EMPT       (1 << 9)\r
+// not part of real SR\r
+#define PVS_ACTIVE    (1 << 16)\r
+\r
 struct PicoVideo\r
 {\r
   unsigned char reg[0x20];\r
@@ -299,14 +307,15 @@ struct PicoVideo
   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 int status;        // Status bits (SR) and extra flags\r
   unsigned char pending_ints; // pending interrupts: ??VH????\r
   signed char lwrite_cnt;     // VDP write count during active display line\r
   unsigned short v_counter;   // V-counter\r
   unsigned short debug;       // raw debug register\r
   unsigned char debug_p;      // ... parsed: PVD_*\r
-  unsigned char addr_u;\r
-  unsigned char pad[0x0c];\r
+  unsigned char addr_u;       // bit16 of .addr\r
+  unsigned char hint_cnt;\r
+  unsigned char pad[0x0b];\r
 };\r
 \r
 struct PicoMisc\r
@@ -583,6 +592,15 @@ struct Pico32xMem
   unsigned short pwm_fifo[2][4];        // [0] - current raw, others - fifo entries\r
 };\r
 \r
+struct PicoTiming\r
+{\r
+  unsigned int m68c_frame_start;        // m68k cycles\r
+  unsigned int z80c_cnt;                // z80 cycles done (this frame)\r
+  unsigned int z80c_aim;\r
+  int z80_scanline;\r
+};\r
+extern struct PicoTiming timing;\r
+\r
 // area.c\r
 extern void (*PicoLoadStateHook)(void);\r
 \r
@@ -684,7 +702,6 @@ extern struct Pico Pico;
 extern struct PicoSRAM SRam;\r
 extern int PicoPadInt[2];\r
 extern int emustatus;\r
-extern int scanlines_total;\r
 extern void (*PicoResetHook)(void);\r
 extern void (*PicoLineHook)(void);\r
 PICO_INTERNAL int  CheckDMA(void);\r
@@ -1077,3 +1094,4 @@ void pevt_dump(void);
 \r
 #endif // PICO_INTERNAL_INCLUDED\r
 \r
+// vim:shiftwidth=2:ts=2:expandtab\r