//ym2612.OPN.ST.TAC = (1024-TAnew)*18;\r
//ym2612.OPN.ST.TAT = 0;\r
//\r
- timer_a_step = timer_a_offset = 16495 * (1024 - TAnew);\r
+ timer_a_step = timer_a_offset = 16466 * (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.TBC = (256-d)<<4;\r
//ym2612.OPN.ST.TBC *= 18;\r
//ym2612.OPN.ST.TBT = 0;\r
- timer_b_step = timer_b_offset = 263912 * (256 - d);\r
+ timer_b_step = timer_b_offset = 262840 * (256 - d); // 262881\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
return ym2612.OPN.ST.status;\r
}\r
\r
-// TODO: new ym2612 savestates\r
+// TODO: new ym2612 savestates, also save timers\r
void ym2612_unpack_state(void)\r
{\r
int i;\r
// sync z80
if (Pico.m.z80Run && (PicoOpt&POPT_EN_Z80))
- PicoSyncZ80(SekCycleCnt);
+ PicoSyncZ80(Pico.m.pal ? 151809 : 127671); // cycles adjusted for convertor
if (PsndOut && ym2612.dacen && PsndDacLine <= lines-1)
PsndDoDAC(lines-1);
}
#undef PAD_DELAY
-#undef Z80_RUN
#undef CPUS_RUN