{
uint8_t header[64];
uint32_t adrs[(64/3)+1] = { 0 };
- uint8_t last_cs = 0;
+ uint8_t cs2 = 0;
int fd;
int r;
int i;
uint32_t adr;
lo = header[i];
- if ((header[i+2] & 0xf8) & 0x40) {
+ hi = header[i+1] & 0x1f;
+
+ //!EOF ?!
+ if ((header[i+2] & 0xf8) != 0xf8)
+ cs2 = header[i+2] & 0xf8;
+
+ if (cs2 & 0x40) {
cs = ((header[i+1] & 0xe0) >> 5) - 2;
} else {
cs = (((header[i+1] & 0xe0) >> 5) | (1 << 3)) - 4;
}
- //EOF?!
- if ((header[i+2] & 0xf8) == 0xf8)
- cs = last_cs;
- else
- last_cs = cs;
-
- hi = header[i+1] & 0x1f;
amp = header[i+2] & 0x3;
adr = ((hi << 8) | lo) + (cs * 8192);