lo = header[i];
hi = header[i+1] & 0x1f;
- //!EOF ?!
+ // !EOF ?!
if ((header[i+2] & 0xf8) != 0xf8)
cs2 = (header[i+2] & 0xf8) >> 3;
- if (cs2 & 0x08) {
- cs = ((header[i+1] & 0xe0) >> 5) - 2;
- } else {
- cs = (((header[i+1] & 0xe0) >> 5) | (1 << 3)) - 4;
- }
+ cs = ((header[i+1] & 0xe0) >> 5) - 2;
+
+ // second module?
+ if ((cs2 & 0x08) == 0x00)
+ cs += 6; // 6 ROMs per module
amp = header[i+2] & 0x3;
if (adr == 0)
adr += sizeof(header);
- printf("%02d. hi: 0x%02x, lo: 0x%02x, cs: 0x%02x, cs2: 0x%02x -> adr: 0x%04x; amp: 0x%02x\n",
- i/3, hi, lo, cs, ((header[i+2] & 0xf8) >> 3), adr, amp);
+ printf("%02d. hi: 0x%02x, lo: 0x%02x, cs: 0x%02x, cs2: 0x%02x -> chip: 0x%02x, adr: 0x%04x; amp: 0x%02x\n",
+ i/3, hi, lo,
+ ((header[i+1] & 0xe0) >> 5),
+ ((header[i+2] & 0xf8) >> 3),
+ cs, adr, amp);
adrs[i/3] = adr;
if ((header[i+2] & 0xf8) == 0xf8)