From: Michael Gernoth Date: Sat, 5 Sep 2020 20:28:17 +0000 (+0200) Subject: print cs2 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/32620_extract/commitdiff_plain/59ab6a09d9fa36d29c6a992e4f6f91a807c25b99?hp=948342d1e4a54233400226fbafd1e7584a5affa4 print cs2 --- diff --git a/extract.c b/extract.c index 0e8699c..1c5a41c 100644 --- a/extract.c +++ b/extract.c @@ -62,9 +62,9 @@ int main(int argc, char **argv) * * 00000000 01000000 01000011 10110111 01001010 01000011 11000011 01011000 * ^^^^^^^^ ^^^^^^^^ ^^^^^^^^| | - * LIIIIIII LIILIIII I????LII - * I I I I +-- Amplification (Default: 3) - * I I I +--------- Remaining chip select line? (but not quite?) + * LIIIIIII LIILIIII LIIIILII + * I I I | +-- Amplification (Default: 3) + * I I I +----- Chip/Module Select lines/EOF? * I I +----------- Address (HI Byte) * I +---------------- Chip Select lines A15, A14, A13 * +-------------------- Address (LO Byte) @@ -78,9 +78,9 @@ int main(int argc, char **argv) //!EOF ?! if ((header[i+2] & 0xf8) != 0xf8) - cs2 = header[i+2] & 0xf8; + cs2 = (header[i+2] & 0xf8) >> 3; - if (cs2 & 0x40) { + if (cs2 & 0x08) { cs = ((header[i+1] & 0xe0) >> 5) - 2; } else { cs = (((header[i+1] & 0xe0) >> 5) | (1 << 3)) - 4; @@ -92,8 +92,8 @@ int main(int argc, char **argv) if (adr == 0) adr += sizeof(header); - printf("%02d. hi: 0x%02x, lo: 0x%02x, cs: 0x%02x -> adr: 0x%04x; amp: 0x%02x\n", - i/3, hi, lo, cs, adr, amp); + 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); adrs[i/3] = adr; if ((header[i+2] & 0xf8) == 0xf8)