From 56e330a4d7b8f88937186c115dd409515e1e5ddd Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Sat, 8 Jun 2013 00:35:07 +0200 Subject: [PATCH] Use symbolic names for all CIO commands. --- asminc/atari.inc | 53 ++++++++++++++++++++++------------------- libsrc/atari/initcwd.s | 2 +- libsrc/atari/lseek.s | 10 ++++---- libsrc/atari/syschdir.s | 4 ++-- libsrc/atari/sysmkdir.s | 2 +- 5 files changed, 38 insertions(+), 33 deletions(-) diff --git a/asminc/atari.inc b/asminc/atari.inc index 29159a177..9de8e3daa 100644 --- a/asminc/atari.inc +++ b/asminc/atari.inc @@ -44,9 +44,34 @@ CLOSE = $0C ;close STATIS = $0D ;status SPECIL = $0E ;special +; DOS IOCB command codes + +RENAME = $20 ;rename disk file +DELETE = $21 ;delete disk file +LOCKFL = $23 ;lock file (set to read-only) +UNLOCK = $24 ;unlock file +POINT = $25 ;point sector +NOTE = $26 ;note sector +GETFL = $27 ;get file length +CHDIR_MYDOS = $29 ;change directory (MyDOS) +MKDIR = $2A ;make directory (MyDOS/SpartaDOS) +CHDIR_SPDOS = $2C ;change directory (SpartaDOS) +FORMAT = $FE ;format + +GETCWD = $30 ;get current directory (MyDOS/SpartaDOS) + ; Special Entry Command Equates +; DOS Commands +; Command line table, Index values for (DOSVEC),Y -- COMTAB +; Compatible with OS/A+, DOS XL and SpartaDOS + +COMTAB = 0 ;DOS entry jump vector +ZCRNAME = 3 ;file name crunch routine jump vector +BUFOFF = 10 ;next parameter buffer offset +COMFNAM = 33 ;destination buffer for crunch routine +LBUF = 63 ;command line input buffer -; Screen Commands +; Screen IOCB Commands DRAWLN = $11 ;draw line FILLIN = $12 ;draw line with right fill @@ -710,6 +735,9 @@ FPSCR1 = $05EC ;6-byte floating point temporary ;LBFEND = $05FF ;##old## END OF LBUFF + +DOS = $0700 + ;------------------------------------------------------------------------- ; Cartridge Address Equates ;------------------------------------------------------------------------- @@ -1022,29 +1050,6 @@ STOPLN = $BA ;2-byte stopped line number ERRSAVE = $C3 ;1-byte error code PTABW = $C9 ;1-byte tab width -;------------------------------------------------------------------------- -; DOS -;------------------------------------------------------------------------- - -DOS = $0700 - -RENAME = $20 ;RENAME DISK FILE -DELETE = $21 ;DELETE DISK FILE -LOCKFL = $23 ;LOCK FILE TO READ ONLY -UNLOCK = $24 ;UNLOCK LOCKED FILE -POINT = $25 ;POINT SECTOR -NOTE = $26 ;NOTE SECTOR -FORMAT = $FE ;FORMAT - -; Command line table, Index values for (DOSVEC),Y -- COMTAB -; Compatible with OS/A+, DOS XL and SpartaDOS - -COMTAB = 0 ;DOS entry jump vector -ZCRNAME = 3 ;file name crunch routine jump vector -BUFOFF = 10 ;next parameter buffer offset -COMFNAM = 33 ;destination buffer for crunch routine -LBUF = 63 ;command line input buffer - ;------------------------------------------------------------------------- ; ATASCII CHARACTER DEFS ;------------------------------------------------------------------------- diff --git a/libsrc/atari/initcwd.s b/libsrc/atari/initcwd.s index 19df6a5a4..d7b574314 100644 --- a/libsrc/atari/initcwd.s +++ b/libsrc/atari/initcwd.s @@ -11,7 +11,7 @@ jsr findfreeiocb bne oserr - lda #48 + lda #GETCWD sta ICCOM,x lda #<__cwd sta ICBLL,x diff --git a/libsrc/atari/lseek.s b/libsrc/atari/lseek.s index bf934294c..889976f5b 100644 --- a/libsrc/atari/lseek.s +++ b/libsrc/atari/lseek.s @@ -68,7 +68,7 @@ iocberr:jsr incsp6 ; SEEK_CUR cur: ldx tmp3 - lda #38 ; NOTE + lda #NOTE sta ICCOM,x jsr CIOV ; read it bmi xxerr @@ -84,7 +84,7 @@ l01: lda ICAX3,x ; low byte of position ; SEEK_END end: ldx tmp3 - lda #39 ; get file size + lda #GETFL sta ICCOM,x jsr CIOV bpl l01 @@ -126,7 +126,7 @@ ret: jsr incsp6 .if 0 ; return exactly the position DOS has ldx tmp3 - lda #38 ; NOTE + lda #NOTE sta ICCOM,x jsr CIOV ; read it bmi xxerr @@ -168,7 +168,7 @@ seek: jsr ldax0sp ; get lower word of new offset sta ICAX4,x lda ptr4 sta ICAX5,x - lda #37 ;POINT + lda #POINT sta ICCOM,x jsr CIOV bpl ret @@ -201,7 +201,7 @@ chk_supp: cmp #$40 bcs supp1 ; SD-X (ver 4.xx) supports seeking on all disks ldx tmp3 ; iocb to use - lda #39 ; get file size + lda #GETFL sta ICCOM,x jsr CIOV bmi notsupp ; error code ? should be 168 (invalid command) diff --git a/libsrc/atari/syschdir.s b/libsrc/atari/syschdir.s index 9fc45edbd..16cb3a1fe 100644 --- a/libsrc/atari/syschdir.s +++ b/libsrc/atari/syschdir.s @@ -58,9 +58,9 @@ ucok1: lda __dos_type cmp #SPARTADOS beq :+ - lda #41 + lda #CHDIR_MYDOS .byte $2C ; BIT -: lda #44 +: lda #CHDIR_SPDOS sta ICCOM,x lda #0 sta ICAX1,x diff --git a/libsrc/atari/sysmkdir.s b/libsrc/atari/sysmkdir.s index de3252ced..56a068757 100644 --- a/libsrc/atari/sysmkdir.s +++ b/libsrc/atari/sysmkdir.s @@ -61,7 +61,7 @@ ucok1: sta ICBAH,y tya tax - lda #42 + lda #MKDIR sta ICCOM,x lda #8 sta ICAX1,x -- 2.39.5