From 10f07d4652cee36a792edf555f5c8bad2c6ca04d Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 16 Nov 2022 15:46:45 -0500 Subject: autorun.sys: make it work on Sparta 3.2 (even though it's not needed). --- autorun.s | 30 +++++++++++++++++++++++++++--- autorun.sys | Bin 1338 -> 1348 bytes dla.atr | Bin 92176 -> 92176 bytes 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/autorun.s b/autorun.s index dc0f5dd..8f75ac3 100644 --- a/autorun.s +++ b/autorun.s @@ -8,6 +8,25 @@ ; might support other DOSes someday... Or I could write my own xex ; file loader (rather not). +; SDX 4.41 manual says: XIO 40,#IOCB,4,X,"Dd:[path]fname.ext" where +; X=0 for load and execute (X=128 is load only, we don't want that). +; manual also says it works the same way in Sparta 3.2. + +; MyDOS 4.50 technical manual says XIO 39 and 40 are identical, and +; that AUX1 should be 4 to load & execute the program (AUX2 doesn't +; do anything). MyDOS 4.30 only documents 39, but I don't care about +; versions older than 4.50. + +; So for all 3 DOSes, XIO 40,#x,4,0,"filename" works... XXX: except it +; doesn't, quite. MyDOS and Sparta 3.2 can load & run both dla.xex and +; dla2csv.xex. SDX 4.42 will load & run dla2csv.xex, but fails with +; error 150 for dla.xex (error 150 is "path not found", no idea what's +; going on here). This autorun.sys only has to work on MyDOS, which +; it does... + +; Eventually I should send the cc65 devs a patch to implement exec() +; on MyDOS and Sparta. + .include "atari.inc" .include "xex.inc" @@ -117,7 +136,7 @@ keytabloop: ; load and run the file (Y is index into filename table) load_file: ldx #$10 ; IOCB #1 - lda #$28 ; MyDOS XIO 40. 39 also works (same thing?), neither works on SDX + lda #$28 ; MyDOS, Sparta 3.2, and SDX all support this XIO sta ICCOM,x lda fntab_l,y ; filename sta ICBAL,x @@ -127,6 +146,9 @@ load_file: sta ICBLL,x lda #0 sta ICBLH,x + sta ICAX2,x ; AUX1=0: On Sparta means "load & run", on MyDOS ignored. + lda #4 + sta ICAX1,x ; AUX2=4: On MyDOS means "load & run", on Sparta 4 is required. jsr CIOV ; pull the trigger ; CIOV should never return on success, so if we get here, give up. @@ -152,10 +174,12 @@ keyloop2: exit: rts -dla_filename: .byte "D:DLA.XEX" + ; SDX insists these must be D1:, not just D:. There's probably + ; a good reason... +dla_filename: .byte "D1:DLA.XEX" dla_fn_len = * - dla_filename -csv_filename: .byte "D:DLA2CSV.XEX" +csv_filename: .byte "D1:DLA2CSV.XEX" csv_fn_len = * - csv_filename ; these tables only have 2 entries, but could have many more if diff --git a/autorun.sys b/autorun.sys index ab38cae..f94eeb4 100644 Binary files a/autorun.sys and b/autorun.sys differ diff --git a/dla.atr b/dla.atr index d1b825b..5e57946 100644 Binary files a/dla.atr and b/dla.atr differ -- cgit v1.2.3