comparison segacd.c @ 2131:d90d92ce5cab

Improve CDC decode timing accuracy
author Michael Pavone <pavone@retrodev.com>
date Wed, 16 Mar 2022 00:16:36 -0700
parents 4c9e447aa25b
children 9caebcfeac72
comparison
equal deleted inserted replaced
2130:28b6453cf7e3 2131:d90d92ce5cab
500 context->target_cycle = context->sync_cycle < context->int_cycle ? context->sync_cycle : context->int_cycle; 500 context->target_cycle = context->sync_cycle < context->int_cycle ? context->sync_cycle : context->int_cycle;
501 if (context->target_cycle == cdc_cycle && context->int_num == 5) { 501 if (context->target_cycle == cdc_cycle && context->int_num == 5) {
502 uint32_t before = context->target_cycle - 2 * cd->cdc.clock_step; 502 uint32_t before = context->target_cycle - 2 * cd->cdc.clock_step;
503 if (before > context->current_cycle) { 503 if (before > context->current_cycle) {
504 context->target_cycle = context->sync_cycle = before; 504 context->target_cycle = context->sync_cycle = before;
505 } else {
506 before = context->target_cycle - cd->cdc.clock_step;
507 if (before > context->current_cycle) {
508 context->target_cycle = context->sync_cycle = before;
509 }
505 } 510 }
506 } 511 }
507 } 512 }
508 513
509 static uint16_t sub_gate_read16(uint32_t address, void *vcontext) 514 static uint16_t sub_gate_read16(uint32_t address, void *vcontext)