Mercurial > repos > blastem
comparison vgmplay.c @ 409:c1bddeadc566
Process events in vgm player so that quitting works
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 17 Jun 2013 19:34:47 -0700 |
parents | a13a83934ba3 |
children | bc9e0829ffc7 |
comparison
equal
deleted
inserted
replaced
408:a13a83934ba3 | 409:c1bddeadc566 |
---|---|
70 | 70 |
71 void handle_keyup(int keycode) | 71 void handle_keyup(int keycode) |
72 { | 72 { |
73 } | 73 } |
74 | 74 |
75 #define CYCLE_LIMIT MCLKS_NTSC/60 | |
76 | |
75 void wait(ym2612_context * y_context, psg_context * p_context, uint32_t * current_cycle, uint32_t cycles) | 77 void wait(ym2612_context * y_context, psg_context * p_context, uint32_t * current_cycle, uint32_t cycles) |
76 { | 78 { |
77 *current_cycle += cycles; | 79 *current_cycle += cycles; |
78 psg_run(p_context, *current_cycle); | 80 psg_run(p_context, *current_cycle); |
79 ym_run(y_context, *current_cycle); | 81 ym_run(y_context, *current_cycle); |
80 | 82 |
81 if (*current_cycle > 0x1FFFFFFF) { | 83 if (*current_cycle > CYCLE_LIMIT) { |
82 *current_cycle -= 0x1FFFFFFF; | 84 *current_cycle -= CYCLE_LIMIT; |
83 p_context->cycles -= 0x1FFFFFFF; | 85 p_context->cycles -= CYCLE_LIMIT; |
84 y_context->current_cycle -= 0x1FFFFFFF; | 86 y_context->current_cycle -= CYCLE_LIMIT; |
87 process_events(); | |
85 } | 88 } |
86 } | 89 } |
87 | 90 |
88 int main(int argc, char ** argv) | 91 int main(int argc, char ** argv) |
89 { | 92 { |