Skip to content

Commit 17d1d15

Browse files
author
Federico Berti
committed
fix compile error
1 parent e7d935a commit 17d1d15

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

src/main/java/mcd/cdd/Cdd.java

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public interface Cdd extends BufferUtil.StepDevice {
2929
//status, command registers
3030
int CDD_REG_NUM = 10;
3131

32+
int PREGAP_LEN_LBA = 150;
33+
34+
int LBA_READAHEAD_LEN = 3;
35+
3236
enum CddStatus {
3337
Stopped, //0, motor disabled
3438
Playing, //1, data or audio playback in progress
@@ -66,15 +70,15 @@ enum CddCommand {
6670
}
6771

6872
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
7882
}
7983

8084
enum CddControl_DM_bit {MUSIC_0, DATA_1}
@@ -155,4 +159,12 @@ public String toString() {
155159
static Cdd createInstance(MegaCdMemoryContext memoryContext, McdSubInterruptHandler ih, Cdc cdc) {
156160
return new CddImpl(memoryContext, ih, cdc);
157161
}
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+
}
158170
}

0 commit comments

Comments
 (0)