annotate notes/cdd_mcu_notes.txt @ 2496:187bc857a76a default tip

Fix bug in MED mapper protection bit implementation
author Michael Pavone <pavone@retrodev.com>
date Sun, 28 Apr 2024 23:33:11 -0700
parents f1c2415f4d1d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2060
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 CD Block Clock: 16.9344 MHz
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 MCU Clock divider: 2.1168 MHz (cd clock / 8)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 State at Reset:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 Status buffer is filled with zero
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 Mechanism is reset
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7 Emulation state set to ES_CLOSING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 HSCK active low
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 IRQ active high
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11 CDCK active high
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 Main Loop:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 wait for subcode data for next frame
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 seems to be delivered via a "bank" IRQ
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 if servo is not in PLAY state
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17 set DOUT and EMP to inactive
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 set MUTE to active
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 elif Q subcode CRC is not valid
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20 set MUTE to active
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
21 elif Q subcode CONTROL field indicates a DATA track
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
22 set DOUT and MUTE to active
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
23 set EMP to inactive
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
24 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
25 set DOUT and MUTE to inactive
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
26 set EMP based on emphasis bit in Q subcode CONTROL field
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
27 run drive emulation state machine
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
28 if we received a valid command last loop
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
29 populate status buffer based on request format (see table below)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
30 if drive error status is valid
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
31 override status format (2nd nibble) to RF_NOTREADY
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
32 put error status in STATUS (1st nibble) of status buffer
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
33 set error status valid to false
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
34 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
35 put drive status in STATUS (1st nibble) of status buffer
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
36 Communication with Host via gate array:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
37 goes to fail state if HSCK is active (i.e. low)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
38 IRQ line is asserted
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
39 Waits ~2ms (4234 cycles) for HSCK to go active (i.e lo)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
40 on timeout, resets outputs to host to inactive and quits comms this loop
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
41 deasserts irq
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
42 Sends 10 status nibbles
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
43 nibbles are inverted
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
44 HSCK is handshake from host
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
45 CDCK is handshake frm MCU
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
46 minimum 77 cycles per nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
47
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
48 HSCK 1 (inactive) -> 0 (active)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
49 nibble output
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
50 CDCK 0 (inactive) ->1 (active)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
51 HSCK 0->1
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
52 CDCK 1->0
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
53 sets status sent flag
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
54 Gets 10 command nibbles
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
55 HSCK 1->0
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
56 nibble input
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
57 CDCK 0->1
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
58 HSCK 0->1
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
59 CDCK 1->0
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
60 Entire status/command transfer has timeout of ~3ms (6351 cycles)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
61 on timeout, resets outputs to host to inactive and quits comms this loop
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
62 sets command received flag
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
63 Checksum of command is checked
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
64 if bad, resets outputs to host to inactive and quits comms this loop
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
65 set command valid flag
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
66 resets outputs to host to inactive
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
67 Runs command from host
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
68 Generally comms failures cause it to just run a Nop command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
69 checksum failures cause drive error status to be set to STATUS_SUMERROR
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
70 command is specified by first 2 nibbles of command packet
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
71 second nibble must be zero or command is invalid
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
72 first nibble must be < 0xE and != 0x5 or command is invalid
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
73 command is sent to PC
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
74 command implementation is run
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
75
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
76
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
77 format Absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
78 if Q subcode CRC is bad OR Q subcode Control ADR mode is not 1 or Q subcode tracknum indicates leadin
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
79 set status format (2nd nibble) to RF_NOTREADY
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
80 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
81 store Absolute (RF_A == 0) in status format (2nd nibble)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
82 copy ATIME in BCD format from Q subcode buffer to 3rd through 8th nibble (inclusive)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
83 store flags in 9th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
84 these seem to correspond to the data, emphasis and mute control bits sent to CD hardware
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
85 format Relative
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
86 if Q subcode CRC is bad OR Q subcode Control ADR mode is not 1 or Q subcode tracknum indicates leadin
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
87 set status format (2nd nibble) to RF_NOTREADY
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
88 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
89 store Relative (RF_R == 1) in status format (2nd nibble)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
90 copy relative track TIME in BCD format from Q subcode buffer to 3rd through 8th nibble (inclusive)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
91 store flags in 9th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
92 these seem to correspond to the data, emphasis and mute control bits sent to CD hardware
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
93 format Track
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
94 if Q subcode CRC is bad OR Q subcode Control ADR mode is not 1 or Q subcode tracknum indicates leadin
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
95 set status format (2nd nibble) to RF_NOTREADY
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
96 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
97 store Track (RF_T == 2) in status format (2nd nibble)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
98 copy track number to 3rd and 4th status buffer nibbles
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
99 copy Q subcode CONTROL field to 5th status buffer nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
100 copy Q subcode ADR field to 6th status buffer nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
101 store flags in 9th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
102 these seem to correspond to the data, emphasis and mute control bits sent to CD hardware
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
103 format TOCO
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
104 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
105 set status format (2nd nibble) to RF_NOTREADY
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
106 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
107 set status format (2nd nibble) to RF_TOCO(3)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
108 copy leadout start in MM:SS:FF format (BCD) to 3rd through 8th nibble (inclusive)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
109 store flags in 9th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
110 these seem to correspond to the data, emphasis and mute control bits sent to CD hardware
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
111 format TOCT
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
112 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
113 set status format (2nd nibble) to RF_NOTREADY
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
114 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
115 set status format (2nd nibble) to RF_TOCT(4)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
116 copy first track number in BCD format to 3rd and 4th nibbles
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
117 copy last track number in BCD format to 5th and 6th nibbles
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
118 copy TOCTVERSION(0) in BCD format to 7th and 8th nibbles
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
119 store flags in 9th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
120 these seem to correspond to the data, emphasis and mute control bits sent to CD hardware
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
121 format TOCN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
122 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
123 set status format (2nd nibble) to RF_NOTREADY
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
124 store flags in 9th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
125 these seem to correspond to the data, emphasis and mute control bits sent to CD hardware
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
126 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
127 set status format (2nd nibble) to RF_TOCN(5)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
128 if requested trac is not valid
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
129 set status format (2nd nibble) to RF_NOTREADY(F)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
130 store flags in 9th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
131 these seem to correspond to the data, emphasis and mute control bits sent to CD hardware
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
132 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
133 copy track start time in MM:SS:FF format (BCD) to 3rd through 8th nibble (includisve)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
134 if track is a data track, force MSB of frame to 1
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
135 notably, since frame numbers sould be <75 this bit would always be zero otherwise
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
136 store low nibble of BCD track number in 8th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
137 format Error
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
138 set status format (2nd nibble) to RF_E(6)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
139 error number is placed in 3rd nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
140 note emulator always writes 0
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
141 store flags in 9th nibble
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
142 these seem to correspond to the data, emphasis and mute control bits sent to CD hardware
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
143
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
144 state Stopping:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
145 if servo is in STOP status
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
146 if disc is known present or disc status is unknown
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
147 set drive status to STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
148 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
149 set drive status to NODISC
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
150 state TOCing:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
151 if servo is in STOP status
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
152 if focus is in NOTFOCUSING status
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
153 set haveDisc to FALSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
154 set haveDiscValid to TRUE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
155 set drive status to NODISC
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
156 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
157 do nothing this tick
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
158 elif haveDisc is FALSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
159 do nothing this tick (comments suggest this is an abnormal situation)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
160 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
161 set drive status to TOCREAD
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
162 if servo is NOT in PLAY status
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
163 stop here
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
164 if haveTOCValid is FALSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
165 process current Q subcode data for TOC entry (see GetTOC)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
166 if TOC reading is done
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
167 set haveTOCValid to true
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
168 SEEK command is set to mechanism for PBA of program area start
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
169 stop until next tick
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
170 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
171 stop until next tick
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
172 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
173 if havePAValid is TRUE (comments say this isn't supposed to happen)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
174 PAUSE command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
175 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
176 check Q subcode data to see if we have found the start of the Program Area
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
177 if we have
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
178 set havePAValid to TRUE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
179 SEEK command for start of first track is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
180 PAUSE command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
181 else if current block Q subcode is invalid or not Mode 1
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
182 SEEK to next block
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
183 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
184 SEEK forward 250 blocks
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
185 state Reading:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
186 state Seeking:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
187 state Pausing:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
188 state Playing:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
189 state Cuing:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
190 These 5 states share a common implementation
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
191 if servo status is STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
192 do nothing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
193 elif servo status is SEEK
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
194 if mechanism error status is NOERROR
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
195 set drive status to SEEK
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
196 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
197 STOP command sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
198 emulation state set to STOPPING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
199 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
200 if servo status is PAUSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
201 if drive status is NOT DISCEND
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
202 set drive status to PAUSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
203 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
204 if Q subcode CRC is bad OR Q Control ADR is not mode 1 OR Q subcode tracknum is not lead out
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
205 set drive status to PLAY
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
206 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
207 PAUSE command sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
208 set drive status to DISCEND
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
209
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
210 state FWDing:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
211 if servo status is STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
212 do nothing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
213 elif servo status is SEEK
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
214 if mechanism error status is NOERROR
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
215 set drive status to SCAN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
216 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
217 STOP command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
218 emulation state is set to STOPPING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
219 elif servo status is PAUSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
220 set drive status to DISCEND
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
221 else:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
222 set drive status to SCAN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
223 if Q subcode CRC is valid AND Q Control ADR is mode 1
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
224 if Q subcode tracknum indicates leadout
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
225 PAUSE command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
226 set drive status to DISCEND
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
227 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
228 if scanClock is 0
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
229 get ATIME from current Q subcode block
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
230 turn it into an LBA, then PBA
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
231 Add 100 to it
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
232 SEEK command sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
233 reset scanClock to SCANPLAYTIME(10)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
234 state RVSing:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
235 if servo status is STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
236 do nothing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
237 elif servo status is SEEK
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
238 if mechanism error status is NOERROR
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
239 set drive status to SCAN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
240 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
241 STOP command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
242 emulation state is set to STOPPING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
243 elif servo status is PAUSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
244 do nothing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
245 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
246 set drive status to SCAN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
247 if Q subcode CRC is valid AND Q Control ADR is mode 1
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
248 if Q subcode tracknum indcates we're in the leadin area
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
249 SEEK command is sent to mechanism for beginning of first track
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
250 PLAY command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
251 Set emulation state to PLAYING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
252 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
253 if scanClock is 0
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
254 get ATIME from current Q subcode block
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
255 turn it into an LBA, then PBA
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
256 subtract 140 from it
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
257 SEEK command sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
258 reset scanClock to SCANPLAYTIME(10)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
259 state Skipping:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
260 if servo status is STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
261 do nothing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
262 elif servo status is SEEK
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
263 if mechanism error status is NOERROR
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
264 set drive status to TRACKING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
265 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
266 STOP command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
267 emulation state is set to STOPPING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
268 elif servo status is PAUSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
269 set drive status to PAUSE
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
270 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
271 PAUSE command sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
272 state DoorClosing:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
273 if door state is CLOSING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
274 set drive status to TRAYMOVING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
275 elif door state is CLOSED
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
276 set drive status to STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
277 set request format to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
278 set emulation state to CLOSED
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
279 state DoorClosed:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
280 do nothing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
281 state DoorOpening:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
282 if door state is OPENING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
283 set drive status to TRAYMOVING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
284 elif door state is OPEN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
285 set drive status to DOOROPEN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
286 set emulation state to OPEN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
287 state DoorOpen:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
288 if door status is NOT one of OPEN or OPENING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
289 set emulation state to CLOSING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
290
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
291 command Nop
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
292 command Stop
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
293 set request format to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
294 if drive status is not DOOROPEN and status is notTRAYMOVING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
295 send stop command to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
296 set emulation state to ES_STOPPING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
297 command Report Request
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
298 4th nibble specifies request type
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
299 RF_A(0)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
300 set absolute time format
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
301 RF_R(1)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
302 set relative time format
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
303 RF_T(2)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
304 request current track info
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
305 RF_TOCO(3)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
306 request disc completion time
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
307 will be ignored if disc has not been validated yet
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
308 drive error status will be set to COMMANDERROR
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
309 request format will be set back to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
310 RF_TOCT(4)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
311 request start/end tracks on disc
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
312 if disc is validated and drive is stopped
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
313 will seek to start of disc and pause there
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
314 emulation state set to TOCing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
315 if disc is validated and drive is not stopped
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
316 only request format is changed
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
317 else
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
318 prepares memory state for TOC read
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
319 will seek to start of disc and tell mechanism to play
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
320 emulation state set to TOCing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
321 RF_TOCN(5)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
322 request start time of track N
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
323 if drivestatus is DOOROPEN, TRAYMOVING or STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
324 command will be ignore dand drive error status will be set to COMMANDERROR
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
325 request format will be set back to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
326 requested track number is in the 5th and 6th nibbles in BCD format
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
327 SEEK command sent to mechanism for start of disc
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
328 PAUSE command sent to mechansim
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
329 emulation state set to TOCing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
330 RF_E(6)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
331 request error info
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
332
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
333 command Read
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
334 if drive status is DOOROPEN or TRAYMOVING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
335 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
336 check request format, if it's TOCT or TOCN, force it to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
337 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
338 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
339 location specified in MM:SS:FF format (BCD) in the 3rd through 8th nibbles (inclusive)
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
340 location is converted to an LBA
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
341 if location >= leadout start
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
342 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
343 program area offset is added to location to convert it to a physical block address
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
344 PBA is adjusted back 4
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
345 SEEK command is sent to mechanism for adjusted PBA
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
346 PLAY command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
347 Emulation state set to Reading
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
348 command Seek
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
349 Same as Read, except sends Pause instead of Play for second command to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
350 Emulation state set to Seeking
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
351 command Pause
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
352 if drive status is DOOROPEN or TRAYMOVING or SCAN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
353 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
354 check request format, if it's TOCT or TOCN, force it to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
355 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
356 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
357 if drive status is STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
358 calculates PBA of first track from TOC
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
359 PBA is NOT adjusted back
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
360 send SEEK command to mechanism for calculated PBA
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
361 send PAUSE to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
362 set emulation state to Pausing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
363 command Play
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
364 if drive status is DOOROPEN or TRAYMOVING or DISCEND or DISCIN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
365 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
366 check request format, if it's TOCT or TOCN, force it to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
367 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
368 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
369 if drive status is TOCREAD or STOP
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
370 calculates PBA of first track from TOC
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
371 PBA is adjusted back by 4
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
372 SEEK command is sent to mechanism for adjusted PBA
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
373 send PLAY command to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
374 set emulation state to Playing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
375 command Fwd
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
376 if drive status is NOT one of PLAY, PAUSE or DISCIN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
377 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
378 check request format, if it's TOCT or TOCN, force it to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
379 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
380 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
381 Send PLAY command to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
382 Emulation state set to Fwding
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
383 scanClock is set to SCANPLAYTIME(10)??
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
384 command Rvs
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
385 if drive status is NOT one of PLAY, PAUSE or DISCEND
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
386 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
387 check request format, if it's TOCT or TOCN, force it to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
388 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
389 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
390 Send PLAY command to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
391 Emulation state set to Rvsing
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
392 command TrackSkip
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
393 if drive status is NOT one of PLAY, PAUSE or DISCEND
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
394 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
395 check request format, if it's TOCT or TOCN, force it to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
396 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
397 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
398 direction to skip is in 4th nibble of command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
399 number of tracks to skip is a 16-bit value in the 5th-8th nibbles
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
400 note tese are physical tracks i.e. loops of the spiral
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
401 SKIP command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
402 PAUSE command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
403 emulation state is set to TSkping
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
404 command TrackCue
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
405 if drive status is NOT one of STOP, PLAY, PAUSE, DISCEND, DISCIN or TOCREAD
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
406 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
407 if drive status is TOCREAD
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
408 check request format, if it's TOCT or TOCN, force it to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
409 if disc is not validated
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
410 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
411 track number is in nibbles 3 and 4 in BCD format
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
412 calculates PBA of requested track from TOC
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
413 Sends SEEK command to mechanism for calculated PBA
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
414 if drive status at start of command was STOP, DISCEND or DISCIN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
415 send PLAY command to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
416 emulation state is set to CUING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
417 command DoorClose
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
418 if drive status is NOT one of DOOROPEN or TRAYMOVING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
419 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
420 CLOSE command is set to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
421 emulation state is set to CLOSING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
422 command DoorOpen
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
423 if drive status is DOOROPEN
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
424 set drive error status to COMMANDERROR and stop processing command
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
425 if drive servo is not stopped:
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
426 set request format to absolute
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
427 OPEN command is sent to mechanism
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
428 emulation state set to OPENING
f1c2415f4d1d Move old notes into a subdir and add CDD MCU notes
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
429 disc, TOC and program area validitly flags are cleared