From 03cb0bd2fd010fdba9a653dfd4515e5d3570f0a9 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 24 May 2016 00:10:47 +0200 Subject: [PATCH 1/4] atari.inc: add XDOS defines and remove trailing whitespace --- asminc/atari.inc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/asminc/atari.inc b/asminc/atari.inc index 3cce03046..e6d165524 100644 --- a/asminc/atari.inc +++ b/asminc/atari.inc @@ -106,7 +106,7 @@ SIO_WRPERCOM = $4F ;write PERCOM block (XF551) SIO_WRITE = $50 ;write sector SIO_READ = $52 ;read sector SIO_STAT = $53 ;get status information -SIO_VERIFY = $56 ;verify sector +SIO_VERIFY = $56 ;verify sector SIO_WRITEV = $57 ;write sector with verify SIO_WRITETRK = $60 ;write track (Speedy) SIO_READTRK = $62 ;read track (Speedy) @@ -689,7 +689,7 @@ CASFLG = $030F ;CASSETTE MODE WHEN SET TIMER2 = $0310 ;2-byte final baud rate timer value TEMP1 = $0312 ;TEMPORARY STORAGE REGISTER ;TEMP2 = $0314 ;##old## TEMPORARY STORAGE REGISTER -TEMP2 = $0313 ;##1200xl## 1-byte temporary +TEMP2 = $0313 ;##1200xl## 1-byte temporary PTIMOT = $0314 ;##1200xl## 1-byte printer timeout TEMP3 = $0315 ;TEMPORARY STORAGE REGISTER SAVIO = $0316 ;SAVE SERIAL IN DATA PORT @@ -765,7 +765,7 @@ CART = $BFFC ;##rev2## 1-byte cartridge present indicator ;0=Cart Exists CARTFG = $BFFD ;##rev2## 1-byte cartridge flags ;D7 0=Not a Diagnostic Cart - ; 1=Is a Diagnostic cart and control is + ; 1=Is a Diagnostic cart and control is ; given to cart before any OS is init. ;D2 0=Init but Do not Start Cart ; 1=Init and Start Cart @@ -925,7 +925,7 @@ RADON = 0 ;INDICATES RADIANS DEGON = 6 ;INDICATES DEGREES ASCZER = '0' ;ASCII ZERO -COLON = $3A ;ASCII COLON +COLON = $3A ;ASCII COLON CR = $9B ;SYSTEM EOL (CARRIAGE RETURN) ;------------------------------------------------------------------------- @@ -1004,6 +1004,21 @@ MYDOS = 3 XDOS = 4 NODOS = 255 +;------------------------------------------------------------------------- +; XDOS defines (version 2.4, taken from xdos24.pdf) +;------------------------------------------------------------------------- + +XOPT = $70B ; XDOS options +XCAR = $70C ; XDOS cartridge address (+ $70D) +XPAT = $86F ; XDOS bugfix and patch number +XVER = $870 ; XDOS version number +XFILE = $87D ; XDOS filename buffer +XLINE = $880 ; XDOS DUP input line +XGLIN = $871 ; get line +XSKIP = $874 ; skip parameter +XMOVE = $877 ; move filename +XGNUM = $87A ; get number + ;------------------------------------------------------------------------- ; End of atari.inc ;------------------------------------------------------------------------- From 6d7dfad80b8d17f7342cdcc38d90441b5c0b22ff Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 24 May 2016 02:57:21 +0200 Subject: [PATCH 2/4] add support for XDOS command lines --- asminc/atari.inc | 13 ++++++++----- libsrc/atari/dosdetect.s | 2 +- libsrc/atari/getargs.s | 30 ++++++++++++++++++++---------- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/asminc/atari.inc b/asminc/atari.inc index e6d165524..183564f1f 100644 --- a/asminc/atari.inc +++ b/asminc/atari.inc @@ -997,12 +997,15 @@ diopp_size = 5 ; size of structure ; VALUES for dos_type ;------------------------------------------------------------------------- -ATARIDOS = 0 -SPARTADOS = 1 -OSADOS = 2 ; OS/A+ -MYDOS = 3 -XDOS = 4 +SPARTADOS = 0 +OSADOS = 1 ; OS/A+ +XDOS = 2 +ATARIDOS = 3 +MYDOS = 4 NODOS = 255 +; The DOSes with dos_type below or equal MAX_DOS_WITH_CMDLINE do support +; command line arguments. +MAX_DOS_WITH_CMDLINE = XDOS ;------------------------------------------------------------------------- ; XDOS defines (version 2.4, taken from xdos24.pdf) diff --git a/libsrc/atari/dosdetect.s b/libsrc/atari/dosdetect.s index c2888d888..68f4aefb2 100644 --- a/libsrc/atari/dosdetect.s +++ b/libsrc/atari/dosdetect.s @@ -50,4 +50,4 @@ done: rts .data -__dos_type: .byte 0 ; default to ATARIDOS +__dos_type: .byte ATARIDOS; default to ATARIDOS diff --git a/libsrc/atari/getargs.s b/libsrc/atari/getargs.s index e3b18b2f9..b1b5d258d 100644 --- a/libsrc/atari/getargs.s +++ b/libsrc/atari/getargs.s @@ -7,6 +7,8 @@ ; startup code but is nevertheless included in the compiled program when ; needed. +; XDOS support added 05/2016 by Christian Groessler + MAXARGS = 16 ; max. amount of arguments in arg. table CL_SIZE = 64 ; command line buffer size SPACE = 32 ; SPACE char. @@ -22,22 +24,30 @@ SPACE = 32 ; SPACE char. .segment "ONCE" +nargdos:rts + initmainargs: lda __dos_type ; which DOS? - cmp #ATARIDOS - beq nargdos ; DOS does not support arguments - cmp #MYDOS - bne argdos ; DOS supports arguments -nargdos:rts + cmp #MAX_DOS_WITH_CMDLINE + 1 + bcs nargdos ; Initialize ourcl buffer -argdos: lda #ATEOL - sta ourcl+CL_SIZE +argdos: ldy #ATEOL + sty ourcl+CL_SIZE -; Move SpartaDOS command line to our own buffer +; Move SpartaDOS/XDOS command line to our own buffer - lda DOSVEC + cmp #XDOS + bne sparta + + lda #XLINE + sta ptr1+1 + bne cpcl0 + +sparta: lda DOSVEC clc adc #LBUF sta ptr1+1 - ldy #0 +cpcl0: ldy #0 cpcl: lda (ptr1),y sta ourcl,y iny From 2dd8f9f5efdda6824c2eb95e74091be3bf0ff968 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 24 May 2016 04:37:35 +0200 Subject: [PATCH 3/4] atari.h: update _dos_type values --- include/atari.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/atari.h b/include/atari.h index 82cd07330..5e36b1daa 100644 --- a/include/atari.h +++ b/include/atari.h @@ -261,11 +261,11 @@ extern void atrx15p2_tgi[]; #define AT_PAL 1 /* valid _dos_type values */ -#define ATARIDOS 0 -#define SPARTADOS 1 -#define OSADOS 2 -#define MYDOS 3 -#define XDOS 4 +#define SPARTADOS 0 +#define OSADOS 1 +#define XDOS 2 +#define ATARIDOS 3 +#define MYDOS 4 #define NODOS 255 /* Define hardware */ From 2abbd9449262a3b41e450234085fb79f1fad34a9 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 24 May 2016 15:47:34 +0200 Subject: [PATCH 4/4] Fix style issue. --- asminc/atari.inc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/asminc/atari.inc b/asminc/atari.inc index 183564f1f..b8f883cd8 100644 --- a/asminc/atari.inc +++ b/asminc/atari.inc @@ -1011,16 +1011,16 @@ MAX_DOS_WITH_CMDLINE = XDOS ; XDOS defines (version 2.4, taken from xdos24.pdf) ;------------------------------------------------------------------------- -XOPT = $70B ; XDOS options -XCAR = $70C ; XDOS cartridge address (+ $70D) -XPAT = $86F ; XDOS bugfix and patch number -XVER = $870 ; XDOS version number -XFILE = $87D ; XDOS filename buffer -XLINE = $880 ; XDOS DUP input line -XGLIN = $871 ; get line -XSKIP = $874 ; skip parameter -XMOVE = $877 ; move filename -XGNUM = $87A ; get number +XOPT = $070B ; XDOS options +XCAR = $070C ; XDOS cartridge address (+ $70D) +XPAT = $086F ; XDOS bugfix and patch number +XVER = $0870 ; XDOS version number +XFILE = $087D ; XDOS filename buffer +XLINE = $0880 ; XDOS DUP input line +XGLIN = $0871 ; get line +XSKIP = $0874 ; skip parameter +XMOVE = $0877 ; move filename +XGNUM = $087A ; get number ;------------------------------------------------------------------------- ; End of atari.inc