diff cdd_mcu.h @ 2062:07ed42bd7b4c segacd

Some progress on CDC and CDD emulation. Now passes first 3 "CDC INIT" tests in mcd-verificator
author Michael Pavone <pavone@retrodev.com>
date Fri, 28 Jan 2022 00:50:17 -0800
parents 7c1760b5b3e5
children 91e4d2fe5cd9
line wrap: on
line diff
--- a/cdd_mcu.h	Thu Jan 27 00:33:41 2022 -0800
+++ b/cdd_mcu.h	Fri Jan 28 00:50:17 2022 -0800
@@ -1,7 +1,7 @@
 #ifndef CDD_MCU_H_
 #define CDD_MCU_H_
 #include "system.h"
-
+#include "lc8951.h"
 
 typedef enum {
 	SF_ABSOLUTE,
@@ -137,8 +137,10 @@
 	uint32_t      next_int_cycle; //this is in SCD MCLKS
 	uint32_t      last_subcode_cycle;
 	uint32_t      last_nibble_cycle;
+	uint32_t      last_byte_cycle;
 	int           current_status_nibble;
 	int           current_cmd_nibble;
+	int           current_sector_byte;
 	uint32_t      head_pba;
 	uint32_t      seek_pba;
 	cdd_status    status_buffer;
@@ -152,10 +154,11 @@
 	uint8_t       int_pending;
 	uint8_t       toc_valid;
 	uint8_t       seeking;
+	uint8_t       in_fake_pregap;
 } cdd_mcu;
 
 void cdd_mcu_init(cdd_mcu *context, system_media *media);
-void cdd_mcu_run(cdd_mcu *context, uint32_t cycle, uint16_t *gate_array);
+void cdd_mcu_run(cdd_mcu *context, uint32_t cycle, uint16_t *gate_array, lc8951* cdc);
 void cdd_hock_enabled(cdd_mcu *context);
 void cdd_hock_disabled(cdd_mcu *context);
 void cdd_mcu_start_cmd_recv(cdd_mcu *context, uint16_t *gate_array);