# HG changeset patch # User Mike Pavone # Date 1368517594 25200 # Node ID 4c91470e1a53cbd4771f3b6581a790ca30858ecf # Parent f16136a3835d1d3f9b4600f471de2503d59e5fc6 Only latch video mode at the very beginning of the frame to avoid problems with the cycle count getting out of sync with what I expect diff -r f16136a3835d -r 4c91470e1a53 vdp.c --- a/vdp.c Tue May 14 00:40:10 2013 -0700 +++ b/vdp.c Tue May 14 00:46:34 2013 -0700 @@ -1111,7 +1111,7 @@ { uint32_t line = context->cycles / MCLKS_LINE; uint32_t active_lines = context->latched_mode & BIT_PAL ? PAL_ACTIVE : NTSC_ACTIVE; - if (!line) { + if (!context->cycles) { latch_mode(context); } uint32_t linecyc = context->cycles % MCLKS_LINE;