ym2612.OPN.ST.TA = TAnew;\r
//ym2612.OPN.ST.TAC = (1024-TAnew)*18;\r
//ym2612.OPN.ST.TAT = 0;\r
- timer_a_step = timer_a_offset = 16466 * (1024 - TAnew);\r
+ timer_a_step = timer_a_offset = TIMER_A_TICK_ZCYCLES * (1024 - TAnew);\r
if (ym2612.OPN.ST.mode & 1) {\r
int cycles = is_from_z80 ? z80_cyclesDone() : cycles_68k_to_z80(SekCyclesDone());\r
timer_a_next_oflow = (cycles << 8) + timer_a_step;\r
ym2612.OPN.ST.TB = d;\r
//ym2612.OPN.ST.TBC = (256-d) * 288;\r
//ym2612.OPN.ST.TBT = 0;\r
- timer_b_step = timer_b_offset = 262800 * (256 - d); // 262881\r
+ timer_b_step = timer_b_offset = TIMER_B_TICK_ZCYCLES * (256 - d); // 262800\r
if (ym2612.OPN.ST.mode & 2) {\r
int cycles = is_from_z80 ? z80_cyclesDone() : cycles_68k_to_z80(SekCyclesDone());\r
timer_b_next_oflow = (cycles << 8) + timer_b_step;\r
void ym2612_unpack_state(void);\r
\r
#define TIMER_NO_OFLOW 0x70000000\r
+// tA = 72 * (1024 - NA) / M\r
+#define TIMER_A_TICK_ZCYCLES 17203\r
+// tB = 1152 * (256 - NA) / M\r
+#define TIMER_B_TICK_ZCYCLES 262800 // 275251 broken, see Dai Makaimura\r
\r
#define timers_cycle() \\r
if (timer_a_next_oflow > 0 && timer_a_next_oflow < TIMER_NO_OFLOW) \\r
\r
#define timers_reset() \\r
timer_a_next_oflow = timer_b_next_oflow = TIMER_NO_OFLOW; \\r
- timer_a_step = timer_a_offset = 16495 * 1024; \\r
- timer_b_step = timer_b_offset = 263912 * 256;\r
+ timer_a_step = timer_a_offset = TIMER_A_TICK_ZCYCLES * 1024; \\r
+ timer_b_step = timer_b_offset = TIMER_B_TICK_ZCYCLES * 256;\r
\r
\r
// VideoPort.c\r
}
}
+void YM2612PicoStateSave2_940(int tat, int tbt)
+{
+ YM2612PicoStateSave2(tat, tbt);
+}
+
+int YM2612PicoStateLoad2_940(int *tat, int *tbt)
+{
+ return YM2612PicoStateLoad2(tat, tbt);
+}
+
void sharedmem_init(void)
{