# HG changeset patch # User Michael Pavone # Date 1643684754 28800 # Node ID 983f57d08eff052f53d2447d10c0a8d267bd922c # Parent c5323c02dde40cc214402e7d2e02a1755a57b530 Fix a couple of CDD bugs diff -r c5323c02dde4 -r 983f57d08eff cdd_mcu.c --- a/cdd_mcu.c Mon Jan 31 00:01:26 2022 -0800 +++ b/cdd_mcu.c Mon Jan 31 19:05:54 2022 -0800 @@ -486,11 +486,11 @@ context->cmd_recv_pending = 0; context->current_cmd_nibble = 0; gate_array[GAO_CDD_STATUS] |= BIT_DTS; - next_nibble = context->cycle + NIBBLE_CLOCKS; + next_cmd_nibble = context->cycle + NIBBLE_CLOCKS; } else { context->cmd_recv_wait = 1; - next_nibble = CYCLE_NEVER; } + next_nibble = CYCLE_NEVER; } else { uint8_t value = ((uint8_t *)&context->status_buffer)[context->current_status_nibble]; int ga_index = GAO_CDD_STATUS + (context->current_status_nibble >> 1); @@ -547,10 +547,11 @@ } lc8951_write_byte(cdc, cd_block_to_mclks(context->cycle), context->current_sector_byte++, byte); context->last_byte_cycle = context->cycle; - next_byte = context->cycle + BYTE_CLOCKS; if (context->current_sector_byte == 2352) { context->current_sector_byte = -1; - + next_byte = CYCLE_NEVER; + } else { + next_byte = context->cycle + BYTE_CLOCKS; } } }