Hi Gerd
Patch attached to fix MdrSummary readHeaderLen, cope with different hdr
lengths more clearly and improve output.
I've found I can now split my old "City Navigator Europe NT" map and
look at the MDR, which includes sections 30/31, 32/33, 34, 37 & 38
codePage=1252 id1=18 id2=1 unk=0x0011 hdrLen=708
Compressed strings flag=0x
MDR 1 NR=265(000109) RS=4 magic=0x0002
2 NR=0 (00) RS=2 magic=0x
3 NR=0 (00) RS=2 magic=0x
4 NR=0 (00) RS=3 magic=0x
MDR 5 NR=633075 (09a8f3) RS=15 magic=0x3e51
MDR 6 NR=181613 (02c56d) RS=4 magic=0x0001
7 NR=0 (00) RS=9 magic=0x1ae2
8 DS=0 () magic=0x
MDR 9 NR=1 (01) RS=4 magic=0x
MDR 10 DS=1607528 (00188768) magic=0x
MDR 11 NR=401882 (0621da) RS=13 magic=0x0575
12 DS=0 () magic=0x
13 DS=0 () magic=0x
14 DS=0 () magic=0x
15 DS=0 () magic=0x
16 DS=0 () magic=0x
MDR 17 DS=2868654 (002bc5ae) magic=0x
18 DS=0 () magic=0x
19 DS=0 () magic=0x
MDR 20 DS=65810719 (03ec311f) magic=0x0006
21 DS=0 () magic=0x
MDR 22 NR=8006434(7a2b22) RS=9 magic=0x0004035e
23 NR=0 (00) RS=9 magic=0x
MDR 24 NR=15516 (003c9c) RS=7 magic=0x
MDR 25 NR=649642 (09e9aa) RS=3 magic=0x
26 DS=0 () magic=0x
27 DS=0 () magic=0x
28 NR=0 (00) RS=13 magic=0x
MDR 29 NR=1452 (0005ac) RS=20 magic=0x03f6
MDR 30 NR=637(00027d) RS=4 magic=0x
MDR 31 DS=3983 (0f8f) magic=0x
MDR 32 NR=566(000236) RS=4 magic=0x
MDR 33 DS=3039 (0bdf) magic=0x
MDR 34 NR=12 (0c) RS=3 magic=0x
35 NR=0 (00) RS=3 magic=0x
36 NR=0 (00) RS=4 magic=0x
MDR 37 NR=2194204(217b1c) RS=23 magic=0x
MDR 38 NR=17120 (0042e0) RS=40 magic=0x0033
39 NR=0 (00) RS=22 magic=0x
40 DS=0 () magic=0x
Ticker
Index: src/test/display/MdrSummary.java
===
--- src/test/display/MdrSummary.java (revision 611)
+++ src/test/display/MdrSummary.java (working copy)
@@ -33,8 +33,8 @@
private final boolean[] wanted = new boolean[NSECT];
protected void print() {
- reader.position(21);
-
+ readHeaderLen();
+
readHeader();
Section end = new Section("END OF FILE", filelen, 0);
@@ -93,15 +93,18 @@
private void printDetails() {
int number = 0;
for (Section s : sections) {
- if (s != null && s.getLen() > 0) {
-System.out.printf("MDR %-2d ", number);
+ if (s != null) {
+if (s.getLen() > 0)
+ System.out.printf("MDR %-2d ", number);
+else
+ System.out.printf("%-2d ", number);
if (s.getRecordSize() > 0)
- System.out.printf("NR=%-6d(%06x) RS=%-2d ",
+ System.out.printf("NR=%-7d(%06x) RS=%-2d ",
s.getNumberOfRecords(),
s.getNumberOfRecords(),
s.getRecordSize());
else
- System.out.printf("DS=%-9d(%08x) ", s.getLen(), s.getLen());
+ System.out.printf("DS=%-10d(%08x) ", s.getLen(), s.getLen());
System.out.printf("magic=0x%08x\n", s.getMagic());
}
@@ -114,7 +117,7 @@
int id1 = reader.get2u();
int id2 = reader.get2u();
int unk3 = reader.get2u();
- System.out.printf("codePage=%d id1=%d id2=%d unk=0x%04x\n", codePage, id1, id2, unk3);
+ System.out.printf("codePage=%d id1=%d id2=%d unk=0x%04x hdrLen=%d\n", codePage, id1, id2, unk3, getHeaderLen());
addSection(1, true, true);
addSection(2, true, true);
@@ -137,8 +140,7 @@
addSection(17, false, true);
addSection(18, true, true);
addSection(19, true, true);
- if (getHeaderLen() <= 286) // 0x011e
- return;
+ // seen headers stop here: 286 / 0x011e
addSection(20, true, true);
addSection(21, true, true);
addSection(22, true, true);
@@ -149,8 +151,7 @@
addSection(27, true, true);
addSection(28, true, true);
addSection(29, true, true);
- if (getHeaderLen() <= 426) // 0x01aa
- return;
+ // seen headers stop here: 426 / 0x01aa
addSection(30, true, true);
addSection(31, false, false);
addSection(32, true, true);
@@ -162,22 +163,21 @@
addSection(38, true, true);
addSection(39, true, true);
addSection(40, true, true);
- //if (getHeaderLen() <= 568) // 0x0238
- // return;
+ // seen headers stop here: 568 / 0x0238
// looks like three sections, two with 4 ints, one with 5 ints
- //if (getHeaderLen() <= 620) // 0x26c
- // return;
+ // seen headers stop here: 620 / 0x26c
// mostly zeros
- //if (getHeaderLen() <= 668) // 0x029c
- // return;
+ // seen headers stop here: 668 / 0x029c