@@ -29,6 +29,10 @@ public interface Cdd extends BufferUtil.StepDevice {
29
29
//status, command registers
30
30
int CDD_REG_NUM = 10 ;
31
31
32
+ int PREGAP_LEN_LBA = 150 ;
33
+
34
+ int LBA_READAHEAD_LEN = 3 ;
35
+
32
36
enum CddStatus {
33
37
Stopped , //0, motor disabled
34
38
Playing , //1, data or audio playback in progress
@@ -66,15 +70,15 @@ enum CddCommand {
66
70
}
67
71
68
72
enum CddRequest {
69
- AbsoluteTime ,
70
- RelativeTime ,
71
- TrackInformation ,
72
- DiscCompletionTime ,
73
- DiscTracks , //start/end track numbers
74
- TrackStartTime , //start time of specific track
75
- ErrorInformation ,
76
- SubcodeError ,
77
- NotReady , //not ready to comply with the current command
73
+ AbsoluteTime , //0
74
+ RelativeTime , //1
75
+ TrackInformation , //2
76
+ DiscCompletionTime , //3
77
+ DiscTracks , //4 start/end track numbers
78
+ TrackStartTime , //5 start time of specific track
79
+ ErrorInformation , //6
80
+ SubcodeError , //7
81
+ NotReady , //8 not ready to comply with the current command
78
82
}
79
83
80
84
enum CddControl_DM_bit {MUSIC_0 , DATA_1 }
@@ -155,4 +159,12 @@ public String toString() {
155
159
static Cdd createInstance (MegaCdMemoryContext memoryContext , McdSubInterruptHandler ih , Cdc cdc ) {
156
160
return new CddImpl (memoryContext , ih , cdc );
157
161
}
162
+
163
+ static int getCddChecksum (int [] vals ) {
164
+ int checksum = 0 ;
165
+ for (int i = 0 ; i < vals .length - 1 ; i ++) {
166
+ checksum += vals [i ];
167
+ }
168
+ return ~checksum & 0xF ;
169
+ }
158
170
}
0 commit comments