DUMP = r"C:/Users/vikto/Documents/Claude/rt-4d/radio-spi-dump.bin"
with open(DUMP, "rb") as f:
    cal = f.read(0x1000)
base=0x20; REC=0x70
# records 15..35 content
allzero=True
for idx in range(15,36):
    off=base+idx*REC
    seg=cal[off:min(off+REC,0x1000)]
    if any(b!=0 for b in seg):
        allzero=False
        print("rec",idx,"nonzero")
print("records 15..35 all zero:", allzero)
# leftover tail
print("bytes 0xfe0..0xfff:", " ".join(f"{b:02x}" for b in cal[0xfe0:0x1000]))
# Where does last record 35 end? base+36*0x70 = 0x20+0xfc0 = 0xfe0. leftover 0xfe0..0xfff = 32 bytes
# check those 32 tail bytes
print("tail region 0xfe0-0xfff nonzero:", any(b!=0 for b in cal[0xfe0:0x1000]))

# Confirm const block identical across all 15 records
MARK=bytes.fromhex("12e234402a4fb3")
ok=True
for idx in range(15):
    off=base+idx*REC
    if cal[off+2:off+9]!=MARK or cal[off+9:off+16]!=MARK:
        ok=False
print("const A&B identical in all 15 recs:", ok)

# tag bytes across records
print("tags:", [cal[base+i*REC] for i in range(15)])
print("flags:", [cal[base+i*REC+1] for i in range(15)])
