Mercurial > repos > blastem
comparison blastem.c @ 362:b7c3facee762
YM2612 WIP update
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 27 May 2013 22:19:11 -0700 |
parents | 9498cfa7f7c8 |
children | 62177cc39049 |
comparison
equal
deleted
inserted
replaced
361:946ae3749260 | 362:b7c3facee762 |
---|---|
196 z80_context * z_context = gen->z80; | 196 z80_context * z_context = gen->z80; |
197 uint32_t mclks = context->current_cycle * MCLKS_PER_68K; | 197 uint32_t mclks = context->current_cycle * MCLKS_PER_68K; |
198 sync_z80(z_context, mclks); | 198 sync_z80(z_context, mclks); |
199 if (mclks >= mclks_per_frame) { | 199 if (mclks >= mclks_per_frame) { |
200 ym_run(gen->ym, context->current_cycle); | 200 ym_run(gen->ym, context->current_cycle); |
201 gen->ym->current_cycle -= mclks_per_frame/MCLKS_PER_68K; | 201 gen->ym->current_cycle -= ((mclks_per_frame/MCLKS_PER_68K) / 6) * 6; |
202 //printf("reached frame end | 68K Cycles: %d, MCLK Cycles: %d\n", context->current_cycle, mclks); | 202 //printf("reached frame end | 68K Cycles: %d, MCLK Cycles: %d\n", context->current_cycle, mclks); |
203 vdp_run_context(v_context, mclks_per_frame); | 203 vdp_run_context(v_context, mclks_per_frame); |
204 psg_run(gen->psg, mclks/MCLKS_PER_PSG); | 204 psg_run(gen->psg, mclks/MCLKS_PER_PSG); |
205 gen->psg->cycles -= mclks_per_frame/MCLKS_PER_PSG; | 205 gen->psg->cycles -= mclks_per_frame/MCLKS_PER_PSG; |
206 if (!headless) { | 206 if (!headless) { |