Mercurial > repos > blastem
comparison blastem.c @ 264:8fd6652e56f8
Fix a crash bug in instruction retranslation
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 01 May 2013 20:09:53 -0700 |
parents | 2989ed7b8608 |
children | c6d12878ea93 |
comparison
equal
deleted
inserted
replaced
263:2989ed7b8608 | 264:8fd6652e56f8 |
---|---|
148 while (z_context->current_cycle < z_context->sync_cycle) { | 148 while (z_context->current_cycle < z_context->sync_cycle) { |
149 if (z_context->iff1 && z_context->current_cycle < ZVINT_CYCLE) { | 149 if (z_context->iff1 && z_context->current_cycle < ZVINT_CYCLE) { |
150 z_context->int_cycle = ZVINT_CYCLE; | 150 z_context->int_cycle = ZVINT_CYCLE; |
151 } | 151 } |
152 z_context->target_cycle = z_context->sync_cycle < z_context->int_cycle ? z_context->sync_cycle : z_context->int_cycle; | 152 z_context->target_cycle = z_context->sync_cycle < z_context->int_cycle ? z_context->sync_cycle : z_context->int_cycle; |
153 printf("Running Z80 from cycle %d to cycle %d\n", z_context->current_cycle, z_context->sync_cycle); | |
154 printf("HL: %X, Native PC: %p\n", (z_context->regs[Z80_H] << 8) | z_context->regs[Z80_L], z_context->native_pc); | |
155 z80_run(z_context); | 153 z80_run(z_context); |
156 printf("Z80 returned at cycle %d\n", z_context->current_cycle); | |
157 } | 154 } |
158 } | 155 } |
159 if (mclks >= MCLKS_PER_FRAME) { | 156 if (mclks >= MCLKS_PER_FRAME) { |
160 //printf("reached frame end | 68K Cycles: %d, MCLK Cycles: %d\n", context->current_cycle, mclks); | 157 //printf("reached frame end | 68K Cycles: %d, MCLK Cycles: %d\n", context->current_cycle, mclks); |
161 vdp_run_context(v_context, MCLKS_PER_FRAME); | 158 vdp_run_context(v_context, MCLKS_PER_FRAME); |