aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-29 20:11:28 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-29 20:11:28 -0400
commit0b8fd380a61805445f1ef25157aa80e22c8e5493 (patch)
tree55e8223e3d3293a24ff560506946731e08a44ae0
parent550356009c9eadf3c3718d885e6e5dde6c0e1bb9 (diff)
downloadbw-atari8-tools-0b8fd380a61805445f1ef25157aa80e22c8e5493.tar.gz
xexcat: detect DOS 1.0 files (and abort).
-rw-r--r--TODO5
-rw-r--r--xexcat.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/TODO b/TODO
index d656b9a..eb90d06 100644
--- a/TODO
+++ b/TODO
@@ -2,8 +2,9 @@ for now:
These may need library (xex.c) changes:
xexcat: handle run/init addresses embedded in a segment longer than
2 bytes.
-xexcat: handle or at least detect DOS 1.0 executables. currently
- xex_fread_seg_header() will warn about them, but that's all.
+xexcat: handle or at least detect DOS 1.0 executables as
+ input. currently xex_fread_seg_header() will warn about them, but that's
+ all.
xexcat: warn if an an init address occurs before the code it
references. or at least if it occurs before *any* code!
diff --git a/xexcat.c b/xexcat.c
index 3ec45c7..1b4ee01 100644
--- a/xexcat.c
+++ b/xexcat.c
@@ -237,6 +237,14 @@ int main(int argc, char **argv) {
/* normalize the $FFFF headers: only the first segment needs one.
though if the output is DOS 1.0, it's $0984 instead. */
if(count == 1) {
+ if(!seg.has_ff_header) {
+ if(seg.start_addr == 0x0984) {
+ fprintf(stderr,
+ SELF ": %s: can't handle DOS 1.0 executables as input\n"
+ " Convert this file to a regular .xex with xex1to2.\n",
+ infile);
+ }
+ }
if(dos1_output) {
seg.has_ff_header = 0;
fputc(0x84, out);