Mercurial > repos > blastem
comparison vdp.c @ 334:4c91470e1a53
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
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 14 May 2013 00:46:34 -0700 |
parents | f16136a3835d |
children | f8c6f8684cd6 |
comparison
equal
deleted
inserted
replaced
333:f16136a3835d | 334:4c91470e1a53 |
---|---|
1109 { | 1109 { |
1110 while(context->cycles < target_cycles) | 1110 while(context->cycles < target_cycles) |
1111 { | 1111 { |
1112 uint32_t line = context->cycles / MCLKS_LINE; | 1112 uint32_t line = context->cycles / MCLKS_LINE; |
1113 uint32_t active_lines = context->latched_mode & BIT_PAL ? PAL_ACTIVE : NTSC_ACTIVE; | 1113 uint32_t active_lines = context->latched_mode & BIT_PAL ? PAL_ACTIVE : NTSC_ACTIVE; |
1114 if (!line) { | 1114 if (!context->cycles) { |
1115 latch_mode(context); | 1115 latch_mode(context); |
1116 } | 1116 } |
1117 uint32_t linecyc = context->cycles % MCLKS_LINE; | 1117 uint32_t linecyc = context->cycles % MCLKS_LINE; |
1118 if (linecyc == 0) { | 1118 if (linecyc == 0) { |
1119 if (line <= 1 || line >= active_lines) { | 1119 if (line <= 1 || line >= active_lines) { |