diff options
author | Mike Pavone <pavone@retrodev.com> | 2013-06-17 19:34:47 -0700 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2013-06-17 19:34:47 -0700 |
commit | 58c629c1f383be5094587ac57a5187387ad0270d (patch) | |
tree | f5b954606444fc38084fa82a3a6b911477d2fcc9 /vgmplay.c | |
parent | d2d71ada1e127eb06bdc8987ede5ab874c28b079 (diff) |
Process events in vgm player so that quitting works
Diffstat (limited to 'vgmplay.c')
-rw-r--r-- | vgmplay.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -72,16 +72,19 @@ void handle_keyup(int keycode) { } +#define CYCLE_LIMIT MCLKS_NTSC/60 + void wait(ym2612_context * y_context, psg_context * p_context, uint32_t * current_cycle, uint32_t cycles) { *current_cycle += cycles; psg_run(p_context, *current_cycle); ym_run(y_context, *current_cycle); - if (*current_cycle > 0x1FFFFFFF) { - *current_cycle -= 0x1FFFFFFF; - p_context->cycles -= 0x1FFFFFFF; - y_context->current_cycle -= 0x1FFFFFFF; + if (*current_cycle > CYCLE_LIMIT) { + *current_cycle -= CYCLE_LIMIT; + p_context->cycles -= CYCLE_LIMIT; + y_context->current_cycle -= CYCLE_LIMIT; + process_events(); } } |