diff cdd_mcu.c @ 2130:28b6453cf7e3

Emulate CDC sync detection and sync insertion rather than relying on external knowledge about sector offset
author Michael Pavone <pavone@retrodev.com>
date Tue, 15 Mar 2022 08:58:04 -0700
parents ad346054ca78
children 11a3d5b00a66
line wrap: on
line diff
--- a/cdd_mcu.c	Sun Mar 13 11:49:07 2022 -0700
+++ b/cdd_mcu.c	Tue Mar 15 08:58:04 2022 -0700
@@ -543,6 +543,7 @@
 		for (; context->cycle < cd_cycle; context->cycle += CDD_MCU_DIVIDER) {
 			if (context->cycle >= context->next_byte_cycle) {
 				cdd_fader_data(fader, 0);
+				lc8951_write_byte(cdc, cd_block_to_mclks(context->cycle), 0, 0);
 				context->next_byte_cycle += BYTE_CLOCKS;
 			}
 		}
@@ -631,6 +632,7 @@
 				lc8951_write_byte(cdc, cd_block_to_mclks(context->cycle), context->current_sector_byte++, byte);
 				cdd_fader_data(fader, gate_array[GAO_CDD_CTRL] & BIT_MUTE ? 0 : byte);
 			} else {
+				lc8951_write_byte(cdc, cd_block_to_mclks(context->cycle), 0, 0);
 				cdd_fader_data(fader, 0);
 				if (context->current_sector_byte >= 0) {
 					next_subcode += BYTE_CLOCKS;