\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
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
\r
#endif // PICO_INTERNAL_INCLUDED\r
\r
+// vim:shiftwidth=2:ts=2:expandtab\r