Mercurial > repos > blastem
comparison blastem.c @ 458:848a3db9d0b0
Remove extra 68K/VDP cycle sync
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 08 Sep 2013 20:47:01 -0700 |
parents | b491df8bdbc0 |
children | a1d298119153 |
comparison
equal
deleted
inserted
replaced
457:6a315728fede | 458:848a3db9d0b0 |
---|---|
345 blocked = vdp_control_port_write(v_context, value); | 345 blocked = vdp_control_port_write(v_context, value); |
346 } else { | 346 } else { |
347 blocked = 0; | 347 blocked = 0; |
348 } | 348 } |
349 } | 349 } |
350 context->current_cycle = v_context->cycles / MCLKS_PER_68K; | |
351 } else { | 350 } else { |
352 adjust_int_cycle(context, v_context); | 351 adjust_int_cycle(context, v_context); |
353 } | 352 } |
354 } else { | 353 } else { |
355 printf("Illegal write to HV Counter port %X\n", vdp_port); | 354 printf("Illegal write to HV Counter port %X\n", vdp_port); |
356 exit(1); | 355 exit(1); |
357 } | 356 } |
358 if (v_context->cycles != before_cycle) { | 357 if (v_context->cycles != before_cycle) { |
359 //printf("68K paused for %d cycles at cycle %d\n", v_context->cycles / MCLKS_PER_68K - context->current_cycle, context->current_cycle); | 358 //printf("68K paused for %d (%d) cycles at cycle %d (%d)\n", v_context->cycles / MCLKS_PER_68K - context->current_cycle, v_context->cycles - before_cycle, context->current_cycle, before_cycle); |
360 context->current_cycle = v_context->cycles / MCLKS_PER_68K; | 359 context->current_cycle = v_context->cycles / MCLKS_PER_68K; |
361 } | 360 } |
362 } else if (vdp_port < 0x18) { | 361 } else if (vdp_port < 0x18) { |
363 genesis_context * gen = context->system; | 362 genesis_context * gen = context->system; |
364 sync_sound(gen, context->current_cycle * MCLKS_PER_68K); | 363 sync_sound(gen, context->current_cycle * MCLKS_PER_68K); |
418 value = vdp_control_port_read(v_context); | 417 value = vdp_control_port_read(v_context); |
419 } else { | 418 } else { |
420 value = vdp_hv_counter_read(v_context); | 419 value = vdp_hv_counter_read(v_context); |
421 //printf("HV Counter: %X at cycle %d\n", value, v_context->cycles); | 420 //printf("HV Counter: %X at cycle %d\n", value, v_context->cycles); |
422 } | 421 } |
423 context->current_cycle = v_context->cycles/MCLKS_PER_68K; | |
424 } else { | 422 } else { |
425 printf("Illegal read from PSG or test register port %X\n", vdp_port); | 423 printf("Illegal read from PSG or test register port %X\n", vdp_port); |
426 exit(1); | 424 exit(1); |
427 } | 425 } |
428 return value; | 426 return value; |