diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-15 15:45:22 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-15 15:45:22 -0400 |
commit | aa7c742ae667c8f827256e097a6c5b9c9bf20483 (patch) | |
tree | aa1c955cde26d908b85f377c6321d68b5cf2edd6 | |
parent | 4b72993e746bc654178ba80b66ed6a1f854210e1 (diff) | |
download | bw-atari8-tools-aa7c742ae667c8f827256e097a6c5b9c9bf20483.tar.gz |
bas.c: handle weirdness when VNTP > $100 (e.g. SPIDER.TB).
-rw-r--r-- | bas.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -103,6 +103,8 @@ void dump_header_vars(void) { } void parse_header(void) { + int vntp_offset; + lomem = getword(0); vntp = getword(2); vntd = getword(4); @@ -110,11 +112,20 @@ void parse_header(void) { stmtab = getword(8); stmcur = getword(10); starp = getword(12); + codestart = stmtab - TBL_OFFSET - (vntp - 256); vnstart = vntp - TBL_OFFSET; vvstart = vvtp - TBL_OFFSET; code_end = starp - TBL_OFFSET; + if(vnstart > 0x0e) { + if(verbose) + fprintf(stderr, "VNTP is $%02x (not ($100), adjusting pointers.\n", vntp); + vntp_offset = vnstart - 0x0e; + vnstart -= vntp_offset; + vvstart -= vntp_offset; + } + if(filelen < code_end) { fprintf(stderr, "Warning: file is truncated: %d bytes, should be %d.\n", filelen, code_end); } |