From: Oliver Schmidt
Date: Thu, 9 May 2013 11:56:54 +0000 (+0200)
Subject: Removed (pretty inconsistently used) tab chars from source code base.
X-Git-Tag: V2.14~5
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=85885001b133e2dc320b6f6459259afa69784ca8;p=cc65
Removed (pretty inconsistently used) tab chars from source code base.
---
diff --git a/asminc/apple2.inc b/asminc/apple2.inc
index 3ef6a3725..536a1d851 100644
--- a/asminc/apple2.inc
+++ b/asminc/apple2.inc
@@ -2,39 +2,39 @@
;-----------------------------------------------------------------------------
; Zero page stuff
-WNDLFT := $20 ; Text window left
-WNDWDTH := $21 ; Text window width
-WNDTOP := $22 ; Text window top
-WNDBTM := $23 ; Text window bottom+1
-CH := $24 ; Cursor horizontal position
-CV := $25 ; Cursor vertical position
-BASL := $28 ; Text base address low
-BASH := $29 ; Text base address high
-INVFLG := $32 ; Normal/inverse(/flash)
-PROMPT := $33 ; Used by GETLN
-RNDL := $4E ; Random counter low
-RNDH := $4F ; Random counter high
-HIMEM := $73 ; Highest available memory address+1
+WNDLFT := $20 ; Text window left
+WNDWDTH := $21 ; Text window width
+WNDTOP := $22 ; Text window top
+WNDBTM := $23 ; Text window bottom+1
+CH := $24 ; Cursor horizontal position
+CV := $25 ; Cursor vertical position
+BASL := $28 ; Text base address low
+BASH := $29 ; Text base address high
+INVFLG := $32 ; Normal/inverse(/flash)
+PROMPT := $33 ; Used by GETLN
+RNDL := $4E ; Random counter low
+RNDH := $4F ; Random counter high
+HIMEM := $73 ; Highest available memory address+1
;-----------------------------------------------------------------------------
; Vectors
-DOSWARM := $03D0 ; DOS warmstart vector
-BRKVec := $03F0 ; Break vector
-SOFTEV := $03F2 ; Vector for warm start
-PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1
+DOSWARM := $03D0 ; DOS warmstart vector
+BRKVec := $03F0 ; Break vector
+SOFTEV := $03F2 ; Vector for warm start
+PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1
;-----------------------------------------------------------------------------
; Hardware
; Keyboard input
-KBD := $C000 ; Read keyboard
-KBDSTRB := $C010 ; Clear keyboard strobe
+KBD := $C000 ; Read keyboard
+KBDSTRB := $C010 ; Clear keyboard strobe
; 80 column video switches
-CLR80COL:= $C000 ; Disable 80 column store
-SET80COL:= $C001 ; Enable 80 column store
-RD80COL := $C018 ; >127 if 80 column store enabled
+CLR80COL:= $C000 ; Disable 80 column store
+SET80COL:= $C001 ; Enable 80 column store
+RD80COL := $C018 ; >127 if 80 column store enabled
RD80VID := $C01F ; >127 if 80 column video enabled
; Character set switches
@@ -43,22 +43,22 @@ SETALTCHAR := $C00F ; Norm/inv LC, no flash
ALTCHARSET := $C01E ; >127 if alt charset switched in
; Language card switches
-RDLCBNK2:= $C011 ; >127 if LC bank 2 in use
-RDLCRAM := $C012 ; >127 if LC is read enabled
-ROMIN := $C081 ; Swap in D000-FFFF ROM
-LCBANK2 := $C083 ; Swap in LC bank 2
-LCBANK1 := $C08B ; Swap in LC bank 1
+RDLCBNK2:= $C011 ; >127 if LC bank 2 in use
+RDLCRAM := $C012 ; >127 if LC is read enabled
+ROMIN := $C081 ; Swap in D000-FFFF ROM
+LCBANK2 := $C083 ; Swap in LC bank 2
+LCBANK1 := $C08B ; Swap in LC bank 1
; Video mode switches
-TXTCLR := $C050 ; Display graphics
-TXTSET := $C051 ; Display text
-MIXCLR := $C052 ; Disable 4 lines of text
-MIXSET := $C053 ; Enable 4 lines of text
-LOWSCR := $C054 ; Page 1
-HISCR := $C055 ; Page 2
-LORES := $C056 ; Lores graphics
-HIRES := $C057 ; Hires graphics
+TXTCLR := $C050 ; Display graphics
+TXTSET := $C051 ; Display text
+MIXCLR := $C052 ; Disable 4 lines of text
+MIXSET := $C053 ; Enable 4 lines of text
+LOWSCR := $C054 ; Page 1
+HISCR := $C055 ; Page 2
+LORES := $C056 ; Lores graphics
+HIRES := $C057 ; Hires graphics
; Game controller
-BUTN0 := $C061 ; Open-Apple Key
-BUTN1 := $C062 ; Closed-Apple Key
+BUTN0 := $C061 ; Open-Apple Key
+BUTN1 := $C062 ; Closed-Apple Key
diff --git a/asminc/atari.inc b/asminc/atari.inc
index 912da1b54..29159a177 100644
--- a/asminc/atari.inc
+++ b/asminc/atari.inc
@@ -8,975 +8,975 @@
; - Atari XL/XE rev.2 source code, Atari 1984
; - Mapping the Atari - revised edition, Ian Chadwick 1985
;
-; ##old## old OS rev.B label - moved or deleted
-; ##1200xl## new label introduced in 1200XL OS (rev.10/11)
-; ##rev2## new label introduced in XL/XE OS rev.2
+; ##old## old OS rev.B label - moved or deleted
+; ##1200xl## new label introduced in 1200XL OS (rev.10/11)
+; ##rev2## new label introduced in XL/XE OS rev.2
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; Configuration Equates
;-------------------------------------------------------------------------
-MAXDEV = 33 ;offset to last possible entry of HATABS
-IOCBSZ = 16 ;length of IOCB
+MAXDEV = 33 ;offset to last possible entry of HATABS
+IOCBSZ = 16 ;length of IOCB
-SEIOCB = 0*IOCBSZ ;##rev2## screen editor IOCB index
-MAXIOC = 8*IOCBSZ ;first invalid IOCB index
+SEIOCB = 0*IOCBSZ ;##rev2## screen editor IOCB index
+MAXIOC = 8*IOCBSZ ;first invalid IOCB index
-DSCTSZ = 128 ;##rev2## disk sector size
+DSCTSZ = 128 ;##rev2## disk sector size
-LEDGE = 2 ;left edge
-REDGE = 39 ;right edge
+LEDGE = 2 ;left edge
+REDGE = 39 ;right edge
-INIML = $0700 ;##rev2## initial MEMLO
+INIML = $0700 ;##rev2## initial MEMLO
-ICSORG = $CC00 ;##rev2## international character set origin
-DCSORG = $E000 ;##rev2## domestic character set origin
+ICSORG = $CC00 ;##rev2## international character set origin
+DCSORG = $E000 ;##rev2## domestic character set origin
; IOCB Command Code Equates
-OPEN = $03 ;open
-GETREC = $05 ;get record
-GETCHR = $07 ;get character(s)
-PUTREC = $09 ;put record
-PUTCHR = $0B ;put character(s)
-CLOSE = $0C ;close
-STATIS = $0D ;status
-SPECIL = $0E ;special
+OPEN = $03 ;open
+GETREC = $05 ;get record
+GETCHR = $07 ;get character(s)
+PUTREC = $09 ;put record
+PUTCHR = $0B ;put character(s)
+CLOSE = $0C ;close
+STATIS = $0D ;status
+SPECIL = $0E ;special
; Special Entry Command Equates
; Screen Commands
-DRAWLN = $11 ;draw line
-FILLIN = $12 ;draw line with right fill
+DRAWLN = $11 ;draw line
+FILLIN = $12 ;draw line with right fill
; ICAX1 Auxiliary Byte 1 Equates
-APPEND = $01 ;open write append (D:)
-DIRECT = $02 ;open for directory access (D:)
-OPNIN = $04 ;open for input (all devices)
-OPNOT = $08 ;open for output (all devices)
-MXDMOD = $10 ;open for mixed mode (E:, S:)
-INSCLR = $20 ;open for input without clearing screen
+APPEND = $01 ;open write append (D:)
+DIRECT = $02 ;open for directory access (D:)
+OPNIN = $04 ;open for input (all devices)
+OPNOT = $08 ;open for output (all devices)
+MXDMOD = $10 ;open for mixed mode (E:, S:)
+INSCLR = $20 ;open for input without clearing screen
; Device Code Equates
-CASSET = 'C' ;cassette
-DISK = 'D' ;disk
-SCREDT = 'E' ;screen editor
-KBD = 'K' ;keyboard
-PRINTR = 'P' ;printer
-DISPLY = 'S' ;screen display
+CASSET = 'C' ;cassette
+DISK = 'D' ;disk
+SCREDT = 'E' ;screen editor
+KBD = 'K' ;keyboard
+PRINTR = 'P' ;printer
+DISPLY = 'S' ;screen display
; SIO Command Code Equates
-SIO_FORMAT = $21 ;format disk (default density)
-SIO_FORMATS = $22 ;1050: format medium density
-SIO_CONFIG = $44 ;configure drive
-SIO_CONFIGSF = $4B ;slow/fast configure drive??
-SIO_WRITE = $50 ;write sector
-SIO_READ = $52 ;read sector
-SIO_STAT = $53 ;get status information
-SIO_VERIFY = $56 ;verify sector
-SIO_WRITEV = $57 ;write sector with verify
+SIO_FORMAT = $21 ;format disk (default density)
+SIO_FORMATS = $22 ;1050: format medium density
+SIO_CONFIG = $44 ;configure drive
+SIO_CONFIGSF = $4B ;slow/fast configure drive??
+SIO_WRITE = $50 ;write sector
+SIO_READ = $52 ;read sector
+SIO_STAT = $53 ;get status information
+SIO_VERIFY = $56 ;verify sector
+SIO_WRITEV = $57 ;write sector with verify
; Character and Key Code Equates
-CLS = $7D ;##rev2## clear screen
-EOL = $9B ;end of line (RETURN)
+CLS = $7D ;##rev2## clear screen
+EOL = $9B ;end of line (RETURN)
-HELP = $11 ;##1200xl## key code for HELP
-CNTLF1 = $83 ;##1200xl## key code for CTRL-F1
-CNTLF2 = $84 ;##1200xl## key code for CTRL-F2
-CNTLF3 = $93 ;##1200xl## key code for CTRL-F3
-CNTLF4 = $94 ;##1200xl## key code for CTRL-F4
-CNTL1 = $9F ;##1200xl## key code for CTRL-1
+HELP = $11 ;##1200xl## key code for HELP
+CNTLF1 = $83 ;##1200xl## key code for CTRL-F1
+CNTLF2 = $84 ;##1200xl## key code for CTRL-F2
+CNTLF3 = $93 ;##1200xl## key code for CTRL-F3
+CNTLF4 = $94 ;##1200xl## key code for CTRL-F4
+CNTL1 = $9F ;##1200xl## key code for CTRL-1
; Status Code Equates
-SUCCES = 1 ;($01) succesful operation
-
-BRKABT = 128 ;($80) BREAK key abort
-PRVOPN = 129 ;($81) IOCB already open error
-NONDEV = 130 ;($82) nonexistent device error
-WRONLY = 131 ;($83) IOCB opened for write only error
-NVALID = 132 ;($84) invalid command error
-NOTOPN = 133 ;($85) device/file not open error
-BADIOC = 134 ;($86) invalid IOCB index error
-RDONLY = 135 ;($87) IOCB opened for read only error
-EOFERR = 136 ;($88) end of file error
-TRNRCD = 137 ;($89) truncated record error
-TIMOUT = 138 ;($8A) peripheral device timeout error
-DNACK = 139 ;($8B) device does not acknowledge command
-FRMERR = 140 ;($8C) serial bus framing error
-CRSROR = 141 ;($8D) cursor overrange error
-OVRRUN = 142 ;($8E) serial bus data overrun error
-CHKERR = 143 ;($8F) serial bus checksum error
-DERROR = 144 ;($90) device done (operation incomplete)
-BADMOD = 145 ;($91) bad screen mode number error
-FNCNOT = 146 ;($92) function not implemented in handler
-SCRMEM = 147 ;($93) insufficient memory for screen mode
-
-DSKFMT = 148 ;($94) SpartaDOS: unrecognized disk format
-INCVER = 149 ;($95) SpartaDOS: disk was made with incompat. version
-DIRNFD = 150 ;($96) SpartaDOS: directory not found
-FEXIST = 151 ;($97) SpartaDOS: file exists
-NOTBIN = 152 ;($98) SpartaDOS: file not binary
-LSYMND = 154 ;($9A) SDX: loader symbol not defined
-BADPRM = 156 ;($9C) SDX: bad parameter
-OUTOFM = 158 ;($9E) SDX: out of memory
-INVDEV = 160 ;($A0) invalid device number
-TMOF = 161 ;($A1) too many open files
-DSKFLL = 162 ;($A2) disk full
-FATLIO = 163 ;($A3) fatal I/O error
-FNMSMT = 164 ;($A4) internal file number mismatch
-INVFNM = 165 ;($A5) invalid file name
-PDLERR = 166 ;($A6) point data length error
-EPERM = 167 ;($A7) permission denied
-DINVCM = 168 ;($A8) command invalid for disk
-DIRFLL = 169 ;($A9) directory full
-FNTFND = 170 ;($AA) file not found
-PNTINV = 171 ;($AB) point invalid
-BADDSK = 173 ;($AD) bad disk
-INCFMT = 176 ;($B0) DOS 3: incompatible file system
+SUCCES = 1 ;($01) succesful operation
+
+BRKABT = 128 ;($80) BREAK key abort
+PRVOPN = 129 ;($81) IOCB already open error
+NONDEV = 130 ;($82) nonexistent device error
+WRONLY = 131 ;($83) IOCB opened for write only error
+NVALID = 132 ;($84) invalid command error
+NOTOPN = 133 ;($85) device/file not open error
+BADIOC = 134 ;($86) invalid IOCB index error
+RDONLY = 135 ;($87) IOCB opened for read only error
+EOFERR = 136 ;($88) end of file error
+TRNRCD = 137 ;($89) truncated record error
+TIMOUT = 138 ;($8A) peripheral device timeout error
+DNACK = 139 ;($8B) device does not acknowledge command
+FRMERR = 140 ;($8C) serial bus framing error
+CRSROR = 141 ;($8D) cursor overrange error
+OVRRUN = 142 ;($8E) serial bus data overrun error
+CHKERR = 143 ;($8F) serial bus checksum error
+DERROR = 144 ;($90) device done (operation incomplete)
+BADMOD = 145 ;($91) bad screen mode number error
+FNCNOT = 146 ;($92) function not implemented in handler
+SCRMEM = 147 ;($93) insufficient memory for screen mode
+
+DSKFMT = 148 ;($94) SpartaDOS: unrecognized disk format
+INCVER = 149 ;($95) SpartaDOS: disk was made with incompat. version
+DIRNFD = 150 ;($96) SpartaDOS: directory not found
+FEXIST = 151 ;($97) SpartaDOS: file exists
+NOTBIN = 152 ;($98) SpartaDOS: file not binary
+LSYMND = 154 ;($9A) SDX: loader symbol not defined
+BADPRM = 156 ;($9C) SDX: bad parameter
+OUTOFM = 158 ;($9E) SDX: out of memory
+INVDEV = 160 ;($A0) invalid device number
+TMOF = 161 ;($A1) too many open files
+DSKFLL = 162 ;($A2) disk full
+FATLIO = 163 ;($A3) fatal I/O error
+FNMSMT = 164 ;($A4) internal file number mismatch
+INVFNM = 165 ;($A5) invalid file name
+PDLERR = 166 ;($A6) point data length error
+EPERM = 167 ;($A7) permission denied
+DINVCM = 168 ;($A8) command invalid for disk
+DIRFLL = 169 ;($A9) directory full
+FNTFND = 170 ;($AA) file not found
+PNTINV = 171 ;($AB) point invalid
+BADDSK = 173 ;($AD) bad disk
+INCFMT = 176 ;($B0) DOS 3: incompatible file system
; DCB Device Bus Equates
-DISKID = $31 ;##rev2## disk bus ID
-PDEVN = $40 ;##rev2## printer bus ID
-CASET = $60 ;##rev2## cassette bus ID
+DISKID = $31 ;##rev2## disk bus ID
+PDEVN = $40 ;##rev2## printer bus ID
+CASET = $60 ;##rev2## cassette bus ID
; Bus Command Equates
-FOMAT = '!' ;##rev2## format command
-PUTSEC = 'P' ;##rev2## put sector command
-READ = 'R' ;##rev2## read command
-STATC = 'S' ;##rev2## status command
-WRITE = 'W' ;##rev2## write command
+FOMAT = '!' ;##rev2## format command
+PUTSEC = 'P' ;##rev2## put sector command
+READ = 'R' ;##rev2## read command
+STATC = 'S' ;##rev2## status command
+WRITE = 'W' ;##rev2## write command
; Command Auxiliary Byte Equates
-DOUBLE = 'D' ;##rev2## print 20 characters double width
-NORMAL = 'N' ;##rev2## print 40 characters normally
-PLOT = 'P' ;##rev2## plot
-SIDWAY = 'S' ;##rev2## print 16 characters sideways
+DOUBLE = 'D' ;##rev2## print 20 characters double width
+NORMAL = 'N' ;##rev2## print 40 characters normally
+PLOT = 'P' ;##rev2## plot
+SIDWAY = 'S' ;##rev2## print 16 characters sideways
; Bus Response Equates
-ACK = 'A' ;##rev2## device acknowledged
-COMPLT = 'C' ;##rev2## device succesfully completed operation
-ERROR = 'E' ;##rev2## device incurred error
-NACK = 'N' ;##rev2## device did not understand
+ACK = 'A' ;##rev2## device acknowledged
+COMPLT = 'C' ;##rev2## device succesfully completed operation
+ERROR = 'E' ;##rev2## device incurred error
+NACK = 'N' ;##rev2## device did not understand
; Floating Point Miscellaneous Equates
-FPREC = 6 ;precision
+FPREC = 6 ;precision
-FMPREC = FPREC-1 ;##rev2## length of mantissa
+FMPREC = FPREC-1 ;##rev2## length of mantissa
; Cassette Record Type Equates
-HDR = $FB ;##rev2## header
-DTA = $FC ;##rev2## data record
-DT1 = $FA ;##rev2## last data record
-EOT = $FE ;##rev2## end of tape (file)
+HDR = $FB ;##rev2## header
+DTA = $FC ;##rev2## data record
+DT1 = $FA ;##rev2## last data record
+EOT = $FE ;##rev2## end of tape (file)
-TONE1 = 2 ;##rev2## record
-TONE2 = 1 ;##rev2## playback
+TONE1 = 2 ;##rev2## record
+TONE2 = 1 ;##rev2## playback
; Cassette Timing Equates
-WLEADN = 1152 ;##rev2## NTSC 19.2 second WRITE file leader
-RLEADN = 576 ;##rev2## NTSC 9.6 second READ file leader
-WIRGLN = 180 ;##rev2## NTSC 3.0 second WRITE IRG
-RIRGLN = 120 ;##rev2## NTSC 2.0 second READ IRG
-WSIRGN = 15 ;##rev2## NTSC 0.25 second WRITE short IRG
-RSIRGN = 10 ;##rev2## NTSC 0.16 second READ short IRG
-BEEPNN = 30 ;##rev2## NTSC 0.5 second beep duration
-BEEPFN = 10 ;##rev2## NTSC 0.16 seconrd beep duration
-
-WLEADP = 960 ;##rev2## PAL 19.2 second WRITE file leader
-RLEADP = 480 ;##rev2## PAL 9.6 second READ file leader
-WIRGLP = 150 ;##rev2## PAL 3.0 second WRITE IRG
-RIRGLP = 100 ;##rev2## PAL 2.0 second READ IRG
-WSIRGP = 13 ;##rev2## PAL 0.25 second WRITE short IRG
-RSIRGP = 8 ;##rev2## PAL 0.16 second READ short IRG
-BEEPNP = 25 ;##rev2## PAL 0.5 second beep duration
-BEEPFP = 8 ;##rev2## PAL 0.16 seconrd beep duration
-
-WIRGHI = 0 ;##rev2## high WRITE IRG
-RIRGHI = 0 ;##rev2## high READ IRG
+WLEADN = 1152 ;##rev2## NTSC 19.2 second WRITE file leader
+RLEADN = 576 ;##rev2## NTSC 9.6 second READ file leader
+WIRGLN = 180 ;##rev2## NTSC 3.0 second WRITE IRG
+RIRGLN = 120 ;##rev2## NTSC 2.0 second READ IRG
+WSIRGN = 15 ;##rev2## NTSC 0.25 second WRITE short IRG
+RSIRGN = 10 ;##rev2## NTSC 0.16 second READ short IRG
+BEEPNN = 30 ;##rev2## NTSC 0.5 second beep duration
+BEEPFN = 10 ;##rev2## NTSC 0.16 seconrd beep duration
+
+WLEADP = 960 ;##rev2## PAL 19.2 second WRITE file leader
+RLEADP = 480 ;##rev2## PAL 9.6 second READ file leader
+WIRGLP = 150 ;##rev2## PAL 3.0 second WRITE IRG
+RIRGLP = 100 ;##rev2## PAL 2.0 second READ IRG
+WSIRGP = 13 ;##rev2## PAL 0.25 second WRITE short IRG
+RSIRGP = 8 ;##rev2## PAL 0.16 second READ short IRG
+BEEPNP = 25 ;##rev2## PAL 0.5 second beep duration
+BEEPFP = 8 ;##rev2## PAL 0.16 seconrd beep duration
+
+WIRGHI = 0 ;##rev2## high WRITE IRG
+RIRGHI = 0 ;##rev2## high READ IRG
; Power-up Validation Byte Value Equates
-PUPVL1 = $5C ;##rev2## power-up validation value 1
-PUPVL2 = $93 ;##rev2## power-up validation value 2
-PUPVL3 = $25 ;##rev2## power-up validation value 3
+PUPVL1 = $5C ;##rev2## power-up validation value 1
+PUPVL2 = $93 ;##rev2## power-up validation value 2
+PUPVL3 = $25 ;##rev2## power-up validation value 3
; Relocating Loader Miscellaneous Equates
-DATAER = 156 ;##rev2## end of record appears before END
-MEMERR = 157 ;##rev2## memory insufficient for load error
+DATAER = 156 ;##rev2## end of record appears before END
+MEMERR = 157 ;##rev2## memory insufficient for load error
; Miscellaneous Equates
-IOCFRE = $FF ;IOCB free indication
+IOCFRE = $FF ;IOCB free indication
-B19200 = $0028 ;##rev2## 19200 baud POKEY counter value
-B00600 = $05CC ;##rev2## 600 baud POKEY counter value
+B19200 = $0028 ;##rev2## 19200 baud POKEY counter value
+B00600 = $05CC ;##rev2## 600 baud POKEY counter value
-HITONE = $05 ;##rev2## FSK high freq. POKEY counter value
-LOTONE = $07 ;##rev2## FSK low freq. POKEY counter value
+HITONE = $05 ;##rev2## FSK high freq. POKEY counter value
+LOTONE = $07 ;##rev2## FSK low freq. POKEY counter value
-NCOMLO = $34 ;##rev2## PIA lower NOT COMMAND line command
-NCOMHI = $3C ;##rev2## PIA raise NOT COMMAND line command
+NCOMLO = $34 ;##rev2## PIA lower NOT COMMAND line command
+NCOMHI = $3C ;##rev2## PIA raise NOT COMMAND line command
-MOTRGO = $34 ;##rev2## PIA cassette motor ON command
-MOTRST = $3C ;##rev2## PIA cassette motor OFF command
+MOTRGO = $34 ;##rev2## PIA cassette motor ON command
+MOTRST = $3C ;##rev2## PIA cassette motor OFF command
-NODAT = $00 ;##rev2## SIO immediate operation
-GETDAT = $40 ;##rev2## SIO read data frame
-PUTDAT = $80 ;##rev2## SIO write data frame
+NODAT = $00 ;##rev2## SIO immediate operation
+GETDAT = $40 ;##rev2## SIO read data frame
+PUTDAT = $80 ;##rev2## SIO write data frame
-CRETRI = 13 ;##rev2## number of command frame retries
-DRETRI = 1 ;##rev2## number of device retries
-CTIM = 2 ;##rev2## command frame ACK timeout
+CRETRI = 13 ;##rev2## number of command frame retries
+DRETRI = 1 ;##rev2## number of device retries
+CTIM = 2 ;##rev2## command frame ACK timeout
-NBUFSZ = 40 ;##rev2## print normal buffer size
-DBUFSZ = 20 ;##rev2## print double buffer size
-SBUFSZ = 29 ;##rev2## print sideways buffer size
+NBUFSZ = 40 ;##rev2## print normal buffer size
+DBUFSZ = 20 ;##rev2## print double buffer size
+SBUFSZ = 29 ;##rev2## print sideways buffer size
;-------------------------------------------------------------------------
; Page Zero Address Equates
;-------------------------------------------------------------------------
-LINZBS = $00 ;LINBUG RAM (WILL BE REPLACED BY MONITOR RAM)
-LNFLG = $00 ;##1200xl## 1-byte LNBUG flag (0 = not LNBUG)
-NGFLAG = $01 ;##1200xl## 1-byte memory status (0 = failure)
+LINZBS = $00 ;LINBUG RAM (WILL BE REPLACED BY MONITOR RAM)
+LNFLG = $00 ;##1200xl## 1-byte LNBUG flag (0 = not LNBUG)
+NGFLAG = $01 ;##1200xl## 1-byte memory status (0 = failure)
; Not Cleared
-CASINI = $02 ;CASSETTE INIT LOCATION
-RAMLO = $04 ;RAM POINTER FOR MEMORY TEST
-TRAMSZ = $06 ;TEMPORARY REGISTER FOR RAM SIZE
-;TSTDAT = $07 ;##old## RAM TEST DATA REGISTER
-CMCMD = $07 ;##rev2## 1-byte command communications
+CASINI = $02 ;CASSETTE INIT LOCATION
+RAMLO = $04 ;RAM POINTER FOR MEMORY TEST
+TRAMSZ = $06 ;TEMPORARY REGISTER FOR RAM SIZE
+;TSTDAT = $07 ;##old## RAM TEST DATA REGISTER
+CMCMD = $07 ;##rev2## 1-byte command communications
; Cleared upon Coldstart only
-WARMST = $08 ;WARM START FLAG
-BOOTQ = $09 ;SUCCESSFUL BOOT FLAG
-DOSVEC = $0A ;DISK SOFTWARE START VECTOR
-DOSINI = $0C ;DISK SOFTWARE INIT ADDRESS
-APPMHI = $0E ;APPLICATIONS MEMORY HI LIMIT
+WARMST = $08 ;WARM START FLAG
+BOOTQ = $09 ;SUCCESSFUL BOOT FLAG
+DOSVEC = $0A ;DISK SOFTWARE START VECTOR
+DOSINI = $0C ;DISK SOFTWARE INIT ADDRESS
+APPMHI = $0E ;APPLICATIONS MEMORY HI LIMIT
; Cleared upon Coldstart or Warmstart
-INTZBS = $10 ;INTERRUPT HANDLER
-
-POKMSK = $10 ;SYSTEM MASK FOR POKEY IRG ENABLE
-BRKKEY = $11 ;BREAK KEY FLAG
-RTCLOK = $12 ;REAL TIME CLOCK (IN 16 MSEC UNITS>
-BUFADR = $15 ;INDIRECT BUFFER ADDRESS REGISTER
-ICCOMT = $17 ;COMMAND FOR VECTOR
-DSKFMS = $18 ;DISK FILE MANAGER POINTER
-DSKUTL = $1A ;DISK UTILITIES POINTER
-ABUFPT = $1C ;##1200xl## 4-byte ACMI buffer pointer area
-
-;PTIMOT = $1C ;##old## PRINTER TIME OUT REGISTER
-;PBPNT = $1D ;##old## PRINT BUFFER POINTER
-;PBUFSZ = $1E ;##old## PRINT BUFFER SIZE
-;PTEMP = $1F ;##old## TEMPORARY REGISTER
-
-ZIOCB = $20 ;ZERO PAGE I/O CONTROL BLOCK
-IOCBAS = $20 ;16-byte page zero IOCB
-ICHIDZ = $20 ;HANDLER INDEX NUMBER (FF = IOCB FREE)
-ICDNOZ = $21 ;DEVICE NUMBER (DRIVE NUMBER)
-ICCOMZ = $22 ;COMMAND CODE
-ICSTAZ = $23 ;STATUS OF LAST IOCB ACTION
-ICBALZ = $24 ;BUFFER ADDRESS LOW BYTE
-ICBAHZ = $25 ;1-byte high buffer address
-ICPTLZ = $26 ;PUT BYTE ROUTINE ADDRESS -1
-ICPTHZ = $27 ;1-byte high PUT-BYTE routine address
-ICBLLZ = $28 ;BUFFER LENGTH LOW BYTE
-ICBLHZ = $29 ;1-byte high buffer length
-ICAX1Z = $2A ;AUXILIARY INFORMATION FIRST BYTE
-ICAX2Z = $2B ;1-byte second auxiliary information
-ICSPRZ = $2C ;4-byte spares
-
-ENTVEC = $2C ;##rev2## 2-byte (not used)
-ICIDNO = $2E ;IOCB NUMBER X 16
-CIOCHR = $2F ;CHARACTER BYTE FOR CURRENT OPERATION
-
-STATUS = $30 ;INTERNAL STATUS STORAGE
-CHKSUM = $31 ;CHECKSUM (SINGLE BYTE SUM WITH CARRY)
-BUFRLO = $32 ;POINTER TO DATA BUFFER (LO BYTE)
-BUFRHI = $33 ;POINTER TO DATA BUFFER (HI BYTE)
-BFENLO = $34 ;NEXT BYTE PAST END OF THE DATA BUFFER LO
-BFENHI = $35 ;NEXT BYTE PAST END OF THE DATA BUFFER HI
-;CRETRY = $36 ;##old## NUMBER OF COMMAND FRAME RETRIES
-;DRETRY = $37 ;##old## NUMBER OF DEVICE RETRIES
-LTEMP = $36 ;##1200xl## 2-byte loader temporary
-BUFRFL = $38 ;DATA BUFFER FULL FLAG
-RECVDN = $39 ;RECEIVE DONE FLAG
-XMTDON = $3A ;TRANSMISSION DONE FLAG
-CHKSNT = $3B ;CHECKSUM SENT FLAG
-NOCKSM = $3C ;NO CHECKSUM FOLLOWS DATA FLAG
-BPTR = $3D ;1-byte cassette buffer pointer
-FTYPE = $3E ;1-byte cassette IRG type
-FEOF = $3F ;1-byte cassette EOF flag (0 = quiet)
-FREQ = $40 ;1-byte cassette beep counter
-SOUNDR = $41 ;NOISY I/0 FLAG. (ZERO IS QUIET)
-
-CRITIC = $42 ;DEFINES CRITICAL SECTION (CRITICAL IF NON-Z)
-
-FMSZPG = $43 ;DISK FILE MANAGER SYSTEM ZERO PAGE
-
-;CKEY = $4A ;##old## FLAG SET WHEN GAME START PRESSED
-ZCHAIN = $4A ;##1200xl## 2-byte handler linkage chain pointer
-;CASSBT = $4B ;##old## CASSETTE BOOT FLAG
-DSTAT = $4C ;DISPLAY STATUS
-ATRACT = $4D ;ATRACT FLAG
-DRKMSK = $4E ;DARK ATRACT MASK
-COLRSH = $4F ;ATRACT COLOR SHIFTER (EOR'ED WITH PLAYFIELD
-
-
-TMPCHR = $50 ;1-byte temporary character
-HOLD1 = $51 ;1-byte temporary
-LMARGN = $52 ;left margin (normally 2, cc65 C startup code sets it to 0)
-RMARGN = $53 ;right margin (normally 39 if no XEP80 is used)
-ROWCRS = $54 ;1-byte cursor row
-COLCRS = $55 ;2-byte cursor column
-DINDEX = $57 ;1-byte display mode
-SAVMSC = $58 ;2-byte saved memory scan counter
-OLDROW = $5A ;1-byte prior row
-OLDCOL = $5B ;2-byte prior column
-OLDCHR = $5D ;DATA UNDER CURSOR
-OLDADR = $5E ;2-byte saved cursor memory address
-FKDEF = $60 ;##1200xl## 2-byte function key definition table
-;NEWROW = $60 ;##old## POINT DRAW GOES TO
-;NEWCOL = $61 ;##old##
-PALNTS = $62 ;##1200xl## 1-byte PAL/NTSC indicator (0 = NTSC)
-LOGCOL = $63 ;POINTS AT COLUMN IN LOGICAL LINE
-ADRESS = $64 ;2-byte temporary address
-
-MLTTMP = $66 ;1-byte temporary
-OPNTMP = $66 ;FIRST BYTE IS USED IN OPEN AS TEMP
-TOADR = $66 ;##rev2## 2-byte destination address
-
-SAVADR = $68 ;2-byte saved address
-FRMADR = $68 ;##rev2## 2-byte source address
-
-RAMTOP = $6A ;RAM SIZE DEFINED BY POWER ON LOGIC
-BUFCNT = $6B ;BUFFER COUNT
-BUFSTR = $6C ;EDITOR GETCH POINTER
-BITMSK = $6E ;BIT MASK
-SHFAMT = $6F ;1-byte shift amount for pixel justifucation
-ROWAC = $70 ;2-byte draw working row
-COLAC = $72 ;2-byte draw working column
-ENDPT = $74 ;2-byte end point
-DELTAR = $76 ;1-byte row difference
-DELTAC = $77 ;2-byte column difference
-KEYDEF = $79 ;##1200xl## 2-byte key definition table address
-;ROWINC = $79 ;##old##
-;COLINC = $7A ;##old##
-SWPFLG = $7B ;NON-0 1F TXT AND REGULAR RAM IS SWAPPED
-HOLDCH = $7C ;CH IS MOVED HERE IN KGETCH BEFORE CNTL & SH
-INSDAT = $7D ;1-byte temporary
-COUNTR = $7E ;2-byte draw iteration count
+INTZBS = $10 ;INTERRUPT HANDLER
+
+POKMSK = $10 ;SYSTEM MASK FOR POKEY IRG ENABLE
+BRKKEY = $11 ;BREAK KEY FLAG
+RTCLOK = $12 ;REAL TIME CLOCK (IN 16 MSEC UNITS>
+BUFADR = $15 ;INDIRECT BUFFER ADDRESS REGISTER
+ICCOMT = $17 ;COMMAND FOR VECTOR
+DSKFMS = $18 ;DISK FILE MANAGER POINTER
+DSKUTL = $1A ;DISK UTILITIES POINTER
+ABUFPT = $1C ;##1200xl## 4-byte ACMI buffer pointer area
+
+;PTIMOT = $1C ;##old## PRINTER TIME OUT REGISTER
+;PBPNT = $1D ;##old## PRINT BUFFER POINTER
+;PBUFSZ = $1E ;##old## PRINT BUFFER SIZE
+;PTEMP = $1F ;##old## TEMPORARY REGISTER
+
+ZIOCB = $20 ;ZERO PAGE I/O CONTROL BLOCK
+IOCBAS = $20 ;16-byte page zero IOCB
+ICHIDZ = $20 ;HANDLER INDEX NUMBER (FF = IOCB FREE)
+ICDNOZ = $21 ;DEVICE NUMBER (DRIVE NUMBER)
+ICCOMZ = $22 ;COMMAND CODE
+ICSTAZ = $23 ;STATUS OF LAST IOCB ACTION
+ICBALZ = $24 ;BUFFER ADDRESS LOW BYTE
+ICBAHZ = $25 ;1-byte high buffer address
+ICPTLZ = $26 ;PUT BYTE ROUTINE ADDRESS -1
+ICPTHZ = $27 ;1-byte high PUT-BYTE routine address
+ICBLLZ = $28 ;BUFFER LENGTH LOW BYTE
+ICBLHZ = $29 ;1-byte high buffer length
+ICAX1Z = $2A ;AUXILIARY INFORMATION FIRST BYTE
+ICAX2Z = $2B ;1-byte second auxiliary information
+ICSPRZ = $2C ;4-byte spares
+
+ENTVEC = $2C ;##rev2## 2-byte (not used)
+ICIDNO = $2E ;IOCB NUMBER X 16
+CIOCHR = $2F ;CHARACTER BYTE FOR CURRENT OPERATION
+
+STATUS = $30 ;INTERNAL STATUS STORAGE
+CHKSUM = $31 ;CHECKSUM (SINGLE BYTE SUM WITH CARRY)
+BUFRLO = $32 ;POINTER TO DATA BUFFER (LO BYTE)
+BUFRHI = $33 ;POINTER TO DATA BUFFER (HI BYTE)
+BFENLO = $34 ;NEXT BYTE PAST END OF THE DATA BUFFER LO
+BFENHI = $35 ;NEXT BYTE PAST END OF THE DATA BUFFER HI
+;CRETRY = $36 ;##old## NUMBER OF COMMAND FRAME RETRIES
+;DRETRY = $37 ;##old## NUMBER OF DEVICE RETRIES
+LTEMP = $36 ;##1200xl## 2-byte loader temporary
+BUFRFL = $38 ;DATA BUFFER FULL FLAG
+RECVDN = $39 ;RECEIVE DONE FLAG
+XMTDON = $3A ;TRANSMISSION DONE FLAG
+CHKSNT = $3B ;CHECKSUM SENT FLAG
+NOCKSM = $3C ;NO CHECKSUM FOLLOWS DATA FLAG
+BPTR = $3D ;1-byte cassette buffer pointer
+FTYPE = $3E ;1-byte cassette IRG type
+FEOF = $3F ;1-byte cassette EOF flag (0 = quiet)
+FREQ = $40 ;1-byte cassette beep counter
+SOUNDR = $41 ;NOISY I/0 FLAG. (ZERO IS QUIET)
+
+CRITIC = $42 ;DEFINES CRITICAL SECTION (CRITICAL IF NON-Z)
+
+FMSZPG = $43 ;DISK FILE MANAGER SYSTEM ZERO PAGE
+
+;CKEY = $4A ;##old## FLAG SET WHEN GAME START PRESSED
+ZCHAIN = $4A ;##1200xl## 2-byte handler linkage chain pointer
+;CASSBT = $4B ;##old## CASSETTE BOOT FLAG
+DSTAT = $4C ;DISPLAY STATUS
+ATRACT = $4D ;ATRACT FLAG
+DRKMSK = $4E ;DARK ATRACT MASK
+COLRSH = $4F ;ATRACT COLOR SHIFTER (EOR'ED WITH PLAYFIELD
+
+
+TMPCHR = $50 ;1-byte temporary character
+HOLD1 = $51 ;1-byte temporary
+LMARGN = $52 ;left margin (normally 2, cc65 C startup code sets it to 0)
+RMARGN = $53 ;right margin (normally 39 if no XEP80 is used)
+ROWCRS = $54 ;1-byte cursor row
+COLCRS = $55 ;2-byte cursor column
+DINDEX = $57 ;1-byte display mode
+SAVMSC = $58 ;2-byte saved memory scan counter
+OLDROW = $5A ;1-byte prior row
+OLDCOL = $5B ;2-byte prior column
+OLDCHR = $5D ;DATA UNDER CURSOR
+OLDADR = $5E ;2-byte saved cursor memory address
+FKDEF = $60 ;##1200xl## 2-byte function key definition table
+;NEWROW = $60 ;##old## POINT DRAW GOES TO
+;NEWCOL = $61 ;##old##
+PALNTS = $62 ;##1200xl## 1-byte PAL/NTSC indicator (0 = NTSC)
+LOGCOL = $63 ;POINTS AT COLUMN IN LOGICAL LINE
+ADRESS = $64 ;2-byte temporary address
+
+MLTTMP = $66 ;1-byte temporary
+OPNTMP = $66 ;FIRST BYTE IS USED IN OPEN AS TEMP
+TOADR = $66 ;##rev2## 2-byte destination address
+
+SAVADR = $68 ;2-byte saved address
+FRMADR = $68 ;##rev2## 2-byte source address
+
+RAMTOP = $6A ;RAM SIZE DEFINED BY POWER ON LOGIC
+BUFCNT = $6B ;BUFFER COUNT
+BUFSTR = $6C ;EDITOR GETCH POINTER
+BITMSK = $6E ;BIT MASK
+SHFAMT = $6F ;1-byte shift amount for pixel justifucation
+ROWAC = $70 ;2-byte draw working row
+COLAC = $72 ;2-byte draw working column
+ENDPT = $74 ;2-byte end point
+DELTAR = $76 ;1-byte row difference
+DELTAC = $77 ;2-byte column difference
+KEYDEF = $79 ;##1200xl## 2-byte key definition table address
+;ROWINC = $79 ;##old##
+;COLINC = $7A ;##old##
+SWPFLG = $7B ;NON-0 1F TXT AND REGULAR RAM IS SWAPPED
+HOLDCH = $7C ;CH IS MOVED HERE IN KGETCH BEFORE CNTL & SH
+INSDAT = $7D ;1-byte temporary
+COUNTR = $7E ;2-byte draw iteration count
; Floating Point Package Page Zero Address Equates
-FR0 = $D4 ;6-byte register 0
-FR0M = $D5 ;##rev2## 5-byte register 0 mantissa
-QTEMP = $D9 ;##rev2## 1-byte temporary
+FR0 = $D4 ;6-byte register 0
+FR0M = $D5 ;##rev2## 5-byte register 0 mantissa
+QTEMP = $D9 ;##rev2## 1-byte temporary
-FRE = $DA ;6-byte (internal) register E
+FRE = $DA ;6-byte (internal) register E
-FR1 = $E0 ;FP REG1
-FR1M = $E1 ;##rev2## 5-byte register 1 mantissa
+FR1 = $E0 ;FP REG1
+FR1M = $E1 ;##rev2## 5-byte register 1 mantissa
-FR2 = $E6 ;6-byte (internal) register 2
+FR2 = $E6 ;6-byte (internal) register 2
-FRX = $EC ;1-byte temporary
+FRX = $EC ;1-byte temporary
-EEXP = $ED ;VALUE OF E
+EEXP = $ED ;VALUE OF E
-FRSIGN = $EE ;##rev2## 1-byte floating point sign
-NSIGN = $EE ;SIGN OF #
+FRSIGN = $EE ;##rev2## 1-byte floating point sign
+NSIGN = $EE ;SIGN OF #
-PLYCNT = $EF ;##rev2## 1-byte polynomial degree
-ESIGN = $EF ;SIGN OF EXPONENT
+PLYCNT = $EF ;##rev2## 1-byte polynomial degree
+ESIGN = $EF ;SIGN OF EXPONENT
-SGNFLG = $F0 ;##rev2## 1-byte sign flag
-FCHRFLG = $F0 ;1ST CHAR FLAG
+SGNFLG = $F0 ;##rev2## 1-byte sign flag
+FCHRFLG = $F0 ;1ST CHAR FLAG
-XFMFLG = $F1 ;##rev2## 1-byte transform flag
-DIGRT = $F1 ;# OF DIGITS RIGHT OF DECIMAL
+XFMFLG = $F1 ;##rev2## 1-byte transform flag
+DIGRT = $F1 ;# OF DIGITS RIGHT OF DECIMAL
-CIX = $F2 ;CURRENT INPUT INDEX
-INBUFF = $F3 ;POINTS TO USER'S LINE INPUT BUFFER
+CIX = $F2 ;CURRENT INPUT INDEX
+INBUFF = $F3 ;POINTS TO USER'S LINE INPUT BUFFER
-ZTEMP1 = $F5 ;2-byte temporary
-ZTEMP4 = $F7 ;2-byte temporary
-ZTEMP3 = $F9 ;2-byte temporary
+ZTEMP1 = $F5 ;2-byte temporary
+ZTEMP4 = $F7 ;2-byte temporary
+ZTEMP3 = $F9 ;2-byte temporary
-;DEGFLG = $FB ;##old## same as RADFLG
-;RADFLG = $FB ;##old## 0=RADIANS, 6=DEGREES
+;DEGFLG = $FB ;##old## same as RADFLG
+;RADFLG = $FB ;##old## 0=RADIANS, 6=DEGREES
-FLPTR = $FC ;2-byte floating point number pointer
-FPTR2 = $FE ;2-byte floating point number pointer
+FLPTR = $FC ;2-byte floating point number pointer
+FPTR2 = $FE ;2-byte floating point number pointer
;-------------------------------------------------------------------------
; Page Two Address Equates
;-------------------------------------------------------------------------
-INTABS = $0200 ;INTERRUPT RAM
-
-VDSLST = $0200 ;DISPLAY LIST NMI VECTOR
-VPRCED = $0202 ;PROCEED LINE IRQ VECTOR
-VINTER = $0204 ;INTERRUPT LINE IRQ VECTOR
-VBREAK = $0206 ;SOFTWARE BREAK (00) INSTRUCTION IRQ VECTOR
-VKEYBD = $0208 ;POKEY KEYBOARD IRQ VECTOR
-VSERIN = $020A ;POKEY SERIAL INPUT READY IRQ
-VSEROR = $020C ;POKEY SERIAL OUTPUT READY IRQ
-VSEROC = $020E ;POKEY SERIAL OUTPUT COMPLETE IRQ
-VTIMR1 = $0210 ;POKEY TIMER 1 IRG
-VTIMR2 = $0212 ;POKEY TIMER 2 IRG
-VTIMR4 = $0214 ;POKEY TIMER 4 IRG
-VIMIRQ = $0216 ;IMMEDIATE IRG VECTOR
-CDTMV1 = $0218 ;COUNT DOWN TIMER 1
-CDTMV2 = $021A ;COUNT DOWN TIMER 2
-CDTMV3 = $021C ;COUNT DOWN TIMER 3
-CDTMV4 = $021E ;COUNT DOWN TIMER 4
-CDTMV5 = $0220 ;COUNT DOWN TIMER 5
-VVBLKI = $0222 ;IMMEDIATE VERTICAL BLANK NMI VECTOR
-VVBLKD = $0224 ;DEFERRED VERTICAL BLANK NMI VECTOR
-CDTMA1 = $0226 ;COUNT DOWN TIMER 1 JSR ADDRESS
-CDTMA2 = $0228 ;COUNT DOWN TIMER 2 JSR ADDRESS
-CDTMF3 = $022A ;COUNT DOWN TIMER 3 FLAG
-SRTIMR = $022B ;SOFTWARE REPEAT TIMER
-CDTMF4 = $022C ;COUNT DOWN TIMER 4 FLAG
-INTEMP = $022D ;IAN'S TEMP
-CDTMF5 = $022E ;COUNT DOWN TIMER FLAG 5
-SDMCTL = $022F ;SAVE DMACTL REGISTER
-SDLSTL = $0230 ;SAVE DISPLAY LIST LOW BYTE
-SDLSTH = $0231 ;SAVE DISPLAY LIST HI BYTE
-SSKCTL = $0232 ;SKCTL REGISTER RAM
-LCOUNT = $0233 ;##1200xl## 1-byte relocating loader record
-LPENH = $0234 ;LIGHT PEN HORIZONTAL VALUE
-LPENV = $0235 ;LIGHT PEN VERTICAL VALUE
-BRKKY = $0236 ;BREAK KEY VECTOR
-;RELADR = $0238 ;##1200xl## 2-byte relocatable loader address
-VPIRQ = $0238 ;##rev2## 2-byte parallel device IRQ vector
-CDEVIC = $023A ;COMMAND FRAME BUFFER - DEVICE
-CCOMND = $023B ;COMMAND
-CAUX1 = $023C ;COMMAND AUX BYTE 1
-CAUX2 = $023D ;COMMAND AUX BYTE 2
-
-TEMP = $023E ;TEMPORARY RAM CELL
-
-ERRFLG = $023F ;ERROR FLAG - ANY DEVICE ERROR EXCEPT TIME OUT
-
-DFLAGS = $0240 ;DISK FLAGS FROM SECTOR ONE
-DBSECT = $0241 ;NUMBER OF DISK BOOT SECTORS
-BOOTAD = $0242 ;ADDRESS WHERE DISK BOOT LOADER WILL BE PUT
-COLDST = $0244 ;COLDSTART FLAG (1=IN MIDDLE OF COLDSTART>
-RECLEN = $0245 ;##1200xl## 1-byte relocating loader record length
-DSKTIM = $0246 ;DISK TIME OUT REGISTER
-;LINBUF = $0247 ;##old## CHAR LINE BUFFER
-PDVMSK = $0247 ;##rev2## 1-byte parallel device selection mask
-SHPDVS = $0248 ;##rev2## 1-byte PDVS (parallel device select)
-PDIMSK = $0249 ;##rev2## 1-byte parallel device IRQ selection
-RELADR = $024A ;##rev2## 2-byte relocating loader relative adr.
-PPTMPA = $024C ;##rev2## 1-byte parallel device handler temporary
-PPTMPX = $024D ;##rev2## 1-byte parallel device handler temporary
-
-CHSALT = $026B ;##1200xl## 1-byte character set alternate
-VSFLAG = $026C ;##1200xl## 1-byte fine vertical scroll count
-KEYDIS = $026D ;##1200xl## 1-byte keyboard disable
-FINE = $026E ;##1200xl## 1-byte fine scrolling mode
-GPRIOR = $026F ;GLOBAL PRIORITY CELL
-
-PADDL0 = $0270 ;1-byte potentiometer 0
-PADDL1 = $0271 ;1-byte potentiometer 1
-PADDL2 = $0272 ;1-byte potentiometer 2
-PADDL3 = $0273 ;1-byte potentiometer 3
-PADDL4 = $0274 ;1-byte potentiometer 4
-PADDL5 = $0275 ;1-byte potentiometer 5
-PADDL6 = $0276 ;1-byte potentiometer 6
-PADDL7 = $0277 ;1-byte potentiometer 7
-
-STICK0 = $0278 ;1-byte joystick 0
-STICK1 = $0279 ;1-byte joystick 1
-STICK2 = $027A ;1-byte joystick 2
-STICK3 = $027B ;1-byte joystick 3
-
-PTRIG0 = $027C ;1-byte paddle trigger 0
-PTRIG1 = $027D ;1-byte paddle trigger 1
-PTRIG2 = $027E ;1-byte paddle trigger 2
-PTRIG3 = $027F ;1-byte paddle trigger 3
-PTRIG4 = $0280 ;1-byte paddle trigger 4
-PTRIG5 = $0281 ;1-byte paddle trigger 5
-PTRIG6 = $0281 ;1-byte paddle trigger 6
-PTRIG7 = $0283 ;1-byte paddle trigger 7
-
-STRIG0 = $0284 ;1-byte joystick trigger 0
-STRIG1 = $0285 ;1-byte joystick trigger 1
-STRIG2 = $0286 ;1-byte joystick trigger 2
-STRIG3 = $0287 ;1-byte joystick trigger 3
-
-;CSTAT = $0288 ;##old## cassette status register
-HIBYTE = $0288 ;##1200xl## 1-byte relocating loader high byte
-WMODE = $0289 ;1-byte cassette WRITE mode
-BLIM = $028A ;1-byte cassette buffer limit
-IMASK = $028B ;##rev2## (not used)
-JVECK = $028C ;2-byte jump vector or temporary
-NEWADR = $028E ;##1200xl## 2-byte relocating address
-TXTROW = $0290 ;TEXT ROWCRS
-TXTCOL = $0291 ;TEXT COLCRS
-TINDEX = $0293 ;TEXT INDEX
-TXTMSC = $0294 ;FOOLS CONVRT INTO NEW MSC
-TXTOLD = $0296 ;OLDROW & OLDCOL FOR TEXT (AND THEN SOME)
-;TMPX1 = $029C ;##old## 1-byte temporary register
-CRETRY = $029C ;##1200xl## 1-byte number of command frame retries
-HOLD3 = $029D ;1-byte temporary
-SUBTMP = $029E ;1-byte temporary
-HOLD2 = $029F ;1-byte (not used)
-DMASK = $02A0 ;1-byte display (pixel location) mask
-TMPLBT = $02A1 ;1-byte (not used)
-ESCFLG = $02A2 ;ESCAPE FLAG
-TABMAP = $02A3 ;15-byte (120 bit) tab stop bit map
-LOGMAP = $02B2 ;LOGICAL LINE START BIT MAP
-INVFLG = $02B6 ;INVERSE VIDEO FLAG (TOGGLED BY ATARI KEY)
-FILFLG = $02B7 ;RIGHT FILL FLAG FOR DRAW
-TMPROW = $02B8 ;1-byte temporary row
-TMPCOL = $02B9 ;2-byte temporary column
-SCRFLG = $02BB ;SET IF SCROLL OCCURS
-HOLD4 = $02BC ;TEMP CELL USED IN DRAW ONLY
-;HOLD5 = $02BD ;##old## DITTO
-DRETRY = $02BD ;##1200xl## 1-byte number of device retries
-SHFLOK = $02BE ;1-byte shift/control lock flags
-BOTSCR = $02BF ;BOTTOM OF SCREEN 24 NORM 4 SPLIT
-
-PCOLR0 = $02C0 ;1-byte player-missile 0 color/luminance
-PCOLR1 = $02C1 ;1-byte player-missile 1 color/luminance
-PCOLR2 = $02C2 ;1-byte player-missile 2 color/luminance
-PCOLR3 = $02C3 ;1-byte player-missile 3 color/luminance
-
-COLOR0 = $02C4 ;1-byte playfield 0 color/luminance
-COLOR1 = $02C5 ;1-byte playfield 1 color/luminance
-COLOR2 = $02C6 ;1-byte playfield 2 color/luminance
-COLOR3 = $02C7 ;1-byte playfield 3 color/luminance
-
-COLOR4 = $02C8 ;1-byte background color/luminance
-
-PARMBL = $02C9 ;##rev2## 6-byte relocating loader parameter
-RUNADR = $02C9 ;##1200xl## 2-byte run address
-HIUSED = $02CB ;##1200xl## 2-byte highest non-zero page address
-ZHIUSE = $02CD ;##1200xl## 2-byte highest zero page address
-
-OLDPAR = $02CF ;##rev2## 6-byte relocating loader parameter
-GBYTEA = $02CF ;##1200xl## 2-byte GET-BYTE routine address
-LOADAD = $02D1 ;##1200xl## 2-byte non-zero page load address
-ZLOADA = $02D3 ;##1200xl## 2-byte zero page load address
-
-DSCTLN = $02D5 ;##1200xl## 2-byte disk sector length
-ACMISR = $02D7 ;##1200xl## 2-byte ACMI interrupt service routine
-KRPDEL = $02D9 ;##1200xl## 1-byte auto-repeat delay
-KEYREP = $02DA ;##1200xl## 1-byte auto-repeat rate
-NOCLIK = $02DB ;##1200xl## 1-byte key click disable
-HELPFG = $02DC ;##1200xl## 1-byte HELP key flag (0 = no HELP)
-DMASAV = $02DD ;##1200xl## 1-byte SDMCTL save/restore
-PBPNT = $02DE ;##1200xl## 1-byte printer buffer pointer
-PBUFSZ = $02DF ;##1200xl## 1-byte printer buffer size
-
-GLBABS = $02E0 ;4-byte global variables for non-DOS users
-RUNAD = $02E0 ;##map## 2-byte binary file run address
-INITAD = $02E2 ;##map## 2-byte binary file initialization address
-
-RAMSIZ = $02E4 ;RAM SIZE (HI BYTE ONLY)
-MEMTOP = $02E5 ;TOP OF AVAILABLE USER MEMORY
-MEMLO = $02E7 ;BOTTOM OF AVAILABLE USER MEMORY
-HNDLOD = $02E9 ;##1200xl## 1-byte user load flag
-DVSTAT = $02EA ;STATUS BUFFER
-CBAUDL = $02EE ;1-byte low cassette baud rate
-CBAUDH = $02EF ;1-byte high cassette baud rate
-CRSINH = $02F0 ;CURSOR INHIBIT (00 = CURSOR ON)
-KEYDEL = $02F1 ;KEY DELAY
-CH1 = $02F2 ;1-byte prior keyboard character
-CHACT = $02F3 ;CHACTL REGISTER RAM
-CHBAS = $02F4 ;CHBAS REGISTER RAM
-
-NEWROW = $02F5 ;##1200xl## 1-byte draw destination row
-NEWCOL = $02F6 ;##1200xl## 2-byte draw destination column
-ROWINC = $02F8 ;##1200xl## 1-byte draw row increment
-COLINC = $02F9 ;##1200xl## 1-byte draw column increment
-
-CHAR = $02FA ;1-byte internal character
-ATACHR = $02FB ;ATASCII CHARACTER
-CH = $02FC ;GLOBAL VARIABLE FOR KEYBOARD
-FILDAT = $02FD ;RIGHT FILL DATA
-DSPFLG = $02FE ;DISPLAY FLAG DISPLAY CNTLS IF NON-ZERO
-SSFLAG = $02FF ;START/STOP FLAG FOR PAGING (CNTL 1). CLEARE
+INTABS = $0200 ;INTERRUPT RAM
+
+VDSLST = $0200 ;DISPLAY LIST NMI VECTOR
+VPRCED = $0202 ;PROCEED LINE IRQ VECTOR
+VINTER = $0204 ;INTERRUPT LINE IRQ VECTOR
+VBREAK = $0206 ;SOFTWARE BREAK (00) INSTRUCTION IRQ VECTOR
+VKEYBD = $0208 ;POKEY KEYBOARD IRQ VECTOR
+VSERIN = $020A ;POKEY SERIAL INPUT READY IRQ
+VSEROR = $020C ;POKEY SERIAL OUTPUT READY IRQ
+VSEROC = $020E ;POKEY SERIAL OUTPUT COMPLETE IRQ
+VTIMR1 = $0210 ;POKEY TIMER 1 IRG
+VTIMR2 = $0212 ;POKEY TIMER 2 IRG
+VTIMR4 = $0214 ;POKEY TIMER 4 IRG
+VIMIRQ = $0216 ;IMMEDIATE IRG VECTOR
+CDTMV1 = $0218 ;COUNT DOWN TIMER 1
+CDTMV2 = $021A ;COUNT DOWN TIMER 2
+CDTMV3 = $021C ;COUNT DOWN TIMER 3
+CDTMV4 = $021E ;COUNT DOWN TIMER 4
+CDTMV5 = $0220 ;COUNT DOWN TIMER 5
+VVBLKI = $0222 ;IMMEDIATE VERTICAL BLANK NMI VECTOR
+VVBLKD = $0224 ;DEFERRED VERTICAL BLANK NMI VECTOR
+CDTMA1 = $0226 ;COUNT DOWN TIMER 1 JSR ADDRESS
+CDTMA2 = $0228 ;COUNT DOWN TIMER 2 JSR ADDRESS
+CDTMF3 = $022A ;COUNT DOWN TIMER 3 FLAG
+SRTIMR = $022B ;SOFTWARE REPEAT TIMER
+CDTMF4 = $022C ;COUNT DOWN TIMER 4 FLAG
+INTEMP = $022D ;IAN'S TEMP
+CDTMF5 = $022E ;COUNT DOWN TIMER FLAG 5
+SDMCTL = $022F ;SAVE DMACTL REGISTER
+SDLSTL = $0230 ;SAVE DISPLAY LIST LOW BYTE
+SDLSTH = $0231 ;SAVE DISPLAY LIST HI BYTE
+SSKCTL = $0232 ;SKCTL REGISTER RAM
+LCOUNT = $0233 ;##1200xl## 1-byte relocating loader record
+LPENH = $0234 ;LIGHT PEN HORIZONTAL VALUE
+LPENV = $0235 ;LIGHT PEN VERTICAL VALUE
+BRKKY = $0236 ;BREAK KEY VECTOR
+;RELADR = $0238 ;##1200xl## 2-byte relocatable loader address
+VPIRQ = $0238 ;##rev2## 2-byte parallel device IRQ vector
+CDEVIC = $023A ;COMMAND FRAME BUFFER - DEVICE
+CCOMND = $023B ;COMMAND
+CAUX1 = $023C ;COMMAND AUX BYTE 1
+CAUX2 = $023D ;COMMAND AUX BYTE 2
+
+TEMP = $023E ;TEMPORARY RAM CELL
+
+ERRFLG = $023F ;ERROR FLAG - ANY DEVICE ERROR EXCEPT TIME OUT
+
+DFLAGS = $0240 ;DISK FLAGS FROM SECTOR ONE
+DBSECT = $0241 ;NUMBER OF DISK BOOT SECTORS
+BOOTAD = $0242 ;ADDRESS WHERE DISK BOOT LOADER WILL BE PUT
+COLDST = $0244 ;COLDSTART FLAG (1=IN MIDDLE OF COLDSTART>
+RECLEN = $0245 ;##1200xl## 1-byte relocating loader record length
+DSKTIM = $0246 ;DISK TIME OUT REGISTER
+;LINBUF = $0247 ;##old## CHAR LINE BUFFER
+PDVMSK = $0247 ;##rev2## 1-byte parallel device selection mask
+SHPDVS = $0248 ;##rev2## 1-byte PDVS (parallel device select)
+PDIMSK = $0249 ;##rev2## 1-byte parallel device IRQ selection
+RELADR = $024A ;##rev2## 2-byte relocating loader relative adr.
+PPTMPA = $024C ;##rev2## 1-byte parallel device handler temporary
+PPTMPX = $024D ;##rev2## 1-byte parallel device handler temporary
+
+CHSALT = $026B ;##1200xl## 1-byte character set alternate
+VSFLAG = $026C ;##1200xl## 1-byte fine vertical scroll count
+KEYDIS = $026D ;##1200xl## 1-byte keyboard disable
+FINE = $026E ;##1200xl## 1-byte fine scrolling mode
+GPRIOR = $026F ;GLOBAL PRIORITY CELL
+
+PADDL0 = $0270 ;1-byte potentiometer 0
+PADDL1 = $0271 ;1-byte potentiometer 1
+PADDL2 = $0272 ;1-byte potentiometer 2
+PADDL3 = $0273 ;1-byte potentiometer 3
+PADDL4 = $0274 ;1-byte potentiometer 4
+PADDL5 = $0275 ;1-byte potentiometer 5
+PADDL6 = $0276 ;1-byte potentiometer 6
+PADDL7 = $0277 ;1-byte potentiometer 7
+
+STICK0 = $0278 ;1-byte joystick 0
+STICK1 = $0279 ;1-byte joystick 1
+STICK2 = $027A ;1-byte joystick 2
+STICK3 = $027B ;1-byte joystick 3
+
+PTRIG0 = $027C ;1-byte paddle trigger 0
+PTRIG1 = $027D ;1-byte paddle trigger 1
+PTRIG2 = $027E ;1-byte paddle trigger 2
+PTRIG3 = $027F ;1-byte paddle trigger 3
+PTRIG4 = $0280 ;1-byte paddle trigger 4
+PTRIG5 = $0281 ;1-byte paddle trigger 5
+PTRIG6 = $0281 ;1-byte paddle trigger 6
+PTRIG7 = $0283 ;1-byte paddle trigger 7
+
+STRIG0 = $0284 ;1-byte joystick trigger 0
+STRIG1 = $0285 ;1-byte joystick trigger 1
+STRIG2 = $0286 ;1-byte joystick trigger 2
+STRIG3 = $0287 ;1-byte joystick trigger 3
+
+;CSTAT = $0288 ;##old## cassette status register
+HIBYTE = $0288 ;##1200xl## 1-byte relocating loader high byte
+WMODE = $0289 ;1-byte cassette WRITE mode
+BLIM = $028A ;1-byte cassette buffer limit
+IMASK = $028B ;##rev2## (not used)
+JVECK = $028C ;2-byte jump vector or temporary
+NEWADR = $028E ;##1200xl## 2-byte relocating address
+TXTROW = $0290 ;TEXT ROWCRS
+TXTCOL = $0291 ;TEXT COLCRS
+TINDEX = $0293 ;TEXT INDEX
+TXTMSC = $0294 ;FOOLS CONVRT INTO NEW MSC
+TXTOLD = $0296 ;OLDROW & OLDCOL FOR TEXT (AND THEN SOME)
+;TMPX1 = $029C ;##old## 1-byte temporary register
+CRETRY = $029C ;##1200xl## 1-byte number of command frame retries
+HOLD3 = $029D ;1-byte temporary
+SUBTMP = $029E ;1-byte temporary
+HOLD2 = $029F ;1-byte (not used)
+DMASK = $02A0 ;1-byte display (pixel location) mask
+TMPLBT = $02A1 ;1-byte (not used)
+ESCFLG = $02A2 ;ESCAPE FLAG
+TABMAP = $02A3 ;15-byte (120 bit) tab stop bit map
+LOGMAP = $02B2 ;LOGICAL LINE START BIT MAP
+INVFLG = $02B6 ;INVERSE VIDEO FLAG (TOGGLED BY ATARI KEY)
+FILFLG = $02B7 ;RIGHT FILL FLAG FOR DRAW
+TMPROW = $02B8 ;1-byte temporary row
+TMPCOL = $02B9 ;2-byte temporary column
+SCRFLG = $02BB ;SET IF SCROLL OCCURS
+HOLD4 = $02BC ;TEMP CELL USED IN DRAW ONLY
+;HOLD5 = $02BD ;##old## DITTO
+DRETRY = $02BD ;##1200xl## 1-byte number of device retries
+SHFLOK = $02BE ;1-byte shift/control lock flags
+BOTSCR = $02BF ;BOTTOM OF SCREEN 24 NORM 4 SPLIT
+
+PCOLR0 = $02C0 ;1-byte player-missile 0 color/luminance
+PCOLR1 = $02C1 ;1-byte player-missile 1 color/luminance
+PCOLR2 = $02C2 ;1-byte player-missile 2 color/luminance
+PCOLR3 = $02C3 ;1-byte player-missile 3 color/luminance
+
+COLOR0 = $02C4 ;1-byte playfield 0 color/luminance
+COLOR1 = $02C5 ;1-byte playfield 1 color/luminance
+COLOR2 = $02C6 ;1-byte playfield 2 color/luminance
+COLOR3 = $02C7 ;1-byte playfield 3 color/luminance
+
+COLOR4 = $02C8 ;1-byte background color/luminance
+
+PARMBL = $02C9 ;##rev2## 6-byte relocating loader parameter
+RUNADR = $02C9 ;##1200xl## 2-byte run address
+HIUSED = $02CB ;##1200xl## 2-byte highest non-zero page address
+ZHIUSE = $02CD ;##1200xl## 2-byte highest zero page address
+
+OLDPAR = $02CF ;##rev2## 6-byte relocating loader parameter
+GBYTEA = $02CF ;##1200xl## 2-byte GET-BYTE routine address
+LOADAD = $02D1 ;##1200xl## 2-byte non-zero page load address
+ZLOADA = $02D3 ;##1200xl## 2-byte zero page load address
+
+DSCTLN = $02D5 ;##1200xl## 2-byte disk sector length
+ACMISR = $02D7 ;##1200xl## 2-byte ACMI interrupt service routine
+KRPDEL = $02D9 ;##1200xl## 1-byte auto-repeat delay
+KEYREP = $02DA ;##1200xl## 1-byte auto-repeat rate
+NOCLIK = $02DB ;##1200xl## 1-byte key click disable
+HELPFG = $02DC ;##1200xl## 1-byte HELP key flag (0 = no HELP)
+DMASAV = $02DD ;##1200xl## 1-byte SDMCTL save/restore
+PBPNT = $02DE ;##1200xl## 1-byte printer buffer pointer
+PBUFSZ = $02DF ;##1200xl## 1-byte printer buffer size
+
+GLBABS = $02E0 ;4-byte global variables for non-DOS users
+RUNAD = $02E0 ;##map## 2-byte binary file run address
+INITAD = $02E2 ;##map## 2-byte binary file initialization address
+
+RAMSIZ = $02E4 ;RAM SIZE (HI BYTE ONLY)
+MEMTOP = $02E5 ;TOP OF AVAILABLE USER MEMORY
+MEMLO = $02E7 ;BOTTOM OF AVAILABLE USER MEMORY
+HNDLOD = $02E9 ;##1200xl## 1-byte user load flag
+DVSTAT = $02EA ;STATUS BUFFER
+CBAUDL = $02EE ;1-byte low cassette baud rate
+CBAUDH = $02EF ;1-byte high cassette baud rate
+CRSINH = $02F0 ;CURSOR INHIBIT (00 = CURSOR ON)
+KEYDEL = $02F1 ;KEY DELAY
+CH1 = $02F2 ;1-byte prior keyboard character
+CHACT = $02F3 ;CHACTL REGISTER RAM
+CHBAS = $02F4 ;CHBAS REGISTER RAM
+
+NEWROW = $02F5 ;##1200xl## 1-byte draw destination row
+NEWCOL = $02F6 ;##1200xl## 2-byte draw destination column
+ROWINC = $02F8 ;##1200xl## 1-byte draw row increment
+COLINC = $02F9 ;##1200xl## 1-byte draw column increment
+
+CHAR = $02FA ;1-byte internal character
+ATACHR = $02FB ;ATASCII CHARACTER
+CH = $02FC ;GLOBAL VARIABLE FOR KEYBOARD
+FILDAT = $02FD ;RIGHT FILL DATA
+DSPFLG = $02FE ;DISPLAY FLAG DISPLAY CNTLS IF NON-ZERO
+SSFLAG = $02FF ;START/STOP FLAG FOR PAGING (CNTL 1). CLEARE
;-------------------------------------------------------------------------
; Page Three Address Equates
;-------------------------------------------------------------------------
-DCB = $0300 ;DEVICE CONTROL BLOCK
-DDEVIC = $0300 ;PERIPHERAL UNIT 1 BUS I.D. NUMBER
-DUNIT = $0301 ;UNIT NUMBER
-DCOMND = $0302 ;BUS COMMAND
-DSTATS = $0303 ;COMMAND TYPE/STATUS RETURN
-DBUFLO = $0304 ;1-byte low data buffer address
-DBUFHI = $0305 ;1-byte high data buffer address
-DTIMLO = $0306 ;DEVICE TIME OUT IN 1 SECOND UNITS
-DUNUSE = $0307 ;UNUSED BYTE
-DBYTLO = $0308 ;1-byte low number of bytes to transfer
-DBYTHI = $0309 ;1-byte high number of bytes to transfer
-DAUX1 = $030A ;1-byte first command auxiliary
-DAUX2 = $030B ;1-byte second command auxiliary
-
-TIMER1 = $030C ;INITIAL TIMER VALUE
-;ADDCOR = $030E ;##old## ADDITION CORRECTION
-JMPERS = $030E ;##1200xl## 1-byte jumper options
-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
-PTIMOT = $0314 ;##1200xl## 1-byte printer timeout
-TEMP3 = $0315 ;TEMPORARY STORAGE REGISTER
-SAVIO = $0316 ;SAVE SERIAL IN DATA PORT
-TIMFLG = $0317 ;TIME OUT FLAG FOR BAUD RATE CORRECTION
-STACKP = $0318 ;SIO STACK POINTER SAVE CELL
-TSTAT = $0319 ;TEMPORARY STATUS HOLDER
-
-HATABS = $031A ;35-byte handler address table (was 38 bytes)
-PUPBT1 = $033D ;##1200xl## 1-byte power-up validation byte 1
-PUPBT2 = $033E ;##1200xl## 1-byte power-up validation byte 2
-PUPBT3 = $033F ;##1200xl## 1-byte power-up validation byte 3
-
-IOCB = $0340 ;I/O CONTROL BLOCKS
-ICHID = $0340 ;HANDLER INDEX NUMBER (FF=IOCB FREE)
-ICDNO = $0341 ;DEVICE NUMBER (DRIVE NUMBER)
-ICCOM = $0342 ;COMMAND CODE
-ICSTA = $0343 ;STATUS OF LAST IOCB ACTION
-ICBAL = $0344 ;1-byte low buffer address
-ICBAH = $0345 ;1-byte high buffer address
-ICPTL = $0346 ;1-byte low PUT-BYTE routine address - 1
-ICPTH = $0347 ;1-byte high PUT-BYTE routine address - 1
-ICBLL = $0348 ;1-byte low buffer length
-ICBLH = $0349 ;1-byte high buffer length
-ICAX1 = $034A ;1-byte first auxiliary information
-ICAX2 = $034B ;1-byte second auxiliary information
-ICAX3 = $034C ;1-byte third auxiliary information
-ICAX4 = $034D ;1-byte fourth auxiliary information
-ICAX5 = $034E ;1-byte fifth auxiliary information
-ICSPR = $034F ;SPARE BYTE
-
-PRNBUF = $03C0 ;PRINTER BUFFER
-SUPERF = $03E8 ;##1200xl## 1-byte editor super function flag
-CKEY = $03E9 ;##1200xl## 1-byte cassette boot request flag
-CASSBT = $03EA ;##1200xl## 1-byte cassette boot flag
-CARTCK = $03EB ;##1200xl## 1-byte cartridge equivalence check
-DERRF = $03EC ;##rev2## 1-byte screen OPEN error flag
+DCB = $0300 ;DEVICE CONTROL BLOCK
+DDEVIC = $0300 ;PERIPHERAL UNIT 1 BUS I.D. NUMBER
+DUNIT = $0301 ;UNIT NUMBER
+DCOMND = $0302 ;BUS COMMAND
+DSTATS = $0303 ;COMMAND TYPE/STATUS RETURN
+DBUFLO = $0304 ;1-byte low data buffer address
+DBUFHI = $0305 ;1-byte high data buffer address
+DTIMLO = $0306 ;DEVICE TIME OUT IN 1 SECOND UNITS
+DUNUSE = $0307 ;UNUSED BYTE
+DBYTLO = $0308 ;1-byte low number of bytes to transfer
+DBYTHI = $0309 ;1-byte high number of bytes to transfer
+DAUX1 = $030A ;1-byte first command auxiliary
+DAUX2 = $030B ;1-byte second command auxiliary
+
+TIMER1 = $030C ;INITIAL TIMER VALUE
+;ADDCOR = $030E ;##old## ADDITION CORRECTION
+JMPERS = $030E ;##1200xl## 1-byte jumper options
+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
+PTIMOT = $0314 ;##1200xl## 1-byte printer timeout
+TEMP3 = $0315 ;TEMPORARY STORAGE REGISTER
+SAVIO = $0316 ;SAVE SERIAL IN DATA PORT
+TIMFLG = $0317 ;TIME OUT FLAG FOR BAUD RATE CORRECTION
+STACKP = $0318 ;SIO STACK POINTER SAVE CELL
+TSTAT = $0319 ;TEMPORARY STATUS HOLDER
+
+HATABS = $031A ;35-byte handler address table (was 38 bytes)
+PUPBT1 = $033D ;##1200xl## 1-byte power-up validation byte 1
+PUPBT2 = $033E ;##1200xl## 1-byte power-up validation byte 2
+PUPBT3 = $033F ;##1200xl## 1-byte power-up validation byte 3
+
+IOCB = $0340 ;I/O CONTROL BLOCKS
+ICHID = $0340 ;HANDLER INDEX NUMBER (FF=IOCB FREE)
+ICDNO = $0341 ;DEVICE NUMBER (DRIVE NUMBER)
+ICCOM = $0342 ;COMMAND CODE
+ICSTA = $0343 ;STATUS OF LAST IOCB ACTION
+ICBAL = $0344 ;1-byte low buffer address
+ICBAH = $0345 ;1-byte high buffer address
+ICPTL = $0346 ;1-byte low PUT-BYTE routine address - 1
+ICPTH = $0347 ;1-byte high PUT-BYTE routine address - 1
+ICBLL = $0348 ;1-byte low buffer length
+ICBLH = $0349 ;1-byte high buffer length
+ICAX1 = $034A ;1-byte first auxiliary information
+ICAX2 = $034B ;1-byte second auxiliary information
+ICAX3 = $034C ;1-byte third auxiliary information
+ICAX4 = $034D ;1-byte fourth auxiliary information
+ICAX5 = $034E ;1-byte fifth auxiliary information
+ICSPR = $034F ;SPARE BYTE
+
+PRNBUF = $03C0 ;PRINTER BUFFER
+SUPERF = $03E8 ;##1200xl## 1-byte editor super function flag
+CKEY = $03E9 ;##1200xl## 1-byte cassette boot request flag
+CASSBT = $03EA ;##1200xl## 1-byte cassette boot flag
+CARTCK = $03EB ;##1200xl## 1-byte cartridge equivalence check
+DERRF = $03EC ;##rev2## 1-byte screen OPEN error flag
; Remainder of Page Three Not Cleared upon Reset
-ACMVAR = $03ED ;##1200xl## 11 bytes reserved for ACMI
-BASICF = $03F8 ;##rev2## 1-byte BASIC switch flag
-MINTLK = $03F9 ;##1200xl## 1-byte ACMI module interlock
-GINTLK = $03FA ;##1200xl## 1-byte cartridge interlock
-CHLINK = $03FB ;##1200xl## 2-byte loaded handler chain link
-CASBUF = $03FD ;CASSETTE BUFFER
+ACMVAR = $03ED ;##1200xl## 11 bytes reserved for ACMI
+BASICF = $03F8 ;##rev2## 1-byte BASIC switch flag
+MINTLK = $03F9 ;##1200xl## 1-byte ACMI module interlock
+GINTLK = $03FA ;##1200xl## 1-byte cartridge interlock
+CHLINK = $03FB ;##1200xl## 2-byte loaded handler chain link
+CASBUF = $03FD ;CASSETTE BUFFER
;-------------------------------------------------------------------------
; Page Four/Five Address Equates
;-------------------------------------------------------------------------
; USER AREA STARTS HERE AND GOES TO END OF PAGE FIVE
-USAREA = $0480 ;128 bytes reserved for application
+USAREA = $0480 ;128 bytes reserved for application
-LBPR1 = $057E ;LBUFF PREFIX 1
-LBPR2 = $057F ;LBUFF PREFIX 2
-LBUFF = $0580 ;128-byte line buffer
+LBPR1 = $057E ;LBUFF PREFIX 1
+LBPR2 = $057F ;LBUFF PREFIX 2
+LBUFF = $0580 ;128-byte line buffer
-PLYARG = $05E0 ;6-byte floating point polynomial argument
-FPSCR = $05E6 ;6-byte floating point temporary
-FPSCR1 = $05EC ;6-byte floating point temporary
+PLYARG = $05E0 ;6-byte floating point polynomial argument
+FPSCR = $05E6 ;6-byte floating point temporary
+FPSCR1 = $05EC ;6-byte floating point temporary
-;LBFEND = $05FF ;##old## END OF LBUFF
+;LBFEND = $05FF ;##old## END OF LBUFF
;-------------------------------------------------------------------------
; Cartridge Address Equates
;-------------------------------------------------------------------------
-CARTCS = $BFFA ;##rev2## 2-byte cartridge coldstart address
-CART = $BFFC ;##rev2## 1-byte cartridge present indicator
-CARTFG = $BFFD ;##rev2## 1-byte cartridge flags
-CARTAD = $BFFE ;##rev2## 2-byte cartridge start vector
+CARTCS = $BFFA ;##rev2## 2-byte cartridge coldstart address
+CART = $BFFC ;##rev2## 1-byte cartridge present indicator
+CARTFG = $BFFD ;##rev2## 1-byte cartridge flags
+CARTAD = $BFFE ;##rev2## 2-byte cartridge start vector
;-------------------------------------------------------------------------
; CTIA/GTIA Address Equates
;-------------------------------------------------------------------------
-GTIA = $D000 ;CTIA/GTIA area
+GTIA = $D000 ;CTIA/GTIA area
; Read/Write Addresses
-CONSOL = $D01F ;console switches and speaker control
+CONSOL = $D01F ;console switches and speaker control
; Read Addresses
-M0PF = $D000 ;missile 0 and playfield collision
-M1PF = $D001 ;missile 1 and playfield collision
-M2PF = $D002 ;missile 2 and playfield collision
-M3PF = $D003 ;missile 3 and playfield collision
+M0PF = $D000 ;missile 0 and playfield collision
+M1PF = $D001 ;missile 1 and playfield collision
+M2PF = $D002 ;missile 2 and playfield collision
+M3PF = $D003 ;missile 3 and playfield collision
-P0PF = $D004 ;player 0 and playfield collision
-P1PF = $D005 ;player 1 and playfield collision
-P2PF = $D006 ;player 2 and playfield collision
-P3PF = $D007 ;player 3 and playfield collision
+P0PF = $D004 ;player 0 and playfield collision
+P1PF = $D005 ;player 1 and playfield collision
+P2PF = $D006 ;player 2 and playfield collision
+P3PF = $D007 ;player 3 and playfield collision
-M0PL = $D008 ;missile 0 and player collision
-M1PL = $D009 ;missile 1 and player collision
-M2PL = $D00A ;missile 2 and player collision
-M3PL = $D00B ;missile 3 and player collision
+M0PL = $D008 ;missile 0 and player collision
+M1PL = $D009 ;missile 1 and player collision
+M2PL = $D00A ;missile 2 and player collision
+M3PL = $D00B ;missile 3 and player collision
-P0PL = $D00C ;player 0 and player collision
-P1PL = $D00D ;player 1 and player collision
-P2PL = $D00E ;player 2 and player collision
-P3PL = $D00F ;player 3 and player collision
+P0PL = $D00C ;player 0 and player collision
+P1PL = $D00D ;player 1 and player collision
+P2PL = $D00E ;player 2 and player collision
+P3PL = $D00F ;player 3 and player collision
-TRIG0 = $D010 ;joystick trigger 0
-TRIG1 = $D011 ;joystick trigger 1
+TRIG0 = $D010 ;joystick trigger 0
+TRIG1 = $D011 ;joystick trigger 1
-TRIG2 = $D012 ;cartridge interlock
-TRIG3 = $D013 ;ACMI module interlock
+TRIG2 = $D012 ;cartridge interlock
+TRIG3 = $D013 ;ACMI module interlock
-PAL = $D014 ;##rev2## PAL/NTSC indicator
+PAL = $D014 ;##rev2## PAL/NTSC indicator
; Write Addresses
-HPOSP0 = $D000 ;player 0 horizontal position
-HPOSP1 = $D001 ;player 1 horizontal position
-HPOSP2 = $D002 ;player 2 horizontal position
-HPOSP3 = $D003 ;player 3 horizontal position
+HPOSP0 = $D000 ;player 0 horizontal position
+HPOSP1 = $D001 ;player 1 horizontal position
+HPOSP2 = $D002 ;player 2 horizontal position
+HPOSP3 = $D003 ;player 3 horizontal position
-HPOSM0 = $D004 ;missile 0 horizontal position
-HPOSM1 = $D005 ;missile 1 horizontal position
-HPOSM2 = $D006 ;missile 2 horizontal position
-HPOSM3 = $D007 ;missile 3 horizontal position
+HPOSM0 = $D004 ;missile 0 horizontal position
+HPOSM1 = $D005 ;missile 1 horizontal position
+HPOSM2 = $D006 ;missile 2 horizontal position
+HPOSM3 = $D007 ;missile 3 horizontal position
-SIZEP0 = $D008 ;player 0 size
-SIZEP1 = $D009 ;player 1 size
-SIZEP2 = $D00A ;player 2 size
-SIZEP3 = $D00B ;player 3 size
+SIZEP0 = $D008 ;player 0 size
+SIZEP1 = $D009 ;player 1 size
+SIZEP2 = $D00A ;player 2 size
+SIZEP3 = $D00B ;player 3 size
-SIZEM = $D00C ;missile sizes
+SIZEM = $D00C ;missile sizes
-GRAFP0 = $D00D ;player 0 graphics
-GRAFP1 = $D00E ;player 1 graphics
-GRAFP2 = $D00F ;player 2 graphics
-GRAFP3 = $D010 ;player 3 graphics
+GRAFP0 = $D00D ;player 0 graphics
+GRAFP1 = $D00E ;player 1 graphics
+GRAFP2 = $D00F ;player 2 graphics
+GRAFP3 = $D010 ;player 3 graphics
-GRAFM = $D011 ;missile graphics
+GRAFM = $D011 ;missile graphics
-COLPM0 = $D012 ;player-missile 0 color/luminance
-COLPM1 = $D013 ;player-missile 1 color/luminance
-COLPM2 = $D014 ;player-missile 2 color/luminance
-COLPM3 = $D015 ;player-missile 3 color/luminance
+COLPM0 = $D012 ;player-missile 0 color/luminance
+COLPM1 = $D013 ;player-missile 1 color/luminance
+COLPM2 = $D014 ;player-missile 2 color/luminance
+COLPM3 = $D015 ;player-missile 3 color/luminance
-COLPF0 = $D016 ;playfield 0 color/luminance
-COLPF1 = $D017 ;playfield 1 color/luminance
-COLPF2 = $D018 ;playfield 2 color/luminance
-COLPF3 = $D019 ;playfield 3 color/luminance
+COLPF0 = $D016 ;playfield 0 color/luminance
+COLPF1 = $D017 ;playfield 1 color/luminance
+COLPF2 = $D018 ;playfield 2 color/luminance
+COLPF3 = $D019 ;playfield 3 color/luminance
-COLBK = $D01A ;background color/luminance
+COLBK = $D01A ;background color/luminance
-PRIOR = $D01B ;priority select
-VDELAY = $D01C ;vertical delay
-GRACTL = $D01D ;graphic control
-HITCLR = $D01E ;collision clear
+PRIOR = $D01B ;priority select
+VDELAY = $D01C ;vertical delay
+GRACTL = $D01D ;graphic control
+HITCLR = $D01E ;collision clear
;-------------------------------------------------------------------------
; PBI Address Equates
;-------------------------------------------------------------------------
-PBI = $D100 ;##rev2## parallel bus interface area
+PBI = $D100 ;##rev2## parallel bus interface area
; Read Addresses
-PDVI = $D1FF ;##rev2## parallel device IRQ status
+PDVI = $D1FF ;##rev2## parallel device IRQ status
; Write Addresses
-PDVS = $D1FF ;##rev2## parallel device select
+PDVS = $D1FF ;##rev2## parallel device select
; PBI RAM Address Equates
-PBIRAM = $D600 ;##rev2## parallel bus interface RAM area
+PBIRAM = $D600 ;##rev2## parallel bus interface RAM area
; Parallel Device Address Equates
-PDID1 = $D803 ;##rev2## parallel device ID 1
-PDIDV = $D805 ;##rev2## parallel device I/O vector
-PDIRQV = $D808 ;##rev2## parallel device IRQ vector
-PDID2 = $D80B ;##rev2## parallel device ID 2
-PDVV = $D80D ;##rev2## parallel device vector table
+PDID1 = $D803 ;##rev2## parallel device ID 1
+PDIDV = $D805 ;##rev2## parallel device I/O vector
+PDIRQV = $D808 ;##rev2## parallel device IRQ vector
+PDID2 = $D80B ;##rev2## parallel device ID 2
+PDVV = $D80D ;##rev2## parallel device vector table
;-------------------------------------------------------------------------
; POKEY Address Equates
;-------------------------------------------------------------------------
-POKEY = $D200 ;POKEY area
+POKEY = $D200 ;POKEY area
; Read Addresses
-POT0 = $D200 ;potentiometer 0
-POT1 = $D201 ;potentiometer 1
-POT2 = $D202 ;potentiometer 2
-POT3 = $D203 ;potentiometer 3
-POT4 = $D204 ;potentiometer 4
-POT5 = $D205 ;potentiometer 5
-POT6 = $D206 ;potentiometer 6
-POT7 = $D207 ;potentiometer 7
-
-ALLPOT = $D208 ;potentiometer port status
-KBCODE = $D209 ;keyboard code
-RANDOM = $D20A ;random number generator
-SERIN = $D20D ;serial port input
-IRQST = $D20E ;IRQ interrupt status
-SKSTAT = $D20F ;serial port and keyboard status
+POT0 = $D200 ;potentiometer 0
+POT1 = $D201 ;potentiometer 1
+POT2 = $D202 ;potentiometer 2
+POT3 = $D203 ;potentiometer 3
+POT4 = $D204 ;potentiometer 4
+POT5 = $D205 ;potentiometer 5
+POT6 = $D206 ;potentiometer 6
+POT7 = $D207 ;potentiometer 7
+
+ALLPOT = $D208 ;potentiometer port status
+KBCODE = $D209 ;keyboard code
+RANDOM = $D20A ;random number generator
+SERIN = $D20D ;serial port input
+IRQST = $D20E ;IRQ interrupt status
+SKSTAT = $D20F ;serial port and keyboard status
; Write Addresses
-AUDF1 = $D200 ;channel 1 audio frequency
-AUDC1 = $D201 ;channel 1 audio control
+AUDF1 = $D200 ;channel 1 audio frequency
+AUDC1 = $D201 ;channel 1 audio control
-AUDF2 = $D202 ;channel 2 audio frequency
-AUDC2 = $D203 ;channel 2 audio control
+AUDF2 = $D202 ;channel 2 audio frequency
+AUDC2 = $D203 ;channel 2 audio control
-AUDF3 = $D204 ;channel 3 audio frequency
-AUDC3 = $D205 ;channel 3 audio control
+AUDF3 = $D204 ;channel 3 audio frequency
+AUDC3 = $D205 ;channel 3 audio control
-AUDF4 = $D206 ;channel 4 audio frequency
-AUDC4 = $D207 ;channel 4 audio control
+AUDF4 = $D206 ;channel 4 audio frequency
+AUDC4 = $D207 ;channel 4 audio control
-AUDCTL = $D208 ;audio control
-STIMER = $D209 ;start timers
-SKRES = $D20A ;reset SKSTAT status
-POTGO = $D20B ;start potentiometer scan sequence
-SEROUT = $D20D ;serial port output
-IRQEN = $D20E ;IRQ interrupt enable
-SKCTL = $D20F ;serial port and keyboard control
+AUDCTL = $D208 ;audio control
+STIMER = $D209 ;start timers
+SKRES = $D20A ;reset SKSTAT status
+POTGO = $D20B ;start potentiometer scan sequence
+SEROUT = $D20D ;serial port output
+IRQEN = $D20E ;IRQ interrupt enable
+SKCTL = $D20F ;serial port and keyboard control
;-------------------------------------------------------------------------
; PIA Address Equates
;-------------------------------------------------------------------------
-PIA = $D300 ;PIA area
+PIA = $D300 ;PIA area
-PORTA = $D300 ;port A direction register or jacks one/two
-PORTB = $D301 ;port B direction register or memory management
+PORTA = $D300 ;port A direction register or jacks one/two
+PORTB = $D301 ;port B direction register or memory management
-PACTL = $D302 ;port A control
-PBCTL = $D303 ;port B control
+PACTL = $D302 ;port A control
+PBCTL = $D303 ;port B control
;-------------------------------------------------------------------------
; ANTIC Address Equates
;-------------------------------------------------------------------------
-ANTIC = $D400 ;ANTIC area
+ANTIC = $D400 ;ANTIC area
; Read Addresses
-VCOUNT = $D40B ;vertical line counter
-PENH = $D40C ;light pen horizontal position
-PENV = $D40D ;light pen vertical position
-NMIST = $D40F ;NMI interrupt status
+VCOUNT = $D40B ;vertical line counter
+PENH = $D40C ;light pen horizontal position
+PENV = $D40D ;light pen vertical position
+NMIST = $D40F ;NMI interrupt status
; Write Addresses
-DMACTL = $D400 ;DMA control
-CHACTL = $D401 ;character control
-DLISTL = $D402 ;low display list address
-DLISTH = $D403 ;high display list address
-HSCROL = $D404 ;horizontal scroll
-VSCROL = $D405 ;vertical scroll
-PMBASE = $D407 ;player-missile base address
-CHBASE = $D409 ;character base address
-WSYNC = $D40A ;wait for HBLANK synchronization
-NMIEN = $D40E ;NMI enable
-NMIRES = $D40F ;NMI interrupt reset
+DMACTL = $D400 ;DMA control
+CHACTL = $D401 ;character control
+DLISTL = $D402 ;low display list address
+DLISTH = $D403 ;high display list address
+HSCROL = $D404 ;horizontal scroll
+VSCROL = $D405 ;vertical scroll
+PMBASE = $D407 ;player-missile base address
+CHBASE = $D409 ;character base address
+WSYNC = $D40A ;wait for HBLANK synchronization
+NMIEN = $D40E ;NMI enable
+NMIRES = $D40F ;NMI interrupt reset
;-------------------------------------------------------------------------
; Floating Point Package Address Equates
;-------------------------------------------------------------------------
-AFP = $D800 ;convert ASCII to floating point
-FASC = $D8E6 ;convert floating point to ASCII
-IFP = $D9AA ;convert integer to floating point
-FPI = $D9D2 ;convert floating point to integer
-ZFR0 = $DA44 ;zero FR0
-ZF1 = $DA46 ;zero floating point number
-FSUB = $DA60 ;subtract floating point numbers
-FADD = $DA66 ;add floating point numbers
-FMUL = $DADB ;multiply floating point numbers
-FDIV = $DB28 ;divide floating point numbers
-PLYEVL = $DD40 ;evaluate floating point polynomial
-FLD0R = $DD89 ;load floating point number
-FLD0P = $DD8D ;load floating point number
-FLD1R = $DD98 ;load floating point number
-PLD1P = $DD9C ;load floating point number
-FST0R = $DDA7 ;store floating point number
-FST0P = $DDAB ;store floating point number
-FMOVE = $DDB6 ;move floating point number
-LOG = $DECD ;calculate floating point logarithm
-LOG10 = $DED1 ;calculate floating point base 10 logarithm
-EXP = $DDC0 ;calculate floating point exponential
-EXP10 = $DDCC ;calculate floating point base 10 exponential
+AFP = $D800 ;convert ASCII to floating point
+FASC = $D8E6 ;convert floating point to ASCII
+IFP = $D9AA ;convert integer to floating point
+FPI = $D9D2 ;convert floating point to integer
+ZFR0 = $DA44 ;zero FR0
+ZF1 = $DA46 ;zero floating point number
+FSUB = $DA60 ;subtract floating point numbers
+FADD = $DA66 ;add floating point numbers
+FMUL = $DADB ;multiply floating point numbers
+FDIV = $DB28 ;divide floating point numbers
+PLYEVL = $DD40 ;evaluate floating point polynomial
+FLD0R = $DD89 ;load floating point number
+FLD0P = $DD8D ;load floating point number
+FLD1R = $DD98 ;load floating point number
+PLD1P = $DD9C ;load floating point number
+FST0R = $DDA7 ;store floating point number
+FST0P = $DDAB ;store floating point number
+FMOVE = $DDB6 ;move floating point number
+LOG = $DECD ;calculate floating point logarithm
+LOG10 = $DED1 ;calculate floating point base 10 logarithm
+EXP = $DDC0 ;calculate floating point exponential
+EXP10 = $DDCC ;calculate floating point base 10 exponential
;-------------------------------------------------------------------------
; Device Handler Vector Table Address Equates
;-------------------------------------------------------------------------
-EDITRV = $E400 ;editor handler vector table
-SCRENV = $E410 ;screen handler vector table
-KEYBDV = $E420 ;keyboard handler vector table
-PRINTV = $E430 ;printer handler vector table
-CASETV = $E440 ;cassette handler vector table
+EDITRV = $E400 ;editor handler vector table
+SCRENV = $E410 ;screen handler vector table
+KEYBDV = $E420 ;keyboard handler vector table
+PRINTV = $E430 ;printer handler vector table
+CASETV = $E440 ;cassette handler vector table
;-------------------------------------------------------------------------
; Jump Vector Address Equates
;-------------------------------------------------------------------------
-DISKIV = $E450 ;vector to initialize DIO
-DSKINV = $E453 ;vector to DIO
-CIOV = $E456 ;vector to CIO
-SIOV = $E459 ;vector to SIO
-SETVBV = $E45C ;vector to set VBLANK parameters
-SYSVBV = $E45F ;vector to process immediate VBLANK
-XITVBV = $E462 ;vector to process deferred VBLANK
-SIOINV = $E465 ;vector to initialize SIO
-SENDEV = $E468 ;vector to enable SEND
-INTINV = $E46B ;vector to initialize interrupt handler
-CIOINV = $E46E ;vector to initialize CIO
-BLKBDV = $E471 ;vector to power-up display
-WARMSV = $E474 ;vector to warmstart
-COLDSV = $E477 ;vector to coldstart
-RBLOKV = $E47A ;vector to read cassette block
-CSOPIV = $E47D ;vector to open cassette for input
-VCTABL = $E480 ;RAM vector initial value table
-PUPDIV = $E480 ;##rev2## vector to power-up display
-SLFTSV = $E483 ;##rev2## vector to self-test
-PHENTV = $E486 ;##rev2## vector to enter peripheral handler
-PHUNLV = $E489 ;##rev2## vector to unlink peripheral handler
-PHINIV = $E48C ;##rev2## vector to initialize peripheral handler
-GPDVV = $E48F ;##rev2## generic parallel device handler vector
+DISKIV = $E450 ;vector to initialize DIO
+DSKINV = $E453 ;vector to DIO
+CIOV = $E456 ;vector to CIO
+SIOV = $E459 ;vector to SIO
+SETVBV = $E45C ;vector to set VBLANK parameters
+SYSVBV = $E45F ;vector to process immediate VBLANK
+XITVBV = $E462 ;vector to process deferred VBLANK
+SIOINV = $E465 ;vector to initialize SIO
+SENDEV = $E468 ;vector to enable SEND
+INTINV = $E46B ;vector to initialize interrupt handler
+CIOINV = $E46E ;vector to initialize CIO
+BLKBDV = $E471 ;vector to power-up display
+WARMSV = $E474 ;vector to warmstart
+COLDSV = $E477 ;vector to coldstart
+RBLOKV = $E47A ;vector to read cassette block
+CSOPIV = $E47D ;vector to open cassette for input
+VCTABL = $E480 ;RAM vector initial value table
+PUPDIV = $E480 ;##rev2## vector to power-up display
+SLFTSV = $E483 ;##rev2## vector to self-test
+PHENTV = $E486 ;##rev2## vector to enter peripheral handler
+PHUNLV = $E489 ;##rev2## vector to unlink peripheral handler
+PHINIV = $E48C ;##rev2## vector to initialize peripheral handler
+GPDVV = $E48F ;##rev2## generic parallel device handler vector
; NOTE: OS rom self-test labels are not included in this file
@@ -985,105 +985,105 @@ GPDVV = $E48F ;##rev2## generic parallel device handler vector
;-------------------------------------------------------------------------
; THE FOLLOWING ARE IN BASIC CARTRIDGE:
-SIN = $BD81 ;FR0 <- SIN (FR0) DEGFLG (0=RAD,6=DEG) CARRY
-COS = $BD73 ;FR0 <- COS (FR0) CARRY
-ATAN = $BE43 ;FR0 <- ATAN(FR0) CARRY
-SQR = $BEB1 ;FR0 <- ROOT(FR0) CARRY
+SIN = $BD81 ;FR0 <- SIN (FR0) DEGFLG (0=RAD,6=DEG) CARRY
+COS = $BD73 ;FR0 <- COS (FR0) CARRY
+ATAN = $BE43 ;FR0 <- ATAN(FR0) CARRY
+SQR = $BEB1 ;FR0 <- ROOT(FR0) CARRY
-RADON = 0 ;INDICATES RADIANS
-DEGON = 6 ;INDICATES DEGREES
+RADON = 0 ;INDICATES RADIANS
+DEGON = 6 ;INDICATES DEGREES
-ASCZER = '0' ;ASCII ZERO
-COLON = $3A ;ASCII COLON
-CR = $9B ;SYSTEM EOL (CARRIAGE RETURN)
+ASCZER = '0' ;ASCII ZERO
+COLON = $3A ;ASCII COLON
+CR = $9B ;SYSTEM EOL (CARRIAGE RETURN)
;-------------------------------------------------------------------------
; 6502
;-------------------------------------------------------------------------
-NMIVEC = $FFFA
-RESVEC = $FFFC
-IRQVEC = $FFFE
+NMIVEC = $FFFA
+RESVEC = $FFFC
+IRQVEC = $FFFE
;-------------------------------------------------------------------------
; BASIC
;-------------------------------------------------------------------------
-LOMEM = $80 ;2-byte low memory pointer
-VNTP = $82 ;2-byte variable name table address
-VNTD = $84 ;2-byte variable name table end + 1
-VVTP = $86 ;2-byte variable value table
-STMTAB = $88 ;2-byte statement table address
-STMCUR = $8A ;2-byte current statement pointer
-STARP = $8C ;2-byte string and array table pointer
-RUNSTK = $8E ;2-byte runtime stack address
-BMEMTOP = $90 ;2-byte top of memory pointer
-STOPLN = $BA ;2-byte stopped line number
-ERRSAVE = $C3 ;1-byte error code
-PTABW = $C9 ;1-byte tab width
+LOMEM = $80 ;2-byte low memory pointer
+VNTP = $82 ;2-byte variable name table address
+VNTD = $84 ;2-byte variable name table end + 1
+VVTP = $86 ;2-byte variable value table
+STMTAB = $88 ;2-byte statement table address
+STMCUR = $8A ;2-byte current statement pointer
+STARP = $8C ;2-byte string and array table pointer
+RUNSTK = $8E ;2-byte runtime stack address
+BMEMTOP = $90 ;2-byte top of memory pointer
+STOPLN = $BA ;2-byte stopped line number
+ERRSAVE = $C3 ;1-byte error code
+PTABW = $C9 ;1-byte tab width
;-------------------------------------------------------------------------
; DOS
;-------------------------------------------------------------------------
-DOS = $0700
+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
+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
+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
;-------------------------------------------------------------------------
-ATCLR = $7D ;CLEAR SCREEN CHARACTER
-ATRUB = $7E ;BACK SPACE (RUBOUT)
-ATTAB = $7F ;TAB
-ATEOL = $9B ;END-OF-LINE
-ATDELL = $9C ;delete line
-ATINSL = $9D ;insert line
-ATCTAB = $9E ;clear TAB
-ATSTAB = $9F ;set TAB
-ATBEL = $FD ;CONSOLE BELL
-ATDEL = $FE ;delete char.
-ATINS = $FF ;insert char.
-ATURW = $1C ;UP-ARROW
-ATDRW = $1D ;DOWN-ARROW
-ATLRW = $1E ;LEFT-ARROW
-ATRRW = $1F ;RIGHT-ARROW
-ATESC = $1B ;ESCAPE
+ATCLR = $7D ;CLEAR SCREEN CHARACTER
+ATRUB = $7E ;BACK SPACE (RUBOUT)
+ATTAB = $7F ;TAB
+ATEOL = $9B ;END-OF-LINE
+ATDELL = $9C ;delete line
+ATINSL = $9D ;insert line
+ATCTAB = $9E ;clear TAB
+ATSTAB = $9F ;set TAB
+ATBEL = $FD ;CONSOLE BELL
+ATDEL = $FE ;delete char.
+ATINS = $FF ;insert char.
+ATURW = $1C ;UP-ARROW
+ATDRW = $1D ;DOWN-ARROW
+ATLRW = $1E ;LEFT-ARROW
+ATRRW = $1F ;RIGHT-ARROW
+ATESC = $1B ;ESCAPE
;-------------------------------------------------------------------------
; OFFSETS INTO SECTSIZETAB (DIO functions)
;-------------------------------------------------------------------------
-sst_flag = 0 ; length 1
-sst_sectsize = 1 ; 2
-sst_driveno = 3 ; 1 (drive #)
-sst_size = 4 ; size of one entry
- ; if changed, adapt diopncls.s
+sst_flag = 0 ; length 1
+sst_sectsize = 1 ; 2
+sst_driveno = 3 ; 1 (drive #)
+sst_size = 4 ; size of one entry
+ ; if changed, adapt diopncls.s
;-------------------------------------------------------------------------
; OFFSETS INTO dio_phys_pos
;-------------------------------------------------------------------------
-diopp_head = 0 ; head
-diopp_track = 1 ; track / cylinder
-diopp_sector = 3 ; sector
-diopp_size = 5 ; size of structure
+diopp_head = 0 ; head
+diopp_track = 1 ; track / cylinder
+diopp_sector = 3 ; sector
+diopp_size = 5 ; size of structure
;-------------------------------------------------------------------------
; VALUES for dos_type
@@ -1091,7 +1091,7 @@ diopp_size = 5 ; size of structure
ATARIDOS = 0
SPARTADOS = 1
-OSADOS = 2 ; OS/A+
+OSADOS = 2 ; OS/A+
MYDOS = 3
XDOS = 4
NODOS = 255
@@ -1103,28 +1103,28 @@ NODOS = 255
; usage example:
;
; ScreenDL:
-; .byte DL_BLK8
-; .byte DL_BLK8
+; .byte DL_BLK8
+; .byte DL_BLK8
; .byte DL_CHR40x8x1 + DL_LMS + DL_DLI
-; .word ScreenAlignment
-; .byte DL_BLK1 + DL_DLI
-; .byte DL_MAP320x1x1 + DL_LMS
-; .word Screen
+; .word ScreenAlignment
+; .byte DL_BLK1 + DL_DLI
+; .byte DL_MAP320x1x1 + DL_LMS
+; .word Screen
;
; .repeat 99
-; .byte DL_MAP320x1x1
+; .byte DL_MAP320x1x1
; .endrepeat
-; .byte DL_MAP320x1x1 + DL_LMS
-; .word Screen + 40 * 100 ; 100 lines a 40 byte, 'Screen' has to be aligned correctly!
+; .byte DL_MAP320x1x1 + DL_LMS
+; .word Screen + 40 * 100 ; 100 lines a 40 byte, 'Screen' has to be aligned correctly!
; .repeat 92
-; .byte DL_MAP320x1x1
+; .byte DL_MAP320x1x1
; .endrepeat
;
-; .byte DL_JVB
+; .byte DL_JVB
; absolute instructions (non mode lines)
-DL_JMP = 1
+DL_JMP = 1
DL_JVB = 65
DL_BLK1 = 0
@@ -1138,21 +1138,21 @@ DL_BLK8 = 112
; absolute instructions (mode lines)
-DL_CHR40x8x1 = 2 ; monochrome, 40 character & 8 scanlines per mode line (GR. 0)
-DL_CHR40x10x1 = 3 ; monochrome, 40 character & 10 scanlines per mode line
-DL_CHR40x8x4 = 4 ; colour, 40 character & 8 scanlines per mode line (GR. 12)
-DL_CHR40x16x4 = 5 ; colour, 40 character & 16 scanlines per mode line (GR. 13)
-DL_CHR20x8x2 = 6 ; colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1)
-DL_CHR20x16x2 = 7 ; colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2)
-
-DL_MAP40x8x4 = 8 ; colour, 40 pixel & 8 scanlines per mode line (GR. 3)
-DL_MAP80x4x2 = 9 ; 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4)
-DL_MAP80x4x4 = 10 ; colour, 80 pixel & 4 scanlines per mode line (GR.5)
-DL_MAP160x2x2 = 11 ; 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6)
-DL_MAP160x1x2 = 12 ; 'duochrome', 160 pixel & 1 scanline per mode line (GR.14)
-DL_MAP160x2x4 = 13 ; 4 colours, 160 pixel & 2 scanlines per mode line (GR.7)
-DL_MAP160x1x4 = 14 ; 4 colours, 160 pixel & 1 scanline per mode line (GR.15)
-DL_MAP320x1x1 = 15 ; monochrome, 320 pixel & 1 scanline per mode line (GR.8)
+DL_CHR40x8x1 = 2 ; monochrome, 40 character & 8 scanlines per mode line (GR. 0)
+DL_CHR40x10x1 = 3 ; monochrome, 40 character & 10 scanlines per mode line
+DL_CHR40x8x4 = 4 ; colour, 40 character & 8 scanlines per mode line (GR. 12)
+DL_CHR40x16x4 = 5 ; colour, 40 character & 16 scanlines per mode line (GR. 13)
+DL_CHR20x8x2 = 6 ; colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1)
+DL_CHR20x16x2 = 7 ; colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2)
+
+DL_MAP40x8x4 = 8 ; colour, 40 pixel & 8 scanlines per mode line (GR. 3)
+DL_MAP80x4x2 = 9 ; 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4)
+DL_MAP80x4x4 = 10 ; colour, 80 pixel & 4 scanlines per mode line (GR.5)
+DL_MAP160x2x2 = 11 ; 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6)
+DL_MAP160x1x2 = 12 ; 'duochrome', 160 pixel & 1 scanline per mode line (GR.14)
+DL_MAP160x2x4 = 13 ; 4 colours, 160 pixel & 2 scanlines per mode line (GR.7)
+DL_MAP160x1x4 = 14 ; 4 colours, 160 pixel & 1 scanline per mode line (GR.15)
+DL_MAP320x1x1 = 15 ; monochrome, 320 pixel & 1 scanline per mode line (GR.8)
; modifiers on mode lines...
@@ -1162,7 +1162,7 @@ DL_LMS = 64
; general modifier...
-DL_DLI = 128
+DL_DLI = 128
;-------------------------------------------------------------------------
; End of atari.inc
diff --git a/asminc/c128.inc b/asminc/c128.inc
index 079c4b4da..8ec72a172 100644
--- a/asminc/c128.inc
+++ b/asminc/c128.inc
@@ -7,193 +7,193 @@
; Zero page, Commodore stuff
TIME := $A0 ; 60HZ clock
-FNAM_LEN := $B7 ; Length of filename
-SECADR := $B9 ; Secondary address
-DEVNUM := $BA ; Device number
-FNAM := $BB ; Address of filename
-FNAM_BANK := $C7 ; Bank for filename
-KEY_COUNT := $D0 ; Number of keys in input buffer
-FKEY_COUNT := $D1 ; Characters for function key
-MODE := $D7 ; 40/80 column mode flag
-CURS_X := $EC ; Cursor column
-CURS_Y := $EB ; Cursor row
-SCREEN_PTR := $E0 ; Pointer to current char in text screen
-CRAM_PTR := $E2 ; Pointer to current char in color RAM
+FNAM_LEN := $B7 ; Length of filename
+SECADR := $B9 ; Secondary address
+DEVNUM := $BA ; Device number
+FNAM := $BB ; Address of filename
+FNAM_BANK := $C7 ; Bank for filename
+KEY_COUNT := $D0 ; Number of keys in input buffer
+FKEY_COUNT := $D1 ; Characters for function key
+MODE := $D7 ; 40/80 column mode flag
+CURS_X := $EC ; Cursor column
+CURS_Y := $EB ; Cursor row
+SCREEN_PTR := $E0 ; Pointer to current char in text screen
+CRAM_PTR := $E2 ; Pointer to current char in color RAM
CHARCOLOR := $F1
RVS := $F3 ; Reverse output flag
-SCROLL := $F8 ; Disable scrolling flag
+SCROLL := $F8 ; Disable scrolling flag
-BASIC_BUF := $200 ; Location of command-line
-BASIC_BUF_LEN = 162 ; Maximum length of command-line
+BASIC_BUF := $200 ; Location of command-line
+BASIC_BUF_LEN = 162 ; Maximum length of command-line
FETCH := $2A2 ; Fetch subroutine in RAM
FETVEC := $2AA ; Vector patch location for FETCH
STASH := $2AF ; Stash routine in RAM
STAVEC := $2B9 ; Vector patch location for STASH
PALFLAG := $A03 ; $FF=PAL, $00=NTSC
-INIT_STATUS := $A04 ; Flag: Reset/NMI Status
-FKEY_LEN := $1000 ; Function key lengths
-FKEY_TEXT := $100A ; Function key texts
+INIT_STATUS := $A04 ; Flag: Reset/NMI Status
+FKEY_LEN := $1000 ; Function key lengths
+FKEY_TEXT := $100A ; Function key texts
; ---------------------------------------------------------------------------
; Kernal routines
; Direct entries
-CURS_SET := $CD57
-CURS_ON := $CD6F
+CURS_SET := $CD57
+CURS_ON := $CD6F
CURS_OFF := $CD9F
-CLRSCR := $C142
-KBDREAD := $C006
-NEWLINE := $C363
-PRINT := $C322
+CLRSCR := $C142
+KBDREAD := $C006
+NEWLINE := $C363
+PRINT := $C322
NMIEXIT := $FF33
INDFET := $FF74
; ---------------------------------------------------------------------------
; Vectors
-IRQVec := $0314
-BRKVec := $0316
-NMIVec := $0318
-KeyStoreVec := $033C
+IRQVec := $0314
+BRKVec := $0316
+NMIVec := $0318
+KeyStoreVec := $033C
; ---------------------------------------------------------------------------
; I/O: VIC
-VIC := $D000
-VIC_SPR0_X := $D000
-VIC_SPR0_Y := $D001
-VIC_SPR1_X := $D002
-VIC_SPR1_Y := $D003
-VIC_SPR2_X := $D004
-VIC_SPR2_Y := $D005
-VIC_SPR3_X := $D006
-VIC_SPR3_Y := $D007
-VIC_SPR4_X := $D008
-VIC_SPR4_Y := $D009
-VIC_SPR5_X := $D00A
-VIC_SPR5_Y := $D00B
-VIC_SPR6_X := $D00C
-VIC_SPR6_Y := $D00D
-VIC_SPR7_X := $D00E
-VIC_SPR7_Y := $D00F
-VIC_SPR_HI_X := $D010
-VIC_SPR_ENA := $D015
-VIC_SPR_EXP_Y := $D017
-VIC_SPR_EXP_X := $D01D
-VIC_SPR_MCOLOR := $D01C
+VIC := $D000
+VIC_SPR0_X := $D000
+VIC_SPR0_Y := $D001
+VIC_SPR1_X := $D002
+VIC_SPR1_Y := $D003
+VIC_SPR2_X := $D004
+VIC_SPR2_Y := $D005
+VIC_SPR3_X := $D006
+VIC_SPR3_Y := $D007
+VIC_SPR4_X := $D008
+VIC_SPR4_Y := $D009
+VIC_SPR5_X := $D00A
+VIC_SPR5_Y := $D00B
+VIC_SPR6_X := $D00C
+VIC_SPR6_Y := $D00D
+VIC_SPR7_X := $D00E
+VIC_SPR7_Y := $D00F
+VIC_SPR_HI_X := $D010
+VIC_SPR_ENA := $D015
+VIC_SPR_EXP_Y := $D017
+VIC_SPR_EXP_X := $D01D
+VIC_SPR_MCOLOR := $D01C
VIC_SPR_BG_PRIO := $D01B
VIC_SPR_MCOLOR0 := $D025
VIC_SPR_MCOLOR1 := $D026
-VIC_SPR0_COLOR := $D027
-VIC_SPR1_COLOR := $D028
-VIC_SPR2_COLOR := $D029
-VIC_SPR3_COLOR := $D02A
-VIC_SPR4_COLOR := $D02B
-VIC_SPR5_COLOR := $D02C
-VIC_SPR6_COLOR := $D02D
-VIC_SPR7_COLOR := $D02E
+VIC_SPR0_COLOR := $D027
+VIC_SPR1_COLOR := $D028
+VIC_SPR2_COLOR := $D029
+VIC_SPR3_COLOR := $D02A
+VIC_SPR4_COLOR := $D02B
+VIC_SPR5_COLOR := $D02C
+VIC_SPR6_COLOR := $D02D
+VIC_SPR7_COLOR := $D02E
-VIC_CTRL1 := $D011
-VIC_CTRL2 := $D016
+VIC_CTRL1 := $D011
+VIC_CTRL2 := $D016
-VIC_HLINE := $D012
+VIC_HLINE := $D012
-VIC_VIDEO_ADR := $D018
+VIC_VIDEO_ADR := $D018
-VIC_IRR := $D019 ; Interrupt request register
-VIC_IMR := $D01A ; Interrupt mask register
+VIC_IRR := $D019 ; Interrupt request register
+VIC_IMR := $D01A ; Interrupt mask register
VIC_BORDERCOLOR := $D020
-VIC_BG_COLOR0 := $D021
-VIC_BG_COLOR1 := $D022
-VIC_BG_COLOR2 := $D023
-VIC_BG_COLOR3 := $D024
+VIC_BG_COLOR0 := $D021
+VIC_BG_COLOR1 := $D022
+VIC_BG_COLOR2 := $D023
+VIC_BG_COLOR3 := $D024
; 128 stuff:
-VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
-VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
+VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
+VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
; ---------------------------------------------------------------------------
; I/O: SID
-SID := $D400
-SID_S1Lo := $D400
-SID_S1Hi := $D401
-SID_PB1Lo := $D402
-SID_PB1Hi := $D403
-SID_Ctl1 := $D404
-SID_AD1 := $D405
-SID_SUR1 := $D406
-
-SID_S2Lo := $D407
-SID_S2Hi := $D408
-SID_PB2Lo := $D409
-SID_PB2Hi := $D40A
-SID_Ctl2 := $D40B
-SID_AD2 := $D40C
-SID_SUR2 := $D40D
-
-SID_S3Lo := $D40E
-SID_S3Hi := $D40F
-SID_PB3Lo := $D410
-SID_PB3Hi := $D411
-SID_Ctl3 := $D412
-SID_AD3 := $D413
-SID_SUR3 := $D414
-
-SID_FltLo := $D415
-SID_FltHi := $D416
-SID_FltCtl := $D417
-SID_Amp := $D418
-SID_ADConv1 := $D419
-SID_ADConv2 := $D41A
-SID_Noise := $D41B
-SID_Read3 := $D41C
+SID := $D400
+SID_S1Lo := $D400
+SID_S1Hi := $D401
+SID_PB1Lo := $D402
+SID_PB1Hi := $D403
+SID_Ctl1 := $D404
+SID_AD1 := $D405
+SID_SUR1 := $D406
+
+SID_S2Lo := $D407
+SID_S2Hi := $D408
+SID_PB2Lo := $D409
+SID_PB2Hi := $D40A
+SID_Ctl2 := $D40B
+SID_AD2 := $D40C
+SID_SUR2 := $D40D
+
+SID_S3Lo := $D40E
+SID_S3Hi := $D40F
+SID_PB3Lo := $D410
+SID_PB3Hi := $D411
+SID_Ctl3 := $D412
+SID_AD3 := $D413
+SID_SUR3 := $D414
+
+SID_FltLo := $D415
+SID_FltHi := $D416
+SID_FltCtl := $D417
+SID_Amp := $D418
+SID_ADConv1 := $D419
+SID_ADConv2 := $D41A
+SID_Noise := $D41B
+SID_Read3 := $D41C
; ---------------------------------------------------------------------------
; I/O: VDC (128 only)
-VDC_INDEX := $D600
-VDC_DATA := $D601
+VDC_INDEX := $D600
+VDC_DATA := $D601
; ---------------------------------------------------------------------------
; I/O: CIAs
-CIA1 := $DC00
-CIA1_PRA := $DC00
-CIA1_PRB := $DC01
-CIA1_DDRA := $DC02
-CIA1_DDRB := $DC03
+CIA1 := $DC00
+CIA1_PRA := $DC00
+CIA1_PRB := $DC01
+CIA1_DDRA := $DC02
+CIA1_DDRB := $DC03
CIA1_TOD10 := $DC08
CIA1_TODSEC := $DC09
CIA1_TODMIN := $DC0A
CIA1_TODHR := $DC0B
-CIA1_ICR := $DC0D
-CIA1_CRA := $DC0E
-CIA1_CRB := $DC0F
-
-CIA2 := $DD00
-CIA2_PRA := $DD00
-CIA2_PRB := $DD01
-CIA2_DDRA := $DD02
-CIA2_DDRB := $DD03
+CIA1_ICR := $DC0D
+CIA1_CRA := $DC0E
+CIA1_CRB := $DC0F
+
+CIA2 := $DD00
+CIA2_PRA := $DD00
+CIA2_PRB := $DD01
+CIA2_DDRA := $DD02
+CIA2_DDRB := $DD03
CIA2_TOD10 := $DD08
CIA2_TODSEC := $DD09
CIA2_TODMIN := $DD0A
CIA2_TODHR := $DD0B
-CIA2_ICR := $DD0D
-CIA2_CRA := $DD0E
-CIA2_CRB := $DD0F
+CIA2_ICR := $DD0D
+CIA2_CRA := $DD0E
+CIA2_CRB := $DD0F
; ---------------------------------------------------------------------------
; I/O: MMU
-MMU_CR := $FF00
+MMU_CR := $FF00
MMU_CFG_CC65 := %00001110 ; Bank 0 with kernal ROM
MMU_CFG_RAM0 := %00111111 ; Bank 0 full RAM
MMU_CFG_RAM1 := %01111111 ; Bank 1 full RAM
@@ -203,9 +203,9 @@ MMU_CFG_RAM3 := %11111111 ; Bank 3 full RAM
; ---------------------------------------------------------------------------
; Super CPU
-SCPU_VIC_Bank1 := $D075
-SCPU_Slow := $D07A
-SCPU_Fast := $D07B
+SCPU_VIC_Bank1 := $D075
+SCPU_Slow := $D07A
+SCPU_Fast := $D07B
SCPU_EnableRegs := $D07E
SCPU_DisableRegs:= $D07F
-SCPU_Detect := $D0BC
+SCPU_Detect := $D0BC
diff --git a/asminc/c64.inc b/asminc/c64.inc
index 710c5b273..6823403c5 100644
--- a/asminc/c64.inc
+++ b/asminc/c64.inc
@@ -7,43 +7,43 @@
; Zero page, Commodore stuff
TIME := $A0 ; 60 HZ clock
-FNAM_LEN := $B7 ; Length of filename
-SECADR := $B9 ; Secondary address
-DEVNUM := $BA ; Device number
+FNAM_LEN := $B7 ; Length of filename
+SECADR := $B9 ; Secondary address
+DEVNUM := $BA ; Device number
FNAM := $BB ; Pointer to filename
-KEY_COUNT := $C6 ; Number of keys in input buffer
+KEY_COUNT := $C6 ; Number of keys in input buffer
RVS := $C7 ; Reverse flag
-CURS_FLAG := $CC ; 1 = cursor off
-CURS_BLINK := $CD ; Blink counter
-CURS_CHAR := $CE ; Character under the cursor
-CURS_STATE := $CF ; Cursor blink state
-SCREEN_PTR := $D1 ; Pointer to current char in text screen
-CURS_X := $D3 ; Cursor column
-CURS_Y := $D6 ; Cursor row
-CRAM_PTR := $F3 ; Pointer to current char in color RAM
-
-BASIC_BUF := $200 ; Location of command-line
-BASIC_BUF_LEN = 89 ; Maximum length of command-line
+CURS_FLAG := $CC ; 1 = cursor off
+CURS_BLINK := $CD ; Blink counter
+CURS_CHAR := $CE ; Character under the cursor
+CURS_STATE := $CF ; Cursor blink state
+SCREEN_PTR := $D1 ; Pointer to current char in text screen
+CURS_X := $D3 ; Cursor column
+CURS_Y := $D6 ; Cursor row
+CRAM_PTR := $F3 ; Pointer to current char in color RAM
+
+BASIC_BUF := $200 ; Location of command-line
+BASIC_BUF_LEN = 89 ; Maximum length of command-line
CHARCOLOR := $286
-CURS_COLOR := $287 ; Color under the cursor
-PALFLAG := $2A6 ; $01 = PAL, $00 = NTSC
+CURS_COLOR := $287 ; Color under the cursor
+PALFLAG := $2A6 ; $01 = PAL, $00 = NTSC
; ---------------------------------------------------------------------------
; Kernal routines
; Direct entries
-CLRSCR := $E544
-KBDREAD := $E5B4
+CLRSCR := $E544
+KBDREAD := $E5B4
NMIEXIT := $FEBC
; ---------------------------------------------------------------------------
; Vector and other locations
-IRQVec := $0314
-BRKVec := $0316
-NMIVec := $0318
+IRQVec := $0314
+BRKVec := $0316
+NMIVec := $0318
; ---------------------------------------------------------------------------
; Screen size
@@ -54,157 +54,157 @@ YSIZE = 25
; ---------------------------------------------------------------------------
; I/O: VIC
-VIC := $D000
-VIC_SPR0_X := $D000
-VIC_SPR0_Y := $D001
-VIC_SPR1_X := $D002
-VIC_SPR1_Y := $D003
-VIC_SPR2_X := $D004
-VIC_SPR2_Y := $D005
-VIC_SPR3_X := $D006
-VIC_SPR3_Y := $D007
-VIC_SPR4_X := $D008
-VIC_SPR4_Y := $D009
-VIC_SPR5_X := $D00A
-VIC_SPR5_Y := $D00B
-VIC_SPR6_X := $D00C
-VIC_SPR6_Y := $D00D
-VIC_SPR7_X := $D00E
-VIC_SPR7_Y := $D00F
-VIC_SPR_HI_X := $D010
-VIC_SPR_ENA := $D015
-VIC_SPR_EXP_Y := $D017
-VIC_SPR_EXP_X := $D01D
-VIC_SPR_MCOLOR := $D01C
+VIC := $D000
+VIC_SPR0_X := $D000
+VIC_SPR0_Y := $D001
+VIC_SPR1_X := $D002
+VIC_SPR1_Y := $D003
+VIC_SPR2_X := $D004
+VIC_SPR2_Y := $D005
+VIC_SPR3_X := $D006
+VIC_SPR3_Y := $D007
+VIC_SPR4_X := $D008
+VIC_SPR4_Y := $D009
+VIC_SPR5_X := $D00A
+VIC_SPR5_Y := $D00B
+VIC_SPR6_X := $D00C
+VIC_SPR6_Y := $D00D
+VIC_SPR7_X := $D00E
+VIC_SPR7_Y := $D00F
+VIC_SPR_HI_X := $D010
+VIC_SPR_ENA := $D015
+VIC_SPR_EXP_Y := $D017
+VIC_SPR_EXP_X := $D01D
+VIC_SPR_MCOLOR := $D01C
VIC_SPR_BG_PRIO := $D01B
VIC_SPR_MCOLOR0 := $D025
VIC_SPR_MCOLOR1 := $D026
-VIC_SPR0_COLOR := $D027
-VIC_SPR1_COLOR := $D028
-VIC_SPR2_COLOR := $D029
-VIC_SPR3_COLOR := $D02A
-VIC_SPR4_COLOR := $D02B
-VIC_SPR5_COLOR := $D02C
-VIC_SPR6_COLOR := $D02D
-VIC_SPR7_COLOR := $D02E
+VIC_SPR0_COLOR := $D027
+VIC_SPR1_COLOR := $D028
+VIC_SPR2_COLOR := $D029
+VIC_SPR3_COLOR := $D02A
+VIC_SPR4_COLOR := $D02B
+VIC_SPR5_COLOR := $D02C
+VIC_SPR6_COLOR := $D02D
+VIC_SPR7_COLOR := $D02E
-VIC_CTRL1 := $D011
-VIC_CTRL2 := $D016
+VIC_CTRL1 := $D011
+VIC_CTRL2 := $D016
-VIC_HLINE := $D012
+VIC_HLINE := $D012
-VIC_VIDEO_ADR := $D018
+VIC_VIDEO_ADR := $D018
-VIC_IRR := $D019 ; Interrupt request register
-VIC_IMR := $D01A ; Interrupt mask register
+VIC_IRR := $D019 ; Interrupt request register
+VIC_IMR := $D01A ; Interrupt mask register
VIC_BORDERCOLOR := $D020
-VIC_BG_COLOR0 := $D021
-VIC_BG_COLOR1 := $D022
-VIC_BG_COLOR2 := $D023
-VIC_BG_COLOR3 := $D024
+VIC_BG_COLOR0 := $D021
+VIC_BG_COLOR1 := $D022
+VIC_BG_COLOR2 := $D023
+VIC_BG_COLOR3 := $D024
; 128 stuff:
-VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
-VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
+VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
+VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
; ---------------------------------------------------------------------------
; I/O: SID
-SID := $D400
-SID_S1Lo := $D400
-SID_S1Hi := $D401
-SID_PB1Lo := $D402
-SID_PB1Hi := $D403
-SID_Ctl1 := $D404
-SID_AD1 := $D405
-SID_SUR1 := $D406
-
-SID_S2Lo := $D407
-SID_S2Hi := $D408
-SID_PB2Lo := $D409
-SID_PB2Hi := $D40A
-SID_Ctl2 := $D40B
-SID_AD2 := $D40C
-SID_SUR2 := $D40D
-
-SID_S3Lo := $D40E
-SID_S3Hi := $D40F
-SID_PB3Lo := $D410
-SID_PB3Hi := $D411
-SID_Ctl3 := $D412
-SID_AD3 := $D413
-SID_SUR3 := $D414
-
-SID_FltLo := $D415
-SID_FltHi := $D416
-SID_FltCtl := $D417
-SID_Amp := $D418
-SID_ADConv1 := $D419
-SID_ADConv2 := $D41A
-SID_Noise := $D41B
-SID_Read3 := $D41C
+SID := $D400
+SID_S1Lo := $D400
+SID_S1Hi := $D401
+SID_PB1Lo := $D402
+SID_PB1Hi := $D403
+SID_Ctl1 := $D404
+SID_AD1 := $D405
+SID_SUR1 := $D406
+
+SID_S2Lo := $D407
+SID_S2Hi := $D408
+SID_PB2Lo := $D409
+SID_PB2Hi := $D40A
+SID_Ctl2 := $D40B
+SID_AD2 := $D40C
+SID_SUR2 := $D40D
+
+SID_S3Lo := $D40E
+SID_S3Hi := $D40F
+SID_PB3Lo := $D410
+SID_PB3Hi := $D411
+SID_Ctl3 := $D412
+SID_AD3 := $D413
+SID_SUR3 := $D414
+
+SID_FltLo := $D415
+SID_FltHi := $D416
+SID_FltCtl := $D417
+SID_Amp := $D418
+SID_ADConv1 := $D419
+SID_ADConv2 := $D41A
+SID_Noise := $D41B
+SID_Read3 := $D41C
; ---------------------------------------------------------------------------
; I/O: VDC (128 only)
-VDC_INDEX := $D600
-VDC_DATA := $D601
+VDC_INDEX := $D600
+VDC_DATA := $D601
; ---------------------------------------------------------------------------
; I/O: CIAs
-CIA1 := $DC00
-CIA1_PRA := $DC00
-CIA1_PRB := $DC01
-CIA1_DDRA := $DC02
-CIA1_DDRB := $DC03
+CIA1 := $DC00
+CIA1_PRA := $DC00
+CIA1_PRB := $DC01
+CIA1_DDRA := $DC02
+CIA1_DDRB := $DC03
CIA1_TOD10 := $DC08
CIA1_TODSEC := $DC09
CIA1_TODMIN := $DC0A
CIA1_TODHR := $DC0B
-CIA1_ICR := $DC0D
-CIA1_CRA := $DC0E
-CIA1_CRB := $DC0F
-
-CIA2 := $DD00
-CIA2_PRA := $DD00
-CIA2_PRB := $DD01
-CIA2_DDRA := $DD02
-CIA2_DDRB := $DD03
+CIA1_ICR := $DC0D
+CIA1_CRA := $DC0E
+CIA1_CRB := $DC0F
+
+CIA2 := $DD00
+CIA2_PRA := $DD00
+CIA2_PRB := $DD01
+CIA2_DDRA := $DD02
+CIA2_DDRB := $DD03
CIA2_TOD10 := $DD08
CIA2_TODSEC := $DD09
CIA2_TODMIN := $DD0A
CIA2_TODHR := $DD0B
-CIA2_ICR := $DD0D
-CIA2_CRA := $DD0E
-CIA2_CRB := $DD0F
+CIA2_ICR := $DD0D
+CIA2_CRA := $DD0E
+CIA2_CRB := $DD0F
; ---------------------------------------------------------------------------
; Super CPU
-SCPU_VIC_Bank1 := $D075
-SCPU_Slow := $D07A
-SCPU_Fast := $D07B
+SCPU_VIC_Bank1 := $D075
+SCPU_Slow := $D07A
+SCPU_Fast := $D07B
SCPU_EnableRegs := $D07E
SCPU_DisableRegs:= $D07F
-SCPU_Detect := $D0BC
+SCPU_Detect := $D0BC
; ---------------------------------------------------------------------------
; Processor Port at $01
-LORAM = $01 ; Enable the basic rom
-HIRAM = $02 ; Enable the kernal rom
-IOEN = $04 ; Enable I/O
-CASSDATA = $08 ; Cassette data
-CASSPLAY = $10 ; Cassette: Play
-CASSMOT = $20 ; Cassette motor on
-TP_FAST = $80 ; Switch Rossmoeller TurboProcess to fast mode
+LORAM = $01 ; Enable the basic rom
+HIRAM = $02 ; Enable the kernal rom
+IOEN = $04 ; Enable I/O
+CASSDATA = $08 ; Cassette data
+CASSPLAY = $10 ; Cassette: Play
+CASSMOT = $20 ; Cassette motor on
+TP_FAST = $80 ; Switch Rossmoeller TurboProcess to fast mode
-RAMONLY = $F8 ; (~(LORAM | HIRAM | IOEN)) & $FF
+RAMONLY = $F8 ; (~(LORAM | HIRAM | IOEN)) & $FF
diff --git a/asminc/cbm510.inc b/asminc/cbm510.inc
index c4476c2e1..827c507fc 100644
--- a/asminc/cbm510.inc
+++ b/asminc/cbm510.inc
@@ -9,8 +9,8 @@
;-----------------------------------------------------------------------------
; Zeropage stuff
-ExecReg = $00
-IndReg = $01
+ExecReg = $00
+IndReg = $01
; ---------------------------------------------------------------------------
; Screen size
@@ -23,93 +23,93 @@ YSIZE = 25
; I/O $d800: VIC
-VIC_SPR0_X = $00
-VIC_SPR0_Y = $01
-VIC_SPR1_X = $02
-VIC_SPR1_Y = $03
-VIC_SPR2_X = $04
-VIC_SPR2_Y = $05
-VIC_SPR3_X = $06
-VIC_SPR3_Y = $07
-VIC_SPR4_X = $08
-VIC_SPR4_Y = $09
-VIC_SPR5_X = $0A
-VIC_SPR5_Y = $0B
-VIC_SPR6_X = $0C
-VIC_SPR6_Y = $0D
-VIC_SPR7_X = $0E
-VIC_SPR7_Y = $0F
-VIC_SPR_HI_X = $10
-VIC_SPR_ENA = $15
-VIC_SPR_EXP_Y = $17
-VIC_SPR_EXP_X = $1D
-VIC_SPR_MCOLOR = $1C
+VIC_SPR0_X = $00
+VIC_SPR0_Y = $01
+VIC_SPR1_X = $02
+VIC_SPR1_Y = $03
+VIC_SPR2_X = $04
+VIC_SPR2_Y = $05
+VIC_SPR3_X = $06
+VIC_SPR3_Y = $07
+VIC_SPR4_X = $08
+VIC_SPR4_Y = $09
+VIC_SPR5_X = $0A
+VIC_SPR5_Y = $0B
+VIC_SPR6_X = $0C
+VIC_SPR6_Y = $0D
+VIC_SPR7_X = $0E
+VIC_SPR7_Y = $0F
+VIC_SPR_HI_X = $10
+VIC_SPR_ENA = $15
+VIC_SPR_EXP_Y = $17
+VIC_SPR_EXP_X = $1D
+VIC_SPR_MCOLOR = $1C
VIC_SPR_BG_PRIO = $1B
VIC_SPR_MCOLOR0 = $25
VIC_SPR_MCOLOR1 = $26
-VIC_SPR0_COLOR = $27
-VIC_SPR1_COLOR = $28
-VIC_SPR2_COLOR = $29
-VIC_SPR3_COLOR = $2A
-VIC_SPR4_COLOR = $2B
-VIC_SPR5_COLOR = $2C
-VIC_SPR6_COLOR = $2D
-VIC_SPR7_COLOR = $2E
+VIC_SPR0_COLOR = $27
+VIC_SPR1_COLOR = $28
+VIC_SPR2_COLOR = $29
+VIC_SPR3_COLOR = $2A
+VIC_SPR4_COLOR = $2B
+VIC_SPR5_COLOR = $2C
+VIC_SPR6_COLOR = $2D
+VIC_SPR7_COLOR = $2E
-VIC_CTRL1 = $11
-VIC_CTRL2 = $16
+VIC_CTRL1 = $11
+VIC_CTRL2 = $16
-VIC_HLINE = $12
+VIC_HLINE = $12
-VIC_VIDEO_ADR = $18
+VIC_VIDEO_ADR = $18
-VIC_IRR = $19 ; Interrupt request register
-VIC_IMR = $1A ; Interrupt mask register
+VIC_IRR = $19 ; Interrupt request register
+VIC_IMR = $1A ; Interrupt mask register
VIC_BORDERCOLOR = $20
-VIC_BG_COLOR0 = $21
-VIC_BG_COLOR1 = $22
-VIC_BG_COLOR2 = $23
-VIC_BG_COLOR3 = $24
+VIC_BG_COLOR0 = $21
+VIC_BG_COLOR1 = $22
+VIC_BG_COLOR2 = $23
+VIC_BG_COLOR3 = $24
; I/O $da00: SID 6581
-SID_S1Lo = $00
-SID_S1Hi = $01
-SID_PB1Lo = $02
-SID_PB1Hi = $03
-SID_Ctl1 = $04
-SID_AD1 = $05
-SID_SUR1 = $06
-
-SID_S2Lo = $07
-SID_S2Hi = $08
-SID_PB2Lo = $09
-SID_PB2Hi = $0A
-SID_Ctl2 = $0B
-SID_AD2 = $0C
-SID_SUR2 = $0D
-
-SID_S3Lo = $0E
-SID_S3Hi = $0F
-SID_PB3Lo = $10
-SID_PB3Hi = $11
-SID_Ctl3 = $12
-SID_AD3 = $13
-SID_SUR3 = $14
-
-SID_FltLo = $15
-SID_FltHi = $16
-SID_FltCtl = $17
-SID_Amp = $18
-SID_ADConv1 = $19
-SID_ADConv2 = $1A
-SID_Noise = $1B
-SID_Read3 = $1C
+SID_S1Lo = $00
+SID_S1Hi = $01
+SID_PB1Lo = $02
+SID_PB1Hi = $03
+SID_Ctl1 = $04
+SID_AD1 = $05
+SID_SUR1 = $06
+
+SID_S2Lo = $07
+SID_S2Hi = $08
+SID_PB2Lo = $09
+SID_PB2Hi = $0A
+SID_Ctl2 = $0B
+SID_AD2 = $0C
+SID_SUR2 = $0D
+
+SID_S3Lo = $0E
+SID_S3Hi = $0F
+SID_PB3Lo = $10
+SID_PB3Hi = $11
+SID_Ctl3 = $12
+SID_AD3 = $13
+SID_SUR3 = $14
+
+SID_FltLo = $15
+SID_FltHi = $16
+SID_FltCtl = $17
+SID_Amp = $18
+SID_ADConv1 = $19
+SID_ADConv2 = $1A
+SID_Noise = $1B
+SID_Read3 = $1C
; I/O $db00: CIA 6526 Inter Process Communication
@@ -178,5 +178,5 @@ SID_Read3 = $1C
; Out video memory address
-COLOR_RAM = $D400 ; System bank
+COLOR_RAM = $D400 ; System bank
diff --git a/asminc/cbm610.inc b/asminc/cbm610.inc
index 14bbb3d69..94256eeb1 100644
--- a/asminc/cbm610.inc
+++ b/asminc/cbm610.inc
@@ -9,8 +9,8 @@
; ---------------------------------------------------------------------------
; Zeropage stuff
-ExecReg = $00
-IndReg = $01
+ExecReg = $00
+IndReg = $01
; ---------------------------------------------------------------------------
; Screen size
@@ -25,13 +25,13 @@ YSIZE = 25
; I/O $d800: CRTC 6545
.struct CRTC
- ADDR .byte
- DATA .byte
+ ADDR .byte
+ DATA .byte
.endstruct
; I/O $db00: CIA 6526 Inter Process Communication
;
-; IPCcia = $db00
+; IPCcia = $db00
.struct CIA
PRA .byte
@@ -65,13 +65,13 @@ YSIZE = 25
; I/O $dc00: CIA 6526
;
-; cia = $dc00
+; cia = $dc00
; I/O $dd00: ACIA 6551
;
-; acia = $dd00
+; acia = $dd00
.struct ACIA
DATA .byte
@@ -83,7 +83,7 @@ YSIZE = 25
; I/O $de00: Triport #1 6525
;
-; tpi1 = $de00
+; tpi1 = $de00
.struct TPI
PRA .byte
@@ -105,6 +105,6 @@ YSIZE = 25
; I/O $df00: Triport #2 6525
-; tpi2 = $df00
+; tpi2 = $df00
diff --git a/asminc/ctype.inc b/asminc/ctype.inc
index 2e29c7293..d6b0ccf46 100644
--- a/asminc/ctype.inc
+++ b/asminc/ctype.inc
@@ -6,24 +6,24 @@
; Make the __ctype table an exported/imported symbol
- .global __ctype
+ .global __ctype
; Define bitmapped constants for the table entries
CT_NONE = $00 ; Nothing special
-CT_LOWER = $01 ; 0 - Lower case char
-CT_UPPER = $02 ; 1 - Upper case char
-CT_DIGIT = $04 ; 2 - Numeric digit
-CT_XDIGIT = $08 ; 3 - Hex digit (both, lower and upper)
-CT_CTRL = $10 ; 4 - Control character
-CT_SPACE = $20 ; 5 - The space character itself
-CT_OTHER_WS = $40 ; 6 - Other whitespace ('\f', '\n', '\r', '\t' and '\v')
-CT_SPACE_TAB = $80 ; 7 - Space or tab character
+CT_LOWER = $01 ; 0 - Lower case char
+CT_UPPER = $02 ; 1 - Upper case char
+CT_DIGIT = $04 ; 2 - Numeric digit
+CT_XDIGIT = $08 ; 3 - Hex digit (both, lower and upper)
+CT_CTRL = $10 ; 4 - Control character
+CT_SPACE = $20 ; 5 - The space character itself
+CT_OTHER_WS = $40 ; 6 - Other whitespace ('\f', '\n', '\r', '\t' and '\v')
+CT_SPACE_TAB = $80 ; 7 - Space or tab character
; Combined stuff
-CT_ALNUM = (CT_LOWER | CT_UPPER | CT_DIGIT)
-CT_ALPHA = (CT_LOWER | CT_UPPER)
-CT_CTRL_SPACE = (CT_CTRL | CT_SPACE)
-CT_NOT_PUNCT = (CT_SPACE | CT_CTRL | CT_DIGIT | CT_UPPER | CT_LOWER)
+CT_ALNUM = (CT_LOWER | CT_UPPER | CT_DIGIT)
+CT_ALPHA = (CT_LOWER | CT_UPPER)
+CT_CTRL_SPACE = (CT_CTRL | CT_SPACE)
+CT_NOT_PUNCT = (CT_SPACE | CT_CTRL | CT_DIGIT | CT_UPPER | CT_LOWER)
diff --git a/asminc/em-kernel.inc b/asminc/em-kernel.inc
index e17b9c6be..1df969225 100644
--- a/asminc/em-kernel.inc
+++ b/asminc/em-kernel.inc
@@ -36,19 +36,19 @@
;------------------------------------------------------------------------------
; The driver header
-.struct EMD_HDR
- ID .byte 3 ; Contains 0x65, 0x6d, 0x64 ("emd")
- VERSION .byte 1 ; Interface version
- JUMPTAB .struct
- INSTALL .word ; INSTALL routine
- UNINSTALL .word ; UNINSTALL routine
- PAGECOUNT .word ; PAGECOUNT routine
- MAP .word ; MAP routine
- USE .word ; USE routine
- MAPCLEAN .word ; MAPCLEAN routine
- COPYFROM .word ; COPYFROM routine
- COPYTO .word ; COPYTO routine
- .endstruct
+.struct EMD_HDR
+ ID .byte 3 ; Contains 0x65, 0x6d, 0x64 ("emd")
+ VERSION .byte 1 ; Interface version
+ JUMPTAB .struct
+ INSTALL .word ; INSTALL routine
+ UNINSTALL .word ; UNINSTALL routine
+ PAGECOUNT .word ; PAGECOUNT routine
+ MAP .word ; MAP routine
+ USE .word ; USE routine
+ MAPCLEAN .word ; MAPCLEAN routine
+ COPYFROM .word ; COPYFROM routine
+ COPYTO .word ; COPYTO routine
+ .endstruct
.endstruct
;------------------------------------------------------------------------------
@@ -59,18 +59,18 @@ EMD_API_VERSION = $00
;------------------------------------------------------------------------------
; The asm equivalent to the C em_copy structure
-.struct EM_COPY
- BUF .word ; Memory buffer to copy from or to
- OFFS .byte ; Offset into page
- PAGE .word ; Starting page to copy from or to
- COUNT .word ; Number of bytes to copy
- UNUSED .byte ; Make the size 8 bytes
+.struct EM_COPY
+ BUF .word ; Memory buffer to copy from or to
+ OFFS .byte ; Offset into page
+ PAGE .word ; Starting page to copy from or to
+ COUNT .word ; Number of bytes to copy
+ UNUSED .byte ; Make the size 8 bytes
.endstruct
;------------------------------------------------------------------------------
; Variables
- .global _em_drv ; Pointer to driver
+ .global _em_drv ; Pointer to driver
;------------------------------------------------------------------------------
; Driver entry points
@@ -81,25 +81,25 @@ EMD_API_VERSION = $00
.global emd_map
.global emd_use
.global emd_commit
- .global emd_copyfrom
+ .global emd_copyfrom
.global emd_copyto
;------------------------------------------------------------------------------
; ASM functions
- .global em_clear_ptr
+ .global em_clear_ptr
;------------------------------------------------------------------------------
; C callable functions
- .global _em_load_driver
- .global _em_unload
- .global _em_install
- .global _em_uninstall
- .global _em_pagecount
- .global _em_map
- .global _em_use
- .global _em_commit
- .global _em_copyfrom
- .global _em_copyto
+ .global _em_load_driver
+ .global _em_unload
+ .global _em_install
+ .global _em_uninstall
+ .global _em_pagecount
+ .global _em_map
+ .global _em_use
+ .global _em_commit
+ .global _em_copyfrom
+ .global _em_copyto
diff --git a/asminc/errno.inc b/asminc/errno.inc
index 733671973..83cd9a75d 100644
--- a/asminc/errno.inc
+++ b/asminc/errno.inc
@@ -12,23 +12,23 @@
; Error codes, must match the values in the C headers
.enum
EOK ; No error
- ENOENT ; No such file or directory
- ENOMEM ; Out of memory
- EACCES ; Permission denied
- ENODEV ; No such device
- EMFILE ; Too many open files
- EBUSY ; Device or resource busy
- EINVAL ; Invalid argument
- ENOSPC ; No space left on device
- EEXIST ; File exists
- EAGAIN ; Try again
- EIO ; I/O error
- EINTR ; Interrupted system call
- ENOSYS ; Function not implemented
- ESPIPE ; Illegal seek
+ ENOENT ; No such file or directory
+ ENOMEM ; Out of memory
+ EACCES ; Permission denied
+ ENODEV ; No such device
+ EMFILE ; Too many open files
+ EBUSY ; Device or resource busy
+ EINVAL ; Invalid argument
+ ENOSPC ; No space left on device
+ EEXIST ; File exists
+ EAGAIN ; Try again
+ EIO ; I/O error
+ EINTR ; Interrupted system call
+ ENOSYS ; Function not implemented
+ ESPIPE ; Illegal seek
ERANGE ; Range error
EBADF ; Bad file number
- EUNKNOWN ; Unknown OS specific error - must be last!
+ EUNKNOWN ; Unknown OS specific error - must be last!
EMAX = EUNKNOWN ; Highest error code
.endenum
diff --git a/asminc/fcntl.inc b/asminc/fcntl.inc
index 49c11a9b5..5e6333d91 100644
--- a/asminc/fcntl.inc
+++ b/asminc/fcntl.inc
@@ -8,12 +8,12 @@ STDOUT_FILENO = 1
STDERR_FILENO = 2
; File mode constants, must match the values in the C headers
-O_RDONLY = $01
-O_WRONLY = $02
-O_RDWR = $03
-O_CREAT = $10
-O_TRUNC = $20
-O_APPEND = $40
+O_RDONLY = $01
+O_WRONLY = $02
+O_RDWR = $03
+O_CREAT = $10
+O_TRUNC = $20
+O_APPEND = $40
O_EXCL = $80
diff --git a/asminc/joy-kernel.inc b/asminc/joy-kernel.inc
index 8f890f141..6c360dd43 100644
--- a/asminc/joy-kernel.inc
+++ b/asminc/joy-kernel.inc
@@ -40,16 +40,16 @@
; Driver header stuff
.struct JOY_HDR
- ID .byte 3 ; $6A, $6F, $79 ("joy")
- VERSION .byte 1 ; Interface version
- MASKS .byte 8 ; Joystick state mask array
- JUMPTAB .struct
- INSTALL .word ; INSTALL routine
- UNINSTALL .word ; UNINSTALL routine
- COUNT .word ; COUNT routine
- READ .word ; READ routine
+ ID .byte 3 ; $6A, $6F, $79 ("joy")
+ VERSION .byte 1 ; Interface version
+ MASKS .byte 8 ; Joystick state mask array
+ JUMPTAB .struct
+ INSTALL .word ; INSTALL routine
+ UNINSTALL .word ; UNINSTALL routine
+ COUNT .word ; COUNT routine
+ READ .word ; READ routine
IRQ .word ; IRQ routine
- .endstruct
+ .endstruct
.endstruct
;------------------------------------------------------------------------------
@@ -60,7 +60,7 @@ JOY_API_VERSION = $01
;------------------------------------------------------------------------------
; Variables
- .global _joy_drv ; Pointer to driver
+ .global _joy_drv ; Pointer to driver
.global _joy_masks
;------------------------------------------------------------------------------
@@ -76,10 +76,10 @@ JOY_API_VERSION = $01
.global _joy_load_driver
.global _joy_unload
- .global _joy_install
- .global _joy_uninstall
- .global _joy_count
- .global _joy_read
+ .global _joy_install
+ .global _joy_uninstall
+ .global _joy_count
+ .global _joy_read
.global _joy_clear_ptr
diff --git a/asminc/modload.inc b/asminc/modload.inc
index 07c052c08..168dd679d 100644
--- a/asminc/modload.inc
+++ b/asminc/modload.inc
@@ -63,7 +63,7 @@
; /* Free a loaded module. Note: The given pointer is the pointer to the
; * module memory, not a pointer to a control structure.
; */
-.global _mod_free
+.global _mod_free
; Errors
.enum
diff --git a/asminc/mouse-kernel.inc b/asminc/mouse-kernel.inc
index 91d84e06e..24a9f7632 100644
--- a/asminc/mouse-kernel.inc
+++ b/asminc/mouse-kernel.inc
@@ -2,7 +2,7 @@
;/* */
;/* mouse-kernel.inc */
;/* */
-;/* Mouse API */
+;/* Mouse API */
;/* */
;/* */
;/* */
@@ -53,23 +53,23 @@
;------------------------------------------------------------------------------
; The driver header
-.struct MOUSE_HDR
- ID .byte 3 ; Contains 0x6D, 0x6F, 0x75 ("mou")
- VERSION .byte 1 ; Interface version
- JUMPTAB .struct
- INSTALL .addr
- UNINSTALL .addr
- HIDE .addr
- SHOW .addr
- SETBOX .addr
- GETBOX .addr
- MOVE .addr
- BUTTONS .addr
- POS .addr
+.struct MOUSE_HDR
+ ID .byte 3 ; Contains 0x6D, 0x6F, 0x75 ("mou")
+ VERSION .byte 1 ; Interface version
+ JUMPTAB .struct
+ INSTALL .addr
+ UNINSTALL .addr
+ HIDE .addr
+ SHOW .addr
+ SETBOX .addr
+ GETBOX .addr
+ MOVE .addr
+ BUTTONS .addr
+ POS .addr
INFO .addr
IOCTL .addr
- IRQ .addr
- .endstruct
+ IRQ .addr
+ .endstruct
FLAGS .byte ; Mouse driver flags
CALLBACKS .struct ; Jump instructions
.byte ; JMP opcode
@@ -86,10 +86,10 @@
;------------------------------------------------------------------------------
; The mouse callback structure
-.struct MOUSE_CALLBACKS
- HIDE .addr ; Hide the mouse cursor
- SHOW .addr ; Show the mouse cursor
- MOVEX .addr ; Move the mouse cursor
+.struct MOUSE_CALLBACKS
+ HIDE .addr ; Hide the mouse cursor
+ SHOW .addr ; Show the mouse cursor
+ MOVEX .addr ; Move the mouse cursor
MOVEY .addr ; Dito for Y
.endstruct
@@ -112,7 +112,7 @@ MOUSE_FLAG_LATE_IRQ = $80 ; Enable IRQ *after* calling INSTALL
;------------------------------------------------------------------------------
; Mouse button definitions
-MOUSE_BTN_LEFT = $10
+MOUSE_BTN_LEFT = $10
MOUSE_BTN_RIGHT = $01
;------------------------------------------------------------------------------
@@ -129,16 +129,16 @@ MOUSE_BTN_RIGHT = $01
.endstruct
.struct MOUSE_BOX
- MINX .word
- MINY .word
- MAXX .word
- MAXY .word
+ MINX .word
+ MINY .word
+ MAXX .word
+ MAXY .word
.endstruct
;------------------------------------------------------------------------------
; Variables
- .global _mouse_drv ; Pointer to driver
+ .global _mouse_drv ; Pointer to driver
.global _mouse_hidden ; Counter, 0 = mouse is visible
;------------------------------------------------------------------------------
@@ -152,14 +152,14 @@ MOUSE_BTN_RIGHT = $01
.global _mouse_hide
.global _mouse_show
.global _mouse_setbox
- .global _mouse_getbox
+ .global _mouse_getbox
.global _mouse_move
.global _mouse_buttons
.global _mouse_pos
.global _mouse_info
.global _mouse_ioctl
- .global _mouse_clear_ptr
+ .global _mouse_clear_ptr
;------------------------------------------------------------------------------
; Driver entry points (asm callable)
@@ -168,8 +168,8 @@ MOUSE_BTN_RIGHT = $01
.global mouse_uninstall
.global mouse_hide
.global mouse_show
- .global mouse_setbox
- .global mouse_getbox
+ .global mouse_setbox
+ .global mouse_getbox
.global mouse_move
.global mouse_buttons
.global mouse_pos
diff --git a/asminc/nes.inc b/asminc/nes.inc
index 1ee5ebc8f..cc83d7cea 100644
--- a/asminc/nes.inc
+++ b/asminc/nes.inc
@@ -5,17 +5,17 @@
;; FIXME: optimize zeropage usage
-SCREEN_PTR = $62 ;2
+SCREEN_PTR = $62 ;2
CRAM_PTR = $64 ;2
-CHARCOLOR = $66
-BGCOLOR = $67
-RVS = $68
-CURS_X = $69
-CURS_Y = $6a
+CHARCOLOR = $66
+BGCOLOR = $67
+RVS = $68
+CURS_X = $69
+CURS_Y = $6a
tickcount = $6b ;2
-VBLANK_FLAG = $70
+VBLANK_FLAG = $70
ringbuff = $0200
ringwrite = $71
@@ -26,20 +26,20 @@ ppuhi = $74
ppulo = $75
ppuval = $76
-screenrows = (30-1)
+screenrows = (30-1)
charsperline = 32
xsize = charsperline
;; PPU defines
-PPU_CTRL1 = $2000
-PPU_CTRL2 = $2001
-PPU_STATUS = $2002
-PPU_SPR_ADDR = $2003
-PPU_SPR_IO = $2004
-PPU_VRAM_ADDR1 = $2005
-PPU_VRAM_ADDR2 = $2006
-PPU_VRAM_IO = $2007
+PPU_CTRL1 = $2000
+PPU_CTRL2 = $2001
+PPU_STATUS = $2002
+PPU_SPR_ADDR = $2003
+PPU_SPR_IO = $2004
+PPU_VRAM_ADDR1 = $2005
+PPU_VRAM_ADDR2 = $2006
+PPU_VRAM_IO = $2007
;; APU defines
@@ -63,30 +63,30 @@ APU_MODCTRL = $4010 ; Delta Modulation Control Register (W)
APU_MODDA = $4011 ; Delta Modulation D/A Register (W)
APU_MODADDR = $4012 ; Delta Modulation Address Register (W)
APU_MODLEN = $4013 ; Delta Modulation Data Length Register (W)
-APU_SPR_DMA = $4014 ; Sprite DMA Register (W)
-APU_CHANCTRL = $4015 ; Sound/Vertical Clock Signal Register (R)
-APU_PAD1 = $4016 ; Joypad #1 (RW)
-APU_PAD2 = $4017 ; Joypad #2/SOFTCLK (RW)
+APU_SPR_DMA = $4014 ; Sprite DMA Register (W)
+APU_CHANCTRL = $4015 ; Sound/Vertical Clock Signal Register (R)
+APU_PAD1 = $4016 ; Joypad #1 (RW)
+APU_PAD2 = $4017 ; Joypad #2/SOFTCLK (RW)
-CH_HLINE = 11
-CH_VLINE = 14
-CH_ULCORNER = 176
-CH_URCORNER = 174
-CH_LLCORNER = 173
-CH_LRCORNER = 189
-CH_TTEE = 178
-CH_RTEE = 179
-CH_BTEE = 177
-CH_LTEE = 171
-CH_CROSS = 123
-CH_CURS_UP = 145
-CH_CURS_DOWN = 17
-CH_CURS_LEFT = 157
-CH_CURS_RIGHT = 29
-CH_PI = 126
-CH_DEL = 20
-CH_INS = 148
+CH_HLINE = 11
+CH_VLINE = 14
+CH_ULCORNER = 176
+CH_URCORNER = 174
+CH_LLCORNER = 173
+CH_LRCORNER = 189
+CH_TTEE = 178
+CH_RTEE = 179
+CH_BTEE = 177
+CH_LTEE = 171
+CH_CROSS = 123
+CH_CURS_UP = 145
+CH_CURS_DOWN = 17
+CH_CURS_LEFT = 157
+CH_CURS_RIGHT = 29
+CH_PI = 126
+CH_DEL = 20
+CH_INS = 148
CH_ENTER = 10
CH_STOP = 3
CH_ESC = 27
diff --git a/asminc/o65.inc b/asminc/o65.inc
index 5bdbe05cb..6e0caa76b 100644
--- a/asminc/o65.inc
+++ b/asminc/o65.inc
@@ -1,8 +1,8 @@
;*****************************************************************************/
;* */
-;* o65.inc */
+;* o65.inc */
;* */
-;* Definitions for the o65 file format */
+;* Definitions for the o65 file format */
;* */
;* */
;* */
@@ -64,7 +64,7 @@ O65_MAGIC_2 = $35 ; '5'
O65_VERSION = $00
; Defines for the mode word
-O65_CPU_65816 = $8000 ; Executable is for 65816
+O65_CPU_65816 = $8000 ; Executable is for 65816
O65_CPU_6502 = $0000 ; Executable is for the 6502
O65_CPU_MASK = $8000 ; Mask to extract CPU type
@@ -91,7 +91,7 @@ O65_BSSZERO = $0200 ; BSS segment must be zeroed
O65_BSSZERO_MASK = $0200 ; Mask to extract bss zero flag
; The following is used if O65_CPU == 6502
-O65_CPU2_6502 = $0000 ; Executable is for 6502
+O65_CPU2_6502 = $0000 ; Executable is for 6502
O65_CPU2_65C02 = $0010 ; Executable is for 65C02
O65_CPU2_65SC02 = $0020 ; Executable is for 65SC02
O65_CPU2_65CE02 = $0030 ; Executable is for 65CE02
@@ -127,14 +127,14 @@ O65_SEGID_MASK = $07
; Option tags
O65_OPT_FILENAME = 0
-O65_OPT_OS = 1
-O65_OPT_ASM = 2
-O65_OPT_AUTHOR = 3
-O65_OPT_TIMESTAMP = 4
+O65_OPT_OS = 1
+O65_OPT_ASM = 2
+O65_OPT_AUTHOR = 3
+O65_OPT_TIMESTAMP = 4
; Operating system codes for O65_OPT_OS
-O65_OS_OSA65 = 1
-O65_OS_LUNIX = 2
+O65_OS_OSA65 = 1
+O65_OS_LUNIX = 2
O65_OS_CC65 = 3
O65_OS_OPENCBM = 4
diff --git a/asminc/pet.inc b/asminc/pet.inc
index 1950046cc..a3dadf48d 100644
--- a/asminc/pet.inc
+++ b/asminc/pet.inc
@@ -6,25 +6,25 @@
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
-MEMSIZE := $34 ; Size of memory installed
+MEMSIZE := $34 ; Size of memory installed
TIME := $8D ; 60HZ clock
-KEY_COUNT := $9E ; Number of keys in input buffer
-RVS := $9F ; Reverse flag
-CURS_FLAG := $A7 ; 1 = cursor off
-CURS_BLINK := $A8 ; Blink counter
-CURS_CHAR := $A9 ; Character under the cursor
-CURS_STATE := $AA ; Cursor blink state
-SCREEN_PTR := $C4 ; Pointer to current char in text screen
-CURS_X := $C6 ; Cursor column
+KEY_COUNT := $9E ; Number of keys in input buffer
+RVS := $9F ; Reverse flag
+CURS_FLAG := $A7 ; 1 = cursor off
+CURS_BLINK := $A8 ; Blink counter
+CURS_CHAR := $A9 ; Character under the cursor
+CURS_STATE := $AA ; Cursor blink state
+SCREEN_PTR := $C4 ; Pointer to current char in text screen
+CURS_X := $C6 ; Cursor column
FNLEN := $D1 ; Length of filename
LFN := $D2 ; Current Logical File Number
-SECADR := $D3 ; Secondary address
-DEVNUM := $D4 ; Device number
-SCR_LINELEN := $D5 ; Screen line length
-CURS_Y := $D8 ; Cursor row
+SECADR := $D3 ; Secondary address
+DEVNUM := $D4 ; Device number
+SCR_LINELEN := $D5 ; Screen line length
+CURS_Y := $D8 ; Cursor row
FNADR := $DA ; Pointer to file name
-KEY_BUF := $26F ; Keyboard buffer
+KEY_BUF := $26F ; Keyboard buffer
;----------------------------------------------------------------------------
; PET ROM type detection
@@ -38,17 +38,17 @@ PET_4000 = $FD
;----------------------------------------------------------------------------
; Vector and other locations
-IRQVec := $0090
-BRKVec := $0092
-NMIVec := $0094
+IRQVec := $0090
+BRKVec := $0092
+NMIVec := $0094
; ---------------------------------------------------------------------------
; I/O: 6522 VIA2
-VIA := $E840
+VIA := $E840
VIA_PRB := $E840
VIA_PRA := $E841
-VIA_DDRB := $E842
-VIA_DDRA := $E843
+VIA_DDRB := $E842
+VIA_DDRA := $E843
diff --git a/asminc/plus4.inc b/asminc/plus4.inc
index 8d07731b2..014c18e60 100644
--- a/asminc/plus4.inc
+++ b/asminc/plus4.inc
@@ -8,41 +8,41 @@
TMPPTR := $22 ; Temporary ptr used by BASIC
TIME := $A3 ; 60HZ clock
-FNAM_LEN := $AB ; Length of filename
+FNAM_LEN := $AB ; Length of filename
LFN := $AC ; Logical file number
-SECADR := $AD ; Secondary address
-DEVNUM := $AE ; Device number
+SECADR := $AD ; Secondary address
+DEVNUM := $AE ; Device number
FNAM := $AF ; Pointer to filename for OPEN
-KEY_COUNT := $EF ; Number of keys in input buffer
+KEY_COUNT := $EF ; Number of keys in input buffer
RVS := $C2 ; Reverse flag
-CURS_X := $CA ; Cursor column
-CURS_Y := $CD ; Cursor row
-SCREEN_PTR := $C8 ; Pointer to current char in text screen
-CRAM_PTR := $EA ; Pointer to current char in color RAM
+CURS_X := $CA ; Cursor column
+CURS_Y := $CD ; Cursor row
+SCREEN_PTR := $C8 ; Pointer to current char in text screen
+CRAM_PTR := $EA ; Pointer to current char in color RAM
-BASIC_BUF := $200 ; Location of command-line
-BASIC_BUF_LEN = 89 ; Maximum length of command-line
+BASIC_BUF := $200 ; Location of command-line
+BASIC_BUF_LEN = 89 ; Maximum length of command-line
-FNBUF := $25E ; Buffer for filename
+FNBUF := $25E ; Buffer for filename
FETCH := $494 ; lda (zp),y from RAM
CHARCOLOR := $53B
-FKEY_COUNT := $55D ; Characters for function key
-FKEY_SPACE := $55F ; Function key definitions
-FKEY_ORIG := $F3D2 ; Original definitions
+FKEY_COUNT := $55D ; Characters for function key
+FKEY_SPACE := $55F ; Function key definitions
+FKEY_ORIG := $F3D2 ; Original definitions
; ---------------------------------------------------------------------------
; Kernal routines
; Direct entries
-CLRSCR := $D88B
-KBDREAD := $D8C1
+CLRSCR := $D88B
+KBDREAD := $D8C1
; ---------------------------------------------------------------------------
; Vector and other locations
-IRQVec := $0314
-BRKVec := $0316
-NMIVec := $0318
+IRQVec := $0314
+BRKVec := $0316
+NMIVec := $0318
; ---------------------------------------------------------------------------
; Screen size
@@ -53,29 +53,29 @@ YSIZE = 25
; ---------------------------------------------------------------------------
; I/O
-TED_T1LO := $FF00
-TED_T1HI := $FF01
-TED_T2LO := $FF02
-TED_T2HI := $FF03
-TED_T3LO := $FF04
-TED_T4HI := $FF05
+TED_T1LO := $FF00
+TED_T1HI := $FF01
+TED_T2LO := $FF02
+TED_T2HI := $FF03
+TED_T3LO := $FF04
+TED_T4HI := $FF05
TED_MULTI1 := $FF07
-TED_KBD := $FF08
-TED_CURSHI := $FF0C
-TED_CURSLO := $FF0D
-TED_V1FRQLO := $FF0E
-TED_V2FRQLO := $FF0F
-TED_V2FRQHI := $FF10
-TED_BGCOLOR := $FF15
-TED_COLOR1 := $FF16
-TED_COLOR2 := $FF17
-TED_COLOR3 := $FF18
-TED_BORDERCOLOR := $FF19
-TED_VLINEHI := $FF1C
-TED_VLINELO := $FF1D
-TED_HPOS := $FF1E
-TED_ROMSEL := $FF3E
-TED_RAMSEL := $FF3F
+TED_KBD := $FF08
+TED_CURSHI := $FF0C
+TED_CURSLO := $FF0D
+TED_V1FRQLO := $FF0E
+TED_V2FRQLO := $FF0F
+TED_V2FRQHI := $FF10
+TED_BGCOLOR := $FF15
+TED_COLOR1 := $FF16
+TED_COLOR2 := $FF17
+TED_COLOR3 := $FF18
+TED_BORDERCOLOR := $FF19
+TED_VLINEHI := $FF1C
+TED_VLINELO := $FF1D
+TED_HPOS := $FF1E
+TED_ROMSEL := $FF3E
+TED_RAMSEL := $FF3F
; ---------------------------------------------------------------------------
; RAM/ROM selection addresses
diff --git a/asminc/ser-kernel.inc b/asminc/ser-kernel.inc
index c8eab707a..7fc5bf9c2 100644
--- a/asminc/ser-kernel.inc
+++ b/asminc/ser-kernel.inc
@@ -48,7 +48,7 @@
PUT .word ; PUT routine
STATUS .word ; STATUS routine
IOCTL .word ; IOCTL routine
- IRQ .word ; IRQ routine
+ IRQ .word ; IRQ routine
.endstruct
.endstruct
@@ -74,44 +74,44 @@ SER_API_VERSION = $00
; Baudrate
SER_BAUD_45_5 = $00
-SER_BAUD_50 = $01
+SER_BAUD_50 = $01
SER_BAUD_75 = $02
-SER_BAUD_110 = $03
-SER_BAUD_134_5 = $04
+SER_BAUD_110 = $03
+SER_BAUD_134_5 = $04
SER_BAUD_150 = $05
-SER_BAUD_300 = $06
-SER_BAUD_600 = $07
-SER_BAUD_1200 = $08
+SER_BAUD_300 = $06
+SER_BAUD_600 = $07
+SER_BAUD_1200 = $08
SER_BAUD_1800 = $09
-SER_BAUD_2400 = $0A
+SER_BAUD_2400 = $0A
SER_BAUD_3600 = $0B
-SER_BAUD_4800 = $0C
+SER_BAUD_4800 = $0C
SER_BAUD_7200 = $0D
-SER_BAUD_9600 = $0E
-SER_BAUD_19200 = $0F
-SER_BAUD_38400 = $10
-SER_BAUD_57600 = $11
-SER_BAUD_115200 = $12
-SER_BAUD_230400 = $13
-SER_BAUD_31250 = $14
-SER_BAUD_62500 = $15
+SER_BAUD_9600 = $0E
+SER_BAUD_19200 = $0F
+SER_BAUD_38400 = $10
+SER_BAUD_57600 = $11
+SER_BAUD_115200 = $12
+SER_BAUD_230400 = $13
+SER_BAUD_31250 = $14
+SER_BAUD_62500 = $15
; Data bit settings
-SER_BITS_5 = $00
-SER_BITS_6 = $01
-SER_BITS_7 = $02
-SER_BITS_8 = $03
+SER_BITS_5 = $00
+SER_BITS_6 = $01
+SER_BITS_7 = $02
+SER_BITS_8 = $03
; Stop bit settings
-SER_STOP_1 = $00
-SER_STOP_2 = $01
+SER_STOP_1 = $00
+SER_STOP_2 = $01
; Parity
-SER_PAR_NONE = $00
-SER_PAR_ODD = $01
-SER_PAR_EVEN = $02
-SER_PAR_MARK = $03
-SER_PAR_SPACE = $04
+SER_PAR_NONE = $00
+SER_PAR_ODD = $01
+SER_PAR_EVEN = $02
+SER_PAR_MARK = $03
+SER_PAR_SPACE = $04
; Handshake
SER_HS_NONE = $00 ; No handshake
@@ -119,16 +119,16 @@ SER_HS_HW = $01 ; Hardware (RTS/CTS) handshake
SER_HS_SW = $02 ; Software handshake
; Bit masks to mask out things from the status returned by ser_status
-SER_STATUS_PE = $01 ; Parity error
-SER_STATUS_FE = $02 ; Framing error
-SER_STATUS_OE = $04 ; Overrun error
-SER_STATUS_DCD = $20 ; NOT data carrier detect
-SER_STATUS_DSR = $40 ; NOT data set ready
+SER_STATUS_PE = $01 ; Parity error
+SER_STATUS_FE = $02 ; Framing error
+SER_STATUS_OE = $04 ; Overrun error
+SER_STATUS_DCD = $20 ; NOT data carrier detect
+SER_STATUS_DSR = $40 ; NOT data set ready
;------------------------------------------------------------------------------
; Variables
- .global _ser_drv ; Pointer to driver
+ .global _ser_drv ; Pointer to driver
;------------------------------------------------------------------------------
; Driver entry points
@@ -141,7 +141,7 @@ SER_STATUS_DSR = $40 ; NOT data set ready
.global ser_put
.global ser_status
.global ser_ioctl
- .global ser_irq
+ .global ser_irq
;------------------------------------------------------------------------------
; C callable functions
diff --git a/asminc/smc.inc b/asminc/smc.inc
index ef710a30e..383417c3d 100644
--- a/asminc/smc.inc
+++ b/asminc/smc.inc
@@ -21,12 +21,12 @@
; distribution.
;
-.define _SMCDesignator .mid(0, .tcount(label) - 1, label) .ident(.concat(.string(.right(1, label)), "_SMC"))
-.define _SMCAlias .mid(0, .tcount(alias) - 1, alias) .ident(.concat(.string(.right(1, alias)), "_SMC"))
+.define _SMCDesignator .mid(0, .tcount(label) - 1, label) .ident(.concat(.string(.right(1, label)), "_SMC"))
+.define _SMCAlias .mid(0, .tcount(alias) - 1, alias) .ident(.concat(.string(.right(1, alias)), "_SMC"))
.define SMC_AbsAdr $FADE
-.define SMC_ZpAdr $00
+.define SMC_ZpAdr $00
.define SMC_Opcode nop
-.define SMC_Value $42
+.define SMC_Value $42
.macro SMC_OperateOnValue opcode, label
opcode _SMCDesignator+1
@@ -48,86 +48,86 @@
.export _SMCAlias := _SMCDesignator
.endmacro
-.macro SMC label, statement
+.macro SMC label, statement
_SMCDesignator: statement
.endmacro
.macro SMC_TransferOpcode label, opcode, register
.if .paramcount = 2 .or .match ({register}, a)
- lda #opcode
- sta _SMCDesignator
+ lda #opcode
+ sta _SMCDesignator
.elseif .match ({register}, x)
- ldx #opcode
- stx _SMCDesignator
+ ldx #opcode
+ stx _SMCDesignator
.elseif .match ({register}, y)
- ldy #opcode
- sty _SMCDesignator
+ ldy #opcode
+ sty _SMCDesignator
.endif
.endmacro
.macro SMC_LoadOpcode label, register
.if .paramcount = 1 .or .match ({register}, a)
- lda _SMCDesignator
+ lda _SMCDesignator
.elseif .match ({register}, x)
- ldx _SMCDesignator
+ ldx _SMCDesignator
.elseif .match ({register}, y)
- ldy _SMCDesignator
+ ldy _SMCDesignator
.endif
.endmacro
.macro SMC_StoreOpcode label, register
.if .paramcount = 1 .or .match ({register}, a)
- sta _SMCDesignator
+ sta _SMCDesignator
.elseif .match ({register}, x)
- stx _SMCDesignator
+ stx _SMCDesignator
.elseif .match ({register}, y)
- sty _SMCDesignator
+ sty _SMCDesignator
.endif
.endmacro
.macro SMC_ChangeBranch label, destination, register
.if .paramcount = 2 .or .match ({register}, a)
- lda #(destination - _SMCDesignator -2)
- sta _SMCDesignator+1
+ lda #(destination - _SMCDesignator -2)
+ sta _SMCDesignator+1
.elseif .match ({register}, x)
- ldx #(destination - _SMCDesignator - 2)
- stx _SMCDesignator+1
+ ldx #(destination - _SMCDesignator - 2)
+ stx _SMCDesignator+1
.elseif .match ({register}, y)
- ldy #(destination - _SMCDesignator - 2)
- sty _SMCDesignator+1
+ ldy #(destination - _SMCDesignator - 2)
+ sty _SMCDesignator+1
.endif
.endmacro
.macro SMC_TransferValue label, value, register
.if .paramcount = 2 .or .match ({register}, a)
- lda value
- sta _SMCDesignator+1
+ lda value
+ sta _SMCDesignator+1
.elseif .match ({register}, x)
- ldx value
- stx _SMCDesignator+1
+ ldx value
+ stx _SMCDesignator+1
.elseif .match ({register}, y)
- ldy value
- sty _SMCDesignator+1
+ ldy value
+ sty _SMCDesignator+1
.endif
.endmacro
.macro SMC_LoadValue label, register
.if .paramcount = 1 .or .match ({register}, a)
- lda _SMCDesignator+1
+ lda _SMCDesignator+1
.elseif .match ({register}, x)
- ldx _SMCDesignator+1
+ ldx _SMCDesignator+1
.elseif .match ({register}, y)
- ldy _SMCDesignator+1
+ ldy _SMCDesignator+1
.endif
.endmacro
.macro SMC_StoreValue label, register
.if .paramcount = 1 .or .match ({register}, a)
- sta _SMCDesignator+1
+ sta _SMCDesignator+1
.elseif .match ({register}, x)
- stx _SMCDesignator+1
+ stx _SMCDesignator+1
.elseif .match ({register}, y)
- sty _SMCDesignator+1
+ sty _SMCDesignator+1
.endif
.endmacro
@@ -146,49 +146,48 @@ SMC_StoreValue label, register
.macro SMC_TransferHighByte label, value, register
.if .paramcount = 2 .or .match ({register}, a)
- lda value
- sta _SMCDesignator+2
+ lda value
+ sta _SMCDesignator+2
.elseif .match ({register}, x)
- ldx value
- stx _SMCDesignator+2
+ ldx value
+ stx _SMCDesignator+2
.elseif .match ({register}, y)
- ldy value
- sty _SMCDesignator+2
+ ldy value
+ sty _SMCDesignator+2
.endif
.endmacro
.macro SMC_LoadHighByte label, register
.if .paramcount = 1 .or .match ({register}, a)
- lda _SMCDesignator+2
+ lda _SMCDesignator+2
.elseif .match ({register}, x)
- ldx _SMCDesignator+2
+ ldx _SMCDesignator+2
.elseif .match ({register}, y)
- ldy _SMCDesignator+2
+ ldy _SMCDesignator+2
.endif
.endmacro
.macro SMC_StoreHighByte label, register
.if .paramcount = 1 .or .match ({register}, a)
- sta _SMCDesignator+2
+ sta _SMCDesignator+2
.elseif .match ({register}, x)
- stx _SMCDesignator+2
+ stx _SMCDesignator+2
.elseif .match ({register}, y)
- sty _SMCDesignator+2
+ sty _SMCDesignator+2
.endif
.endmacro
-
.macro SMC_TransferAddressSingle label, address, register
.if .paramcount = 2 .or .match ((register), a)
.if (.match (.left (1, {address}), #))
; immediate mode
- lda #<(.right (.tcount ({address})-1, {address}))
+ lda #<(.right (.tcount ({address})-1, {address}))
sta _SMCDesignator+1
- lda #>(.right (.tcount ({address})-1, {address}))
+ lda #>(.right (.tcount ({address})-1, {address}))
sta _SMCDesignator+2
- .else
- ; assume absolute or zero page
- lda address
+ .else
+ ; assume absolute or zero page
+ lda address
sta _SMCDesignator+1
lda 1+(address)
sta _SMCDesignator+2
@@ -196,13 +195,13 @@ SMC_StoreValue label, register
.elseif .match ((register), x)
.if (.match (.left (1, {address}), #))
; immediate mode
- ldx #<(.right (.tcount ({address})-1, {address}))
+ ldx #<(.right (.tcount ({address})-1, {address}))
stx _SMCDesignator+1
- ldx #>(.right (.tcount ({address})-1, {address}))
+ ldx #>(.right (.tcount ({address})-1, {address}))
stx _SMCDesignator+2
- .else
- ; assume absolute or zero page
- ldx address
+ .else
+ ; assume absolute or zero page
+ ldx address
stx _SMCDesignator+1
ldx 1+(address)
stx _SMCDesignator+2
@@ -210,13 +209,13 @@ SMC_StoreValue label, register
.elseif .match ((register), y)
.if (.match (.left (1, {address}), #))
; immediate mode
- ldy #<(.right (.tcount ({address})-1, {address}))
+ ldy #<(.right (.tcount ({address})-1, {address}))
sty _SMCDesignator+1
- ldy #>(.right (.tcount ({address})-1, {address}))
+ ldy #>(.right (.tcount ({address})-1, {address}))
sty _SMCDesignator+2
- .else
- ; assume absolute or zero page
- ldy address
+ .else
+ ; assume absolute or zero page
+ ldy address
sty _SMCDesignator+1
ldy 1+(address)
sty _SMCDesignator+2
@@ -224,17 +223,16 @@ SMC_StoreValue label, register
.endif
.endmacro
-
.macro SMC_TransferAddress label, address
.if (.match (.left (1, {address}), #))
; immediate mode
- lda #<(.right (.tcount ({address})-1, {address}))
+ lda #<(.right (.tcount ({address})-1, {address}))
sta _SMCDesignator+1
ldx #>(.right (.tcount ({address})-1, {address}))
stx _SMCDesignator+2
.else
; assume absolute or zero page
- lda {address}
+ lda {address}
sta _SMCDesignator+1
ldx 1+{address}
stx _SMCDesignator)+2
@@ -242,8 +240,6 @@ SMC_StoreValue label, register
.endmacro
.macro SMC_StoreAddress label
- sta _SMCDesignator+1
- stx _SMCDesignator+2
+ sta _SMCDesignator+1
+ stx _SMCDesignator+2
.endmacro
-
-
diff --git a/asminc/stdio.inc b/asminc/stdio.inc
index ab9d86d2c..fc75238cf 100644
--- a/asminc/stdio.inc
+++ b/asminc/stdio.inc
@@ -36,25 +36,25 @@
;----------------------------------------------------------------------------
; Constants
-_IOFBF = 0
-_IOLBF = 1
-_IONBF = 2
-BUFSIZ = 256
-EOF = -1
+_IOFBF = 0
+_IOLBF = 1
+_IONBF = 2
+BUFSIZ = 256
+EOF = -1
.if .defined(__APPLE2__) .or .defined(__APPLE2ENH__)
-FILENAME_MAX = 64+1
+FILENAME_MAX = 64+1
.elseif .defined(__ATARI__)
-FILENAME_MAX = 12+1
+FILENAME_MAX = 12+1
.elseif .defined(__LUNIX__)
FILENAME_MAX = 80+1
.else
-FILENAME_MAX = 16+1
+FILENAME_MAX = 16+1
.endif
-L_tmpnam = FILENAME_MAX
-SEEK_CUR = 0
-SEEK_END = 1
-SEEK_SET = 2
-TMP_MAX = 256
+L_tmpnam = FILENAME_MAX
+SEEK_CUR = 0
+SEEK_END = 1
+SEEK_SET = 2
+TMP_MAX = 256
; Maximum number of open files (size of the file table)
FOPEN_MAX = 8
diff --git a/asminc/tgi-error.inc b/asminc/tgi-error.inc
index 0e026ee1b..a4559bb2a 100644
--- a/asminc/tgi-error.inc
+++ b/asminc/tgi-error.inc
@@ -41,7 +41,7 @@
TGI_ERR_INV_DRIVER ; Invalid driver
TGI_ERR_INV_MODE ; Mode not supported by driver
TGI_ERR_INV_ARG ; Invalid function argument
- TGI_ERR_INV_FUNC ; Function not supported
+ TGI_ERR_INV_FUNC ; Function not supported
TGI_ERR_INV_FONT ; Font file is invalid
TGI_ERR_NO_RES ; Out of resources (memory, handles, ...)
TGI_ERR_UNKNOWN ; Unknown error
diff --git a/asminc/tgi-kernel.inc b/asminc/tgi-kernel.inc
index 9061fe9af..c1182d371 100644
--- a/asminc/tgi-kernel.inc
+++ b/asminc/tgi-kernel.inc
@@ -54,7 +54,7 @@
UNINSTALL .addr ; UNINSTALL routine
INIT .addr ; INIT routine
DONE .addr ; DONE routine
- GETERROR .addr ; GETERROR routine
+ GETERROR .addr ; GETERROR routine
CONTROL .addr ; CONTROL routine
CLEAR .addr ; CLEAR routine
SETVIEWPAGE .addr ; SETVIEWPAGE routine
@@ -106,14 +106,14 @@ TGI_CLIP_TOP = $08
;------------------------------------------------------------------------------
; ASM accessible color constants
- .global tgi_color_black:zp ; Target-specific value for black
- .global tgi_color_white:zp ; Target-specific value for white
+ .global tgi_color_black:zp ; Target-specific value for black
+ .global tgi_color_white:zp ; Target-specific value for white
;------------------------------------------------------------------------------
; C accessible variables
- .global _tgi_drv ; Pointer to driver
- .global _tgi_error ; Last error code
+ .global _tgi_drv ; Pointer to driver
+ .global _tgi_error ; Last error code
.global _tgi_gmode ; Flag: graphics mode active
.global _tgi_curx ; Current drawing cursor X
.global _tgi_cury ; Current drawing cursor Y
@@ -139,10 +139,10 @@ TGI_CLIP_TOP = $08
;------------------------------------------------------------------------------
; ASM accessible variables
- .global tgi_clip_x1 ; Coordinate for line clipper
- .global tgi_clip_y1 ; Coordinate for line clipper
- .global tgi_clip_x2 ; Coordinate for line clipper
- .global tgi_clip_y2 ; Coordinate for line clipper
+ .global tgi_clip_x1 ; Coordinate for line clipper
+ .global tgi_clip_y1 ; Coordinate for line clipper
+ .global tgi_clip_x2 ; Coordinate for line clipper
+ .global tgi_clip_y2 ; Coordinate for line clipper
;------------------------------------------------------------------------------
; Driver entry points
@@ -151,7 +151,7 @@ TGI_CLIP_TOP = $08
.global tgi_uninstall
.global tgi_init
.global tgi_done
- .global tgi_geterror
+ .global tgi_geterror
.global tgi_control
.global tgi_clear
.global tgi_setviewpage
@@ -192,7 +192,7 @@ TGI_CLIP_TOP = $08
.global _tgi_clear
.global _tgi_done
.global _tgi_ellipse
- .global _tgi_getaspectratio
+ .global _tgi_getaspectratio
.global _tgi_getcolor
.global _tgi_getcolorcount
.global _tgi_getdefpalette
@@ -220,7 +220,7 @@ TGI_CLIP_TOP = $08
.global _tgi_outtext
.global _tgi_outtextxy
.global _tgi_pieslice
- .global _tgi_setaspectratio
+ .global _tgi_setaspectratio
.global _tgi_setcolor
.global _tgi_setdrawpage
.global _tgi_setpalette
diff --git a/asminc/time.inc b/asminc/time.inc
index dcc4877aa..16858471d 100644
--- a/asminc/time.inc
+++ b/asminc/time.inc
@@ -2,7 +2,7 @@
;/* */
;/* time.inc */
;/* */
-;/* Date and time */
+;/* Date and time */
;/* */
;/* */
;/* */
diff --git a/asminc/vic20.inc b/asminc/vic20.inc
index 3331b95f6..6780d067d 100644
--- a/asminc/vic20.inc
+++ b/asminc/vic20.inc
@@ -7,26 +7,26 @@
; Zero page, Commodore stuff
TIME := $A0 ; 60HZ clock
-FNAM_LEN := $B7 ; Length of filename
-SECADR := $B9 ; Secondary address
-DEVNUM := $BA ; Device number
+FNAM_LEN := $B7 ; Length of filename
+SECADR := $B9 ; Secondary address
+DEVNUM := $BA ; Device number
FNAM := $BB ; Pointer to filename
-KEY_COUNT := $C6 ; Number of keys in input buffer
-RVS := $C7 ; Reverse flag
-CURS_FLAG := $CC ; 1 = cursor off
-CURS_BLINK := $CD ; Blink counter
-CURS_CHAR := $CE ; Character under the cursor
-CURS_STATE := $CF ; Cursor blink state
-SCREEN_PTR := $D1 ; Pointer to current char in text screen
-CURS_X := $D3 ; Cursor column
-CURS_Y := $D6 ; Cursor row
-CRAM_PTR := $F3 ; Pointer to current char in color RAM
-
-BASIC_BUF := $200 ; Location of command-line
-BASIC_BUF_LEN = 89 ; Maximum length of command-line
+KEY_COUNT := $C6 ; Number of keys in input buffer
+RVS := $C7 ; Reverse flag
+CURS_FLAG := $CC ; 1 = cursor off
+CURS_BLINK := $CD ; Blink counter
+CURS_CHAR := $CE ; Character under the cursor
+CURS_STATE := $CF ; Cursor blink state
+SCREEN_PTR := $D1 ; Pointer to current char in text screen
+CURS_X := $D3 ; Cursor column
+CURS_Y := $D6 ; Cursor row
+CRAM_PTR := $F3 ; Pointer to current char in color RAM
+
+BASIC_BUF := $200 ; Location of command-line
+BASIC_BUF_LEN = 89 ; Maximum length of command-line
CHARCOLOR := $286
-CURS_COLOR := $287 ; Color under the cursor
+CURS_COLOR := $287 ; Color under the cursor
; ---------------------------------------------------------------------------
@@ -39,37 +39,37 @@ YSIZE = 23
; Kernal routines
; Direct entries
-CLRSCR := $E55F
-KBDREAD := $E5CF
+CLRSCR := $E55F
+KBDREAD := $E5CF
; ---------------------------------------------------------------------------
; Vector and other locations
-IRQVec := $0314
-BRKVec := $0316
-NMIVec := $0318
+IRQVec := $0314
+BRKVec := $0316
+NMIVec := $0318
; ---------------------------------------------------------------------------
; I/O: 6560 VIC
-VIC := $9000
+VIC := $9000
VIC_LINES := $9003 ; Screen lines, bit 7 is bit 0 from VIC_HLINE
VIC_HLINE := $9004 ; Rasterline, bits 1-8
-VIC_COLOR := $900F ; Border and background color
+VIC_COLOR := $900F ; Border and background color
; ---------------------------------------------------------------------------
; I/O: 6522 VIA1
-VIA1 := $9110
-VIA1_JOY := $9111
-VIA1_DDRB := $9112
-VIA1_DDRA := $9113
+VIA1 := $9110
+VIA1_JOY := $9111
+VIA1_DDRB := $9112
+VIA1_DDRA := $9113
; ---------------------------------------------------------------------------
; I/O: 6522 VIA2
-VIA2 := $9120
-VIA2_JOY := $9120
-VIA2_DDRB := $9122
-VIA2_DDRA := $9123
+VIA2 := $9120
+VIA2_JOY := $9120
+VIA2_DDRB := $9122
+VIA2_DDRA := $9123
diff --git a/include/6502.h b/include/6502.h
index 99014ffb5..706418516 100644
--- a/include/6502.h
+++ b/include/6502.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* 6502.h */
+/* 6502.h */
/* */
-/* 6502 specific declarations */
+/* 6502 specific declarations */
/* */
/* */
/* */
@@ -47,9 +47,9 @@ typedef unsigned size_t;
/* Possible returns of getcpu() */
-#define CPU_6502 0
-#define CPU_65C02 1
-#define CPU_65816 2
+#define CPU_6502 0
+#define CPU_65C02 1
+#define CPU_65816 2
unsigned char getcpu (void);
/* Detect the CPU the program is running on */
@@ -57,29 +57,29 @@ unsigned char getcpu (void);
/* Macros for CPU instructions */
-#define BRK() __asm__ ("brk")
-#define CLI() __asm__ ("cli")
-#define SEI() __asm__ ("sei")
+#define BRK() __asm__ ("brk")
+#define CLI() __asm__ ("cli")
+#define SEI() __asm__ ("sei")
/* Struct that holds the registers for the sys function */
struct regs {
- unsigned char a; /* A register value */
- unsigned char x; /* X register value */
- unsigned char y; /* Y register value */
- unsigned char flags; /* Flags value */
- unsigned pc; /* Program counter */
+ unsigned char a; /* A register value */
+ unsigned char x; /* X register value */
+ unsigned char y; /* Y register value */
+ unsigned char flags; /* Flags value */
+ unsigned pc; /* Program counter */
};
/* Defines for the flags in the regs structure */
-#define F6502_N 0x80 /* N flag */
-#define F6502_V 0x40 /* V flag */
-#define F6502_B 0x10 /* B flag */
-#define F6502_D 0x08 /* D flag */
-#define F6502_I 0x04 /* I flag */
-#define F6502_Z 0x02 /* Z flag */
-#define F6502_C 0x01 /* C flag */
+#define F6502_N 0x80 /* N flag */
+#define F6502_V 0x40 /* V flag */
+#define F6502_B 0x10 /* B flag */
+#define F6502_D 0x08 /* D flag */
+#define F6502_I 0x04 /* I flag */
+#define F6502_Z 0x02 /* Z flag */
+#define F6502_C 0x01 /* C flag */
/* Function to call any machine language subroutine. All registers in the
* regs structure are passed into the routine and the results are passed
@@ -98,11 +98,11 @@ void __fastcall__ _sys (struct regs* r);
* vector if the program ends.
*/
-extern unsigned char brk_a; /* A register value */
-extern unsigned char brk_x; /* X register value */
-extern unsigned char brk_y; /* Y register value */
-extern unsigned char brk_sr; /* Status register */
-extern unsigned brk_pc; /* PC value */
+extern unsigned char brk_a; /* A register value */
+extern unsigned char brk_x; /* X register value */
+extern unsigned char brk_y; /* Y register value */
+extern unsigned char brk_sr; /* Status register */
+extern unsigned brk_pc; /* PC value */
typedef void (*brk_handler) (void);
/* Type of the break handler */
@@ -116,8 +116,8 @@ void reset_brk (void);
/* Possible returns for irq_handler() */
-#define IRQ_NOT_HANDLED 0
-#define IRQ_HANDLED 1
+#define IRQ_NOT_HANDLED 0
+#define IRQ_HANDLED 1
typedef unsigned char (*irq_handler) (void);
/* Type of the C level interrupt request handler */
diff --git a/include/_6522.h b/include/_6522.h
index d5dbc5f75..1072e6779 100644
--- a/include/_6522.h
+++ b/include/_6522.h
@@ -2,7 +2,7 @@
/* */
/* _6522.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -41,22 +41,22 @@
* the compiler doesn't guarantee any order when writing 16 bit values.
*/
struct __6522 {
- unsigned char prb; /* Port register B */
- unsigned char pra; /* Port register A */
- unsigned char ddrb; /* Data direction register B */
- unsigned char ddra; /* Data direction register A */
- unsigned char t1_lo; /* Timer 1, low byte */
- unsigned char t1_hi; /* Timer 1, high byte */
- unsigned char t1l_lo; /* Timer 1 latch, low byte */
- unsigned char t1l_hi; /* Timer 1 latch, high byte */
- unsigned char t2_lo; /* Timer 2, low byte */
- unsigned char t2_hi; /* Timer 2, high byte */
- unsigned char sr; /* Shift register */
- unsigned char acr; /* Auxiliary control register */
- unsigned char pcr; /* Peripheral control register */
- unsigned char ifr; /* Interrupt flag register */
- unsigned char ier; /* Interrupt enable register */
- unsigned char pra2; /* Port register A w/o handshake */
+ unsigned char prb; /* Port register B */
+ unsigned char pra; /* Port register A */
+ unsigned char ddrb; /* Data direction register B */
+ unsigned char ddra; /* Data direction register A */
+ unsigned char t1_lo; /* Timer 1, low byte */
+ unsigned char t1_hi; /* Timer 1, high byte */
+ unsigned char t1l_lo; /* Timer 1 latch, low byte */
+ unsigned char t1l_hi; /* Timer 1 latch, high byte */
+ unsigned char t2_lo; /* Timer 2, low byte */
+ unsigned char t2_hi; /* Timer 2, high byte */
+ unsigned char sr; /* Shift register */
+ unsigned char acr; /* Auxiliary control register */
+ unsigned char pcr; /* Peripheral control register */
+ unsigned char ifr; /* Interrupt flag register */
+ unsigned char ier; /* Interrupt enable register */
+ unsigned char pra2; /* Port register A w/o handshake */
};
diff --git a/include/_6525.h b/include/_6525.h
index e4f539478..dee0ba459 100644
--- a/include/_6525.h
+++ b/include/_6525.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _6525.h */
+/* _6525.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -43,14 +43,14 @@
* union to do that, however that would introduce an additional name.
*/
struct __6525 {
- unsigned char pra; /* Port register A */
- unsigned char prb; /* Port register B */
- unsigned char prc; /* Port register C */
- unsigned char ddra; /* Data direction register A */
- unsigned char ddrb; /* Data direction register B */
- unsigned char ddrc; /* Data direction register C */
- unsigned char cr; /* Control register */
- unsigned char air; /* Active interrupt register */
+ unsigned char pra; /* Port register A */
+ unsigned char prb; /* Port register B */
+ unsigned char prc; /* Port register C */
+ unsigned char ddra; /* Data direction register A */
+ unsigned char ddrb; /* Data direction register B */
+ unsigned char ddrc; /* Data direction register C */
+ unsigned char cr; /* Control register */
+ unsigned char air; /* Active interrupt register */
};
diff --git a/include/_6526.h b/include/_6526.h
index c04b26d68..5f8cb7d10 100644
--- a/include/_6526.h
+++ b/include/_6526.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _6526.h */
+/* _6526.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -44,22 +44,22 @@
* the compiler doesn't guarantee any order when writing 16 bit values.
*/
struct __6526 {
- unsigned char pra; /* Port register A */
- unsigned char prb; /* Port register B */
- unsigned char ddra; /* Data direction register A */
- unsigned char ddrb; /* Data direction register B */
- unsigned char ta_lo; /* Timer A, low byte */
- unsigned char ta_hi; /* Timer A, high byte */
- unsigned char tb_lo; /* Timer B, low byte */
- unsigned char tb_hi; /* Timer B, high byte */
- unsigned char tod_10; /* TOD, 1/10 sec. */
- unsigned char tod_sec; /* TOD, seconds */
- unsigned char tod_min; /* TOD, minutes */
- unsigned char tod_hour; /* TOD, hours */
- unsigned char sdr; /* Serial data register */
- unsigned char icr; /* Interrupt control register */
- unsigned char cra; /* Control register A */
- unsigned char crb; /* Control register B */
+ unsigned char pra; /* Port register A */
+ unsigned char prb; /* Port register B */
+ unsigned char ddra; /* Data direction register A */
+ unsigned char ddrb; /* Data direction register B */
+ unsigned char ta_lo; /* Timer A, low byte */
+ unsigned char ta_hi; /* Timer A, high byte */
+ unsigned char tb_lo; /* Timer B, low byte */
+ unsigned char tb_hi; /* Timer B, high byte */
+ unsigned char tod_10; /* TOD, 1/10 sec. */
+ unsigned char tod_sec; /* TOD, seconds */
+ unsigned char tod_min; /* TOD, minutes */
+ unsigned char tod_hour; /* TOD, hours */
+ unsigned char sdr; /* Serial data register */
+ unsigned char icr; /* Interrupt control register */
+ unsigned char cra; /* Control register A */
+ unsigned char crb; /* Control register B */
};
diff --git a/include/_6545.h b/include/_6545.h
index 7dc79a371..ea7c8597b 100644
--- a/include/_6545.h
+++ b/include/_6545.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _6545.h */
+/* _6545.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -40,8 +40,8 @@
/* Define a structure with the 6545 register offsets */
struct __6545 {
- unsigned char ctrl; /* Control register */
- unsigned char data; /* Data register */
+ unsigned char ctrl; /* Control register */
+ unsigned char data; /* Data register */
};
diff --git a/include/_6551.h b/include/_6551.h
index 73a82243d..cdf766d60 100644
--- a/include/_6551.h
+++ b/include/_6551.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _6551.h */
+/* _6551.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -40,10 +40,10 @@
/* Define a structure with the 6551 register offsets */
struct __6551 {
- unsigned char data; /* Data register */
- unsigned char status; /* Status register */
- unsigned char cmd; /* Command register */
- unsigned char ctrl; /* Control register */
+ unsigned char data; /* Data register */
+ unsigned char status; /* Status register */
+ unsigned char cmd; /* Command register */
+ unsigned char ctrl; /* Control register */
};
diff --git a/include/_gtia.h b/include/_gtia.h
index f3257e32f..424628f19 100644
--- a/include/_gtia.h
+++ b/include/_gtia.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _gtia.h */
+/* _gtia.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
diff --git a/include/_heap.h b/include/_heap.h
index 8ac9064c3..76bad35c3 100644
--- a/include/_heap.h
+++ b/include/_heap.h
@@ -29,19 +29,19 @@ struct usedblock {
* Beware: Field order is significant!
*/
struct freeblock {
- unsigned size;
- struct freeblock* next;
- struct freeblock* prev;
+ unsigned size;
+ struct freeblock* next;
+ struct freeblock* prev;
};
/* Variables that describe the heap */
-extern unsigned* _heaporg; /* Bottom of heap */
-extern unsigned* _heapptr; /* Current top */
-extern unsigned* _heapend; /* Upper limit */
-extern struct freeblock* _heapfirst; /* First free block in list */
-extern struct freeblock* _heaplast; /* Last free block in list */
+extern unsigned* _heaporg; /* Bottom of heap */
+extern unsigned* _heapptr; /* Current top */
+extern unsigned* _heapend; /* Upper limit */
+extern struct freeblock* _heapfirst; /* First free block in list */
+extern struct freeblock* _heaplast; /* Last free block in list */
diff --git a/include/_mikey.h b/include/_mikey.h
index 2e7ef12c5..b9b7f6906 100644
--- a/include/_mikey.h
+++ b/include/_mikey.h
@@ -98,7 +98,7 @@ struct __mikey {
unsigned char mtest2; // 0xFD9E
unsigned char unused5; // 0xFD9F not used
unsigned char palette[32]; // 0xFDA0 - 0xFDBF palette 32 bytes
- // 0xFDC0 - 0xFDFF not used
+ // 0xFDC0 - 0xFDFF not used
};
diff --git a/include/_pbi.h b/include/_pbi.h
index 4bc3314db..f74262f4c 100644
--- a/include/_pbi.h
+++ b/include/_pbi.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _pbi.h */
+/* _pbi.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -32,31 +32,31 @@
#define __PBI_H
/* parallel bus interface area */
-#define PBI ((unsigned char*)0xD100)
+#define PBI ((unsigned char*)0xD100)
/* parallel device IRQ status */
-#define PDVI ((unsigned char*)0xD1FF)
+#define PDVI ((unsigned char*)0xD1FF)
/* parallel device select */
-#define PDVS ((unsigned char*)0xD1FF)
+#define PDVS ((unsigned char*)0xD1FF)
/* parallel bus interface RAM area */
-#define PBIRAM ((unsigned char*)0xD600)
+#define PBIRAM ((unsigned char*)0xD600)
/* parallel device ID 1 */
-#define PDID1 ((unsigned char*)0xD803)
+#define PDID1 ((unsigned char*)0xD803)
/* parallel device I/O vector */
-#define PDIDV ((unsigned char*)0xD805)
+#define PDIDV ((unsigned char*)0xD805)
/* parallel device IRQ vector */
-#define PDIRQV ((unsigned char*)0xD808)
+#define PDIRQV ((unsigned char*)0xD808)
/* parallel device ID 2 */
-#define PDID2 ((unsigned char*)0xD80B)
+#define PDID2 ((unsigned char*)0xD80B)
/* parallel device vector table */
-#define PDVV ((unsigned char*)0xD80D)
+#define PDVV ((unsigned char*)0xD80D)
/* End of _pbi.h */
#endif /* #ifndef __PBI_H */
diff --git a/include/_pia.h b/include/_pia.h
index 582b84275..867c8f8a5 100644
--- a/include/_pia.h
+++ b/include/_pia.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _pia.h */
+/* _pia.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
diff --git a/include/_pokey.h b/include/_pokey.h
index a6a0338f8..df10eac3f 100644
--- a/include/_pokey.h
+++ b/include/_pokey.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _pokey.h */
+/* _pokey.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
diff --git a/include/_sid.h b/include/_sid.h
index b7978ac1a..0aa61b294 100644
--- a/include/_sid.h
+++ b/include/_sid.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _sid.h */
+/* _sid.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -40,23 +40,23 @@
/* Define a structure with the sid register offsets */
struct __sid_voice {
- unsigned freq; /* Frequency */
- unsigned pw; /* Pulse width */
- unsigned char ctrl; /* Control register */
- unsigned char ad; /* Attack/decay */
- unsigned char sr; /* Sustain/release */
+ unsigned freq; /* Frequency */
+ unsigned pw; /* Pulse width */
+ unsigned char ctrl; /* Control register */
+ unsigned char ad; /* Attack/decay */
+ unsigned char sr; /* Sustain/release */
};
struct __sid {
- struct __sid_voice v1; /* Voice 1 */
- struct __sid_voice v2; /* Voice 2 */
- struct __sid_voice v3; /* Voice 3 */
- unsigned flt_freq; /* Filter frequency */
- unsigned char flt_ctrl; /* Filter control register */
- unsigned char amp; /* Amplitude */
- unsigned char ad1; /* A/D converter 1 */
- unsigned char ad2; /* A/D converter 2 */
- unsigned char noise; /* Noise generator */
- unsigned char read3; /* Value of voice 3 */
+ struct __sid_voice v1; /* Voice 1 */
+ struct __sid_voice v2; /* Voice 2 */
+ struct __sid_voice v3; /* Voice 3 */
+ unsigned flt_freq; /* Filter frequency */
+ unsigned char flt_ctrl; /* Filter control register */
+ unsigned char amp; /* Amplitude */
+ unsigned char ad1; /* A/D converter 1 */
+ unsigned char ad2; /* A/D converter 2 */
+ unsigned char noise; /* Noise generator */
+ unsigned char read3; /* Value of voice 3 */
};
diff --git a/include/_suzy.h b/include/_suzy.h
index 3bdf9c708..8ab7f68dd 100644
--- a/include/_suzy.h
+++ b/include/_suzy.h
@@ -310,7 +310,7 @@ struct __suzy {
unsigned char parstat; // 0xFCC2 parallel port status
unsigned char pardata; // 0xFCC3 parallel port data
unsigned char howie; // 0xFCC4 howie (?)
- // 0xFCC5 - 0xFCFF unused
+ // 0xFCC5 - 0xFCFF unused
};
diff --git a/include/_ted.h b/include/_ted.h
index d4401a4ad..68b59d706 100644
--- a/include/_ted.h
+++ b/include/_ted.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _ted.h */
+/* _ted.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
diff --git a/include/_vdc.h b/include/_vdc.h
index adabe01e5..161721d7a 100644
--- a/include/_vdc.h
+++ b/include/_vdc.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _vdc.h */
+/* _vdc.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -40,8 +40,8 @@
/* Define a structure with the vdc register offsets */
struct __vdc {
- unsigned char ctrl; /* Control register */
- unsigned char data; /* Data register */
+ unsigned char ctrl; /* Control register */
+ unsigned char data; /* Data register */
};
diff --git a/include/_vic.h b/include/_vic.h
index 7074aedba..ac4d8a2ca 100644
--- a/include/_vic.h
+++ b/include/_vic.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* _vic.h */
+/* _vic.h */
/* */
-/* Internal include file, do not use directly */
+/* Internal include file, do not use directly */
/* */
/* */
/* */
@@ -40,21 +40,21 @@
/* Define a structure with the vic register offsets */
struct __vic {
- unsigned char leftborder;
- unsigned char upperborder;
- unsigned char charsperline; /* Characters per line */
- unsigned char linecount; /* Number of lines */
- unsigned char rasterline; /* Current raster line */
- unsigned char addr; /* Address of chargen and video ram */
- unsigned char strobe_x; /* Light pen, X position */
- unsigned char strobe_y; /* Light pen, Y position */
- unsigned char analog_x; /* Analog input X */
- unsigned char analog_y; /* Analog input Y */
- unsigned char voice1; /* Sound generator #1 */
- unsigned char voice2; /* Sound generator #2 */
- unsigned char voice3; /* Sound generator #3 */
- unsigned char noise; /* Noise generator */
- unsigned char volume_color; /* Bits 0..3: volume, 4..7: color */
+ unsigned char leftborder;
+ unsigned char upperborder;
+ unsigned char charsperline; /* Characters per line */
+ unsigned char linecount; /* Number of lines */
+ unsigned char rasterline; /* Current raster line */
+ unsigned char addr; /* Address of chargen and video ram */
+ unsigned char strobe_x; /* Light pen, X position */
+ unsigned char strobe_y; /* Light pen, Y position */
+ unsigned char analog_x; /* Analog input X */
+ unsigned char analog_y; /* Analog input Y */
+ unsigned char voice1; /* Sound generator #1 */
+ unsigned char voice2; /* Sound generator #2 */
+ unsigned char voice3; /* Sound generator #3 */
+ unsigned char noise; /* Noise generator */
+ unsigned char volume_color; /* Bits 0..3: volume, 4..7: color */
unsigned char bg_border_color;/* Background and border color */
};
diff --git a/include/ace.h b/include/ace.h
index cb5df1f69..8d9130085 100644
--- a/include/ace.h
+++ b/include/ace.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* ace.h */
+/* ace.h */
/* */
-/* ACE system specific definitions */
+/* ACE system specific definitions */
/* */
/* */
/* */
@@ -52,10 +52,10 @@
struct aceDirentBuf {
- unsigned long ad_size; /* Size in bytes */
- unsigned char ad_date [8]; /* YY:YY:MM:DD:HH:MM:SS:TW */
- char ad_type [4]; /* File type as ASCIIZ string */
- unsigned char ad_flags; /* File flags */
+ unsigned long ad_size; /* Size in bytes */
+ unsigned char ad_date [8]; /* YY:YY:MM:DD:HH:MM:SS:TW */
+ char ad_type [4]; /* File type as ASCIIZ string */
+ unsigned char ad_flags; /* File flags */
unsigned char ad_usage; /* More flags */
unsigned char ad_namelen; /* Length of name */
char ad_name [17]; /* Name itself, ASCIIZ */
@@ -69,27 +69,27 @@ int aceDirRead (int handle, struct aceDirentBuf* buf);
typedef unsigned int aceKey;
/* #defines for the shift mask returned by aceConGetKey */
-#define aceSH_KEY 0x00FF /* Mask key itself */
-#define aceSH_MASK 0xFF00 /* Mask shift mask */
-#define aceSH_EXT 0x2000 /* Extended key */
-#define aceSH_CAPS 0x1000 /* Caps lock key */
-#define aceSH_ALT 0x0800 /* Alternate key */
-#define aceSH_CTRL 0x0400 /* Ctrl key */
-#define aceSH_CBM 0x0200 /* Commodore key */
-#define aceSH_SHIFT 0x0100 /* Shift key */
+#define aceSH_KEY 0x00FF /* Mask key itself */
+#define aceSH_MASK 0xFF00 /* Mask shift mask */
+#define aceSH_EXT 0x2000 /* Extended key */
+#define aceSH_CAPS 0x1000 /* Caps lock key */
+#define aceSH_ALT 0x0800 /* Alternate key */
+#define aceSH_CTRL 0x0400 /* Ctrl key */
+#define aceSH_CBM 0x0200 /* Commodore key */
+#define aceSH_SHIFT 0x0100 /* Shift key */
/* #defines for the options in aceConSetOpt/aceConGetOpt */
-#define aceOP_PUTMASK 1 /* Console put mask */
-#define aceOP_CHARCOLOR 2 /* Character color */
-#define aceOP_CHARATTR 3 /* Character attribute */
-#define aceOP_FILLCOLOR 4 /* Fill color */
-#define aceOP_FILLATTR 5 /* Fill attribute */
-#define aceOP_CRSCOLOR 6 /* Cursor color */
-#define aceOP_CRSWRAP 7 /* Force cursor wrap */
-#define aceOP_SHSCROLL 8 /* Shift keys for scrolling */
-#define aceOP_MOUSCALE 9 /* Mouse scaling */
-#define aceOP_RPTDELAY 10 /* Key repeat delay */
-#define aceOP_RPTRATE 11 /* Key repeat rate */
+#define aceOP_PUTMASK 1 /* Console put mask */
+#define aceOP_CHARCOLOR 2 /* Character color */
+#define aceOP_CHARATTR 3 /* Character attribute */
+#define aceOP_FILLCOLOR 4 /* Fill color */
+#define aceOP_FILLATTR 5 /* Fill attribute */
+#define aceOP_CRSCOLOR 6 /* Cursor color */
+#define aceOP_CRSWRAP 7 /* Force cursor wrap */
+#define aceOP_SHSCROLL 8 /* Shift keys for scrolling */
+#define aceOP_MOUSCALE 9 /* Mouse scaling */
+#define aceOP_RPTDELAY 10 /* Key repeat delay */
+#define aceOP_RPTRATE 11 /* Key repeat rate */
/* Console functions */
void aceConWrite (char* buf, size_t count);
diff --git a/include/apple2.h b/include/apple2.h
index f5dcff0ae..177159e46 100644
--- a/include/apple2.h
+++ b/include/apple2.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* apple2.h */
+/* apple2.h */
/* */
-/* Apple ][ system specific definitions */
+/* Apple ][ system specific definitions */
/* */
/* */
/* */
@@ -44,7 +44,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -154,7 +154,7 @@ extern void a2_lo_tgi[];
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/apple2enh.h b/include/apple2enh.h
index 112522117..9fb093b45 100644
--- a/include/apple2enh.h
+++ b/include/apple2enh.h
@@ -1,31 +1,31 @@
/*****************************************************************************/
-/* */
-/* apple2enh.h */
-/* */
-/* enhanced Apple //e system specific definitions */
-/* */
-/* */
-/* */
+/* */
+/* apple2enh.h */
+/* */
+/* enhanced Apple //e system specific definitions */
+/* */
+/* */
+/* */
/* (C) 2004 Oliver Schmidt, */
-/* */
-/* */
-/* This software is provided 'as-is', without any expressed or implied */
+/* */
+/* */
+/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
-/* arising from the use of this software. */
-/* */
+/* arising from the use of this software. */
+/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
-/* freely, subject to the following restrictions: */
-/* */
+/* freely, subject to the following restrictions: */
+/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
-/* appreciated but is not required. */
+/* appreciated but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
-/* be misrepresented as being the original software. */
-/* 3. This notice may not be removed or altered from any source */
-/* distribution. */
-/* */
+/* be misrepresented as being the original software. */
+/* 3. This notice may not be removed or altered from any source */
+/* distribution. */
+/* */
/*****************************************************************************/
@@ -50,7 +50,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -73,8 +73,8 @@
#define CH_F10 0xB0
/* Styles for textframe */
-#define TEXTFRAME_WIDE 0x00
-#define TEXTFRAME_TALL 0x04
+#define TEXTFRAME_WIDE 0x00
+#define TEXTFRAME_TALL 0x04
/* Video modes */
#define VIDEOMODE_40x24 0x0011
@@ -101,7 +101,7 @@ extern void a2e_lo_tgi[];
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/assert.h b/include/assert.h
index bd58e2068..87bc4ff02 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* assert.h */
+/* assert.h */
/* */
-/* Diagnostics */
+/* Diagnostics */
/* */
/* */
/* */
@@ -43,7 +43,7 @@
# define assert(expr)
#else
extern void _afailed (const char*, unsigned);
-# define assert(expr) ((expr)? (void)0 : _afailed(__FILE__, __LINE__))
+# define assert(expr) ((expr)? (void)0 : _afailed(__FILE__, __LINE__))
#endif
diff --git a/include/atari.h b/include/atari.h
index 555dc9a93..26c555cc4 100644
--- a/include/atari.h
+++ b/include/atari.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* atari.h */
+/* atari.h */
/* */
-/* Atari system specific definitions */
+/* Atari system specific definitions */
/* */
/* */
/* */
@@ -45,11 +45,11 @@
/* Character codes */
-#define CH_DELCHR 0xFE /* delete char under the cursor */
-#define CH_ENTER 0x9B
-#define CH_ESC 0x1B
-#define CH_CURS_UP 28
-#define CH_CURS_DOWN 29
+#define CH_DELCHR 0xFE /* delete char under the cursor */
+#define CH_ENTER 0x9B
+#define CH_ESC 0x1B
+#define CH_CURS_UP 28
+#define CH_CURS_DOWN 29
#define CH_CURS_LEFT 30
#define CH_CURS_RIGHT 31
@@ -63,26 +63,26 @@
#define CH_INSLINE 0x9D /* insert line */
/* These are defined to be Atari + NumberKey */
-#define CH_F1 177
-#define CH_F2 178
-#define CH_F3 179
-#define CH_F4 180
-#define CH_F5 181
-#define CH_F6 182
-#define CH_F7 183
-#define CH_F8 184
-#define CH_F9 185
-#define CH_F10 176
-
-#define CH_ULCORNER 0x11
-#define CH_URCORNER 0x05
-#define CH_LLCORNER 0x1A
-#define CH_LRCORNER 0x03
-#define CH_TTEE 0x17
-#define CH_BTEE 0x18
-#define CH_LTEE 0x01
-#define CH_RTEE 0x04
-#define CH_CROSS 0x13
+#define CH_F1 177
+#define CH_F2 178
+#define CH_F3 179
+#define CH_F4 180
+#define CH_F5 181
+#define CH_F6 182
+#define CH_F7 183
+#define CH_F8 184
+#define CH_F9 185
+#define CH_F10 176
+
+#define CH_ULCORNER 0x11
+#define CH_URCORNER 0x05
+#define CH_LLCORNER 0x1A
+#define CH_LRCORNER 0x03
+#define CH_TTEE 0x17
+#define CH_BTEE 0x18
+#define CH_LTEE 0x01
+#define CH_RTEE 0x04
+#define CH_CROSS 0x13
#define CH_HLINE 0x12
#define CH_VLINE 0x7C
@@ -114,22 +114,22 @@
/* Color defines, similar to c64 colors (untested) */
/* Note that the conio color implementation is monochrome (bgcolor and textcolor are only placeholders) */
/* Use the defines with the setcolor() or _atari_xxxcolor() functions */
-#define COLOR_BLACK _gtia_mkcolor(HUE_GREY,0)
-#define COLOR_WHITE _gtia_mkcolor(HUE_GREY,7)
-#define COLOR_RED _gtia_mkcolor(HUE_REDORANGE,1)
-#define COLOR_CYAN _gtia_mkcolor(HUE_CYAN,3)
-#define COLOR_VIOLET _gtia_mkcolor(HUE_PURPLE,4)
-#define COLOR_GREEN _gtia_mkcolor(HUE_GREEN,2)
-#define COLOR_BLUE _gtia_mkcolor(HUE_BLUE,2)
-#define COLOR_YELLOW _gtia_mkcolor(HUE_YELLOW,7)
-#define COLOR_ORANGE _gtia_mkcolor(HUE_ORANGE,5)
-#define COLOR_BROWN _gtia_mkcolor(HUE_YELLOW,2)
-#define COLOR_LIGHTRED _gtia_mkcolor(HUE_REDORANGE,6)
-#define COLOR_GRAY1 _gtia_mkcolor(HUE_GREY,2)
-#define COLOR_GRAY2 _gtia_mkcolor(HUE_GREY,3)
-#define COLOR_LIGHTGREEN _gtia_mkcolor(HUE_GREEN,6)
-#define COLOR_LIGHTBLUE _gtia_mkcolor(HUE_BLUE,6)
-#define COLOR_GRAY3 _gtia_mkcolor(HUE_GREY,5)
+#define COLOR_BLACK _gtia_mkcolor(HUE_GREY,0)
+#define COLOR_WHITE _gtia_mkcolor(HUE_GREY,7)
+#define COLOR_RED _gtia_mkcolor(HUE_REDORANGE,1)
+#define COLOR_CYAN _gtia_mkcolor(HUE_CYAN,3)
+#define COLOR_VIOLET _gtia_mkcolor(HUE_PURPLE,4)
+#define COLOR_GREEN _gtia_mkcolor(HUE_GREEN,2)
+#define COLOR_BLUE _gtia_mkcolor(HUE_BLUE,2)
+#define COLOR_YELLOW _gtia_mkcolor(HUE_YELLOW,7)
+#define COLOR_ORANGE _gtia_mkcolor(HUE_ORANGE,5)
+#define COLOR_BROWN _gtia_mkcolor(HUE_YELLOW,2)
+#define COLOR_LIGHTRED _gtia_mkcolor(HUE_REDORANGE,6)
+#define COLOR_GRAY1 _gtia_mkcolor(HUE_GREY,2)
+#define COLOR_GRAY2 _gtia_mkcolor(HUE_GREY,3)
+#define COLOR_LIGHTGREEN _gtia_mkcolor(HUE_GREEN,6)
+#define COLOR_LIGHTBLUE _gtia_mkcolor(HUE_BLUE,6)
+#define COLOR_GRAY3 _gtia_mkcolor(HUE_GREY,5)
/* color register functions */
extern void __fastcall__ _setcolor (unsigned char color_reg, unsigned char hue, unsigned char luminace);
diff --git a/include/atmos.h b/include/atmos.h
index e4c2af9b2..eed6d7564 100644
--- a/include/atmos.h
+++ b/include/atmos.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* atmos.h */
+/* atmos.h */
/* */
-/* Oric Atmos system-specific definitions */
+/* Oric Atmos system-specific definitions */
/* */
/* */
/* */
@@ -47,82 +47,82 @@
/* Color defines */
-#define COLOR_BLACK 0x00
-#define COLOR_RED 0x01
-#define COLOR_GREEN 0x02
-#define COLOR_YELLOW 0x03
-#define COLOR_BLUE 0x04
-#define COLOR_MAGENTA 0x05
-#define COLOR_CYAN 0x06
-#define COLOR_WHITE 0x07
+#define COLOR_BLACK 0x00
+#define COLOR_RED 0x01
+#define COLOR_GREEN 0x02
+#define COLOR_YELLOW 0x03
+#define COLOR_BLUE 0x04
+#define COLOR_MAGENTA 0x05
+#define COLOR_CYAN 0x06
+#define COLOR_WHITE 0x07
/* TGI color defines */
/* White and red are swapped, so that the pallete
** driver is compatible with black-and-white drivers.
*/
-#define TGI_COLOR_BLACK COLOR_BLACK
-#define TGI_COLOR_WHITE 1
-#define TGI_COLOR_GREEN COLOR_GREEN
-#define TGI_COLOR_YELLOW COLOR_YELLOW
-#define TGI_COLOR_BLUE COLOR_BLUE
-#define TGI_COLOR_MAGENTA COLOR_MAGENTA
-#define TGI_COLOR_CYAN COLOR_CYAN
-#define TGI_COLOR_RED 7
+#define TGI_COLOR_BLACK COLOR_BLACK
+#define TGI_COLOR_WHITE 1
+#define TGI_COLOR_GREEN COLOR_GREEN
+#define TGI_COLOR_YELLOW COLOR_YELLOW
+#define TGI_COLOR_BLUE COLOR_BLUE
+#define TGI_COLOR_MAGENTA COLOR_MAGENTA
+#define TGI_COLOR_CYAN COLOR_CYAN
+#define TGI_COLOR_RED 7
/* Define hardware */
#include <_6522.h>
-#define VIA (*(struct __6522*)0x300)
+#define VIA (*(struct __6522*)0x300)
/* These are defined to be FUNCT + NumberKey */
-#define CH_F1 0xB1
-#define CH_F2 0xB2
-#define CH_F3 0xB3
-#define CH_F4 0xB4
-#define CH_F5 0xB5
-#define CH_F6 0xB6
-#define CH_F7 0xB7
-#define CH_F8 0xB8
-#define CH_F9 0xB9
-#define CH_F10 0xB0
+#define CH_F1 0xB1
+#define CH_F2 0xB2
+#define CH_F3 0xB3
+#define CH_F4 0xB4
+#define CH_F5 0xB5
+#define CH_F6 0xB6
+#define CH_F7 0xB7
+#define CH_F8 0xB8
+#define CH_F9 0xB9
+#define CH_F10 0xB0
/* Character codes */
-#define CH_ULCORNER '+'
-#define CH_URCORNER '+'
-#define CH_LLCORNER '+'
-#define CH_LRCORNER '+'
-#define CH_TTEE '+'
-#define CH_BTEE '+'
-#define CH_LTEE '+'
-#define CH_RTEE '+'
-#define CH_CROSS '+'
-#define CH_CURS_UP 11
-#define CH_CURS_DOWN 10
-#define CH_CURS_LEFT 8
-#define CH_CURS_RIGHT 9
-#define CH_DEL 127
-#define CH_ENTER 13
-#define CH_STOP 3
-#define CH_LIRA 95
-#define CH_ESC 27
+#define CH_ULCORNER '+'
+#define CH_URCORNER '+'
+#define CH_LLCORNER '+'
+#define CH_LRCORNER '+'
+#define CH_TTEE '+'
+#define CH_BTEE '+'
+#define CH_LTEE '+'
+#define CH_RTEE '+'
+#define CH_CROSS '+'
+#define CH_CURS_UP 11
+#define CH_CURS_DOWN 10
+#define CH_CURS_LEFT 8
+#define CH_CURS_RIGHT 9
+#define CH_DEL 127
+#define CH_ENTER 13
+#define CH_STOP 3
+#define CH_LIRA 95
+#define CH_ESC 27
/* No support for dynamically loadable drivers */
-#define DYN_DRV 0
+#define DYN_DRV 0
/* The addresses of the static drivers */
-extern void atmos_pase_joy[]; /* Referred to by joy_static_stddrv[] */
+extern void atmos_pase_joy[]; /* Referred to by joy_static_stddrv[] */
extern void atmos_acia_ser[];
extern void atmos_228_200_3_tgi[];
-extern void atmos_240_200_2_tgi[]; /* Referred to by tgi_static_stddrv[] */
+extern void atmos_240_200_2_tgi[]; /* Referred to by tgi_static_stddrv[] */
diff --git a/include/c128.h b/include/c128.h
index 26fb25274..0b005bce0 100644
--- a/include/c128.h
+++ b/include/c128.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* c128.h */
+/* c128.h */
/* */
-/* C128 system specific definitions */
+/* C128 system specific definitions */
/* */
/* */
/* */
@@ -46,50 +46,50 @@
/* Additional key defines */
-#define CH_F1 133
-#define CH_F2 137
-#define CH_F3 134
-#define CH_F4 138
-#define CH_F5 135
-#define CH_F6 139
-#define CH_F7 136
-#define CH_F8 140
+#define CH_F1 133
+#define CH_F2 137
+#define CH_F3 134
+#define CH_F4 138
+#define CH_F5 135
+#define CH_F6 139
+#define CH_F7 136
+#define CH_F8 140
/* Color defines */
-#define COLOR_BLACK 0x00
-#define COLOR_WHITE 0x01
-#define COLOR_RED 0x02
-#define COLOR_CYAN 0x03
-#define COLOR_VIOLET 0x04
-#define COLOR_GREEN 0x05
-#define COLOR_BLUE 0x06
-#define COLOR_YELLOW 0x07
-#define COLOR_ORANGE 0x08
-#define COLOR_BROWN 0x09
-#define COLOR_LIGHTRED 0x0A
-#define COLOR_GRAY1 0x0B
-#define COLOR_GRAY2 0x0C
-#define COLOR_LIGHTGREEN 0x0D
-#define COLOR_LIGHTBLUE 0x0E
-#define COLOR_GRAY3 0x0F
+#define COLOR_BLACK 0x00
+#define COLOR_WHITE 0x01
+#define COLOR_RED 0x02
+#define COLOR_CYAN 0x03
+#define COLOR_VIOLET 0x04
+#define COLOR_GREEN 0x05
+#define COLOR_BLUE 0x06
+#define COLOR_YELLOW 0x07
+#define COLOR_ORANGE 0x08
+#define COLOR_BROWN 0x09
+#define COLOR_LIGHTRED 0x0A
+#define COLOR_GRAY1 0x0B
+#define COLOR_GRAY2 0x0C
+#define COLOR_LIGHTGREEN 0x0D
+#define COLOR_LIGHTBLUE 0x0E
+#define COLOR_GRAY3 0x0F
/* TGI color defines */
-#define TGI_COLOR_BLACK COLOR_BLACK
-#define TGI_COLOR_WHITE COLOR_WHITE
-#define TGI_COLOR_RED COLOR_RED
-#define TGI_COLOR_CYAN COLOR_CYAN
-#define TGI_COLOR_VIOLET COLOR_VIOLET
-#define TGI_COLOR_GREEN COLOR_GREEN
-#define TGI_COLOR_BLUE COLOR_BLUE
-#define TGI_COLOR_YELLOW COLOR_YELLOW
-#define TGI_COLOR_ORANGE COLOR_ORANGE
-#define TGI_COLOR_BROWN COLOR_BROWN
+#define TGI_COLOR_BLACK COLOR_BLACK
+#define TGI_COLOR_WHITE COLOR_WHITE
+#define TGI_COLOR_RED COLOR_RED
+#define TGI_COLOR_CYAN COLOR_CYAN
+#define TGI_COLOR_VIOLET COLOR_VIOLET
+#define TGI_COLOR_GREEN COLOR_GREEN
+#define TGI_COLOR_BLUE COLOR_BLUE
+#define TGI_COLOR_YELLOW COLOR_YELLOW
+#define TGI_COLOR_ORANGE COLOR_ORANGE
+#define TGI_COLOR_BROWN COLOR_BROWN
#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
-#define TGI_COLOR_GRAY1 COLOR_GRAY1
-#define TGI_COLOR_GRAY2 COLOR_GRAY2
+#define TGI_COLOR_GRAY1 COLOR_GRAY1
+#define TGI_COLOR_GRAY2 COLOR_GRAY2
#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
-#define TGI_COLOR_GRAY3 COLOR_GRAY3
+#define TGI_COLOR_GRAY3 COLOR_GRAY3
/* Video mode defines */
#define VIDEOMODE_40x25 0x00
@@ -101,22 +101,22 @@
/* Define hardware */
#include <_vic2.h>
-#define VIC (*(struct __vic2*)0xD000)
+#define VIC (*(struct __vic2*)0xD000)
#include <_sid.h>
-#define SID (*(struct __sid*)0xD400)
+#define SID (*(struct __sid*)0xD400)
#include <_vdc.h>
#define VDC (*(struct __vdc*)0xD600)
#include <_6526.h>
-#define CIA1 (*(struct __6526*)0xDC00)
-#define CIA2 (*(struct __6526*)0xDD00)
+#define CIA1 (*(struct __6526*)0xDC00)
+#define CIA2 (*(struct __6526*)0xDD00)
/* Define special memory areas */
-#define COLOR_RAM ((unsigned char*)0xD800)
+#define COLOR_RAM ((unsigned char*)0xD800)
@@ -128,12 +128,12 @@ extern void c128_ramcart_emd[];
extern void c128_reu_emd[];
extern void c128_vdc_emd[];
extern void c128_ptvjoy_joy[];
-extern void c128_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
-extern void c128_1351_mous[]; /* Referred to by mouse_static_stddrv[] */
+extern void c128_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
+extern void c128_1351_mous[]; /* Referred to by mouse_static_stddrv[] */
extern void c128_joy_mou[];
extern void c128_pot_mou[];
extern void c128_swlink_ser[];
-extern void c128_vdc_tgi[]; /* Referred to by tgi_static_stddrv[] */
+extern void c128_vdc_tgi[]; /* Referred to by tgi_static_stddrv[] */
extern void c128_vdc2_tgi[];
diff --git a/include/c16.h b/include/c16.h
index 35124a709..d49ca6fd4 100644
--- a/include/c16.h
+++ b/include/c16.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* c16.h */
+/* c16.h */
/* */
-/* C16 system specific definitions */
+/* C16 system specific definitions */
/* */
/* */
/* */
diff --git a/include/c64.h b/include/c64.h
index 5cc2bd08e..0a4ebaf97 100644
--- a/include/c64.h
+++ b/include/c64.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* c64.h */
+/* c64.h */
/* */
-/* C64 system specific definitions */
+/* C64 system specific definitions */
/* */
/* */
/* */
@@ -46,72 +46,72 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/* Additional key defines */
-#define CH_F1 133
-#define CH_F2 137
-#define CH_F3 134
-#define CH_F4 138
-#define CH_F5 135
-#define CH_F6 139
-#define CH_F7 136
-#define CH_F8 140
+#define CH_F1 133
+#define CH_F2 137
+#define CH_F3 134
+#define CH_F4 138
+#define CH_F5 135
+#define CH_F6 139
+#define CH_F7 136
+#define CH_F8 140
/* Color defines */
-#define COLOR_BLACK 0x00
-#define COLOR_WHITE 0x01
-#define COLOR_RED 0x02
-#define COLOR_CYAN 0x03
-#define COLOR_VIOLET 0x04
+#define COLOR_BLACK 0x00
+#define COLOR_WHITE 0x01
+#define COLOR_RED 0x02
+#define COLOR_CYAN 0x03
+#define COLOR_VIOLET 0x04
#define COLOR_PURPLE COLOR_VIOLET
-#define COLOR_GREEN 0x05
-#define COLOR_BLUE 0x06
-#define COLOR_YELLOW 0x07
-#define COLOR_ORANGE 0x08
-#define COLOR_BROWN 0x09
-#define COLOR_LIGHTRED 0x0A
-#define COLOR_GRAY1 0x0B
-#define COLOR_GRAY2 0x0C
-#define COLOR_LIGHTGREEN 0x0D
-#define COLOR_LIGHTBLUE 0x0E
-#define COLOR_GRAY3 0x0F
+#define COLOR_GREEN 0x05
+#define COLOR_BLUE 0x06
+#define COLOR_YELLOW 0x07
+#define COLOR_ORANGE 0x08
+#define COLOR_BROWN 0x09
+#define COLOR_LIGHTRED 0x0A
+#define COLOR_GRAY1 0x0B
+#define COLOR_GRAY2 0x0C
+#define COLOR_LIGHTGREEN 0x0D
+#define COLOR_LIGHTBLUE 0x0E
+#define COLOR_GRAY3 0x0F
/* TGI color defines */
-#define TGI_COLOR_BLACK COLOR_BLACK
-#define TGI_COLOR_WHITE COLOR_WHITE
-#define TGI_COLOR_RED COLOR_RED
-#define TGI_COLOR_CYAN COLOR_CYAN
-#define TGI_COLOR_VIOLET COLOR_VIOLET
-#define TGI_COLOR_PURPLE COLOR_PURPLE
-#define TGI_COLOR_GREEN COLOR_GREEN
-#define TGI_COLOR_BLUE COLOR_BLUE
-#define TGI_COLOR_YELLOW COLOR_YELLOW
-#define TGI_COLOR_ORANGE COLOR_ORANGE
-#define TGI_COLOR_BROWN COLOR_BROWN
-#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
-#define TGI_COLOR_GRAY1 COLOR_GRAY1
-#define TGI_COLOR_GRAY2 COLOR_GRAY2
-#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
-#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
-#define TGI_COLOR_GRAY3 COLOR_GRAY3
+#define TGI_COLOR_BLACK COLOR_BLACK
+#define TGI_COLOR_WHITE COLOR_WHITE
+#define TGI_COLOR_RED COLOR_RED
+#define TGI_COLOR_CYAN COLOR_CYAN
+#define TGI_COLOR_VIOLET COLOR_VIOLET
+#define TGI_COLOR_PURPLE COLOR_PURPLE
+#define TGI_COLOR_GREEN COLOR_GREEN
+#define TGI_COLOR_BLUE COLOR_BLUE
+#define TGI_COLOR_YELLOW COLOR_YELLOW
+#define TGI_COLOR_ORANGE COLOR_ORANGE
+#define TGI_COLOR_BROWN COLOR_BROWN
+#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
+#define TGI_COLOR_GRAY1 COLOR_GRAY1
+#define TGI_COLOR_GRAY2 COLOR_GRAY2
+#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
+#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
+#define TGI_COLOR_GRAY3 COLOR_GRAY3
/* Define hardware */
#include <_vic2.h>
-#define VIC (*(struct __vic2*)0xD000)
+#define VIC (*(struct __vic2*)0xD000)
#include <_sid.h>
-#define SID (*(struct __sid*)0xD400)
+#define SID (*(struct __sid*)0xD400)
#include <_6526.h>
-#define CIA1 (*(struct __6526*)0xDC00)
-#define CIA2 (*(struct __6526*)0xDD00)
+#define CIA1 (*(struct __6526*)0xDC00)
+#define CIA2 (*(struct __6526*)0xDD00)
/* Define special memory areas */
-#define COLOR_RAM ((unsigned char*)0xD800)
+#define COLOR_RAM ((unsigned char*)0xD800)
/* Return codes for get_ostype */
#define C64_OS_US 0xAA /* US version */
@@ -152,7 +152,7 @@ extern void c64_hi_tgi[]; /* Referred to by tgi_static_stddrv[] */
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/cbm.h b/include/cbm.h
index 5a422806a..ed7397849 100644
--- a/include/cbm.h
+++ b/include/cbm.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* cbm.h */
+/* cbm.h */
/* */
-/* CBM system-specific definitions */
+/* CBM system-specific definitions */
/* */
/* */
/* */
@@ -94,29 +94,29 @@ extern char _filetype; /* Defaults to 's' */
-#define CH_HLINE 192
-#define CH_VLINE 221
-#define CH_ULCORNER 176
-#define CH_URCORNER 174
-#define CH_LLCORNER 173
-#define CH_LRCORNER 189
-#define CH_TTEE 178
-#define CH_BTEE 177
-#define CH_LTEE 171
-#define CH_RTEE 179
-#define CH_CROSS 219
-#define CH_CURS_UP 145
-#define CH_CURS_DOWN 17
-#define CH_CURS_LEFT 157
-#define CH_CURS_RIGHT 29
-#define CH_PI 222
-#define CH_HOME 19
-#define CH_DEL 20
-#define CH_INS 148
-#define CH_ENTER 13
-#define CH_STOP 3
-#define CH_LIRA 92
-#define CH_ESC 27
+#define CH_HLINE 192
+#define CH_VLINE 221
+#define CH_ULCORNER 176
+#define CH_URCORNER 174
+#define CH_LLCORNER 173
+#define CH_LRCORNER 189
+#define CH_TTEE 178
+#define CH_BTEE 177
+#define CH_LTEE 171
+#define CH_RTEE 179
+#define CH_CROSS 219
+#define CH_CURS_UP 145
+#define CH_CURS_DOWN 17
+#define CH_CURS_LEFT 157
+#define CH_CURS_RIGHT 29
+#define CH_PI 222
+#define CH_HOME 19
+#define CH_DEL 20
+#define CH_INS 148
+#define CH_ENTER 13
+#define CH_STOP 3
+#define CH_LIRA 92
+#define CH_ESC 27
@@ -166,9 +166,9 @@ unsigned char get_tv (void);
*
* e.g., cbm_open(2, 8, CBM_READ, "0:data,s");
*/
-#define CBM_READ 0 /* default is ",p" */
-#define CBM_WRITE 1 /* ditto */
-#define CBM_SEQ 2 /* default is ",r" -- or ",s" when writing */
+#define CBM_READ 0 /* default is ",p" */
+#define CBM_WRITE 1 /* ditto */
+#define CBM_SEQ 2 /* default is ",r" -- or ",s" when writing */
/* Kernal-level functions */
unsigned char cbm_k_acptr (void);
@@ -204,20 +204,20 @@ void cbm_k_unlsn (void);
/* The cbm_* I/O functions below set _oserror (see errno.h),
* in case of an error.
*
- * error-code BASIC error
- * ---------- -----------
- * 1 = too many files
- * 2 = file open
- * 3 = file not open
- * 4 = file not found
- * 5 = device not present
- * 6 = not input-file
- * 7 = not output-file
- * 8 = missing file-name
- * 9 = illegal device-number
+ * error-code BASIC error
+ * ---------- -----------
+ * 1 = too many files
+ * 2 = file open
+ * 3 = file not open
+ * 4 = file not found
+ * 5 = device not present
+ * 6 = not input-file
+ * 7 = not output-file
+ * 8 = missing file-name
+ * 9 = illegal device-number
*
- * 10 = STOP-key pushed
- * 11 = general I/O-error
+ * 10 = STOP-key pushed
+ * 11 = general I/O-error
*/
diff --git a/include/cbm264.h b/include/cbm264.h
index 961701700..9ede10f47 100644
--- a/include/cbm264.h
+++ b/include/cbm264.h
@@ -46,83 +46,83 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/* Additional key defines */
-#define CH_F1 133
-#define CH_F2 137
-#define CH_F3 134
-#define CH_F4 138
-#define CH_F5 135
-#define CH_F6 139
-#define CH_F7 136
-#define CH_F8 140
+#define CH_F1 133
+#define CH_F2 137
+#define CH_F3 134
+#define CH_F4 138
+#define CH_F5 135
+#define CH_F6 139
+#define CH_F7 136
+#define CH_F8 140
/* Color attributes */
-#define CATTR_LUMA0 0x00
-#define CATTR_LUMA1 0x10
-#define CATTR_LUMA2 0x20
-#define CATTR_LUMA3 0x30
-#define CATTR_LUMA4 0x40
-#define CATTR_LUMA5 0x50
-#define CATTR_LUMA6 0x60
-#define CATTR_LUMA7 0x70
-#define CATTR_BLINK 0x80
+#define CATTR_LUMA0 0x00
+#define CATTR_LUMA1 0x10
+#define CATTR_LUMA2 0x20
+#define CATTR_LUMA3 0x30
+#define CATTR_LUMA4 0x40
+#define CATTR_LUMA5 0x50
+#define CATTR_LUMA6 0x60
+#define CATTR_LUMA7 0x70
+#define CATTR_BLINK 0x80
/* Base colors */
-#define BCOLOR_BLACK 0x00
-#define BCOLOR_WHITE 0x01
-#define BCOLOR_RED 0x02
-#define BCOLOR_CYAN 0x03
-#define BCOLOR_VIOLET 0x04
+#define BCOLOR_BLACK 0x00
+#define BCOLOR_WHITE 0x01
+#define BCOLOR_RED 0x02
+#define BCOLOR_CYAN 0x03
+#define BCOLOR_VIOLET 0x04
#define BCOLOR_PURPLE BCOLOR_VIOLET
-#define BCOLOR_GREEN 0x05
-#define BCOLOR_BLUE 0x06
-#define BCOLOR_YELLOW 0x07
-#define BCOLOR_ORANGE 0x08
-#define BCOLOR_BROWN 0x09
-#define BCOLOR_LEMON 0x0A /* What's that color? */
-#define BCOLOR_LIGHTVIOLET 0x0B
-#define BCOLOR_BLUEGREEN 0x0C
-#define BCOLOR_LIGHTBLUE 0x0D
-#define BCOLOR_DARKBLUE 0x0E
-#define BCOLOR_LIGHTGREEN 0x0F
+#define BCOLOR_GREEN 0x05
+#define BCOLOR_BLUE 0x06
+#define BCOLOR_YELLOW 0x07
+#define BCOLOR_ORANGE 0x08
+#define BCOLOR_BROWN 0x09
+#define BCOLOR_LEMON 0x0A /* What's that color? */
+#define BCOLOR_LIGHTVIOLET 0x0B
+#define BCOLOR_BLUEGREEN 0x0C
+#define BCOLOR_LIGHTBLUE 0x0D
+#define BCOLOR_DARKBLUE 0x0E
+#define BCOLOR_LIGHTGREEN 0x0F
/* Now try to mix up a C64/C128 compatible palette */
-#define COLOR_BLACK (BCOLOR_BLACK)
-#define COLOR_WHITE (BCOLOR_WHITE | CATTR_LUMA7)
-#define COLOR_RED (BCOLOR_RED | CATTR_LUMA4)
-#define COLOR_CYAN (BCOLOR_CYAN | CATTR_LUMA7)
-#define COLOR_VIOLET (BCOLOR_VIOLET | CATTR_LUMA7)
+#define COLOR_BLACK (BCOLOR_BLACK)
+#define COLOR_WHITE (BCOLOR_WHITE | CATTR_LUMA7)
+#define COLOR_RED (BCOLOR_RED | CATTR_LUMA4)
+#define COLOR_CYAN (BCOLOR_CYAN | CATTR_LUMA7)
+#define COLOR_VIOLET (BCOLOR_VIOLET | CATTR_LUMA7)
#define COLOR_PURPLE COLOR_VIOLET
-#define COLOR_GREEN (BCOLOR_GREEN | CATTR_LUMA7)
-#define COLOR_BLUE (BCOLOR_BLUE | CATTR_LUMA7)
-#define COLOR_YELLOW (BCOLOR_YELLOW | CATTR_LUMA7)
-#define COLOR_ORANGE (BCOLOR_ORANGE | CATTR_LUMA7)
-#define COLOR_BROWN (BCOLOR_BROWN | CATTR_LUMA7)
-#define COLOR_LIGHTRED (BCOLOR_RED | CATTR_LUMA7)
-#define COLOR_GRAY1 (BCOLOR_WHITE | CATTR_LUMA1)
-#define COLOR_GRAY2 (BCOLOR_WHITE | CATTR_LUMA3)
-#define COLOR_LIGHTGREEN (BCOLOR_LIGHTGREEN | CATTR_LUMA7)
-#define COLOR_LIGHTBLUE (BCOLOR_LIGHTBLUE | CATTR_LUMA7)
-#define COLOR_GRAY3 (BCOLOR_WHITE | CATTR_LUMA5)
+#define COLOR_GREEN (BCOLOR_GREEN | CATTR_LUMA7)
+#define COLOR_BLUE (BCOLOR_BLUE | CATTR_LUMA7)
+#define COLOR_YELLOW (BCOLOR_YELLOW | CATTR_LUMA7)
+#define COLOR_ORANGE (BCOLOR_ORANGE | CATTR_LUMA7)
+#define COLOR_BROWN (BCOLOR_BROWN | CATTR_LUMA7)
+#define COLOR_LIGHTRED (BCOLOR_RED | CATTR_LUMA7)
+#define COLOR_GRAY1 (BCOLOR_WHITE | CATTR_LUMA1)
+#define COLOR_GRAY2 (BCOLOR_WHITE | CATTR_LUMA3)
+#define COLOR_LIGHTGREEN (BCOLOR_LIGHTGREEN | CATTR_LUMA7)
+#define COLOR_LIGHTBLUE (BCOLOR_LIGHTBLUE | CATTR_LUMA7)
+#define COLOR_GRAY3 (BCOLOR_WHITE | CATTR_LUMA5)
/* Define hardware */
#include <_ted.h>
#define TED (*(struct __ted*)0xFF00)
/* Define special memory areas */
-#define COLOR_RAM ((unsigned char*)0x0800)
+#define COLOR_RAM ((unsigned char*)0x0800)
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/cbm510.h b/include/cbm510.h
index 19370d818..350527c89 100644
--- a/include/cbm510.h
+++ b/include/cbm510.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* cbm510.h */
+/* cbm510.h */
/* */
-/* System specific definitions for the CBM5x0 / P500 */
+/* System specific definitions for the CBM5x0 / P500 */
/* */
/* */
/* */
@@ -46,68 +46,68 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/* Additional key defines */
-#define CH_F1 224
-#define CH_F2 225
-#define CH_F3 226
-#define CH_F4 227
-#define CH_F5 228
-#define CH_F6 229
-#define CH_F7 230
-#define CH_F8 231
-#define CH_F9 232
-#define CH_F10 233
-#define CH_F11 234
-#define CH_F12 235
-#define CH_F13 236
-#define CH_F14 237
-#define CH_F15 238
-#define CH_F16 239
-#define CH_F17 240
-#define CH_F18 241
-#define CH_F19 242
-#define CH_F20 243
+#define CH_F1 224
+#define CH_F2 225
+#define CH_F3 226
+#define CH_F4 227
+#define CH_F5 228
+#define CH_F6 229
+#define CH_F7 230
+#define CH_F8 231
+#define CH_F9 232
+#define CH_F10 233
+#define CH_F11 234
+#define CH_F12 235
+#define CH_F13 236
+#define CH_F14 237
+#define CH_F15 238
+#define CH_F16 239
+#define CH_F17 240
+#define CH_F18 241
+#define CH_F19 242
+#define CH_F20 243
/* Color defines */
-#define COLOR_BLACK 0x00
-#define COLOR_WHITE 0x01
-#define COLOR_RED 0x02
-#define COLOR_CYAN 0x03
-#define COLOR_VIOLET 0x04
+#define COLOR_BLACK 0x00
+#define COLOR_WHITE 0x01
+#define COLOR_RED 0x02
+#define COLOR_CYAN 0x03
+#define COLOR_VIOLET 0x04
#define COLOR_PURPLE COLOR_VIOLET
-#define COLOR_GREEN 0x05
-#define COLOR_BLUE 0x06
-#define COLOR_YELLOW 0x07
-#define COLOR_ORANGE 0x08
-#define COLOR_BROWN 0x09
-#define COLOR_LIGHTRED 0x0A
-#define COLOR_GRAY1 0x0B
-#define COLOR_GRAY2 0x0C
-#define COLOR_LIGHTGREEN 0x0D
-#define COLOR_LIGHTBLUE 0x0E
-#define COLOR_GRAY3 0x0F
+#define COLOR_GREEN 0x05
+#define COLOR_BLUE 0x06
+#define COLOR_YELLOW 0x07
+#define COLOR_ORANGE 0x08
+#define COLOR_BROWN 0x09
+#define COLOR_LIGHTRED 0x0A
+#define COLOR_GRAY1 0x0B
+#define COLOR_GRAY2 0x0C
+#define COLOR_LIGHTGREEN 0x0D
+#define COLOR_LIGHTBLUE 0x0E
+#define COLOR_GRAY3 0x0F
/* Define hardware */
#include <_vic2.h>
-#define VIC (*(struct __vic2*)0xD800)
+#define VIC (*(struct __vic2*)0xD800)
#include <_sid.h>
-#define SID (*(struct __sid*)0xDA00)
+#define SID (*(struct __sid*)0xDA00)
#include <_6526.h>
-#define CIA (*(struct __6526*)0xDC00)
+#define CIA (*(struct __6526*)0xDC00)
#include <_6551.h>
-#define ACIA (*(struct __6551*)0xDD00)
+#define ACIA (*(struct __6551*)0xDD00)
#include <_6525.h>
-#define TPI1 (*(struct __6525*)0xDE00)
-#define TPI2 (*(struct __6525*)0xDF00)
+#define TPI1 (*(struct __6525*)0xDE00)
+#define TPI2 (*(struct __6525*)0xDF00)
@@ -119,13 +119,13 @@
/* The addresses of the static drivers */
extern void cbm510_ram_emd[];
-extern void cbm510_std_joy[]; /* Referred to by joy_static_stddrv[] */
+extern void cbm510_std_joy[]; /* Referred to by joy_static_stddrv[] */
extern void cbm510_std_ser[];
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/cbm610.h b/include/cbm610.h
index 523b49577..84ea12ece 100644
--- a/include/cbm610.h
+++ b/include/cbm610.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* cbm610.h */
+/* cbm610.h */
/* */
-/* CBM610 system specific definitions */
+/* CBM610 system specific definitions */
/* */
/* */
/* */
@@ -46,7 +46,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -74,15 +74,15 @@
#define CH_F20 243
/* Color defines */
-#define COLOR_BLACK 0x00
-#define COLOR_WHITE 0x01
+#define COLOR_BLACK 0x00
+#define COLOR_WHITE 0x01
/* Define hardware */
#include <_6545.h>
#define CRTC (*(struct __6545)0xD800)
#include <_sid.h>
-#define SID (*(struct __sid*)0xDA00)
+#define SID (*(struct __sid*)0xDA00)
#include <_6526.h>
#define CIA (*(struct __6526*)0xDC00)
@@ -109,7 +109,7 @@ extern void cbm610_std_ser[];
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/cc65.h b/include/cc65.h
index e1c23e1bc..5607eab7b 100644
--- a/include/cc65.h
+++ b/include/cc65.h
@@ -39,7 +39,7 @@
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/conio.h b/include/conio.h
index 21a0c1ea7..ab446ad42 100644
--- a/include/conio.h
+++ b/include/conio.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* conio.h */
+/* conio.h */
/* */
-/* Direct console I/O */
+/* Direct console I/O */
/* */
/* */
/* */
@@ -82,7 +82,7 @@
/*****************************************************************************/
-/* Functions */
+/* Functions */
/*****************************************************************************/
diff --git a/include/ctype.h b/include/ctype.h
index 8437e2c2c..4c7f976d2 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* ctype.h */
+/* ctype.h */
/* */
-/* Character handling */
+/* Character handling */
/* */
/* */
/* */
@@ -41,21 +41,21 @@
extern unsigned char _ctype[256];
/* Bits used to specify character classes */
-#define _CT_LOWER 0x01 /* 0 - Lower case char */
-#define _CT_UPPER 0x02 /* 1 - Upper case char */
-#define _CT_DIGIT 0x04 /* 2 - Numeric digit */
-#define _CT_XDIGIT 0x08 /* 3 - Hex digit (both lower and upper) */
-#define _CT_CNTRL 0x10 /* 4 - Control character */
-#define _CT_SPACE 0x20 /* 5 - The space character itself */
-#define _CT_OTHER_WS 0x40 /* 6 - Other whitespace ('\f', '\n', '\r', '\t', and '\v') */
-#define _CT_SPACE_TAB 0x80 /* 7 - Space or tab character */
+#define _CT_LOWER 0x01 /* 0 - Lower case char */
+#define _CT_UPPER 0x02 /* 1 - Upper case char */
+#define _CT_DIGIT 0x04 /* 2 - Numeric digit */
+#define _CT_XDIGIT 0x08 /* 3 - Hex digit (both lower and upper) */
+#define _CT_CNTRL 0x10 /* 4 - Control character */
+#define _CT_SPACE 0x20 /* 5 - The space character itself */
+#define _CT_OTHER_WS 0x40 /* 6 - Other whitespace ('\f', '\n', '\r', '\t', and '\v') */
+#define _CT_SPACE_TAB 0x80 /* 7 - Space or tab character */
/* Bit combinations */
-#define _CT_ALNUM (_CT_LOWER | _CT_UPPER | _CT_DIGIT)
-#define _CT_ALPHA (_CT_LOWER | _CT_UPPER)
-#define _CT_NOT_GRAPH (_CT_CNTRL | _CT_SPACE)
+#define _CT_ALNUM (_CT_LOWER | _CT_UPPER | _CT_DIGIT)
+#define _CT_ALPHA (_CT_LOWER | _CT_UPPER)
+#define _CT_NOT_GRAPH (_CT_CNTRL | _CT_SPACE)
#define _CT_NOT_PRINT (_CT_CNTRL)
-#define _CT_NOT_PUNCT (_CT_SPACE | _CT_CNTRL | _CT_DIGIT | _CT_UPPER | _CT_LOWER)
+#define _CT_NOT_PUNCT (_CT_SPACE | _CT_CNTRL | _CT_DIGIT | _CT_UPPER | _CT_LOWER)
#define _CT_WS (_CT_SPACE | _CT_OTHER_WS)
/* Character classification functions */
@@ -71,11 +71,11 @@ int __fastcall__ isspace (int c);
int __fastcall__ isupper (int c);
int __fastcall__ isxdigit (int c);
#if __CC65_STD__ >= __CC65_STD_C99__
-int __fastcall__ isblank (int c); /* New in C99 */
+int __fastcall__ isblank (int c); /* New in C99 */
#endif
-int __fastcall__ toupper (int c); /* Always external */
-int __fastcall__ tolower (int c); /* Always external */
+int __fastcall__ toupper (int c); /* Always external */
+int __fastcall__ tolower (int c); /* Always external */
#if __CC65_STD__ >= __CC65_STD_CC65__
unsigned char __fastcall__ toascii (unsigned char c);
@@ -95,83 +95,83 @@ unsigned char __fastcall__ toascii (unsigned char c);
#define isalnum(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_ALNUM), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_ALNUM), \
__AX__)
#define isalpha(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_ALPHA), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_ALPHA), \
__AX__)
#if __CC65_STD__ >= __CC65_STD_C99__
#define isblank(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_SPACE_TAB), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_SPACE_TAB), \
__AX__)
#endif
#define iscntrl(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_CNTRL), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_CNTRL), \
__AX__)
#define isdigit(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_DIGIT), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_DIGIT), \
__AX__)
#define isgraph(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_NOT_GRAPH), \
- __asm__ ("cmp #1"), \
- __asm__ ("lda #1"), \
- __asm__ ("sbc #1"), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_NOT_GRAPH), \
+ __asm__ ("cmp #1"), \
+ __asm__ ("lda #1"), \
+ __asm__ ("sbc #1"), \
__AX__)
#define islower(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_LOWER), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_LOWER), \
__AX__)
#define isprint(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_NOT_PRINT), \
- __asm__ ("eor #%b", _CT_NOT_PRINT), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_NOT_PRINT), \
+ __asm__ ("eor #%b", _CT_NOT_PRINT), \
__AX__)
#define ispunct(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_NOT_PUNCT), \
- __asm__ ("cmp #1"), \
- __asm__ ("lda #1"), \
- __asm__ ("sbc #1"), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_NOT_PUNCT), \
+ __asm__ ("cmp #1"), \
+ __asm__ ("lda #1"), \
+ __asm__ ("sbc #1"), \
__AX__)
#define isspace(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_WS), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_WS), \
__AX__)
#define isupper(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_UPPER), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_UPPER), \
__AX__)
#define isxdigit(c) (__AX__ = (c), \
__asm__ ("tay"), \
- __asm__ ("lda %v,y", _ctype), \
- __asm__ ("and #%b", _CT_XDIGIT), \
+ __asm__ ("lda %v,y", _ctype), \
+ __asm__ ("and #%b", _CT_XDIGIT), \
__AX__)
#endif
diff --git a/include/dbg.h b/include/dbg.h
index 4749b18be..5156658f0 100644
--- a/include/dbg.h
+++ b/include/dbg.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* dbg.h */
+/* dbg.h */
/* */
-/* Debugger module interface */
+/* Debugger module interface */
/* */
/* */
/* */
@@ -61,7 +61,7 @@
/*****************************************************************************/
-/* Utility functions */
+/* Utility functions */
/*****************************************************************************/
@@ -101,7 +101,7 @@ char* DbgMemDump (unsigned Addr, char* Buf, unsigned char Len);
/*****************************************************************************/
-/* High level user interface */
+/* High level user interface */
/*****************************************************************************/
@@ -111,7 +111,7 @@ void __fastcall__ DbgInit (unsigned unused);
* next brk encountered.
*/
-#define BREAK() __asm__ ("brk")
+#define BREAK() __asm__ ("brk")
/* Use this to insert breakpoints into your code */
diff --git a/include/dirent.h b/include/dirent.h
index 010db6a11..993036a1b 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -36,7 +36,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -113,11 +113,11 @@ struct dirent {
#elif defined(__LYNX__)
struct dirent {
- unsigned char d_blocks;
- unsigned int d_offset;
- char d_type;
- void *d_address;
- unsigned int d_size;
+ unsigned char d_blocks;
+ unsigned int d_offset;
+ char d_type;
+ void *d_address;
+ unsigned int d_size;
};
extern struct dirent FileEntry;
@@ -144,7 +144,7 @@ struct dirent {
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/em.h b/include/em.h
index 8b409cac2..28836f2b1 100644
--- a/include/em.h
+++ b/include/em.h
@@ -71,7 +71,7 @@ struct em_copy {
/*****************************************************************************/
-/* Functions */
+/* Functions */
/*****************************************************************************/
diff --git a/include/em/em-kernel.h b/include/em/em-kernel.h
index 04757499c..48cbbe8f7 100644
--- a/include/em/em-kernel.h
+++ b/include/em/em-kernel.h
@@ -60,7 +60,7 @@ typedef struct {
void* map; /* MAP routine */
void* use; /* USE routine */
void* mapclean; /* MAPCLEAN routine */
- void* copyfrom; /* COPYFROM routine */
+ void* copyfrom; /* COPYFROM routine */
void* copyto; /* COPYTO routine */
} em_drv_header;
@@ -68,7 +68,7 @@ typedef struct {
/* EM kernel variables */
-extern em_drv_header* em_drv; /* Pointer to driver */
+extern em_drv_header* em_drv; /* Pointer to driver */
diff --git a/include/errno.h b/include/errno.h
index 60f069dac..468e7d4ea 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* errno.h */
+/* errno.h */
/* */
-/* Error codes */
+/* Error codes */
/* */
/* */
/* */
@@ -39,7 +39,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -56,23 +56,23 @@ extern int _errno;
/* Possible error codes */
-#define ENOENT 1 /* No such file or directory */
-#define ENOMEM 2 /* Out of memory */
-#define EACCES 3 /* Permission denied */
-#define ENODEV 4 /* No such device */
-#define EMFILE 5 /* Too many open files */
-#define EBUSY 6 /* Device or resource busy */
-#define EINVAL 7 /* Invalid argument */
-#define ENOSPC 8 /* No space left on device */
-#define EEXIST 9 /* File exists */
-#define EAGAIN 10 /* Try again */
-#define EIO 11 /* I/O error */
-#define EINTR 12 /* Interrupted system call */
-#define ENOSYS 13 /* Function not implemented */
-#define ESPIPE 14 /* Illegal seek */
+#define ENOENT 1 /* No such file or directory */
+#define ENOMEM 2 /* Out of memory */
+#define EACCES 3 /* Permission denied */
+#define ENODEV 4 /* No such device */
+#define EMFILE 5 /* Too many open files */
+#define EBUSY 6 /* Device or resource busy */
+#define EINVAL 7 /* Invalid argument */
+#define ENOSPC 8 /* No space left on device */
+#define EEXIST 9 /* File exists */
+#define EAGAIN 10 /* Try again */
+#define EIO 11 /* I/O error */
+#define EINTR 12 /* Interrupted system call */
+#define ENOSYS 13 /* Function not implemented */
+#define ESPIPE 14 /* Illegal seek */
#define ERANGE 15 /* Range error */
#define EBADF 16 /* Bad file number */
-#define EUNKNOWN 17 /* Unknown OS specific error */
+#define EUNKNOWN 17 /* Unknown OS specific error */
diff --git a/include/fcntl.h b/include/fcntl.h
index fd86c7a19..0d2398315 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -1,6 +1,6 @@
/*****************************************************************************/
/* */
-/* fcntl.h */
+/* fcntl.h */
/* */
/* File control operations */
/* */
@@ -39,7 +39,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -56,13 +56,13 @@
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
/* Functions */
-int open (const char* name, int flags, ...); /* May take a mode argument */
+int open (const char* name, int flags, ...); /* May take a mode argument */
int __fastcall__ close (int fd);
int __fastcall__ creat (const char* name, unsigned mode);
diff --git a/include/geos.h b/include/geos.h
index 2491d2f09..65b85cd59 100644
--- a/include/geos.h
+++ b/include/geos.h
@@ -68,70 +68,70 @@
#endif
-#define CH_ULCORNER '+'
-#define CH_URCORNER '+'
-#define CH_LLCORNER '+'
-#define CH_LRCORNER '+'
-#define CH_TTEE '+'
-#define CH_RTEE '+'
-#define CH_BTEE '+'
-#define CH_LTEE '+'
-#define CH_CROSS '+'
-
-#define CH_F1 KEY_F1
-#define CH_F2 KEY_F2
-#define CH_F3 KEY_F3
-#define CH_F4 KEY_F4
-#define CH_F5 KEY_F5
-#define CH_F6 KEY_F6
-#define CH_F7 KEY_F7
-#define CH_F8 KEY_F8
-
-#define CH_CURS_UP KEY_UP
-#define CH_CURS_DOWN KEY_DOWN
-#define CH_CURS_LEFT KEY_LEFT
-#define CH_CURS_RIGHT KEY_RIGHT
-#define CH_DEL KEY_DELETE
-#define CH_INS KEY_INSERT
-#define CH_ENTER KEY_ENTER
-#define CH_STOP KEY_STOP
-#define CH_ESC KEY_ESC
-
-#define COLOR_BLACK BLACK
-#define COLOR_WHITE WHITE
-#define COLOR_RED RED
-#define COLOR_CYAN CYAN
-#define COLOR_VIOLET PURPLE
-#define COLOR_PURPLE PURPLE
-#define COLOR_GREEN GREEN
-#define COLOR_BLUE BLUE
-#define COLOR_YELLOW YELLOW
-#define COLOR_ORANGE ORANGE
-#define COLOR_BROWN BROWN
-#define COLOR_LIGHTRED LTRED
-#define COLOR_GRAY1 DKGREY
-#define COLOR_GRAY2 MEDGREY
-#define COLOR_LIGHTGREEN LTGREEN
-#define COLOR_LIGHTBLUE LTBLUE
-#define COLOR_GRAY3 LTGREY
-
-#define TGI_COLOR_BLACK COLOR_BLACK
-#define TGI_COLOR_WHITE COLOR_WHITE
-#define TGI_COLOR_RED COLOR_RED
-#define TGI_COLOR_CYAN COLOR_CYAN
-#define TGI_COLOR_VIOLET COLOR_VIOLET
-#define TGI_COLOR_PURPLE COLOR_PURPLE
-#define TGI_COLOR_GREEN COLOR_GREEN
-#define TGI_COLOR_BLUE COLOR_BLUE
-#define TGI_COLOR_YELLOW COLOR_YELLOW
-#define TGI_COLOR_ORANGE COLOR_ORANGE
-#define TGI_COLOR_BROWN COLOR_BROWN
-#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
-#define TGI_COLOR_GRAY1 COLOR_GRAY1
-#define TGI_COLOR_GRAY2 COLOR_GRAY2
-#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
-#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
-#define TGI_COLOR_GRAY3 COLOR_GRAY3
+#define CH_ULCORNER '+'
+#define CH_URCORNER '+'
+#define CH_LLCORNER '+'
+#define CH_LRCORNER '+'
+#define CH_TTEE '+'
+#define CH_RTEE '+'
+#define CH_BTEE '+'
+#define CH_LTEE '+'
+#define CH_CROSS '+'
+
+#define CH_F1 KEY_F1
+#define CH_F2 KEY_F2
+#define CH_F3 KEY_F3
+#define CH_F4 KEY_F4
+#define CH_F5 KEY_F5
+#define CH_F6 KEY_F6
+#define CH_F7 KEY_F7
+#define CH_F8 KEY_F8
+
+#define CH_CURS_UP KEY_UP
+#define CH_CURS_DOWN KEY_DOWN
+#define CH_CURS_LEFT KEY_LEFT
+#define CH_CURS_RIGHT KEY_RIGHT
+#define CH_DEL KEY_DELETE
+#define CH_INS KEY_INSERT
+#define CH_ENTER KEY_ENTER
+#define CH_STOP KEY_STOP
+#define CH_ESC KEY_ESC
+
+#define COLOR_BLACK BLACK
+#define COLOR_WHITE WHITE
+#define COLOR_RED RED
+#define COLOR_CYAN CYAN
+#define COLOR_VIOLET PURPLE
+#define COLOR_PURPLE PURPLE
+#define COLOR_GREEN GREEN
+#define COLOR_BLUE BLUE
+#define COLOR_YELLOW YELLOW
+#define COLOR_ORANGE ORANGE
+#define COLOR_BROWN BROWN
+#define COLOR_LIGHTRED LTRED
+#define COLOR_GRAY1 DKGREY
+#define COLOR_GRAY2 MEDGREY
+#define COLOR_LIGHTGREEN LTGREEN
+#define COLOR_LIGHTBLUE LTBLUE
+#define COLOR_GRAY3 LTGREY
+
+#define TGI_COLOR_BLACK COLOR_BLACK
+#define TGI_COLOR_WHITE COLOR_WHITE
+#define TGI_COLOR_RED COLOR_RED
+#define TGI_COLOR_CYAN COLOR_CYAN
+#define TGI_COLOR_VIOLET COLOR_VIOLET
+#define TGI_COLOR_PURPLE COLOR_PURPLE
+#define TGI_COLOR_GREEN COLOR_GREEN
+#define TGI_COLOR_BLUE COLOR_BLUE
+#define TGI_COLOR_YELLOW COLOR_YELLOW
+#define TGI_COLOR_ORANGE COLOR_ORANGE
+#define TGI_COLOR_BROWN COLOR_BROWN
+#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
+#define TGI_COLOR_GRAY1 COLOR_GRAY1
+#define TGI_COLOR_GRAY2 COLOR_GRAY2
+#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
+#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
+#define TGI_COLOR_GRAY3 COLOR_GRAY3
/* End of geos.h */
diff --git a/include/geos/gconst.h b/include/geos/gconst.h
index 4847c3286..e70eb9304 100644
--- a/include/geos/gconst.h
+++ b/include/geos/gconst.h
@@ -9,59 +9,59 @@
#ifndef _GCONST_H
#define _GCONST_H
-#define NULL 0
-#define FALSE NULL
-#define TRUE 0xff
-#define MOUSE_SPRNUM 0
-#define DISK_DRV_LGH 0x0d80
+#define NULL 0
+#define FALSE NULL
+#define TRUE 0xff
+#define MOUSE_SPRNUM 0
+#define DISK_DRV_LGH 0x0d80
/* drivetypes */
-#define DRV_NULL 0
-#define DRV_1541 1
-#define DRV_1571 2
-#define DRV_1581 3
-#define DRV_NETWORK 15
+#define DRV_NULL 0
+#define DRV_1541 1
+#define DRV_1571 2
+#define DRV_1581 3
+#define DRV_NETWORK 15
/* various disk constants */
-#define REL_FILE_NUM 9
-#define CMND_FILE_NUM 15
-#define MAX_CMND_STR 32
-#define DIR_1581_TRACK 40
-#define DIR_ACC_CHAN 13
-#define DIR_TRACK 18
-#define N_TRACKS 35
-#define DK_NM_ID_LEN 18
-#define TRACK 9
-#define SECTOR 12
-#define TOTAL_BLOCKS 664
+#define REL_FILE_NUM 9
+#define CMND_FILE_NUM 15
+#define MAX_CMND_STR 32
+#define DIR_1581_TRACK 40
+#define DIR_ACC_CHAN 13
+#define DIR_TRACK 18
+#define N_TRACKS 35
+#define DK_NM_ID_LEN 18
+#define TRACK 9
+#define SECTOR 12
+#define TOTAL_BLOCKS 664
/* offset to something */
-#define OFF_INDEX_PTR 1
+#define OFF_INDEX_PTR 1
/* values for CPU_DATA memory config - C64 */
-#define IO_IN 0x35
-#define KRNL_IO_IN 0x36
-#define KRNL_BAS_IO_IN 0x37
+#define IO_IN 0x35
+#define KRNL_IO_IN 0x36
+#define KRNL_BAS_IO_IN 0x37
/* values for MMU config - C128 */
-#define CIOIN 0x7E
-#define CRAM64K 0x7F
-#define CKRNLBASIOIN 0x40
-#define CKRNLIOIN 0x4E
+#define CIOIN 0x7E
+#define CRAM64K 0x7F
+#define CKRNLBASIOIN 0x40
+#define CKRNLIOIN 0x4E
/* alarmSetFlag */
-#define ALARMMASK 4
+#define ALARMMASK 4
-#define CLR_SAVE 0x40
-#define CONSTRAINED 0x40
-#define UN_CONSTRAINED 0
-#define FG_SAVE 0x80
+#define CLR_SAVE 0x40
+#define CONSTRAINED 0x40
+#define UN_CONSTRAINED 0
+#define FG_SAVE 0x80
-#define FUTURE1 7
-#define FUTURE2 8
-#define FUTURE3 9
-#define FUTURE4 10
-#define USELAST 127
-#define SHORTCUT 128
+#define FUTURE1 7
+#define FUTURE2 8
+#define FUTURE3 9
+#define FUTURE4 10
+#define USELAST 127
+#define SHORTCUT 128
#endif
diff --git a/include/geos/gdisk.h b/include/geos/gdisk.h
index ac6438117..f65d7d301 100644
--- a/include/geos/gdisk.h
+++ b/include/geos/gdisk.h
@@ -4,7 +4,7 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GDISK_H
+#ifndef _GDISK_H
#define _GDISK_H
#ifndef _GSTRUCT_H
@@ -29,7 +29,7 @@ char OpenDisk(void);
char __fastcall__ FindBAMBit(struct tr_se *myTrSe);
char __fastcall__ BlkAlloc(struct tr_se output[], unsigned length);
char __fastcall__ NxtBlkAlloc(struct tr_se *startTrSe,
- struct tr_se output[], unsigned length);
+ struct tr_se output[], unsigned length);
char __fastcall__ FreeBlock(struct tr_se *myTrSe);
struct tr_se __fastcall__ SetNextFree(struct tr_se *myTrSe);
// above needs (unsigned) casts on both sides of '='
@@ -44,38 +44,38 @@ void PurgeTurbo(void);
char __fastcall__ ChangeDiskDevice(char newdev);
-/* disk header offsets i.e. index curDirHead with these */
-#define OFF_TO_BAM 4
-#define OFF_DISK_NAME 144
-#define OFF_GS_DTYPE 189
-#define OFF_OP_TR_SC 171
-#define OFF_GS_ID 173
+/* disk header offsets i.e. index curDirHead with these */
+#define OFF_TO_BAM 4
+#define OFF_DISK_NAME 144
+#define OFF_GS_DTYPE 189
+#define OFF_OP_TR_SC 171
+#define OFF_GS_ID 173
/* disk errors reported in _oserror */
-#define ANY_FAULT 0xf0
-#define G_EOF 0
-#define NO_BLOCKS 1
-#define INV_TRACK 2
-#define INSUFF_SPACE 3
-#define FULL_DIRECTORY 4
-#define FILE_NOT_FOUND 5
-#define BAD_BAM 6
-#define UNOPENED_VLIR 7
-#define INV_RECORD 8
-#define OUT_OF_RECORDS 9
-#define STRUCT_MISMAT 10
-#define BFR_OVERFLOW 11
-#define CANCEL_ERR 12
-#define DEV_NOT_FOUND 13
-#define INCOMPATIBLE 14
-#define HDR_NOT_THERE 0x20
-#define NO_SYNC 0x21
-#define DBLK_NOT_THERE 0x22
-#define DAT_CHKSUM_ERR 0x23
-#define WR_VER_ERR 0x25
-#define WR_PR_ON 0x26
-#define HDR_CHKSUM_ERR 0x27
-#define DSK_ID_MISMAT 0x29
-#define BYTE_DEC_ERR 0x2e
-#define DOS_MISMATCH 0x73
+#define ANY_FAULT 0xf0
+#define G_EOF 0
+#define NO_BLOCKS 1
+#define INV_TRACK 2
+#define INSUFF_SPACE 3
+#define FULL_DIRECTORY 4
+#define FILE_NOT_FOUND 5
+#define BAD_BAM 6
+#define UNOPENED_VLIR 7
+#define INV_RECORD 8
+#define OUT_OF_RECORDS 9
+#define STRUCT_MISMAT 10
+#define BFR_OVERFLOW 11
+#define CANCEL_ERR 12
+#define DEV_NOT_FOUND 13
+#define INCOMPATIBLE 14
+#define HDR_NOT_THERE 0x20
+#define NO_SYNC 0x21
+#define DBLK_NOT_THERE 0x22
+#define DAT_CHKSUM_ERR 0x23
+#define WR_VER_ERR 0x25
+#define WR_PR_ON 0x26
+#define HDR_CHKSUM_ERR 0x27
+#define DSK_ID_MISMAT 0x29
+#define BYTE_DEC_ERR 0x2e
+#define DOS_MISMATCH 0x73
#endif
diff --git a/include/geos/gdlgbox.h b/include/geos/gdlgbox.h
index b1433fea4..bca890383 100644
--- a/include/geos/gdlgbox.h
+++ b/include/geos/gdlgbox.h
@@ -4,22 +4,22 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GDLGBOX_H
+#ifndef _GDLGBOX_H
#define _GDLGBOX_H
char __fastcall__ DoDlgBox(const char *dboxstring);
char RstrFrmDialogue(void);
/* These are custom, predefined dialog boxes, I'm sure you'll find them usable
- Most of them show 2 lines of text */
+ Most of them show 2 lines of text */
char __fastcall__ DlgBoxYesNo(const char *line1, const char *line2);
char __fastcall__ DlgBoxOkCancel(const char *line1, const char *line2);
void __fastcall__ DlgBoxOk(const char *line1, const char *line2);
char __fastcall__ DlgBoxGetString(char *myString, char strLength,
- const char *line1, const char *line2);
+ const char *line1, const char *line2);
char __fastcall__ DlgBoxFileSelect(const char *classtxt, char ftype,
- char *fname);
+ char *fname);
/* This is a more general dialog box, works like printf in a window */
char MessageBox(char mode, const char *format, ...);
@@ -40,8 +40,8 @@ typedef void dlgBoxStr;
#define DB_DEFPOS(pattern) (char)(DEF_DB_POS | (pattern))
#define DB_SETPOS(pattern,top,bot,left,right) \
- (char)(SET_DB_POS | (pattern)), (char)(top), (char)(bot), \
- (unsigned)(left), (unsigned)(right)
+ (char)(SET_DB_POS | (pattern)), (char)(top), (char)(bot), \
+ (unsigned)(left), (unsigned)(right)
#define DB_ICON(i,x,y) (char)(i), (char)(x), (char)(y)
#define DB_TXTSTR(x,y,text) (char)DBTXTSTR, (char)(x), (char)(y), (text)
#define DB_VARSTR(x,y,ptr) (char)DBVARSTR, (char)(x), (char)(y), (char)(ptr)
@@ -59,52 +59,52 @@ typedef void dlgBoxStr;
*/
/* icons for DB_ICON */
-#define OK 1
-#define CANCEL 2
-#define YES 3
-#define NO 4
-#define OPEN 5
-#define DISK 6
+#define OK 1
+#define CANCEL 2
+#define YES 3
+#define NO 4
+#define OPEN 5
+#define DISK 6
/* commands - internally used by command macros */
-#define DBTXTSTR 11
-#define DBVARSTR 12
-#define DBGETSTRING 13
-#define DBSYSOPV 14
-#define DBGRPHSTR 15
-#define DBGETFILES 16
-#define DBOPVEC 17
-#define DBUSRICON 18
-#define DB_USR_ROUT 19
+#define DBTXTSTR 11
+#define DBVARSTR 12
+#define DBGETSTRING 13
+#define DBSYSOPV 14
+#define DBGRPHSTR 15
+#define DBGETFILES 16
+#define DBOPVEC 17
+#define DBUSRICON 18
+#define DB_USR_ROUT 19
/* icons tabulation in standard window */
-#define DBI_X_0 1
-#define DBI_X_1 9
-#define DBI_X_2 17
-#define DBI_Y_0 8
-#define DBI_Y_1 40
-#define DBI_Y_2 72
+#define DBI_X_0 1
+#define DBI_X_1 9
+#define DBI_X_2 17
+#define DBI_Y_0 8
+#define DBI_Y_1 40
+#define DBI_Y_2 72
/* standard window size defaults */
-#define SET_DB_POS 0
-#define DEF_DB_POS 0x80
-#define DEF_DB_TOP 32
-#define DEF_DB_BOT 127
-#define DEF_DB_LEFT 64
-#define DEF_DB_RIGHT 255
+#define SET_DB_POS 0
+#define DEF_DB_POS 0x80
+#define DEF_DB_TOP 32
+#define DEF_DB_BOT 127
+#define DEF_DB_LEFT 64
+#define DEF_DB_RIGHT 255
/* text tabulation in standard window */
-#define TXT_LN_1_Y 16
-#define TXT_LN_2_Y 32
-#define TXT_LN_3_Y 48
-#define TXT_LN_4_Y 64
-#define TXT_LN_5_Y 80
-#define TXT_LN_X 16
+#define TXT_LN_1_Y 16
+#define TXT_LN_2_Y 32
+#define TXT_LN_3_Y 48
+#define TXT_LN_4_Y 64
+#define TXT_LN_5_Y 80
+#define TXT_LN_X 16
/* system icons size */
-#define SYSDBI_HEIGHT 16
-#define SYSDBI_WIDTH 6
+#define SYSDBI_HEIGHT 16
+#define SYSDBI_WIDTH 6
/* dialogbox string offsets */
-#define OFF_DB_FORM 0
-#define OFF_DB_TOP 1
-#define OFF_DB_BOT 2
-#define OFF_DB_LEFT 3
-#define OFF_DB_RIGHT 5
-#define OFF_DB_1STCMD 7
+#define OFF_DB_FORM 0
+#define OFF_DB_TOP 1
+#define OFF_DB_BOT 2
+#define OFF_DB_LEFT 3
+#define OFF_DB_RIGHT 5
+#define OFF_DB_1STCMD 7
#endif
diff --git a/include/geos/gfile.h b/include/geos/gfile.h
index e574e4418..d7667d8ec 100644
--- a/include/geos/gfile.h
+++ b/include/geos/gfile.h
@@ -4,7 +4,7 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GFILE_H
+#ifndef _GFILE_H
#define _GFILE_H
#ifndef _GSTRUCT_H
@@ -43,32 +43,32 @@ char __fastcall__ WriteRecord(const char *buffer, unsigned flength);
char UpdateRecordFile(void);
/* GEOS filetypes */
-#define NOT_GEOS 0
-#define BASIC 1
-#define ASSEMBLY 2
-#define DATA 3
-#define SYSTEM 4
-#define DESK_ACC 5
-#define APPLICATION 6
-#define APPL_DATA 7
-#define FONT 8
-#define PRINTER 9
-#define INPUT_DEVICE 10
-#define DISK_DEVICE 11
-#define SYSTEM_BOOT 12
-#define TEMPORARY 13
-#define AUTO_EXEC 14
-#define INPUT_128 15
-#define NUMFILETYPES 16
+#define NOT_GEOS 0
+#define BASIC 1
+#define ASSEMBLY 2
+#define DATA 3
+#define SYSTEM 4
+#define DESK_ACC 5
+#define APPLICATION 6
+#define APPL_DATA 7
+#define FONT 8
+#define PRINTER 9
+#define INPUT_DEVICE 10
+#define DISK_DEVICE 11
+#define SYSTEM_BOOT 12
+#define TEMPORARY 13
+#define AUTO_EXEC 14
+#define INPUT_128 15
+#define NUMFILETYPES 16
/* supported structures */
-#define SEQUENTIAL 0
-#define VLIR 1
+#define SEQUENTIAL 0
+#define VLIR 1
/* DOS filetypes */
-#define DEL 0
-#define SEQ 1
-#define PRG 2
-#define USR 3
-#define REL 4
-#define CBM 5
+#define DEL 0
+#define SEQ 1
+#define PRG 2
+#define USR 3
+#define REL 4
+#define CBM 5
#endif
diff --git a/include/geos/ggraph.h b/include/geos/ggraph.h
index 184ec4e1d..961ec2d80 100644
--- a/include/geos/ggraph.h
+++ b/include/geos/ggraph.h
@@ -4,7 +4,7 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GGRAPH_H
+#ifndef _GGRAPH_H
#define _GGRAPH_H
#ifndef _GSTRUCT_H
@@ -40,125 +40,125 @@ void UseSystemFont(void);
void __fastcall__ BitmapUp(struct iconpic *myIcon);
void __fastcall__ BitmapClip(char skipl, char skipr, unsigned skiptop,
- struct iconpic *myIcon);
+ struct iconpic *myIcon);
void __fastcall__ BitOtherClip(void *proc1, void *proc2, char skipl,
- char skipr, unsigned skiptop,
- struct iconpic *myIcon);
+ char skipr, unsigned skiptop,
+ struct iconpic *myIcon);
void __fastcall__ GraphicsString(char *myGfxString);
/* VIC colour constants */
-#define BLACK 0
-#define WHITE 1
-#define RED 2
-#define CYAN 3
-#define PURPLE 4
-#define GREEN 5
-#define BLUE 6
-#define YELLOW 7
-#define ORANGE 8
-#define BROWN 9
-#define LTRED 10
-#define DKGREY 11
-#define GREY 12
-#define MEDGREY 12
-#define LTGREEN 13
-#define LTBLUE 14
-#define LTGREY 15
+#define BLACK 0
+#define WHITE 1
+#define RED 2
+#define CYAN 3
+#define PURPLE 4
+#define GREEN 5
+#define BLUE 6
+#define YELLOW 7
+#define ORANGE 8
+#define BROWN 9
+#define LTRED 10
+#define DKGREY 11
+#define GREY 12
+#define MEDGREY 12
+#define LTGREEN 13
+#define LTBLUE 14
+#define LTGREY 15
/* VIC memory banks - lowest 2 bits of cia2base+0 */
-#define GRBANK0 3
-#define GRBANK1 2
-#define GRBANK2 1
-#define GRBANK3 0
+#define GRBANK0 3
+#define GRBANK1 2
+#define GRBANK2 1
+#define GRBANK3 0
/* VIC screen sizes */
-#define VIC_X_POS_OFF 24
-#define VIC_Y_POS_OFF 50
+#define VIC_X_POS_OFF 24
+#define VIC_Y_POS_OFF 50
#ifdef __GEOS_CBM__
-#define SC_BYTE_WIDTH 40
-#define SC_PIX_HEIGHT 200
-#define SC_PIX_WIDTH 320
-#define SC_SIZE 8000
+#define SC_BYTE_WIDTH 40
+#define SC_PIX_HEIGHT 200
+#define SC_PIX_WIDTH 320
+#define SC_SIZE 8000
#else
-#define SC_BYTE_WIDTH 70
-#define SC_PIX_HEIGHT 192
-#define SC_PIX_WIDTH 560
-#define SC_SIZE 13440
+#define SC_BYTE_WIDTH 70
+#define SC_PIX_HEIGHT 192
+#define SC_PIX_WIDTH 560
+#define SC_SIZE 13440
#endif
-/* VDC screen constants */
-#define SCREENBYTEWIDTH 80
-#define SCREENPIXELWIDTH 640
+/* VDC screen constants */
+#define SCREENBYTEWIDTH 80
+#define SCREENPIXELWIDTH 640
/* control characters for use as numbers, not characters */
-#define BACKSPACE 8
-#define FORWARDSPACE 9
-#define TAB 9
-#define LF 10
-#define HOME 11
-#define PAGE_BREAK 12
-#define UPLINE 12
-#define CR 13
-#define ULINEON 14
-#define ULINEOFF 15
-#define ESC_GRAPHICS 16
-#define ESC_RULER 17
-#define REV_ON 18
-#define REV_OFF 19
-#define GOTOX 20
-#define GOTOY 21
-#define GOTOXY 22
-#define NEWCARDSET 23
-#define BOLDON 24
-#define ITALICON 25
-#define OUTLINEON 26
-#define PLAINTEXT 27
+#define BACKSPACE 8
+#define FORWARDSPACE 9
+#define TAB 9
+#define LF 10
+#define HOME 11
+#define PAGE_BREAK 12
+#define UPLINE 12
+#define CR 13
+#define ULINEON 14
+#define ULINEOFF 15
+#define ESC_GRAPHICS 16
+#define ESC_RULER 17
+#define REV_ON 18
+#define REV_OFF 19
+#define GOTOX 20
+#define GOTOY 21
+#define GOTOXY 22
+#define NEWCARDSET 23
+#define BOLDON 24
+#define ITALICON 25
+#define OUTLINEON 26
+#define PLAINTEXT 27
/* control characters for use in
strings: eg: str[10]=CBOLDON "Hello"; */
-#define CCR "\015"
-#define CULINEON "\016"
-#define CULINEOFF "\017"
-#define CREV_ON "\022"
-#define CREV_OFF "\023"
-#define CBOLDON "\030"
-#define CITALICON "\031"
-#define COUTLINEON "\032"
-#define CPLAINTEXT "\033"
-
-/*values of currentMode */
+#define CCR "\015"
+#define CULINEON "\016"
+#define CULINEOFF "\017"
+#define CREV_ON "\022"
+#define CREV_OFF "\023"
+#define CBOLDON "\030"
+#define CITALICON "\031"
+#define COUTLINEON "\032"
+#define CPLAINTEXT "\033"
+
+/*values of currentMode */
/* bitNumbers */
-#define UNDERLINE_BIT 7
-#define BOLD_BIT 6
-#define REVERSE_BIT 5
-#define ITALIC_BIT 4
-#define OUTLINE_BIT 3
-#define SUPERSCRIPT_BIT 2
-#define SUBSCRIPT_BIT 1
+#define UNDERLINE_BIT 7
+#define BOLD_BIT 6
+#define REVERSE_BIT 5
+#define ITALIC_BIT 4
+#define OUTLINE_BIT 3
+#define SUPERSCRIPT_BIT 2
+#define SUBSCRIPT_BIT 1
/* bitMasks */
-#define SET_UNDERLINE 0x80
-#define SET_BOLD 0x40
-#define SET_REVERSE 0x20
-#define SET_ITALIC 0x10
-#define SET_OUTLINE 0x08
-#define SET_SUPERSCRIPT 0x04
-#define SET_SUBSCRIPT 0x02
-#define SET_PLAINTEXT 0
+#define SET_UNDERLINE 0x80
+#define SET_BOLD 0x40
+#define SET_REVERSE 0x20
+#define SET_ITALIC 0x10
+#define SET_OUTLINE 0x08
+#define SET_SUPERSCRIPT 0x04
+#define SET_SUBSCRIPT 0x02
+#define SET_PLAINTEXT 0
/* values of dispBufferOn */
-#define ST_WRGS_FORE 0x20
-#define ST_WR_BACK 0x40
-#define ST_WR_FORE 0x80
+#define ST_WRGS_FORE 0x20
+#define ST_WR_BACK 0x40
+#define ST_WR_FORE 0x80
/* PutDecimal parameters */
/* leading zeros? */
-#define SET_NOSURPRESS 0
-#define SET_SURPRESS 0x40
+#define SET_NOSURPRESS 0
+#define SET_SURPRESS 0x40
/* justification */
-#define SET_RIGHTJUST 0
-#define SET_LEFTJUST 0x80
+#define SET_RIGHTJUST 0
+#define SET_LEFTJUST 0x80
/* C128 x-extension flags */
-#define ADD1_W 0x2000
-#define DOUBLE_B 0x80
-#define DOUBLE_W 0x8000
+#define ADD1_W 0x2000
+#define DOUBLE_B 0x80
+#define DOUBLE_W 0x8000
/* DrawLine/DrawPoint mode values */
-#define DRAW_ERASE 0x00
-#define DRAW_DRAW 0x40
-#define DRAW_COPY 0x80
+#define DRAW_ERASE 0x00
+#define DRAW_DRAW 0x40
+#define DRAW_COPY 0x80
typedef void graphicStr;
diff --git a/include/geos/gmemory.h b/include/geos/gmemory.h
index 87be6c1e8..3fba5cb5b 100644
--- a/include/geos/gmemory.h
+++ b/include/geos/gmemory.h
@@ -4,7 +4,7 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GMEMORY_H
+#ifndef _GMEMORY_H
#define _GMEMORY_H
#ifndef _GSTRUCT_H
diff --git a/include/geos/gmenu.h b/include/geos/gmenu.h
index b579aef5b..3175b6cf3 100644
--- a/include/geos/gmenu.h
+++ b/include/geos/gmenu.h
@@ -4,7 +4,7 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GMENU_H
+#ifndef _GMENU_H
#define _GMENU_H
#ifndef _GSTRUCT_H
@@ -21,35 +21,35 @@ void GotoFirstMenu(void);
void __fastcall__ DoIcons(struct icontab *myIconTab);
/* DoMenu - menutypes */
-#define MENU_ACTION 0x00
-#define DYN_SUB_MENU 0x40
-#define SUB_MENU 0x80
-#define HORIZONTAL 0x00
-#define VERTICAL 0x80
+#define MENU_ACTION 0x00
+#define DYN_SUB_MENU 0x40
+#define SUB_MENU 0x80
+#define HORIZONTAL 0x00
+#define VERTICAL 0x80
/* menu string offsets */
-#define OFF_MY_TOP 0
-#define OFF_MY_BOT 1
-#define OFF_MX_LEFT 2
-#define OFF_MX_RIGHT 4
-#define OFF_NUM_M_ITEMS 6
-#define OFF_1ST_M_ITEM 7
+#define OFF_MY_TOP 0
+#define OFF_MY_BOT 1
+#define OFF_MX_LEFT 2
+#define OFF_MX_RIGHT 4
+#define OFF_NUM_M_ITEMS 6
+#define OFF_1ST_M_ITEM 7
/* icon string offsets */
-#define OFF_NM_ICNS 0
-#define OFF_IC_XMOUSE 1
-#define OFF_IC_YMOUSE 3
-#define OFF_PIC_ICON 0
-#define OFF_X_ICON_POS 2
-#define OFF_Y_ICON_POS 3
-#define OFF_WDTH_ICON 4
-#define OFF_HEIGHT_ICON 5
-#define OFF_SRV_RT_ICON 6
-#define OFF_NX_ICON 8
-/* icons, menus status flags */
-#define ST_FLASH 0x80
-#define ST_INVERT 0x40
-#define ST_LD_AT_ADDR 0x01
-#define ST_LD_DATA 0x80
-#define ST_PR_DATA 0x40
-#define ST_WR_PR 0x40
+#define OFF_NM_ICNS 0
+#define OFF_IC_XMOUSE 1
+#define OFF_IC_YMOUSE 3
+#define OFF_PIC_ICON 0
+#define OFF_X_ICON_POS 2
+#define OFF_Y_ICON_POS 3
+#define OFF_WDTH_ICON 4
+#define OFF_HEIGHT_ICON 5
+#define OFF_SRV_RT_ICON 6
+#define OFF_NX_ICON 8
+/* icons, menus status flags */
+#define ST_FLASH 0x80
+#define ST_INVERT 0x40
+#define ST_LD_AT_ADDR 0x01
+#define ST_LD_DATA 0x80
+#define ST_PR_DATA 0x40
+#define ST_WR_PR 0x40
#endif
diff --git a/include/geos/gprocess.h b/include/geos/gprocess.h
index d784a2cc6..6fab2ecfa 100644
--- a/include/geos/gprocess.h
+++ b/include/geos/gprocess.h
@@ -4,7 +4,7 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GPROCESS_H
+#ifndef _GPROCESS_H
#define _GPROCESS_H
#ifndef _GSTRUCT_H
diff --git a/include/geos/gsprite.h b/include/geos/gsprite.h
index 470cfb27b..9679e9f59 100644
--- a/include/geos/gsprite.h
+++ b/include/geos/gsprite.h
@@ -4,7 +4,7 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GSPRITE_H
+#ifndef _GSPRITE_H
#define _GSPRITE_H
void StartMouseMode(void);
@@ -24,73 +24,73 @@ void PromptOff(void);
char GetNextChar(void);
/* keyboard constants */
-#define KEY_F1 1
-#define KEY_F2 2
-#define KEY_F3 3
-#define KEY_F4 4
-#define KEY_F5 5
-#define KEY_F6 6
-#define KEY_NOSCRL 7
-#define KEY_ENTER 13
-#define KEY_F7 14
-#define KEY_F8 15
-#define KEY_HOME 18
-#define KEY_CLEAR 19
-#define KEY_LARROW 20
-#define KEY_UPARROW 21
-#define KEY_STOP 22
-#define KEY_RUN 23
-#define KEY_BPS 24
-#define KEY_HELP 25
-#define KEY_ALT 26
-#define KEY_ESC 27
-#define KEY_INSERT 28
-#define KEY_INVALID 31
-#define KEY_LEFT BACKSPACE
+#define KEY_F1 1
+#define KEY_F2 2
+#define KEY_F3 3
+#define KEY_F4 4
+#define KEY_F5 5
+#define KEY_F6 6
+#define KEY_NOSCRL 7
+#define KEY_ENTER 13
+#define KEY_F7 14
+#define KEY_F8 15
+#define KEY_HOME 18
+#define KEY_CLEAR 19
+#define KEY_LARROW 20
+#define KEY_UPARROW 21
+#define KEY_STOP 22
+#define KEY_RUN 23
+#define KEY_BPS 24
+#define KEY_HELP 25
+#define KEY_ALT 26
+#define KEY_ESC 27
+#define KEY_INSERT 28
+#define KEY_INVALID 31
+#define KEY_LEFT BACKSPACE
#ifdef __GEOS_CBM__
-#define KEY_UP 16
-#define KEY_DOWN 17
-#define KEY_DELETE 29
-#define KEY_RIGHT 30
+#define KEY_UP 16
+#define KEY_DOWN 17
+#define KEY_DELETE 29
+#define KEY_RIGHT 30
#else
-#define KEY_UP 11
-#define KEY_DOWN 10
-#define KEY_DELETE 127
-#define KEY_RIGHT 21
+#define KEY_UP 11
+#define KEY_DOWN 10
+#define KEY_DELETE 127
+#define KEY_RIGHT 21
#endif
/* values of faultData - pointer position vs. mouseWindow */
/* bit numbers */
-#define OFFTOP_BIT 7
-#define OFFBOTTOM_BIT 6
-#define OFFLEFT_BIT 5
-#define OFFRIGHT_BIT 4
-#define OFFMENU_BIT 3
+#define OFFTOP_BIT 7
+#define OFFBOTTOM_BIT 6
+#define OFFLEFT_BIT 5
+#define OFFRIGHT_BIT 4
+#define OFFMENU_BIT 3
/* bit masks */
-#define SET_OFFTOP 0x80
-#define SET_OFFBOTTOM 0x40
-#define SET_OFFLEFT 0x20
-#define SET_OFFRIGHT 0x10
-#define SET_OFFMENU 0x08
+#define SET_OFFTOP 0x80
+#define SET_OFFBOTTOM 0x40
+#define SET_OFFLEFT 0x20
+#define SET_OFFRIGHT 0x10
+#define SET_OFFMENU 0x08
/* mouseOn */
/* bit numbers */
-#define MOUSEON_BIT 7
-#define MENUON_BIT 6
-#define ICONSON_BIT 5
+#define MOUSEON_BIT 7
+#define MENUON_BIT 6
+#define ICONSON_BIT 5
/* bit masks */
-#define SET_MSE_ON 0x80
-#define SET_MENUON 0x40
-#define SET_ICONSON 0x20
+#define SET_MSE_ON 0x80
+#define SET_MENUON 0x40
+#define SET_ICONSON 0x20
/* pressFlag */
/* bit numbers */
-#define KEYPRESS_BIT 7
-#define INPUT_BIT 6
-#define MOUSE_BIT 5
+#define KEYPRESS_BIT 7
+#define INPUT_BIT 6
+#define MOUSE_BIT 5
/* bit masks */
-#define SET_KEYPRESS 0x80
-#define SET_INPUTCHG 0x40
-#define SET_MOUSE 0x20
-
+#define SET_KEYPRESS 0x80
+#define SET_INPUTCHG 0x40
+#define SET_MOUSE 0x20
+
#endif
diff --git a/include/geos/gstruct.h b/include/geos/gstruct.h
index ecb2e7714..9e5f0ddda 100644
--- a/include/geos/gstruct.h
+++ b/include/geos/gstruct.h
@@ -18,157 +18,157 @@
typedef void (*void_func) (void);
-struct s_date { /* system date & time */
- char s_year;
- char s_month;
- char s_day;
- char s_hour;
- char s_minutes;
- char s_seconds;
-};
-
-struct tr_se { /* track and sector */
- char track;
- char sector;
-};
-
-struct fileheader { /* header block (like fileHeader) */
- struct tr_se n_block;
- char icon_desc[3];
- char icon_pic[63];
- char dostype;
- char type;
- char structure;
- unsigned load_address;
- unsigned end_address;
- unsigned exec_address;
- char class_name[19];
- char column_flag;
- char author[63];
- char note[96];
+struct s_date { /* system date & time */
+ char s_year;
+ char s_month;
+ char s_day;
+ char s_hour;
+ char s_minutes;
+ char s_seconds;
+};
+
+struct tr_se { /* track and sector */
+ char track;
+ char sector;
+};
+
+struct fileheader { /* header block (like fileHeader) */
+ struct tr_se n_block;
+ char icon_desc[3];
+ char icon_pic[63];
+ char dostype;
+ char type;
+ char structure;
+ unsigned load_address;
+ unsigned end_address;
+ unsigned exec_address;
+ char class_name[19];
+ char column_flag;
+ char author[63];
+ char note[96];
};
#ifdef __GEOS_CBM__
-struct f_date { /* date in filedesctiptor */
- char f_year;
- char f_month;
- char f_day;
- char f_hour;
- char f_minute;
+struct f_date { /* date in filedesctiptor */
+ char f_year;
+ char f_month;
+ char f_day;
+ char f_hour;
+ char f_minute;
};
-struct filehandle { /* filehandle in directory sectors */
- char dostype; /* or in dirEntryBuf */
- struct tr_se n_block;
- char name[16];
- struct tr_se header;
- char structure;
- char type;
- struct f_date date;
- unsigned size;
+struct filehandle { /* filehandle in directory sectors */
+ char dostype; /* or in dirEntryBuf */
+ struct tr_se n_block;
+ char name[16];
+ struct tr_se header;
+ char structure;
+ char type;
+ struct f_date date;
+ unsigned size;
};
#else /* #ifdef __GEOS_CBM__ */
-struct f_date { /* date in filedesctiptor */
- unsigned f_day:5;
- unsigned f_month:4;
- unsigned f_year:7;
- char f_minute;
- char f_hour;
-};
-
-struct filehandle { /* filehandle in directory sectors */
- unsigned name_len:4; /* or in dirEntryBuf */
- unsigned structure:4;
- char name[15];
- char type;
- struct tr_se n_block;
- unsigned size;
- char byte_size[3];
- struct f_date date;
- char version;
- char min_version;
- char access;
- struct tr_se header;
- struct f_date mod_date;
- struct tr_se dir_head;
+struct f_date { /* date in filedesctiptor */
+ unsigned f_day:5;
+ unsigned f_month:4;
+ unsigned f_year:7;
+ char f_minute;
+ char f_hour;
+};
+
+struct filehandle { /* filehandle in directory sectors */
+ unsigned name_len:4; /* or in dirEntryBuf */
+ unsigned structure:4;
+ char name[15];
+ char type;
+ struct tr_se n_block;
+ unsigned size;
+ char byte_size[3];
+ struct f_date date;
+ char version;
+ char min_version;
+ char access;
+ struct tr_se header;
+ struct f_date mod_date;
+ struct tr_se dir_head;
};
#endif /* #ifdef __GEOS_CBM__ */
-struct pixel { /* describes point */
- unsigned x;
- char y;
+struct pixel { /* describes point */
+ unsigned x;
+ char y;
};
-struct fontdesc { /* describes font */
- char baseline;
- char width;
- char height;
- char *index_tbl;
- char *data_ptr;
+struct fontdesc { /* describes font */
+ char baseline;
+ char width;
+ char height;
+ char *index_tbl;
+ char *data_ptr;
};
-struct window { /* describes screen region */
- char top;
- char bot;
- unsigned left;
- unsigned right;
+struct window { /* describes screen region */
+ char top;
+ char bot;
+ unsigned left;
+ unsigned right;
};
-struct VLIR_info { /* VLIR information */
- char curRecord; /* currently only used in VLIR */
- char usedRecords; /* as system info (curRecord is mainly of your interest */
- char fileWritten;
- unsigned fileSize;
+struct VLIR_info { /* VLIR information */
+ char curRecord; /* currently only used in VLIR */
+ char usedRecords; /* as system info (curRecord is mainly of your interest */
+ char fileWritten;
+ unsigned fileSize;
};
-struct process { /* process info, declare table of that type */
- unsigned pointer; /* (like: struct process proctab[2]=... */
- unsigned jiffies; /* last entry HAVE TO BE {0,0} */
+struct process { /* process info, declare table of that type */
+ unsigned pointer; /* (like: struct process proctab[2]=... */
+ unsigned jiffies; /* last entry HAVE TO BE {0,0} */
};
-struct iconpic { /* icon/encoded bitmap description */
- char *pic_ptr; /* ptr to a photo scrap (or encoded bitmap) */
- char x; /* position in cards (*8 pixels) */
- char y;
- char width; /* in cards */
- char heigth; /* in lines (pixels) */
+struct iconpic { /* icon/encoded bitmap description */
+ char *pic_ptr; /* ptr to a photo scrap (or encoded bitmap) */
+ char x; /* position in cards (*8 pixels) */
+ char y;
+ char width; /* in cards */
+ char heigth; /* in lines (pixels) */
};
-struct icondef { /* icon definition for DoIcons */
- char *pic_ptr; /* ptr to a photo scrap (or encoded bitmap) */
- char x; /* position in cards (*8 pixels) */
- char y;
- char width; /* of icon (in cards) */
- char heigth; /* of icon in lines (pixels) */
- unsigned proc_ptr; /* pointer to function handling that icon */
+struct icondef { /* icon definition for DoIcons */
+ char *pic_ptr; /* ptr to a photo scrap (or encoded bitmap) */
+ char x; /* position in cards (*8 pixels) */
+ char y;
+ char width; /* of icon (in cards) */
+ char heigth; /* of icon in lines (pixels) */
+ unsigned proc_ptr; /* pointer to function handling that icon */
};
struct icontab {
- char number; /* number of declared icons */
- struct pixel mousepos; /* position of mouse after DoIcons */
- struct icondef tab[]; /* table of size declared by icontab.number */
+ char number; /* number of declared icons */
+ struct pixel mousepos; /* position of mouse after DoIcons */
+ struct icondef tab[]; /* table of size declared by icontab.number */
};
struct menuitem {
- char *name;
- char type;
- void *rest; /* may be ptr to function, or ptr to struct menu (submenu) */
+ char *name;
+ char type;
+ void *rest; /* may be ptr to function, or ptr to struct menu (submenu) */
};
struct menu {
- struct window size;
- char number;
- struct menuitem items[];
+ struct window size;
+ char number;
+ struct menuitem items[];
};
-struct inittab { /* use struct inittab mytab[n] for initram */
- unsigned ptr; /* ptr to 1st byte */
- char number; /* number of following bytes */
- char values[]; /* actual string of bytes */
+struct inittab { /* use struct inittab mytab[n] for initram */
+ unsigned ptr; /* ptr to 1st byte */
+ char number; /* number of following bytes */
+ char values[]; /* actual string of bytes */
};
#endif
diff --git a/include/geos/gsym.h b/include/geos/gsym.h
index 13a29f9da..085046674 100644
--- a/include/geos/gsym.h
+++ b/include/geos/gsym.h
@@ -11,331 +11,331 @@
#include
#endif
-#define r0 (*(unsigned*)(R_BASE + 0x00))
-#define r0L (*(char*)(R_BASE + 0x00))
-#define r0H (*(char*)(R_BASE + 0x01))
-#define r1 (*(unsigned*)(R_BASE + 0x02))
-#define r1L (*(char*)(R_BASE + 0x02))
-#define r1H (*(char*)(R_BASE + 0x03))
-#define drawWindow (*(struct window*)(R_BASE + 0x04))
-#define r2 (*(unsigned*)(R_BASE + 0x04))
-#define r2L (*(char*)(R_BASE + 0x04))
-#define r2H (*(char*)(R_BASE + 0x05))
-#define r3 (*(unsigned*)(R_BASE + 0x06))
-#define r3L (*(char*)(R_BASE + 0x06))
-#define r3H (*(char*)(R_BASE + 0x07))
-#define r4 (*(unsigned*)(R_BASE + 0x08))
-#define r4L (*(char*)(R_BASE + 0x08))
-#define r4H (*(char*)(R_BASE + 0x09))
-#define r5 (*(unsigned*)(R_BASE + 0x0a))
-#define r5L (*(char*)(R_BASE + 0x0a))
-#define r5H (*(char*)(R_BASE + 0x0b))
-#define r6 (*(unsigned*)(R_BASE + 0x0c))
-#define r6L (*(char*)(R_BASE + 0x0c))
-#define r6H (*(char*)(R_BASE + 0x0d))
-#define r7 (*(unsigned*)(R_BASE + 0x0e))
-#define r7L (*(char*)(R_BASE + 0x0e))
-#define r7H (*(char*)(R_BASE + 0x0f))
-#define r8 (*(unsigned*)(R_BASE + 0x10))
-#define r8L (*(char*)(R_BASE + 0x10))
-#define r8H (*(char*)(R_BASE + 0x11))
-#define r9 (*(unsigned*)(R_BASE + 0x12))
-#define r9L (*(char*)(R_BASE + 0x12))
-#define r9H (*(char*)(R_BASE + 0x13))
-#define r10 (*(unsigned*)(R_BASE + 0x14))
-#define r10L (*(char*)(R_BASE + 0x14))
-#define r10H (*(char*)(R_BASE + 0x15))
-#define r11 (*(unsigned*)(R_BASE + 0x16))
-#define r11L (*(char*)(R_BASE + 0x16))
-#define r11H (*(char*)(R_BASE + 0x17))
-#define r12 (*(unsigned*)(R_BASE + 0x18))
-#define r12L (*(char*)(R_BASE + 0x18))
-#define r12H (*(char*)(R_BASE + 0x19))
-#define r13 (*(unsigned*)(R_BASE + 0x1a))
-#define r13L (*(char*)(R_BASE + 0x1a))
-#define r13H (*(char*)(R_BASE + 0x1b))
-#define r14 (*(unsigned*)(R_BASE + 0x1c))
-#define r14L (*(char*)(R_BASE + 0x1c))
-#define r14H (*(char*)(R_BASE + 0x1d))
-#define r15 (*(unsigned*)(R_BASE + 0x1e))
-#define r15L (*(char*)(R_BASE + 0x1e))
-#define r15H (*(char*)(R_BASE + 0x1f))
+#define r0 (*(unsigned*)(R_BASE + 0x00))
+#define r0L (*(char*)(R_BASE + 0x00))
+#define r0H (*(char*)(R_BASE + 0x01))
+#define r1 (*(unsigned*)(R_BASE + 0x02))
+#define r1L (*(char*)(R_BASE + 0x02))
+#define r1H (*(char*)(R_BASE + 0x03))
+#define drawWindow (*(struct window*)(R_BASE + 0x04))
+#define r2 (*(unsigned*)(R_BASE + 0x04))
+#define r2L (*(char*)(R_BASE + 0x04))
+#define r2H (*(char*)(R_BASE + 0x05))
+#define r3 (*(unsigned*)(R_BASE + 0x06))
+#define r3L (*(char*)(R_BASE + 0x06))
+#define r3H (*(char*)(R_BASE + 0x07))
+#define r4 (*(unsigned*)(R_BASE + 0x08))
+#define r4L (*(char*)(R_BASE + 0x08))
+#define r4H (*(char*)(R_BASE + 0x09))
+#define r5 (*(unsigned*)(R_BASE + 0x0a))
+#define r5L (*(char*)(R_BASE + 0x0a))
+#define r5H (*(char*)(R_BASE + 0x0b))
+#define r6 (*(unsigned*)(R_BASE + 0x0c))
+#define r6L (*(char*)(R_BASE + 0x0c))
+#define r6H (*(char*)(R_BASE + 0x0d))
+#define r7 (*(unsigned*)(R_BASE + 0x0e))
+#define r7L (*(char*)(R_BASE + 0x0e))
+#define r7H (*(char*)(R_BASE + 0x0f))
+#define r8 (*(unsigned*)(R_BASE + 0x10))
+#define r8L (*(char*)(R_BASE + 0x10))
+#define r8H (*(char*)(R_BASE + 0x11))
+#define r9 (*(unsigned*)(R_BASE + 0x12))
+#define r9L (*(char*)(R_BASE + 0x12))
+#define r9H (*(char*)(R_BASE + 0x13))
+#define r10 (*(unsigned*)(R_BASE + 0x14))
+#define r10L (*(char*)(R_BASE + 0x14))
+#define r10H (*(char*)(R_BASE + 0x15))
+#define r11 (*(unsigned*)(R_BASE + 0x16))
+#define r11L (*(char*)(R_BASE + 0x16))
+#define r11H (*(char*)(R_BASE + 0x17))
+#define r12 (*(unsigned*)(R_BASE + 0x18))
+#define r12L (*(char*)(R_BASE + 0x18))
+#define r12H (*(char*)(R_BASE + 0x19))
+#define r13 (*(unsigned*)(R_BASE + 0x1a))
+#define r13L (*(char*)(R_BASE + 0x1a))
+#define r13H (*(char*)(R_BASE + 0x1b))
+#define r14 (*(unsigned*)(R_BASE + 0x1c))
+#define r14L (*(char*)(R_BASE + 0x1c))
+#define r14H (*(char*)(R_BASE + 0x1d))
+#define r15 (*(unsigned*)(R_BASE + 0x1e))
+#define r15L (*(char*)(R_BASE + 0x1e))
+#define r15H (*(char*)(R_BASE + 0x1f))
#ifdef __GEOS_CBM__
-#define nameBuf char[17]
-#define blockBuf char[256]
-
-#define CPU_DDR (*(char*)0x00)
-#define CPU_DATA (*(char*)0x01)
-
-#define R_BASE 0x02
-
-#define curPattern (*(unsigned*)0x22)
-#define string (*(unsigned*)0x24)
-#define curFontDesc (*(struct fontdesc*)0x26)
-#define currentMode (*(char*)0x2e)
-#define dispBufferOn (*(char*)0x2f)
-#define mouseOn (*(char*)0x30)
-#define msePicPtr (*(unsigned*)0x31)
-#define curWindow (*(struct window*)0x33)
-#define pressFlag (*(char*)0x39)
-#define mousePos (*(struct pixel*)0x3a)
-#define returnAddress (*(unsigned*)0x3d)
-#define graphMode (*(char*)0x3f)
-#define STATUS (*(char*)0x90)
-#define curDevice (*(char*)0xba)
-
-#define irqvec (*(void_func*)0x0314)
-#define bkvec (*(void_func*)0x0316)
-#define nmivec (*(void_func*)0x0318)
-
-#define APP_RAM ((char*)0x0400)
-#define BACK_SCR_BASE ((char*)0x6000)
-#define PRINTBASE ((char*)0x7900)
-#define OS_VARS ((char*)0x8000)
-
-#define diskBlkBuf ((blockBuf)0x8000)
-#define fileHeader (*(struct fileheader*)0x8100)
-#define curDirHead ((blockBuf)0x8200)
-#define fileTrScTab ((struct tr_se[128])0x8300)
-#define dirEntryBuf (*(struct filehandle*)0x8400)
-
-#define DrACurDkNm ((nameBuf)0x841e)
-#define DrBCurDkNm ((nameBuf)0x8430)
-#define dataFileName ((nameBuf)0x8442)
-#define dataDiskName ((nameBuf)0x8453)
-#define PrntFileName ((nameBuf)0x8465)
-#define PrntDiskName ((nameBuf)0x8476)
-
-#define curDrive (*(char*)0x8489)
-#define diskOpenFlg (*(char*)0x848a)
-#define isGEOS (*(char*)0x848b)
-#define interleave (*(char*)0x848c)
-#define NUMDRV (*(char*)0x848d)
-
-#define driveType ((char[4])0x848e)
-#define turboFlags ((char[4])0x8492)
-
-#define VLIRInfo (*(struct VLIR_info*)0x8496)
-
-#define appMain (*(void_func*)0x849b)
-#define intTopVector (*(void_func*)0x849d)
-#define intBotVector (*(void_func*)0x849f)
-#define mouseVector (*(void_func*)0x84a1)
-#define keyVector (*(void_func*)0x84a3)
-#define inputVector (*(void_func*)0x84a5)
-#define mouseFaultVec (*(void_func*)0x84a7)
-#define otherPressVec (*(void_func*)0x84a9)
-#define StringFaultVec (*(void_func*)0x84ab)
-#define alarmTmtVector (*(void_func*)0x84ad)
-#define BRKVector (*(void_func*)0x84af)
-#define RecoverVector (*(void_func*)0x84b1)
-
-#define selectionFlash (*(char*)0x84b3)
-#define alphaFlag (*(char*)0x84b4)
-#define iconSelFlg (*(char*)0x84b5)
-#define faultData (*(char*)0x84b6)
-#define menuNumber (*(char*)0x84b7)
-#define mouseWindow (*(struct window*)0x84b8)
-#define stringXY (*(struct pixel*)0x84be)
-#define mousePicData (*(char*)0x84c1)
-
-#define maxMouseSpeed (*(char*)0x8501)
-#define minMouseSpeed (*(char*)0x8502)
-#define mouseAccel (*(char*)0x8503)
-#define keyData (*(char*)0x8504)
-#define mouseData (*(char*)0x8505)
-#define inputData (*(char*)0x8506)
-#define mouseSpeed (*(char*)0x8507)
-#define random (*(char*)0x850a)
-#define saveFontTab (*(struct fontdesc*)0x850c)
-
-#define dblClickCount (*(char*)0x8515)
-#define system_date (*(struct s_date*)0x8516)
-#define alarmSetFlag (*(char*)0x851c)
-#define sysDBData (*(char*)0x851d)
-#define screencolors (*(char*)0x851e)
-#define dlgBoxRamBuf (*(char*)0x851f)
-
-#define savedmoby2 (*(char*)0x88bb)
-#define scr80polar (*(char*)0x88bc)
-#define scr80colors (*(char*)0x88bd)
-#define vdcClrMode (*(char*)0x88be)
-#define driveData ((char[4])0x88bf)
-#define ramExpSize (*(char*)0x88c3)
-#define sysRAMFlg (*(char*)0x88c4)
-#define firstBoot (*(char*)0x88c5)
-#define curType (*(char*)0x88c6)
-#define ramBase (*(char*)0x88c7)
-#define inputDevName ((nameBuf)0x88cb)
-#define DrCCurDkNm ((nameBuf)0x88dc)
-#define DrDCurDkNm ((nameBuf)0x88ee)
-#define dir2Head ((blockBuf)0x8900)
-#define SPRITE_PICS ((char*)0x8a00)
-#define sprpic ((char[8][64])0x8a00)
-#define COLOR_MATRIX ((char[1000])0x8c00)
-#define objPointer ((char[8])0x8ff8)
-
-#define DISK_BASE ((char*)0x9000)
-#define SCREEN_BASE ((char*)0xa000)
-#define OS_ROM ((char*)0xc000)
-#define OS_JUMPTAB ((char*)0xc100)
-#define EXP_BASE ((char*)0xdf00)
-#define MOUSE_BASE_128 ((char*)0xfd00)
-#define MOUSE_JMP_128 ((char*)0xfd00)
-#define END_MOUSE_128 ((char*)0xfe80)
-#define MOUSE_BASE ((char*)0xfe80)
-#define MOUSE_JMP ((char*)0xfe80)
-
-#define config (*(char*)0xff00)
-#define END_MOUSE ((char*)0xfffa)
-
-#define NMI_VECTOR (*(void_func*)0xfffa)
-#define RESET_VECTOR (*(void_func*)0xfffc)
-#define IRQ_VECTOR (*(void_func*)0xfffe)
-
-#define vicbase ((char*)0xd000)
-#define sidbase ((char*)0xd400)
-#define mmu ((char*)0xd500)
-#define VDC ((char*)0xd600)
-#define ctab ((char*)0xd800)
-#define cia1base ((char*)0xdc00)
-#define cia2base ((char*)0xdd00)
-
-#define mob0xpos (*(char*)0xd000)
-#define mob0ypos (*(char*)0xd001)
-#define mob1xpos (*(char*)0xd002)
-#define mob1ypos (*(char*)0xd003)
-#define mob2xpos (*(char*)0xd004)
-#define mob2ypos (*(char*)0xd005)
-#define mob3xpos (*(char*)0xd006)
-#define mob3ypos (*(char*)0xd007)
-#define mob4xpos (*(char*)0xd008)
-#define mob4ypos (*(char*)0xd009)
-#define mob5xpos (*(char*)0xd00a)
-#define mob5ypos (*(char*)0xd00b)
-#define mob6xpos (*(char*)0xd00c)
-#define mob6ypos (*(char*)0xd00d)
-#define mob7xpos (*(char*)0xd00e)
-#define mob7ypos (*(char*)0xd00f)
-#define msbxpos (*(char*)0xd010)
-#define grcntrl1 (*(char*)0xd011)
-#define rasreg (*(char*)0xd012)
-#define lpxpos (*(char*)0xd013)
-#define lpypos (*(char*)0xd014)
-#define mobenble (*(char*)0xd015)
-#define grcntrl2 (*(char*)0xd016)
-#define grmemptr (*(char*)0xd018)
-#define grirq (*(char*)0xd019)
-#define grirqen (*(char*)0xd01a)
-#define moby2 (*(char*)0xd017)
-#define mobprior (*(char*)0xd01b)
-#define mobmcm (*(char*)0xd01c)
-#define mobx2 (*(char*)0xd01d)
-#define mobmobcol (*(char*)0xd01e)
-#define mobbakcol (*(char*)0xd01f)
-#define extclr (*(char*)0xd020)
-#define bakclr0 (*(char*)0xd021)
-#define bakclr1 (*(char*)0xd022)
-#define bakclr2 (*(char*)0xd023)
-#define bakclr3 (*(char*)0xd024)
-#define mcmclr0 (*(char*)0xd025)
-#define mcmclr1 (*(char*)0xd026)
-#define mob0clr (*(char*)0xd027)
-#define mob1clr (*(char*)0xd028)
-#define mob2clr (*(char*)0xd029)
-#define mob3clr (*(char*)0xd02a)
-#define mob4clr (*(char*)0xd02b)
-#define mob5clr (*(char*)0xd02c)
-#define mob6clr (*(char*)0xd02d)
-#define mob7clr (*(char*)0xd02e)
-#define keyreg (*(char*)0xd02f)
-#define clkreg (*(char*)0xd030)
-
-#define vdcreg (*(char*)0xd600)
-#define vdcdata (*(char*)0xd601)
+#define nameBuf char[17]
+#define blockBuf char[256]
+
+#define CPU_DDR (*(char*)0x00)
+#define CPU_DATA (*(char*)0x01)
+
+#define R_BASE 0x02
+
+#define curPattern (*(unsigned*)0x22)
+#define string (*(unsigned*)0x24)
+#define curFontDesc (*(struct fontdesc*)0x26)
+#define currentMode (*(char*)0x2e)
+#define dispBufferOn (*(char*)0x2f)
+#define mouseOn (*(char*)0x30)
+#define msePicPtr (*(unsigned*)0x31)
+#define curWindow (*(struct window*)0x33)
+#define pressFlag (*(char*)0x39)
+#define mousePos (*(struct pixel*)0x3a)
+#define returnAddress (*(unsigned*)0x3d)
+#define graphMode (*(char*)0x3f)
+#define STATUS (*(char*)0x90)
+#define curDevice (*(char*)0xba)
+
+#define irqvec (*(void_func*)0x0314)
+#define bkvec (*(void_func*)0x0316)
+#define nmivec (*(void_func*)0x0318)
+
+#define APP_RAM ((char*)0x0400)
+#define BACK_SCR_BASE ((char*)0x6000)
+#define PRINTBASE ((char*)0x7900)
+#define OS_VARS ((char*)0x8000)
+
+#define diskBlkBuf ((blockBuf)0x8000)
+#define fileHeader (*(struct fileheader*)0x8100)
+#define curDirHead ((blockBuf)0x8200)
+#define fileTrScTab ((struct tr_se[128])0x8300)
+#define dirEntryBuf (*(struct filehandle*)0x8400)
+
+#define DrACurDkNm ((nameBuf)0x841e)
+#define DrBCurDkNm ((nameBuf)0x8430)
+#define dataFileName ((nameBuf)0x8442)
+#define dataDiskName ((nameBuf)0x8453)
+#define PrntFileName ((nameBuf)0x8465)
+#define PrntDiskName ((nameBuf)0x8476)
+
+#define curDrive (*(char*)0x8489)
+#define diskOpenFlg (*(char*)0x848a)
+#define isGEOS (*(char*)0x848b)
+#define interleave (*(char*)0x848c)
+#define NUMDRV (*(char*)0x848d)
+
+#define driveType ((char[4])0x848e)
+#define turboFlags ((char[4])0x8492)
+
+#define VLIRInfo (*(struct VLIR_info*)0x8496)
+
+#define appMain (*(void_func*)0x849b)
+#define intTopVector (*(void_func*)0x849d)
+#define intBotVector (*(void_func*)0x849f)
+#define mouseVector (*(void_func*)0x84a1)
+#define keyVector (*(void_func*)0x84a3)
+#define inputVector (*(void_func*)0x84a5)
+#define mouseFaultVec (*(void_func*)0x84a7)
+#define otherPressVec (*(void_func*)0x84a9)
+#define StringFaultVec (*(void_func*)0x84ab)
+#define alarmTmtVector (*(void_func*)0x84ad)
+#define BRKVector (*(void_func*)0x84af)
+#define RecoverVector (*(void_func*)0x84b1)
+
+#define selectionFlash (*(char*)0x84b3)
+#define alphaFlag (*(char*)0x84b4)
+#define iconSelFlg (*(char*)0x84b5)
+#define faultData (*(char*)0x84b6)
+#define menuNumber (*(char*)0x84b7)
+#define mouseWindow (*(struct window*)0x84b8)
+#define stringXY (*(struct pixel*)0x84be)
+#define mousePicData (*(char*)0x84c1)
+
+#define maxMouseSpeed (*(char*)0x8501)
+#define minMouseSpeed (*(char*)0x8502)
+#define mouseAccel (*(char*)0x8503)
+#define keyData (*(char*)0x8504)
+#define mouseData (*(char*)0x8505)
+#define inputData (*(char*)0x8506)
+#define mouseSpeed (*(char*)0x8507)
+#define random (*(char*)0x850a)
+#define saveFontTab (*(struct fontdesc*)0x850c)
+
+#define dblClickCount (*(char*)0x8515)
+#define system_date (*(struct s_date*)0x8516)
+#define alarmSetFlag (*(char*)0x851c)
+#define sysDBData (*(char*)0x851d)
+#define screencolors (*(char*)0x851e)
+#define dlgBoxRamBuf (*(char*)0x851f)
+
+#define savedmoby2 (*(char*)0x88bb)
+#define scr80polar (*(char*)0x88bc)
+#define scr80colors (*(char*)0x88bd)
+#define vdcClrMode (*(char*)0x88be)
+#define driveData ((char[4])0x88bf)
+#define ramExpSize (*(char*)0x88c3)
+#define sysRAMFlg (*(char*)0x88c4)
+#define firstBoot (*(char*)0x88c5)
+#define curType (*(char*)0x88c6)
+#define ramBase (*(char*)0x88c7)
+#define inputDevName ((nameBuf)0x88cb)
+#define DrCCurDkNm ((nameBuf)0x88dc)
+#define DrDCurDkNm ((nameBuf)0x88ee)
+#define dir2Head ((blockBuf)0x8900)
+#define SPRITE_PICS ((char*)0x8a00)
+#define sprpic ((char[8][64])0x8a00)
+#define COLOR_MATRIX ((char[1000])0x8c00)
+#define objPointer ((char[8])0x8ff8)
+
+#define DISK_BASE ((char*)0x9000)
+#define SCREEN_BASE ((char*)0xa000)
+#define OS_ROM ((char*)0xc000)
+#define OS_JUMPTAB ((char*)0xc100)
+#define EXP_BASE ((char*)0xdf00)
+#define MOUSE_BASE_128 ((char*)0xfd00)
+#define MOUSE_JMP_128 ((char*)0xfd00)
+#define END_MOUSE_128 ((char*)0xfe80)
+#define MOUSE_BASE ((char*)0xfe80)
+#define MOUSE_JMP ((char*)0xfe80)
+
+#define config (*(char*)0xff00)
+#define END_MOUSE ((char*)0xfffa)
+
+#define NMI_VECTOR (*(void_func*)0xfffa)
+#define RESET_VECTOR (*(void_func*)0xfffc)
+#define IRQ_VECTOR (*(void_func*)0xfffe)
+
+#define vicbase ((char*)0xd000)
+#define sidbase ((char*)0xd400)
+#define mmu ((char*)0xd500)
+#define VDC ((char*)0xd600)
+#define ctab ((char*)0xd800)
+#define cia1base ((char*)0xdc00)
+#define cia2base ((char*)0xdd00)
+
+#define mob0xpos (*(char*)0xd000)
+#define mob0ypos (*(char*)0xd001)
+#define mob1xpos (*(char*)0xd002)
+#define mob1ypos (*(char*)0xd003)
+#define mob2xpos (*(char*)0xd004)
+#define mob2ypos (*(char*)0xd005)
+#define mob3xpos (*(char*)0xd006)
+#define mob3ypos (*(char*)0xd007)
+#define mob4xpos (*(char*)0xd008)
+#define mob4ypos (*(char*)0xd009)
+#define mob5xpos (*(char*)0xd00a)
+#define mob5ypos (*(char*)0xd00b)
+#define mob6xpos (*(char*)0xd00c)
+#define mob6ypos (*(char*)0xd00d)
+#define mob7xpos (*(char*)0xd00e)
+#define mob7ypos (*(char*)0xd00f)
+#define msbxpos (*(char*)0xd010)
+#define grcntrl1 (*(char*)0xd011)
+#define rasreg (*(char*)0xd012)
+#define lpxpos (*(char*)0xd013)
+#define lpypos (*(char*)0xd014)
+#define mobenble (*(char*)0xd015)
+#define grcntrl2 (*(char*)0xd016)
+#define grmemptr (*(char*)0xd018)
+#define grirq (*(char*)0xd019)
+#define grirqen (*(char*)0xd01a)
+#define moby2 (*(char*)0xd017)
+#define mobprior (*(char*)0xd01b)
+#define mobmcm (*(char*)0xd01c)
+#define mobx2 (*(char*)0xd01d)
+#define mobmobcol (*(char*)0xd01e)
+#define mobbakcol (*(char*)0xd01f)
+#define extclr (*(char*)0xd020)
+#define bakclr0 (*(char*)0xd021)
+#define bakclr1 (*(char*)0xd022)
+#define bakclr2 (*(char*)0xd023)
+#define bakclr3 (*(char*)0xd024)
+#define mcmclr0 (*(char*)0xd025)
+#define mcmclr1 (*(char*)0xd026)
+#define mob0clr (*(char*)0xd027)
+#define mob1clr (*(char*)0xd028)
+#define mob2clr (*(char*)0xd029)
+#define mob3clr (*(char*)0xd02a)
+#define mob4clr (*(char*)0xd02b)
+#define mob5clr (*(char*)0xd02c)
+#define mob6clr (*(char*)0xd02d)
+#define mob7clr (*(char*)0xd02e)
+#define keyreg (*(char*)0xd02f)
+#define clkreg (*(char*)0xd030)
+
+#define vdcreg (*(char*)0xd600)
+#define vdcdata (*(char*)0xd601)
#else /* #ifdef __GEOS_CBM__ */
-#define nameBuf char[16]
-#define blockBuf char[512]
-
-#define R_BASE 0x00
-
-#define curPattern (*(unsigned*)0x022c)
-#define string (*(unsigned*)0x53)
-#define curFontDesc (*(struct fontdesc*)0x0218)
-#define currentMode (*(char*)0x021c)
-#define dispBufferOn (*(char*)0x021d)
-#define mouseOn (*(char*)0x5d)
-#define curWindow (*(struct window*)0x021e)
-#define pressFlag (*(char*)0x08fe)
-#define mousePos (*(struct pixel*)0x0241)
-#define returnAddress (*(unsigned*)0x64)
-
-#define diskBlkBuf ((blockBuf)0xf659)
-#define fileHeader (*(struct fileheader*)0xf859)
-#define curDirHead ((char[39])0xfa80)
-#define dirEntryBuf (*(struct filehandle*)0xfa59)
-
-#define DrACurDkNm ((nameBuf)0xfaa7)
-#define DrBCurDkNm ((nameBuf)0xfab7)
-#define dataFileName ((nameBuf)0x02a4)
-#define dataDiskName ((nameBuf)0x02b4)
-#define PrntFileName ((nameBuf)0x08ac)
-
-#define curDrive (*(char*)0xf60d)
-#define diskOpenFlg (*(char*)0xf617)
-#define NUMDRV (*(char*)0xf60e)
-
-#define driveType ((char[4])0xfaf3)
-
-#define VLIRInfo (*(struct VLIR_info*)0xf618)
-
-#define appMain (*(void_func*)0x0200)
-#define intTopVector (*(void_func*)0x0202)
-#define intBotVector (*(void_func*)0x0204)
-#define mouseVector (*(void_func*)0x0206)
-#define keyVector (*(void_func*)0x0208)
-#define inputVector (*(void_func*)0x020a)
-#define mouseFaultVec (*(void_func*)0x020c)
-#define otherPressVec (*(void_func*)0x020e)
-#define StringFaultVec (*(void_func*)0x0210)
-#define alarmTmtVector (*(void_func*)0x0212)
-#define BRKVector (*(void_func*)0x0214)
-#define RecoverVector (*(void_func*)0x0216)
-
-#define selectionFlash (*(char*)0x0224)
-#define alphaFlag (*(char*)0x0225)
-#define iconSelFlg (*(char*)0x0226)
-#define faultData (*(char*)0x0227)
-#define menuNumber (*(char*)0x0228)
-#define mouseWindow (*(struct window*)0x57)
-#define stringXY (*(struct pixel*)0x022e)
-
-#define maxMouseSpeed (*(char*)0x027d)
-#define minMouseSpeed (*(char*)0x027e)
-#define mouseAccel (*(char*)0x027f)
-#define keyData (*(char*)0x0245)
-#define mouseData (*(char*)0x0246)
-#define inputData (*(char*)0x0247)
-#define random (*(char*)0x024c)
-#define saveFontTab (*(struct fontdesc*)0x024e)
-
-#define dblClickCount (*(char*)0x0258)
-#define system_date (*(struct s_date*)0xf200)
-#define sysDBData (*(char*)0x0259)
-#define dlgBoxRamBuf (*(char*)0xf381)
-
-#define firstBoot (*(char*)0x0281)
-#define inputDevName ((nameBuf)0x08cc)
-#define DrCCurDkNm ((nameBuf)0xfac7)
-#define DrDCurDkNm ((nameBuf)0xfad7)
-
-#define mobenble (*(char*)0x0818)
-#define moby2 (*(char*)0x081a)
-#define mobx2 (*(char*)0x0819)
+#define nameBuf char[16]
+#define blockBuf char[512]
+
+#define R_BASE 0x00
+
+#define curPattern (*(unsigned*)0x022c)
+#define string (*(unsigned*)0x53)
+#define curFontDesc (*(struct fontdesc*)0x0218)
+#define currentMode (*(char*)0x021c)
+#define dispBufferOn (*(char*)0x021d)
+#define mouseOn (*(char*)0x5d)
+#define curWindow (*(struct window*)0x021e)
+#define pressFlag (*(char*)0x08fe)
+#define mousePos (*(struct pixel*)0x0241)
+#define returnAddress (*(unsigned*)0x64)
+
+#define diskBlkBuf ((blockBuf)0xf659)
+#define fileHeader (*(struct fileheader*)0xf859)
+#define curDirHead ((char[39])0xfa80)
+#define dirEntryBuf (*(struct filehandle*)0xfa59)
+
+#define DrACurDkNm ((nameBuf)0xfaa7)
+#define DrBCurDkNm ((nameBuf)0xfab7)
+#define dataFileName ((nameBuf)0x02a4)
+#define dataDiskName ((nameBuf)0x02b4)
+#define PrntFileName ((nameBuf)0x08ac)
+
+#define curDrive (*(char*)0xf60d)
+#define diskOpenFlg (*(char*)0xf617)
+#define NUMDRV (*(char*)0xf60e)
+
+#define driveType ((char[4])0xfaf3)
+
+#define VLIRInfo (*(struct VLIR_info*)0xf618)
+
+#define appMain (*(void_func*)0x0200)
+#define intTopVector (*(void_func*)0x0202)
+#define intBotVector (*(void_func*)0x0204)
+#define mouseVector (*(void_func*)0x0206)
+#define keyVector (*(void_func*)0x0208)
+#define inputVector (*(void_func*)0x020a)
+#define mouseFaultVec (*(void_func*)0x020c)
+#define otherPressVec (*(void_func*)0x020e)
+#define StringFaultVec (*(void_func*)0x0210)
+#define alarmTmtVector (*(void_func*)0x0212)
+#define BRKVector (*(void_func*)0x0214)
+#define RecoverVector (*(void_func*)0x0216)
+
+#define selectionFlash (*(char*)0x0224)
+#define alphaFlag (*(char*)0x0225)
+#define iconSelFlg (*(char*)0x0226)
+#define faultData (*(char*)0x0227)
+#define menuNumber (*(char*)0x0228)
+#define mouseWindow (*(struct window*)0x57)
+#define stringXY (*(struct pixel*)0x022e)
+
+#define maxMouseSpeed (*(char*)0x027d)
+#define minMouseSpeed (*(char*)0x027e)
+#define mouseAccel (*(char*)0x027f)
+#define keyData (*(char*)0x0245)
+#define mouseData (*(char*)0x0246)
+#define inputData (*(char*)0x0247)
+#define random (*(char*)0x024c)
+#define saveFontTab (*(struct fontdesc*)0x024e)
+
+#define dblClickCount (*(char*)0x0258)
+#define system_date (*(struct s_date*)0xf200)
+#define sysDBData (*(char*)0x0259)
+#define dlgBoxRamBuf (*(char*)0xf381)
+
+#define firstBoot (*(char*)0x0281)
+#define inputDevName ((nameBuf)0x08cc)
+#define DrCCurDkNm ((nameBuf)0xfac7)
+#define DrDCurDkNm ((nameBuf)0xfad7)
+
+#define mobenble (*(char*)0x0818)
+#define moby2 (*(char*)0x081a)
+#define mobx2 (*(char*)0x0819)
#endif /* #ifdef __GEOS_CBM__ */
diff --git a/include/geos/gsys.h b/include/geos/gsys.h
index 493c2609f..284c38b63 100644
--- a/include/geos/gsys.h
+++ b/include/geos/gsys.h
@@ -4,7 +4,7 @@
by Maciej 'YTM/Elysium' Witkowiak
*/
-#ifndef _GSYS_H
+#ifndef _GSYS_H
#define _GSYS_H
void FirstInit(void);
@@ -27,24 +27,24 @@ char get_ostype(void);
/* possible return values of get_ostype, machine and version flags will
be combined with OR */
/* machine flags */
-#define GEOS64 0x00
+#define GEOS64 0x00
#define GEOS4 0x04 /* plus4 geos is not or'ed with version */
-#define GEOS128 0x80
+#define GEOS128 0x80
/* version flags */
-#define GEOS_V10 0x10
+#define GEOS_V10 0x10
#define GEOS_V11 0x11
-#define GEOS_V12 0x12 /* ??? not sure */
-#define GEOS_V20 0x20
-#define WHEELS 0x40 /* only Wheels? */
+#define GEOS_V12 0x12 /* ??? not sure */
+#define GEOS_V20 0x20
+#define WHEELS 0x40 /* only Wheels? */
char get_tv(void);
/* possible return values of get_tv, these flags will be combined
note that columns state can be changed during runtime and get_tv
always returns the current state */
-#define COLUMNS40 0x00
-#define COLUMNS80 0x01
-#define TV_PAL 0x00
-#define TV_NTSC 0x80
+#define COLUMNS40 0x00
+#define COLUMNS80 0x01
+#define TV_PAL 0x00
+#define TV_NTSC 0x80
#endif
diff --git a/include/iso646.h b/include/iso646.h
index 287bddc3b..18cf6e50d 100644
--- a/include/iso646.h
+++ b/include/iso646.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* iso646.h */
+/* iso646.h */
/* */
-/* Alternative spellings */
+/* Alternative spellings */
/* */
/* */
/* */
@@ -39,17 +39,17 @@
/* Operator tokens */
-#define and &&
-#define and_eq &=
-#define bitand &
-#define bitor |
-#define compl ~
-#define not !
-#define not_eq !=
-#define or ||
-#define or_eq |=
-#define xor ^
-#define xor_eq ^=
+#define and &&
+#define and_eq &=
+#define bitand &
+#define bitor |
+#define compl ~
+#define not !
+#define not_eq !=
+#define or ||
+#define or_eq |=
+#define xor ^
+#define xor_eq ^=
diff --git a/include/joystick.h b/include/joystick.h
index 2e6a3fefe..18b552f08 100644
--- a/include/joystick.h
+++ b/include/joystick.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* joystick.h */
+/* joystick.h */
/* */
-/* Read the joystick on systems that support it */
+/* Read the joystick on systems that support it */
/* */
/* */
/* */
@@ -52,8 +52,8 @@
#define JOY_ERR_NO_DEVICE 4 /* Device (hardware) not found */
/* Argument for the joy_read function */
-#define JOY_1 0
-#define JOY_2 1
+#define JOY_1 0
+#define JOY_2 1
/* The following codes are *indices* into the joy_masks array */
#define JOY_UP 0
@@ -83,7 +83,7 @@ extern const void joy_static_stddrv[];
/*****************************************************************************/
-/* Functions */
+/* Functions */
/*****************************************************************************/
diff --git a/include/joystick/joy-kernel.h b/include/joystick/joy-kernel.h
index d57ad5dc7..e617a43c5 100644
--- a/include/joystick/joy-kernel.h
+++ b/include/joystick/joy-kernel.h
@@ -68,7 +68,7 @@ typedef struct {
/* JOY kernel variables */
-extern joy_drv_header* joy_drv; /* Pointer to driver */
+extern joy_drv_header* joy_drv; /* Pointer to driver */
diff --git a/include/limits.h b/include/limits.h
index d02d52dca..23474c78c 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* limits.h */
+/* limits.h */
/* */
-/* Sizes of integer types */
+/* Sizes of integer types */
/* */
/* */
/* */
@@ -38,30 +38,30 @@
-#define CHAR_BIT 8
+#define CHAR_BIT 8
-#define SCHAR_MIN ((signed char) 0x80)
-#define SCHAR_MAX 127
+#define SCHAR_MIN ((signed char) 0x80)
+#define SCHAR_MAX 127
-#define UCHAR_MAX 255
+#define UCHAR_MAX 255
-#define CHAR_MIN 0
-#define CHAR_MAX 255
+#define CHAR_MIN 0
+#define CHAR_MAX 255
-#define SHRT_MIN ((short) 0x8000)
-#define SHRT_MAX 32767
+#define SHRT_MIN ((short) 0x8000)
+#define SHRT_MAX 32767
-#define USHRT_MAX 65535U
+#define USHRT_MAX 65535U
-#define INT_MIN ((int) 0x8000)
-#define INT_MAX 32767
+#define INT_MIN ((int) 0x8000)
+#define INT_MAX 32767
-#define UINT_MAX 65535U
+#define UINT_MAX 65535U
-#define LONG_MAX 2147483647L
-#define LONG_MIN ((long) 0x80000000)
+#define LONG_MAX 2147483647L
+#define LONG_MIN ((long) 0x80000000)
-#define ULONG_MAX 4294967295UL
+#define ULONG_MAX 4294967295UL
diff --git a/include/locale.h b/include/locale.h
index f099ad1d2..4134dd5db 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* locale.h */
+/* locale.h */
/* */
-/* Localization */
+/* Localization */
/* */
/* */
/* */
@@ -40,38 +40,38 @@
/* NULL pointer */
#ifndef _HAVE_NULL
-#define NULL 0
+#define NULL 0
#define _HAVE_NULL
#endif
/* Locale information constants */
-#define LC_ALL 0
-#define LC_COLLATE 1
-#define LC_CTYPE 2
-#define LC_MONETARY 3
-#define LC_NUMERIC 4
-#define LC_TIME 5
+#define LC_ALL 0
+#define LC_COLLATE 1
+#define LC_CTYPE 2
+#define LC_MONETARY 3
+#define LC_NUMERIC 4
+#define LC_TIME 5
/* Struct containing locale settings */
struct lconv {
- char* currency_symbol;
- char* decimal_point;
- char* grouping;
- char* int_curr_symbol;
- char* mon_decimal_point;
- char* mon_grouping;
- char* mon_thousands_sep;
- char* negative_sign;
- char* positive_sign;
- char* thousands_sep;
- char frac_digits;
- char int_frac_digits;
- char n_cs_precedes;
- char n_sep_by_space;
- char n_sign_posn;
- char p_cs_precedes;
- char p_sep_by_space;
- char p_sign_posn;
+ char* currency_symbol;
+ char* decimal_point;
+ char* grouping;
+ char* int_curr_symbol;
+ char* mon_decimal_point;
+ char* mon_grouping;
+ char* mon_thousands_sep;
+ char* negative_sign;
+ char* positive_sign;
+ char* thousands_sep;
+ char frac_digits;
+ char int_frac_digits;
+ char n_cs_precedes;
+ char n_sep_by_space;
+ char n_sign_posn;
+ char p_cs_precedes;
+ char p_sep_by_space;
+ char p_sign_posn;
};
/* Function prototypes */
diff --git a/include/lynx.h b/include/lynx.h
index ec1a8c464..e9c702994 100644
--- a/include/lynx.h
+++ b/include/lynx.h
@@ -46,7 +46,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
diff --git a/include/mouse.h b/include/mouse.h
index bfb0acad3..bc90263cf 100644
--- a/include/mouse.h
+++ b/include/mouse.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* mouse.h */
+/* mouse.h */
/* */
-/* Mouse API */
+/* Mouse API */
/* */
/* */
/* */
@@ -41,7 +41,7 @@
/*****************************************************************************/
-/* Definitions */
+/* Definitions */
/*****************************************************************************/
@@ -55,13 +55,13 @@
#define MOUSE_ERR_INV_IOCTL 5 /* Invalid ioctl code */
/* Mouse button masks */
-#define MOUSE_BTN_LEFT 0x10
+#define MOUSE_BTN_LEFT 0x10
#define MOUSE_BTN_RIGHT 0x01
/* Structure containing the mouse coordinates */
struct mouse_pos {
- int x;
- int y;
+ int x;
+ int y;
};
/* Structure containing information about the mouse */
@@ -72,10 +72,10 @@ struct mouse_info {
/* Structure used for getbox/setbox */
struct mouse_box {
- int minx;
- int miny;
- int maxx;
- int maxy;
+ int minx;
+ int miny;
+ int maxx;
+ int maxy;
};
/* Structure containing mouse callback functions. These functions are declared
@@ -113,7 +113,7 @@ extern const void mouse_static_stddrv[];
/*****************************************************************************/
-/* Functions */
+/* Functions */
/*****************************************************************************/
@@ -150,10 +150,10 @@ void __fastcall__ mouse_setbox (const struct mouse_box* box);
* NOTE: The function does *not* check if the mouse is currently inside the
* given margins. The proper way to use this function therefore is:
*
- * - Hide the mouse
- * - Set the bounding box
- * - Place the mouse at the desired position
- * - Show the mouse again.
+ * - Hide the mouse
+ * - Set the bounding box
+ * - Place the mouse at the desired position
+ * - Show the mouse again.
*
* NOTE2: When setting the box to something that is larger than the actual
* screen, the positioning of the mouse cursor can fail. If such margins
diff --git a/include/mouse/mouse-kernel.h b/include/mouse/mouse-kernel.h
index 1bcac64d5..f024b0926 100644
--- a/include/mouse/mouse-kernel.h
+++ b/include/mouse/mouse-kernel.h
@@ -45,7 +45,7 @@
/* Mouse kernel variables */
-extern void* mouse_drv; /* Pointer to driver */
+extern void* mouse_drv; /* Pointer to driver */
diff --git a/include/nes.h b/include/nes.h
index 46219b3de..3ad442280 100644
--- a/include/nes.h
+++ b/include/nes.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* nes.h */
+/* nes.h */
/* */
-/* NES system specific definitions */
+/* NES system specific definitions */
/* */
/* */
/* */
diff --git a/include/o65.h b/include/o65.h
index e33f98d97..2321cfe10 100644
--- a/include/o65.h
+++ b/include/o65.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* o65.h */
+/* o65.h */
/* */
-/* Definitions for the o65 file format */
+/* Definitions for the o65 file format */
/* */
/* */
/* */
@@ -57,9 +57,9 @@ typedef struct o65_header o65_header;
struct o65_header {
char marker[2]; /* Non-C64 marker */
char magic[3]; /* o65 magic */
- char version; /* Version number */
+ char version; /* Version number */
unsigned mode; /* Mode word */
- o65_size tbase; /* Original text (code) segment address */
+ o65_size tbase; /* Original text (code) segment address */
o65_size tlen; /* Size of text (code) segment */
o65_size dbase; /* Original data segment address */
o65_size dlen; /* Size of data segment */
@@ -81,7 +81,7 @@ struct o65_header {
#define O65_VERSION 0x00
/* Defines for the mode word */
-#define O65_CPU_65816 0x8000 /* Executable is for 65816 */
+#define O65_CPU_65816 0x8000 /* Executable is for 65816 */
#define O65_CPU_6502 0x0000 /* Executable is for the 6502 */
#define O65_CPU_MASK 0x8000 /* Mask to extract CPU type */
@@ -89,7 +89,7 @@ struct o65_header {
#define O65_RELOC_BYTE 0x0000 /* Byte wise relocation */
#define O65_RELOC_MASK 0x4000 /* Mask to extract relocation type */
-#define O65_SIZE_32BIT 0x2000 /* All size words are 32bit */
+#define O65_SIZE_32BIT 0x2000 /* All size words are 32bit */
#define O65_SIZE_16BIT 0x0000 /* All size words are 16bit */
#define O65_SIZE_MASK 0x2000 /* Mask to extract size */
@@ -108,7 +108,7 @@ struct o65_header {
#define O65_BSSZERO_MASK 0x0200 /* Mask to extract bss zero flag */
/* The following is used if O65_CPU == 6502 */
-#define O65_CPU2_6502 0x0000 /* Executable is for 6502 */
+#define O65_CPU2_6502 0x0000 /* Executable is for 6502 */
#define O65_CPU2_65C02 0x0010 /* Executable is for 65C02 */
#define O65_CPU2_65SC02 0x0020 /* Executable is for 65SC02 */
#define O65_CPU2_65CE02 0x0030 /* Executable is for 65CE02 */
@@ -131,12 +131,12 @@ struct o65_header {
O65_ALIGN_1)
/* The four o65 segment types. */
-#define O65_SEGID_UNDEF 0x00
-#define O65_SEGID_ABS 0x01
-#define O65_SEGID_TEXT 0x02
-#define O65_SEGID_DATA 0x03
-#define O65_SEGID_BSS 0x04
-#define O65_SEGID_ZP 0x05
+#define O65_SEGID_UNDEF 0x00
+#define O65_SEGID_ABS 0x01
+#define O65_SEGID_TEXT 0x02
+#define O65_SEGID_DATA 0x03
+#define O65_SEGID_BSS 0x04
+#define O65_SEGID_ZP 0x05
#define O65_SEGID_MASK 0x07
/* Relocation type codes */
@@ -158,14 +158,14 @@ struct o65_header {
/* Option tags */
#define O65_OPT_FILENAME 0
-#define O65_OPT_OS 1
-#define O65_OPT_ASM 2
-#define O65_OPT_AUTHOR 3
-#define O65_OPT_TIMESTAMP 4
+#define O65_OPT_OS 1
+#define O65_OPT_ASM 2
+#define O65_OPT_AUTHOR 3
+#define O65_OPT_TIMESTAMP 4
/* Operating system codes for O65_OPT_OS */
-#define O65_OS_OSA65 1
-#define O65_OS_LUNIX 2
+#define O65_OS_OSA65 1
+#define O65_OS_LUNIX 2
#define O65_OS_CC65 3
#define O65_OS_OPENCBM 4
diff --git a/include/pet.h b/include/pet.h
index 24e937c5a..0588ee8bf 100644
--- a/include/pet.h
+++ b/include/pet.h
@@ -2,7 +2,7 @@
/* */
/* pet.h */
/* */
-/* PET system specific definitions */
+/* PET system specific definitions */
/* */
/* */
/* */
@@ -52,8 +52,8 @@
/* Color defines */
-#define COLOR_BLACK 0x00
-#define COLOR_WHITE 0x01
+#define COLOR_BLACK 0x00
+#define COLOR_WHITE 0x01
/* Define hardware */
#include <_pia.h>
diff --git a/include/plus4.h b/include/plus4.h
index 3a764b984..840e8b342 100644
--- a/include/plus4.h
+++ b/include/plus4.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* plus4.h */
+/* plus4.h */
/* */
-/* Plus/4 system specific definitions */
+/* Plus/4 system specific definitions */
/* */
/* */
/* */
diff --git a/include/serial.h b/include/serial.h
index b5601170e..f88ab114e 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -39,51 +39,51 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/* Baudrate settings */
#define SER_BAUD_45_5 0x00
-#define SER_BAUD_50 0x01
+#define SER_BAUD_50 0x01
#define SER_BAUD_75 0x02
-#define SER_BAUD_110 0x03
-#define SER_BAUD_134_5 0x04
+#define SER_BAUD_110 0x03
+#define SER_BAUD_134_5 0x04
#define SER_BAUD_150 0x05
-#define SER_BAUD_300 0x06
-#define SER_BAUD_600 0x07
-#define SER_BAUD_1200 0x08
+#define SER_BAUD_300 0x06
+#define SER_BAUD_600 0x07
+#define SER_BAUD_1200 0x08
#define SER_BAUD_1800 0x09
-#define SER_BAUD_2400 0x0A
+#define SER_BAUD_2400 0x0A
#define SER_BAUD_3600 0x0B
-#define SER_BAUD_4800 0x0C
+#define SER_BAUD_4800 0x0C
#define SER_BAUD_7200 0x0D
-#define SER_BAUD_9600 0x0E
-#define SER_BAUD_19200 0x0F
-#define SER_BAUD_38400 0x10
-#define SER_BAUD_57600 0x11
-#define SER_BAUD_115200 0x12
-#define SER_BAUD_230400 0x13
-#define SER_BAUD_31250 0x14
-#define SER_BAUD_62500 0x15
+#define SER_BAUD_9600 0x0E
+#define SER_BAUD_19200 0x0F
+#define SER_BAUD_38400 0x10
+#define SER_BAUD_57600 0x11
+#define SER_BAUD_115200 0x12
+#define SER_BAUD_230400 0x13
+#define SER_BAUD_31250 0x14
+#define SER_BAUD_62500 0x15
/* Data bit settings */
-#define SER_BITS_5 0x00
-#define SER_BITS_6 0x01
-#define SER_BITS_7 0x02
-#define SER_BITS_8 0x03
+#define SER_BITS_5 0x00
+#define SER_BITS_6 0x01
+#define SER_BITS_7 0x02
+#define SER_BITS_8 0x03
/* Stop bit settings */
-#define SER_STOP_1 0x00 /* One stop bit */
-#define SER_STOP_2 0x01 /* Two stop bits */
+#define SER_STOP_1 0x00 /* One stop bit */
+#define SER_STOP_2 0x01 /* Two stop bits */
/* Parity settings */
-#define SER_PAR_NONE 0x00
-#define SER_PAR_ODD 0x01
-#define SER_PAR_EVEN 0x02
-#define SER_PAR_MARK 0x03
-#define SER_PAR_SPACE 0x04
+#define SER_PAR_NONE 0x00
+#define SER_PAR_ODD 0x01
+#define SER_PAR_EVEN 0x02
+#define SER_PAR_MARK 0x03
+#define SER_PAR_SPACE 0x04
/* Handshake settings. The latter two may be combined. */
#define SER_HS_NONE 0x00 /* No handshake */
@@ -93,22 +93,22 @@
/* Bit masks to mask out things from the status returned by ser_status.
* These are 6551 specific and must be mapped by drivers for other chips.
*/
-#define SER_STATUS_PE 0x01 /* Parity error */
-#define SER_STATUS_FE 0x02 /* Framing error */
-#define SER_STATUS_OE 0x04 /* Overrun error */
-#define SER_STATUS_DCD 0x20 /* NOT data carrier detect */
-#define SER_STATUS_DSR 0x40 /* NOT data set ready */
+#define SER_STATUS_PE 0x01 /* Parity error */
+#define SER_STATUS_FE 0x02 /* Framing error */
+#define SER_STATUS_OE 0x04 /* Overrun error */
+#define SER_STATUS_DCD 0x20 /* NOT data carrier detect */
+#define SER_STATUS_DSR 0x40 /* NOT data set ready */
/* Error codes returned by all functions */
-#define SER_ERR_OK 0x00 /* Not an error - relax */
+#define SER_ERR_OK 0x00 /* Not an error - relax */
#define SER_ERR_NO_DRIVER 0x01 /* No driver available */
#define SER_ERR_CANNOT_LOAD 0x02 /* Error loading driver */
#define SER_ERR_INV_DRIVER 0x03 /* Invalid driver */
#define SER_ERR_NO_DEVICE 0x04 /* Device (hardware) not found */
-#define SER_ERR_BAUD_UNAVAIL 0x05 /* Baud rate not available */
-#define SER_ERR_NO_DATA 0x06 /* Nothing to read */
-#define SER_ERR_OVERFLOW 0x07 /* No room in send buffer */
-#define SER_ERR_INIT_FAILED 0x08 /* Initialization failed */
+#define SER_ERR_BAUD_UNAVAIL 0x05 /* Baud rate not available */
+#define SER_ERR_NO_DATA 0x06 /* Nothing to read */
+#define SER_ERR_OVERFLOW 0x07 /* No room in send buffer */
+#define SER_ERR_INIT_FAILED 0x08 /* Initialization failed */
#define SER_ERR_INV_IOCTL 0x09 /* IOCTL not supported */
#define SER_ERR_INSTALLED 0x0A /* A driver is already installed */
@@ -123,7 +123,7 @@ struct ser_params {
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/setjmp.h b/include/setjmp.h
index 0befe8163..460829e38 100644
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* setjmp.h */
+/* setjmp.h */
/* */
-/* Nonlocal jumps */
+/* Nonlocal jumps */
/* */
/* */
/* */
@@ -43,7 +43,7 @@ typedef char jmp_buf [5];
int __fastcall__ _setjmp (jmp_buf buf);
-#define setjmp _setjmp /* ISO insists on a macro */
+#define setjmp _setjmp /* ISO insists on a macro */
void __fastcall__ longjmp (jmp_buf buf, int retval) __attribute__((noreturn));
diff --git a/include/stdarg.h b/include/stdarg.h
index 4fd822b2a..adf73483c 100644
--- a/include/stdarg.h
+++ b/include/stdarg.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* stdarg.h */
+/* stdarg.h */
/* */
-/* Variable arguments */
+/* Variable arguments */
/* */
/* */
/* */
@@ -40,10 +40,10 @@
typedef unsigned char* va_list;
-#define va_start(ap, fix) ap = ((va_list)&(fix))
-#define va_arg(ap,type) (*(type*)(ap -= ((sizeof (type) + 1) & ~1)))
+#define va_start(ap, fix) ap = ((va_list)&(fix))
+#define va_arg(ap,type) (*(type*)(ap -= ((sizeof (type) + 1) & ~1)))
#if __CC65_STD__ >= __CC65_STD_C99__
-#define va_copy(dest, src) ((dest)=(src))
+#define va_copy(dest, src) ((dest)=(src))
#endif
#define va_end(ap)
diff --git a/include/stdbool.h b/include/stdbool.h
index 638d35a58..137dde708 100644
--- a/include/stdbool.h
+++ b/include/stdbool.h
@@ -1,9 +1,9 @@
/*****************************************************************************/
/* */
-/* stdbool.h */
-/* */
-/* C99 Boolean definitions */
-/* */
+/* stdbool.h */
+/* */
+/* C99 Boolean definitions */
+/* */
/* */
/* */
/* (C) 2002 Greg King */
@@ -11,20 +11,20 @@
/* */
/* This software is provided "as-is," without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
-/* arising from the use of this software. */
-/* */
+/* arising from the use of this software. */
+/* */
/* Permission is granted to anyone to use this software for any purpose, */
-/* including commercial applications, and to alter and redistribute it */
-/* freely, subject to the following restrictions: */
-/* */
+/* including commercial applications, and to alter and redistribute it */
+/* freely, subject to the following restrictions: */
+/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
-/* in a product, an acknowledgment, in the product's documentation, */
-/* would be appreciated, but is not required. */
-/* 2. Alterred source versions must be marked plainly as such, */
-/* and must not be misrepresented as being the original software. */
-/* 3. This notice may not be removed or alterred */
-/* from any source distribution. */
+/* in a product, an acknowledgment, in the product's documentation, */
+/* would be appreciated, but is not required. */
+/* 2. Alterred source versions must be marked plainly as such, */
+/* and must not be misrepresented as being the original software. */
+/* 3. This notice may not be removed or alterred */
+/* from any source distribution. */
/*****************************************************************************/
diff --git a/include/stddef.h b/include/stddef.h
index eff0c55bd..3230a32b0 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* stddef.h */
+/* stddef.h */
/* */
-/* Common definitions */
+/* Common definitions */
/* */
/* */
/* */
@@ -54,12 +54,12 @@ typedef unsigned size_t;
/* NULL pointer */
#ifndef _HAVE_NULL
-#define NULL 0
+#define NULL 0
#define _HAVE_NULL
#endif
/* offsetof macro */
-#define offsetof(type, member) (size_t) (&((type*) 0)->member)
+#define offsetof(type, member) (size_t) (&((type*) 0)->member)
diff --git a/include/stdio.h b/include/stdio.h
index c29fa4901..6f2f9c3f8 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* stdio.h */
+/* stdio.h */
/* */
-/* Input/output */
+/* Input/output */
/* */
/* */
/* */
@@ -57,33 +57,33 @@ extern FILE* stdout;
extern FILE* stderr;
/* Standard defines */
-#define _IOFBF 0
-#define _IOLBF 1
-#define _IONBF 2
-#define BUFSIZ 256
-#define EOF -1
-#define FOPEN_MAX 8
-#define SEEK_CUR 0
-#define SEEK_END 1
-#define SEEK_SET 2
-#define TMP_MAX 256
+#define _IOFBF 0
+#define _IOLBF 1
+#define _IONBF 2
+#define BUFSIZ 256
+#define EOF -1
+#define FOPEN_MAX 8
+#define SEEK_CUR 0
+#define SEEK_END 1
+#define SEEK_SET 2
+#define TMP_MAX 256
/* Standard defines that are platform dependent */
#if defined(__APPLE2__) || defined(__APPLE2ENH__)
-# define FILENAME_MAX (64+1)
+# define FILENAME_MAX (64+1)
#elif defined(__ATARI__)
-# define FILENAME_MAX (12+1)
+# define FILENAME_MAX (12+1)
#elif defined(__LUNIX__)
# define FILENAME_MAX (80+1)
#else
# define FILENAME_MAX (16+1)
#endif
-#define L_tmpnam FILENAME_MAX
+#define L_tmpnam FILENAME_MAX
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
@@ -132,14 +132,14 @@ int __fastcall__ vsscanf (const char* s, const char* format, va_list ap);
int __fastcall__ vfscanf (FILE* f, const char* format, va_list ap);
#if __CC65_STD__ == __CC65_STD_CC65__
-FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */
-int __fastcall__ fileno (FILE* f); /* Unix */
+FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */
+int __fastcall__ fileno (FILE* f); /* Unix */
#endif
-void __fastcall__ _poserror (const char* msg); /* cc65 */
+void __fastcall__ _poserror (const char* msg); /* cc65 */
/* Masking macros for some functions */
-#define getc(f) fgetc (f) /* ANSI */
-#define putc(c, f) fputc (c, f) /* ANSI */
+#define getc(f) fgetc (f) /* ANSI */
+#define putc(c, f) fputc (c, f) /* ANSI */
diff --git a/include/stdlib.h b/include/stdlib.h
index 57e7f6166..026e19198 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* stdlib.h */
+/* stdlib.h */
/* */
-/* General utilities */
+/* General utilities */
/* */
/* */
/* */
@@ -45,8 +45,8 @@ typedef unsigned size_t;
#endif
/* Standard exit codes */
-#define EXIT_SUCCESS 0
-#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
/* Return type of the div function */
typedef struct {
@@ -94,7 +94,7 @@ size_t _heapmaxavail (void);
/* Random numbers */
-#define RAND_MAX 0x7FFF
+#define RAND_MAX 0x7FFF
int rand (void);
void __fastcall__ srand (unsigned seed);
void _randomize (void); /* Non-standard */
@@ -107,12 +107,12 @@ int __fastcall__ atoi (const char* s);
long __fastcall__ atol (const char* s);
int __fastcall__ atexit (void (*exitfunc) (void));
void* __fastcall__ bsearch (const void* key, const void* base, size_t n,
- size_t size, int (*cmp) (const void*, const void*));
+ size_t size, int (*cmp) (const void*, const void*));
div_t __fastcall__ div (int numer, int denom);
void __fastcall__ exit (int ret) __attribute__ ((noreturn));
char* __fastcall__ getenv (const char* name);
void __fastcall__ qsort (void* base, size_t count, size_t size,
- int (*compare) (const void*, const void*));
+ int (*compare) (const void*, const void*));
long __fastcall__ strtol (const char* nptr, char** endptr, int base);
unsigned long __fastcall__ strtoul (const char* nptr, char** endptr, int base);
int __fastcall__ system (const char* s);
diff --git a/include/string.h b/include/string.h
index 7eb69959c..19cfba27e 100644
--- a/include/string.h
+++ b/include/string.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* string.h */
+/* string.h */
/* */
-/* String handling */
+/* String handling */
/* */
/* */
/* */
@@ -72,7 +72,7 @@ void* __fastcall__ _bzero (void* ptr, size_t n);
/* Non standard: */
#if __CC65_STD__ == __CC65_STD_CC65__
void __fastcall__ bzero (void* ptr, size_t n); /* BSD */
-char* __fastcall__ strdup (const char* s); /* SYSV/BSD */
+char* __fastcall__ strdup (const char* s); /* SYSV/BSD */
int __fastcall__ stricmp (const char* s1, const char* s2); /* DOS/Windows */
int __fastcall__ strcasecmp (const char* s1, const char* s2); /* Same for Unix */
int __fastcall__ strnicmp (const char* s1, const char* s2, size_t count); /* DOS/Windows */
diff --git a/include/supervision.h b/include/supervision.h
index 85748e0a2..332fe973b 100644
--- a/include/supervision.h
+++ b/include/supervision.h
@@ -2,7 +2,7 @@
/* */
/* supervision.h */
/* */
-/* Supervision specific definitions */
+/* Supervision specific definitions */
/* */
/* */
/* */
@@ -11,20 +11,20 @@
/* */
/* This software is provided "as-is," without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
-/* arising from the use of this software. */
-/* */
+/* arising from the use of this software. */
+/* */
/* Permission is granted to anyone to use this software for any purpose, */
-/* including commercial applications, and to alter and redistribute it */
-/* freely, subject to the following restrictions: */
-/* */
+/* including commercial applications, and to alter and redistribute it */
+/* freely, subject to the following restrictions: */
+/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
-/* in a product, an acknowledgment, in the product's documentation, */
-/* would be appreciated, but is not required. */
-/* 2. Alterred source versions must be marked plainly as such, */
-/* and must not be misrepresented as being the original software. */
-/* 3. This notice may not be removed or alterred */
-/* from any source distribution. */
+/* in a product, an acknowledgment, in the product's documentation, */
+/* would be appreciated, but is not required. */
+/* 2. Alterred source versions must be marked plainly as such, */
+/* and must not be misrepresented as being the original software. */
+/* 3. This notice may not be removed or alterred */
+/* from any source distribution. */
/* */
/*****************************************************************************/
@@ -43,7 +43,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -89,8 +89,8 @@ struct __sv_dma {
#define SV_BANK (*(unsigned char*)0x2026)
#define SV_BANK_COMBINE(nmi,irq_timer,irq_dma,lcd_on, timer_prescale, bank) \
- ((nmi)?1:0)|((irq_timer)?2:0)|((irq_dma)?4:0)|((lcd_on)?8:0) \
- |((timer_prescale)?0x10:0)|((bank)<<5)
+ ((nmi)?1:0)|((irq_timer)?2:0)|((irq_dma)?4:0)|((lcd_on)?8:0) \
+ |((timer_prescale)?0x10:0)|((bank)<<5)
#define SV_VIDEO ((unsigned char*)0x4000)
#define SV_TIMER_COUNT (*(unsigned char*)0x2023)
diff --git a/include/sys/types.h b/include/sys/types.h
index 087bff5d8..9b1e9610f 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -39,7 +39,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -53,7 +53,7 @@ typedef long int off_t;
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/sys/utsname.h b/include/sys/utsname.h
index 0cf2cc4b4..28feecc46 100644
--- a/include/sys/utsname.h
+++ b/include/sys/utsname.h
@@ -39,7 +39,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -80,7 +80,7 @@ struct utsname {
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/tgi.h b/include/tgi.h
index 661403370..a43eb0cc3 100644
--- a/include/tgi.h
+++ b/include/tgi.h
@@ -70,7 +70,7 @@ typedef struct tgi_vectorfont tgi_vectorfont;
/*****************************************************************************/
-/* Functions */
+/* Functions */
/*****************************************************************************/
diff --git a/include/tgi/tgi-error.h b/include/tgi/tgi-error.h
index e8dd9c236..334feaa1f 100644
--- a/include/tgi/tgi-error.h
+++ b/include/tgi/tgi-error.h
@@ -39,7 +39,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -50,7 +50,7 @@
#define TGI_ERR_INV_DRIVER 3 /* Invalid driver */
#define TGI_ERR_INV_MODE 4 /* Mode not supported by driver */
#define TGI_ERR_INV_ARG 5 /* Invalid function argument */
-#define TGI_ERR_INV_FUNC 6 /* Function not supported */
+#define TGI_ERR_INV_FUNC 6 /* Function not supported */
#define TGI_ERR_INV_FONT 7 /* Font file is invalid */
#define TGI_ERR_NO_RES 8 /* Out of resources */
#define TGI_ERR_INSTALLED 9 /* A driver is already installed */
diff --git a/include/tgi/tgi-kernel.h b/include/tgi/tgi-kernel.h
index 3d0bbda84..8367e4453 100644
--- a/include/tgi/tgi-kernel.h
+++ b/include/tgi/tgi-kernel.h
@@ -39,13 +39,13 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/* TGI kernel variables */
-extern void* tgi_drv; /* Pointer to driver */
+extern void* tgi_drv; /* Pointer to driver */
extern unsigned char tgi_error; /* Last error code */
extern unsigned char tgi_gmode; /* Flag: Graphics mode active */
extern int tgi_curx; /* Current drawing cursor X */
diff --git a/include/tgi/tgi-vectorfont.h b/include/tgi/tgi-vectorfont.h
index bf36f8b0b..82513b271 100644
--- a/include/tgi/tgi-vectorfont.h
+++ b/include/tgi/tgi-vectorfont.h
@@ -39,7 +39,7 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
@@ -71,7 +71,7 @@ struct tgi_vectorfont {
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
diff --git a/include/time.h b/include/time.h
index a38508000..507d7e29a 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* time.h */
+/* time.h */
/* */
-/* Date and time */
+/* Date and time */
/* */
/* */
/* */
@@ -40,7 +40,7 @@
/* NULL pointer */
#ifndef _HAVE_NULL
-#define NULL 0
+#define NULL 0
#define _HAVE_NULL
#endif
@@ -55,7 +55,7 @@ typedef unsigned long clock_t;
/* Structure for broken down time */
struct tm {
- int tm_sec;
+ int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
@@ -79,32 +79,32 @@ extern struct _timezone {
#if defined(__ATARI__)
/* The clock depends on the video standard, so read it at runtime */
unsigned _clocks_per_sec (void);
-# define CLK_TCK _clocks_per_sec()
-# define CLOCKS_PER_SEC _clocks_per_sec()
+# define CLK_TCK _clocks_per_sec()
+# define CLOCKS_PER_SEC _clocks_per_sec()
#elif defined(__ATMOS__)
-# define CLK_TCK 100 /* POSIX */
-# define CLOCKS_PER_SEC 100 /* ANSI */
+# define CLK_TCK 100 /* POSIX */
+# define CLOCKS_PER_SEC 100 /* ANSI */
#elif defined(__CBM__)
# if defined(__CBM510__) || defined(__CBM610__)
/* The 510/610 gets its clock from the AC current */
-# define CLK_TCK 50 /* POSIX */
-# define CLOCKS_PER_SEC 50 /* ANSI */
+# define CLK_TCK 50 /* POSIX */
+# define CLOCKS_PER_SEC 50 /* ANSI */
# else
-# define CLK_TCK 60 /* POSIX */
-# define CLOCKS_PER_SEC 60 /* ANSI */
+# define CLK_TCK 60 /* POSIX */
+# define CLOCKS_PER_SEC 60 /* ANSI */
# endif
#elif defined(__NES__)
-# define CLK_TCK 50 /* POSIX */
-# define CLOCKS_PER_SEC 50 /* ANSI */
+# define CLK_TCK 50 /* POSIX */
+# define CLOCKS_PER_SEC 50 /* ANSI */
#elif defined(__GEOS__)
-# define CLK_TCK 1 /* POSIX */
-# define CLOCKS_PER_SEC 1 /* ANSI */
+# define CLK_TCK 1 /* POSIX */
+# define CLOCKS_PER_SEC 1 /* ANSI */
#elif defined(__LYNX__)
/* The clock-rate depends on the video scan-rate;
** so, read it at run-time. */
extern clock_t _clk_tck (void);
-# define CLK_TCK _clk_tck()
-# define CLOCKS_PER_SEC _clk_tck()
+# define CLK_TCK _clk_tck()
+# define CLOCKS_PER_SEC _clk_tck()
#endif
diff --git a/include/unistd.h b/include/unistd.h
index fb401be89..05b60f1fd 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -39,15 +39,15 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/* Predefined file handles */
-#define STDIN_FILENO 0
-#define STDOUT_FILENO 1
-#define STDERR_FILENO 2
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
/* WE need size_t */
#ifndef _HAVE_size_t
@@ -68,7 +68,7 @@ extern int optind, opterr, optopt;
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
@@ -77,12 +77,12 @@ extern int optind, opterr, optopt;
int __fastcall__ write (int fd, const void* buf, unsigned count);
int __fastcall__ read (int fd, void* buf, unsigned count);
off_t __fastcall__ lseek (int fd, off_t offset, int whence);
-int __fastcall__ unlink (const char* name); /* Same as remove() */
+int __fastcall__ unlink (const char* name); /* Same as remove() */
/* Directories */
int __fastcall__ chdir (const char* name);
char* __fastcall__ getcwd (char* buf, size_t size);
-int mkdir (const char* name, ...); /* May take a mode argument */
+int mkdir (const char* name, ...); /* May take a mode argument */
int __fastcall__ rmdir (const char* name);
/* Others */
diff --git a/include/vic20.h b/include/vic20.h
index 378e32b4e..c675de6d2 100644
--- a/include/vic20.h
+++ b/include/vic20.h
@@ -1,8 +1,8 @@
/*****************************************************************************/
/* */
-/* vic20.h */
+/* vic20.h */
/* */
-/* vic20 system specific definitions */
+/* vic20 system specific definitions */
/* */
/* */
/* */
@@ -46,55 +46,55 @@
/* Additional key defines */
-#define CH_F1 133
-#define CH_F2 137
-#define CH_F3 134
-#define CH_F4 138
-#define CH_F5 135
-#define CH_F6 139
-#define CH_F7 136
-#define CH_F8 140
+#define CH_F1 133
+#define CH_F2 137
+#define CH_F3 134
+#define CH_F4 138
+#define CH_F5 135
+#define CH_F6 139
+#define CH_F7 136
+#define CH_F8 140
/* Color defines */
-#define COLOR_BLACK 0x00
-#define COLOR_WHITE 0x01
-#define COLOR_RED 0x02
-#define COLOR_CYAN 0x03
-#define COLOR_VIOLET 0x04
-#define COLOR_GREEN 0x05
-#define COLOR_BLUE 0x06
-#define COLOR_YELLOW 0x07
-#define COLOR_ORANGE 0x08
-#define COLOR_BROWN 0x09
-#define COLOR_LIGHTRED 0x0A
-#define COLOR_GRAY1 0x0B
-#define COLOR_GRAY2 0x0C
-#define COLOR_LIGHTGREEN 0x0D
-#define COLOR_LIGHTBLUE 0x0E
-#define COLOR_GRAY3 0x0F
+#define COLOR_BLACK 0x00
+#define COLOR_WHITE 0x01
+#define COLOR_RED 0x02
+#define COLOR_CYAN 0x03
+#define COLOR_VIOLET 0x04
+#define COLOR_GREEN 0x05
+#define COLOR_BLUE 0x06
+#define COLOR_YELLOW 0x07
+#define COLOR_ORANGE 0x08
+#define COLOR_BROWN 0x09
+#define COLOR_LIGHTRED 0x0A
+#define COLOR_GRAY1 0x0B
+#define COLOR_GRAY2 0x0C
+#define COLOR_LIGHTGREEN 0x0D
+#define COLOR_LIGHTBLUE 0x0E
+#define COLOR_GRAY3 0x0F
/* Define hardware */
#include <_vic.h>
-#define VIC (*(struct __vic*)0x9000)
+#define VIC (*(struct __vic*)0x9000)
#include <_6522.h>
-#define VIA1 (*(struct __6522*)0x9110)
-#define VIA2 (*(struct __6522*)0x9120)
+#define VIA1 (*(struct __6522*)0x9110)
+#define VIA2 (*(struct __6522*)0x9120)
/* Define special memory areas */
-#define COLOR_RAM ((unsigned char*)0x9600)
+#define COLOR_RAM ((unsigned char*)0x9600)
/* The addresses of the static drivers */
extern void vic20_ptvjoy_joy[];
-extern void vic20_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
+extern void vic20_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
diff --git a/libsrc/apple2/_scrsize.s b/libsrc/apple2/_scrsize.s
index 62988ae16..7d1079e15 100644
--- a/libsrc/apple2/_scrsize.s
+++ b/libsrc/apple2/_scrsize.s
@@ -4,14 +4,14 @@
; Screen size variables
;
- .export screensize
+ .export screensize
.include "apple2.inc"
screensize:
- ldx WNDWDTH
- lda WNDBTM
+ ldx WNDWDTH
+ lda WNDBTM
sec
- sbc WNDTOP
+ sbc WNDTOP
tay
rts
diff --git a/libsrc/apple2/break.s b/libsrc/apple2/break.s
index e645bfde9..9129dde96 100644
--- a/libsrc/apple2/break.s
+++ b/libsrc/apple2/break.s
@@ -5,14 +5,14 @@
; void reset_brk (void);
;
- .export _set_brk, _reset_brk
- .destructor _reset_brk
+ .export _set_brk, _reset_brk
+ .destructor _reset_brk
; Be sure to export the following variables absolute
- .export _brk_a: abs, _brk_x: abs, _brk_y: abs
+ .export _brk_a: abs, _brk_x: abs, _brk_y: abs
.export _brk_sr: abs, _brk_pc: abs
- .include "apple2.inc"
+ .include "apple2.inc"
_brk_a = $45
_brk_x = $46
@@ -22,51 +22,51 @@ _brk_sp = $49
_brk_pc = $3A
.bss
-oldvec: .res 2 ; Old vector
+oldvec: .res 2 ; Old vector
.data
-uservec: jmp $FFFF ; Patched at runtime
+uservec: jmp $FFFF ; Patched at runtime
.code
; Set the break vector
-.proc _set_brk
+.proc _set_brk
- sta uservec+1
- stx uservec+2 ; Set the user vector
+ sta uservec+1
+ stx uservec+2 ; Set the user vector
- lda oldvec
- ora oldvec+1 ; Did we save the vector already?
- bne L1 ; Jump if we installed the handler already
+ lda oldvec
+ ora oldvec+1 ; Did we save the vector already?
+ bne L1 ; Jump if we installed the handler already
- lda BRKVec
- sta oldvec
- lda BRKVec+1
- sta oldvec+1 ; Save the old vector
+ lda BRKVec
+ sta oldvec
+ lda BRKVec+1
+ sta oldvec+1 ; Save the old vector
-L1: lda #brk_handler
- sta BRKVec
- stx BRKVec+1
- rts
+L1: lda #brk_handler
+ sta BRKVec
+ stx BRKVec+1
+ rts
.endproc
; Reset the break vector
-.proc _reset_brk
-
- lda oldvec
- ldx oldvec+1
- beq @L9 ; Jump if vector not installed
- sta BRKVec
- stx BRKVec+1
- lda #$00
- sta oldvec ; Clear the old vector
- stx oldvec+1
-@L9: rts
+.proc _reset_brk
+
+ lda oldvec
+ ldx oldvec+1
+ beq @L9 ; Jump if vector not installed
+ sta BRKVec
+ stx BRKVec+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
+@L9: rts
.endproc
@@ -74,39 +74,39 @@ L1: lda #_____
- .byte CT_NONE ; 63/3f _____?_____
+ .byte CT_CTRL ; 0/00 ___ctrl_@___
+ .byte CT_CTRL ; 1/01 ___ctrl_A___
+ .byte CT_CTRL ; 2/02 ___ctrl_B___
+ .byte CT_CTRL ; 3/03 ___ctrl_C___
+ .byte CT_CTRL ; 4/04 ___ctrl_D___
+ .byte CT_CTRL ; 5/05 ___ctrl_E___
+ .byte CT_CTRL ; 6/06 ___ctrl_F___
+ .byte CT_CTRL ; 7/07 ___ctrl_G___
+ .byte CT_CTRL ; 8/08 ___ctrl_H___
+ .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB
+ ; 9/09 ___ctrl_I___
+ .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___
+ .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___
+ .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___
+ .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___
+ .byte CT_CTRL ; 14/0e ___ctrl_N___
+ .byte CT_CTRL ; 15/0f ___ctrl_O___
+ .byte CT_CTRL ; 16/10 ___ctrl_P___
+ .byte CT_CTRL ; 17/11 ___ctrl_Q___
+ .byte CT_CTRL ; 18/12 ___ctrl_R___
+ .byte CT_CTRL ; 19/13 ___ctrl_S___
+ .byte CT_CTRL ; 20/14 ___ctrl_T___
+ .byte CT_CTRL ; 21/15 ___ctrl_U___
+ .byte CT_CTRL ; 22/16 ___ctrl_V___
+ .byte CT_CTRL ; 23/17 ___ctrl_W___
+ .byte CT_CTRL ; 24/18 ___ctrl_X___
+ .byte CT_CTRL ; 25/19 ___ctrl_Y___
+ .byte CT_CTRL ; 26/1a ___ctrl_Z___
+ .byte CT_CTRL ; 27/1b ___ctrl_[___
+ .byte CT_CTRL ; 28/1c ___ctrl_\___
+ .byte CT_CTRL ; 29/1d ___ctrl_]___
+ .byte CT_CTRL ; 30/1e ___ctrl_^___
+ .byte CT_CTRL ; 31/1f ___ctrl_____
+ .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___
+ .byte CT_NONE ; 33/21 _____!_____
+ .byte CT_NONE ; 34/22 _____"_____
+ .byte CT_NONE ; 35/23 _____#_____
+ .byte CT_NONE ; 36/24 _____$_____
+ .byte CT_NONE ; 37/25 _____%_____
+ .byte CT_NONE ; 38/26 _____&_____
+ .byte CT_NONE ; 39/27 _____'_____
+ .byte CT_NONE ; 40/28 _____(_____
+ .byte CT_NONE ; 41/29 _____)_____
+ .byte CT_NONE ; 42/2a _____*_____
+ .byte CT_NONE ; 43/2b _____+_____
+ .byte CT_NONE ; 44/2c _____,_____
+ .byte CT_NONE ; 45/2d _____-_____
+ .byte CT_NONE ; 46/2e _____._____
+ .byte CT_NONE ; 47/2f _____/_____
+ .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____
+ .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____
+ .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____
+ .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____
+ .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____
+ .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____
+ .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____
+ .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____
+ .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____
+ .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____
+ .byte CT_NONE ; 58/3a _____:_____
+ .byte CT_NONE ; 59/3b _____;_____
+ .byte CT_NONE ; 60/3c _____<_____
+ .byte CT_NONE ; 61/3d _____=_____
+ .byte CT_NONE ; 62/3e _____>_____
+ .byte CT_NONE ; 63/3f _____?_____
- .byte CT_NONE ; 64/40 _____@_____
- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____
- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____
- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____
- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____
- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____
- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____
- .byte CT_UPPER ; 71/47 _____G_____
- .byte CT_UPPER ; 72/48 _____H_____
- .byte CT_UPPER ; 73/49 _____I_____
- .byte CT_UPPER ; 74/4a _____J_____
- .byte CT_UPPER ; 75/4b _____K_____
- .byte CT_UPPER ; 76/4c _____L_____
- .byte CT_UPPER ; 77/4d _____M_____
- .byte CT_UPPER ; 78/4e _____N_____
- .byte CT_UPPER ; 79/4f _____O_____
- .byte CT_UPPER ; 80/50 _____P_____
- .byte CT_UPPER ; 81/51 _____Q_____
- .byte CT_UPPER ; 82/52 _____R_____
- .byte CT_UPPER ; 83/53 _____S_____
- .byte CT_UPPER ; 84/54 _____T_____
- .byte CT_UPPER ; 85/55 _____U_____
- .byte CT_UPPER ; 86/56 _____V_____
- .byte CT_UPPER ; 87/57 _____W_____
- .byte CT_UPPER ; 88/58 _____X_____
- .byte CT_UPPER ; 89/59 _____Y_____
- .byte CT_UPPER ; 90/5a _____Z_____
- .byte CT_NONE ; 91/5b _____[_____
- .byte CT_NONE ; 92/5c _____\_____
- .byte CT_NONE ; 93/5d _____]_____
- .byte CT_NONE ; 94/5e _____^_____
- .byte CT_NONE ; 95/5f _UNDERLINE_
- .byte CT_NONE ; 96/60 ___grave___
- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____
- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____
- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____
- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____
- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____
- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____
- .byte CT_LOWER ; 103/67 _____g_____
- .byte CT_LOWER ; 104/68 _____h_____
- .byte CT_LOWER ; 105/69 _____i_____
- .byte CT_LOWER ; 106/6a _____j_____
- .byte CT_LOWER ; 107/6b _____k_____
- .byte CT_LOWER ; 108/6c _____l_____
- .byte CT_LOWER ; 109/6d _____m_____
- .byte CT_LOWER ; 110/6e _____n_____
- .byte CT_LOWER ; 111/6f _____o_____
- .byte CT_LOWER ; 112/70 _____p_____
- .byte CT_LOWER ; 113/71 _____q_____
- .byte CT_LOWER ; 114/72 _____r_____
- .byte CT_LOWER ; 115/73 _____s_____
- .byte CT_LOWER ; 116/74 _____t_____
- .byte CT_LOWER ; 117/75 _____u_____
- .byte CT_LOWER ; 118/76 _____v_____
- .byte CT_LOWER ; 119/77 _____w_____
- .byte CT_LOWER ; 120/78 _____x_____
- .byte CT_LOWER ; 121/79 _____y_____
- .byte CT_LOWER ; 122/7a _____z_____
- .byte CT_NONE ; 123/7b _____{_____
- .byte CT_NONE ; 124/7c _____|_____
- .byte CT_NONE ; 125/7d _____}_____
- .byte CT_NONE ; 126/7e _____~_____
- .byte CT_OTHER_WS ; 127/7f ____DEL____
+ .byte CT_NONE ; 64/40 _____@_____
+ .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____
+ .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____
+ .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____
+ .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____
+ .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____
+ .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____
+ .byte CT_UPPER ; 71/47 _____G_____
+ .byte CT_UPPER ; 72/48 _____H_____
+ .byte CT_UPPER ; 73/49 _____I_____
+ .byte CT_UPPER ; 74/4a _____J_____
+ .byte CT_UPPER ; 75/4b _____K_____
+ .byte CT_UPPER ; 76/4c _____L_____
+ .byte CT_UPPER ; 77/4d _____M_____
+ .byte CT_UPPER ; 78/4e _____N_____
+ .byte CT_UPPER ; 79/4f _____O_____
+ .byte CT_UPPER ; 80/50 _____P_____
+ .byte CT_UPPER ; 81/51 _____Q_____
+ .byte CT_UPPER ; 82/52 _____R_____
+ .byte CT_UPPER ; 83/53 _____S_____
+ .byte CT_UPPER ; 84/54 _____T_____
+ .byte CT_UPPER ; 85/55 _____U_____
+ .byte CT_UPPER ; 86/56 _____V_____
+ .byte CT_UPPER ; 87/57 _____W_____
+ .byte CT_UPPER ; 88/58 _____X_____
+ .byte CT_UPPER ; 89/59 _____Y_____
+ .byte CT_UPPER ; 90/5a _____Z_____
+ .byte CT_NONE ; 91/5b _____[_____
+ .byte CT_NONE ; 92/5c _____\_____
+ .byte CT_NONE ; 93/5d _____]_____
+ .byte CT_NONE ; 94/5e _____^_____
+ .byte CT_NONE ; 95/5f _UNDERLINE_
+ .byte CT_NONE ; 96/60 ___grave___
+ .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____
+ .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____
+ .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____
+ .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____
+ .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____
+ .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____
+ .byte CT_LOWER ; 103/67 _____g_____
+ .byte CT_LOWER ; 104/68 _____h_____
+ .byte CT_LOWER ; 105/69 _____i_____
+ .byte CT_LOWER ; 106/6a _____j_____
+ .byte CT_LOWER ; 107/6b _____k_____
+ .byte CT_LOWER ; 108/6c _____l_____
+ .byte CT_LOWER ; 109/6d _____m_____
+ .byte CT_LOWER ; 110/6e _____n_____
+ .byte CT_LOWER ; 111/6f _____o_____
+ .byte CT_LOWER ; 112/70 _____p_____
+ .byte CT_LOWER ; 113/71 _____q_____
+ .byte CT_LOWER ; 114/72 _____r_____
+ .byte CT_LOWER ; 115/73 _____s_____
+ .byte CT_LOWER ; 116/74 _____t_____
+ .byte CT_LOWER ; 117/75 _____u_____
+ .byte CT_LOWER ; 118/76 _____v_____
+ .byte CT_LOWER ; 119/77 _____w_____
+ .byte CT_LOWER ; 120/78 _____x_____
+ .byte CT_LOWER ; 121/79 _____y_____
+ .byte CT_LOWER ; 122/7a _____z_____
+ .byte CT_NONE ; 123/7b _____{_____
+ .byte CT_NONE ; 124/7c _____|_____
+ .byte CT_NONE ; 125/7d _____}_____
+ .byte CT_NONE ; 126/7e _____~_____
+ .byte CT_OTHER_WS ; 127/7f ____DEL____
.endrepeat
diff --git a/libsrc/apple2/cvline.s b/libsrc/apple2/cvline.s
index 280e4ced3..1ac3fad74 100644
--- a/libsrc/apple2/cvline.s
+++ b/libsrc/apple2/cvline.s
@@ -5,31 +5,31 @@
; void __fastcall__ cvline (unsigned char length);
;
- .export _cvlinexy, _cvline, cvlinedirect
- .import popa, _gotoxy, putchar, newline
+ .export _cvlinexy, _cvline, cvlinedirect
+ .import popa, _gotoxy, putchar, newline
- .include "zeropage.inc"
+ .include "zeropage.inc"
_cvlinexy:
- pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
- pla ; Restore the length and run into _cvline
+ pha ; Save the length
+ jsr popa ; Get y
+ jsr _gotoxy ; Call this one, will pop params
+ pla ; Restore the length and run into _cvline
_cvline:
- .ifdef __APPLE2ENH__
- ldx #'|' | $80 ; Vertical line, screen code
+ .ifdef __APPLE2ENH__
+ ldx #'|' | $80 ; Vertical line, screen code
.else
- ldx #'!' | $80 ; Vertical line, screen code
+ ldx #'!' | $80 ; Vertical line, screen code
.endif
cvlinedirect:
- cmp #$00 ; Is the length zero?
- beq done ; Jump if done
- sta tmp1
-: txa ; Screen code
- jsr putchar ; Write, no cursor advance
- jsr newline ; Advance cursor to next line
- dec tmp1
- bne :-
+ cmp #$00 ; Is the length zero?
+ beq done ; Jump if done
+ sta tmp1
+: txa ; Screen code
+ jsr putchar ; Write, no cursor advance
+ jsr newline ; Advance cursor to next line
+ dec tmp1
+ bne :-
done: rts
diff --git a/libsrc/apple2/devicedir.s b/libsrc/apple2/devicedir.s
index b2a6382f8..dea2ba8c5 100644
--- a/libsrc/apple2/devicedir.s
+++ b/libsrc/apple2/devicedir.s
@@ -4,79 +4,79 @@
; char* __fastcall__ getdevicedir (unsigned char device, char* buf, size_t size);
;
- .export _getdevicedir
- .import popax, popa
+ .export _getdevicedir
+ .import popax, popa
- .include "zeropage.inc"
- .include "errno.inc"
- .include "mli.inc"
+ .include "zeropage.inc"
+ .include "errno.inc"
+ .include "mli.inc"
_getdevicedir:
; Save size
- sta ptr2
- stx ptr2+1
+ sta ptr2
+ stx ptr2+1
; Save buf
- jsr popax
- sta ptr1
- stx ptr1+1
+ jsr popax
+ sta ptr1
+ stx ptr1+1
; Set buf
- sta mliparam + MLI::ON_LINE::DATA_BUFFER
- stx mliparam + MLI::ON_LINE::DATA_BUFFER+1
+ sta mliparam + MLI::ON_LINE::DATA_BUFFER
+ stx mliparam + MLI::ON_LINE::DATA_BUFFER+1
; Set device
- jsr popa
+ jsr popa
asl
asl
asl
asl
- sta mliparam + MLI::ON_LINE::UNIT_NUM
+ sta mliparam + MLI::ON_LINE::UNIT_NUM
; Check for valid slot
- and #$70
- beq erange
+ and #$70
+ beq erange
; Check for sufficient buf size
- lda ptr2+1
- bne :++ ; Buf >= 256
- lda ptr2
- cmp #17
- bcs :++ ; Buf >= 17
+ lda ptr2+1
+ bne :++ ; Buf >= 256
+ lda ptr2
+ cmp #17
+ bcs :++ ; Buf >= 17
; Handle errors
-erange: lda #280
+ lda #>280
pha
- bne done ; Branch always
+ bne done ; Branch always
diff --git a/libsrc/apple2/diosectsize.s b/libsrc/apple2/diosectsize.s
index f9737cdd5..d3ece3779 100644
--- a/libsrc/apple2/diosectsize.s
+++ b/libsrc/apple2/diosectsize.s
@@ -4,15 +4,15 @@
; unsigned __fastcall__ dio_query_sectsize (dhandle_t handle);
;
- .export _dio_query_sectsize
+ .export _dio_query_sectsize
- .include "errno.inc"
+ .include "errno.inc"
_dio_query_sectsize:
; Clear error
- stx __oserror ; X = 0
+ stx __oserror ; X = 0
; Return ProDOS 8 block size
- txa ; X = 0
- ldx #>512
+ txa ; X = 0
+ ldx #>512
rts
diff --git a/libsrc/apple2/diowrite.s b/libsrc/apple2/diowrite.s
index 6deb754f2..d031c49d0 100644
--- a/libsrc/apple2/diowrite.s
+++ b/libsrc/apple2/diowrite.s
@@ -4,12 +4,12 @@
; unsigned char __fastcall__ dio_write (dhandle_t handle, unsigned sect_num, const void *buffer);
;
- .export _dio_write
- .import dioprolog, diocommon
+ .export _dio_write
+ .import dioprolog, diocommon
- .include "mli.inc"
+ .include "mli.inc"
_dio_write:
- jsr dioprolog
- lda #WRITE_BLOCK_CALL
- jmp diocommon
+ jsr dioprolog
+ lda #WRITE_BLOCK_CALL
+ jmp diocommon
diff --git a/libsrc/apple2/dir.h b/libsrc/apple2/dir.h
index 0faffd634..369080c47 100644
--- a/libsrc/apple2/dir.h
+++ b/libsrc/apple2/dir.h
@@ -36,23 +36,23 @@
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
struct DIR {
- int fd;
+ int fd;
unsigned char entry_length;
unsigned char entries_per_block;
unsigned char current_entry;
union {
- unsigned char bytes[512];
- struct {
- unsigned prev_block;
- unsigned next_block;
- unsigned char entries[1];
- } content;
+ unsigned char bytes[512];
+ struct {
+ unsigned prev_block;
+ unsigned next_block;
+ unsigned char entries[1];
+ } content;
} block;
};
diff --git a/libsrc/apple2/dosdetect.s b/libsrc/apple2/dosdetect.s
index 5dcda07a9..68910e3da 100644
--- a/libsrc/apple2/dosdetect.s
+++ b/libsrc/apple2/dosdetect.s
@@ -34,12 +34,12 @@
initdostype:
lda $BF00
- cmp #$4C ; Is MLI present? (JMP opcode)
+ cmp #$4C ; Is MLI present? (JMP opcode)
bne done
- lda KVERSION ; ProDOS 8 kernel version
+ lda KVERSION ; ProDOS 8 kernel version
cmp #$10
bcs :+
- ora #$10 ; Make high nibble match major version
+ ora #$10 ; Make high nibble match major version
: sta __dos_type
done: rts
diff --git a/libsrc/apple2/emd/a2.auxmem.s b/libsrc/apple2/emd/a2.auxmem.s
index 7a72cfc85..ecf78fc37 100644
--- a/libsrc/apple2/emd/a2.auxmem.s
+++ b/libsrc/apple2/emd/a2.auxmem.s
@@ -5,48 +5,48 @@
; Ullrich von Bassewitz, 2002-12-02
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "em-kernel.inc"
- .include "em-error.inc"
+ .include "em-kernel.inc"
+ .include "em-error.inc"
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "JUMPTABLE"
; Driver signature
- .byte $65, $6d, $64 ; "emd"
- .byte EMD_API_VERSION ; EM API version number
+ .byte $65, $6d, $64 ; "emd"
+ .byte EMD_API_VERSION ; EM API version number
; Jump table.
- .word INSTALL
- .word DEINSTALL
- .word PAGECOUNT
- .word MAP
- .word USE
- .word COMMIT
- .word COPYFROM
- .word COPYTO
+ .word INSTALL
+ .word DEINSTALL
+ .word PAGECOUNT
+ .word MAP
+ .word USE
+ .word COMMIT
+ .word COPYFROM
+ .word COPYTO
; ------------------------------------------------------------------------
; Constants
-BASE = $0200
-AUXCARD = $C30C ; Card signature
-AUXMOVE = $C311 ; Auxiliary move routine
-PAGES = ($C000 - BASE) / 256
+BASE = $0200
+AUXCARD = $C30C ; Card signature
+AUXMOVE = $C311 ; Auxiliary move routine
+PAGES = ($C000 - BASE) / 256
; ------------------------------------------------------------------------
; Data.
.data
-curpage: .byte $FF ; Current page number (invalid)
+curpage: .byte $FF ; Current page number (invalid)
.bss
-window: .res 256 ; Memory "window"
+window: .res 256 ; Memory "window"
.code
@@ -58,15 +58,15 @@ window: .res 256 ; Memory "window"
;
INSTALL:
- ldx #0
- lda AUXCARD
- and #$f0
- cmp #$80
- bne @L1
- lda #EM_ERR_OK
- rts
-@L1: lda #EM_ERR_NO_DEVICE
-; rts
+ ldx #0
+ lda AUXCARD
+ and #$f0
+ cmp #$80
+ bne @L1
+ lda #EM_ERR_OK
+ rts
+@L1: lda #EM_ERR_NO_DEVICE
+; rts
; ------------------------------------------------------------------------
; DEINSTALL routine. Is called before the driver is removed from memory.
@@ -74,7 +74,7 @@ INSTALL:
;
DEINSTALL:
- rts
+ rts
; ------------------------------------------------------------------------
@@ -82,9 +82,9 @@ DEINSTALL:
;
PAGECOUNT:
- lda #PAGES
- rts
+ lda #PAGES
+ rts
; ------------------------------------------------------------------------
; MAP: Map the page in a/x into memory and return a pointer to the page in
@@ -92,83 +92,83 @@ PAGECOUNT:
; by the driver.
;
-MAP: sta curpage ; Remember the new page
+MAP: sta curpage ; Remember the new page
- clc
- adc #>BASE
- sta ptr1+1
- ldy #$00
- sty ptr1
+ clc
+ adc #>BASE
+ sta ptr1+1
+ ldy #$00
+ sty ptr1
- lda #window
- sta ptr2+1
+ lda #window
+ sta ptr2+1
; Transfer one page
- clc ; Direction flag
- jsr transfer ; Transfer one page
+ clc ; Direction flag
+ jsr transfer ; Transfer one page
; Return the memory window
- lda #window ; Return the window address
+ lda #window ; Return the window address
; Done
-done: rts
+done: rts
; ------------------------------------------------------------------------
; USE: Tell the driver that the window is now associated with a given page.
-USE: sta curpage ; Remember the page
- lda #window ; Return the window
- rts
+USE: sta curpage ; Remember the page
+ lda #window ; Return the window
+ rts
; ------------------------------------------------------------------------
; COMMIT: Commit changes in the memory window to extended storage.
-COMMIT: lda curpage ; Get the current page
- cmp #$FF
- beq done ; Jump if no page mapped
-
- clc
- adc #>BASE
- sta ptr2+1
- ldy #$00
- sty ptr2
-
- lda #window
- sta ptr1+1
- lda #<$FF
- sta ptr4
- lda #>$FF
- sta ptr4+1
- sec ; Direction flag
+COMMIT: lda curpage ; Get the current page
+ cmp #$FF
+ beq done ; Jump if no page mapped
+
+ clc
+ adc #>BASE
+ sta ptr2+1
+ ldy #$00
+ sty ptr2
+
+ lda #window
+ sta ptr1+1
+ lda #<$FF
+ sta ptr4
+ lda #>$FF
+ sta ptr4+1
+ sec ; Direction flag
; Transfer one page/all bytes
transfer:
- php
- clc
- lda ptr1
- sta $3C
- adc ptr4
- sta $3E
- lda ptr1+1
- sta $3D
- adc ptr4+1
- sta $3F
- lda ptr2
- sta $42
- lda ptr2+1
- sta $43
- plp
- jmp AUXMOVE
+ php
+ clc
+ lda ptr1
+ sta $3C
+ adc ptr4
+ sta $3E
+ lda ptr1+1
+ sta $3D
+ adc ptr4+1
+ sta $3F
+ lda ptr2
+ sta $42
+ lda ptr2+1
+ sta $43
+ plp
+ jmp AUXMOVE
; ------------------------------------------------------------------------
; COPYFROM: Copy from extended into linear memory. A pointer to a structure
@@ -177,34 +177,34 @@ transfer:
;
COPYFROM:
- sta ptr3
- stx ptr3+1 ; Save the passed em_copy pointer
-
- ldy #EM_COPY::OFFS
- lda (ptr3),y
- sta ptr1
- ldy #EM_COPY::PAGE
- lda (ptr3),y
- clc
- adc #>BASE
- sta ptr1+1 ; From
-
- ldy #EM_COPY::BUF
- lda (ptr3),y
- sta ptr2
- iny
- lda (ptr3),y
- sta ptr2+1 ; To
- clc ; Direction flag
-
-common: ldy #EM_COPY::COUNT
- lda (ptr3),y ; Get bytes in last page
- sta ptr4
- iny
- lda (ptr3),y ; Get number of pages
- sta ptr4+1
-
- jmp transfer
+ sta ptr3
+ stx ptr3+1 ; Save the passed em_copy pointer
+
+ ldy #EM_COPY::OFFS
+ lda (ptr3),y
+ sta ptr1
+ ldy #EM_COPY::PAGE
+ lda (ptr3),y
+ clc
+ adc #>BASE
+ sta ptr1+1 ; From
+
+ ldy #EM_COPY::BUF
+ lda (ptr3),y
+ sta ptr2
+ iny
+ lda (ptr3),y
+ sta ptr2+1 ; To
+ clc ; Direction flag
+
+common: ldy #EM_COPY::COUNT
+ lda (ptr3),y ; Get bytes in last page
+ sta ptr4
+ iny
+ lda (ptr3),y ; Get number of pages
+ sta ptr4+1
+
+ jmp transfer
; ------------------------------------------------------------------------
; COPYTO: Copy from linear into extended memory. A pointer to a structure
@@ -212,24 +212,24 @@ common: ldy #EM_COPY::COUNT
; The function must not return anything.
;
-COPYTO: sta ptr3
- stx ptr3+1 ; Save the passed em_copy pointer
-
- ldy #EM_COPY::OFFS
- lda (ptr3),y
- sta ptr2
- ldy #EM_COPY::PAGE
- lda (ptr3),y
- clc
- adc #>BASE
- sta ptr2+1 ; To
-
- ldy #EM_COPY::BUF
- lda (ptr3),y
- sta ptr1
- iny
- lda (ptr3),y
- sta ptr1+1 ; From
-
- sec ; Direction flag
- jmp common
+COPYTO: sta ptr3
+ stx ptr3+1 ; Save the passed em_copy pointer
+
+ ldy #EM_COPY::OFFS
+ lda (ptr3),y
+ sta ptr2
+ ldy #EM_COPY::PAGE
+ lda (ptr3),y
+ clc
+ adc #>BASE
+ sta ptr2+1 ; To
+
+ ldy #EM_COPY::BUF
+ lda (ptr3),y
+ sta ptr1
+ iny
+ lda (ptr3),y
+ sta ptr1+1 ; From
+
+ sec ; Direction flag
+ jmp common
diff --git a/libsrc/apple2/exec.s b/libsrc/apple2/exec.s
index 2660b6f86..914e10c50 100644
--- a/libsrc/apple2/exec.s
+++ b/libsrc/apple2/exec.s
@@ -4,108 +4,108 @@
; int __fastcall__ exec (const char* progname, const char* cmdline);
;
- .export _exec
- .import pushname, popname
- .import popax, done, _exit
+ .export _exec
+ .import pushname, popname
+ .import popax, done, _exit
- .include "zeropage.inc"
- .include "errno.inc"
- .include "apple2.inc"
- .include "mli.inc"
+ .include "zeropage.inc"
+ .include "errno.inc"
+ .include "apple2.inc"
+ .include "mli.inc"
; Wrong file type
-typerr: lda #$4A ; "Incompatible file format"
+typerr: lda #$4A ; "Incompatible file format"
; Cleanup name
-oserr: jsr popname ; Preserves A
+oserr: jsr popname ; Preserves A
; Set __oserror
- jmp __mappederrno
+ jmp __mappederrno
_exec:
; Get and push name
- jsr popax
- jsr pushname
- bne oserr
+ jsr popax
+ jsr pushname
+ bne oserr
; Set pushed name
- lda sp
- ldx sp+1
- sta mliparam + MLI::INFO::PATHNAME
- stx mliparam + MLI::INFO::PATHNAME+1
+ lda sp
+ ldx sp+1
+ sta mliparam + MLI::INFO::PATHNAME
+ stx mliparam + MLI::INFO::PATHNAME+1
; Get file_type and aux_type
- lda #GET_INFO_CALL
- ldx #GET_INFO_COUNT
- jsr callmli
- bcs oserr
+ lda #GET_INFO_CALL
+ ldx #GET_INFO_COUNT
+ jsr callmli
+ bcs oserr
; If we get here the program file at least exists so we copy
; the loader stub right now and patch it later to set params
- ldx #size - 1
-: lda source,x
- sta target,x
+ ldx #size - 1
+: lda source,x
+ sta target,x
dex
- bpl :-
+ bpl :-
; Check program file type
- lda mliparam + MLI::INFO::FILE_TYPE
- cmp #$FF ; SYS file?
- bne binary ; No, check for BIN file
+ lda mliparam + MLI::INFO::FILE_TYPE
+ cmp #$FF ; SYS file?
+ bne binary ; No, check for BIN file
; ProDOS TechRefMan, chapter 5.1.5.1:
; "The complete or partial pathname of the system program
; is stored at $280, starting with a length byte."
- ldy #$00
- lda (sp),y
+ ldy #$00
+ lda (sp),y
tay
-: lda (sp),y
- sta $0280,y
+: lda (sp),y
+ sta $0280,y
dey
- bpl :-
+ bpl :-
; SYS programs replace BASIC.SYSTEM so set in the ProDOS system bit map
; protection for pages $80 - $BF just in case BASIC.SYSTEM is there now
- ldx #$0F ; Start with protection for pages $B8 - $BF
- lda #%00000001 ; Protect only system global page
-: sta $BF60,x ; Set protection for 8 pages
- lda #$00 ; Protect no page
+ ldx #$0F ; Start with protection for pages $B8 - $BF
+ lda #%00000001 ; Protect only system global page
+: sta $BF60,x ; Set protection for 8 pages
+ lda #$00 ; Protect no page
dex
- bpl :-
- bmi prodos ; Branch always
+ bpl :-
+ bmi prodos ; Branch always
-binary: cmp #$06 ; BIN file?
- bne typerr ; No, wrong file type
+binary: cmp #$06 ; BIN file?
+ bne typerr ; No, wrong file type
; Set BIN program load addr
- lda mliparam + MLI::INFO::AUX_TYPE
- ldx mliparam + MLI::INFO::AUX_TYPE+1
- sta data_buffer
- stx data_buffer+1
+ lda mliparam + MLI::INFO::AUX_TYPE
+ ldx mliparam + MLI::INFO::AUX_TYPE+1
+ sta data_buffer
+ stx data_buffer+1
; Check ProDOS system bit map for presence of BASIC.SYSTEM
- lda $BF6F ; Protection for pages $B8 - $BF
- cmp #%00000001 ; Exactly system global page is protected
- beq setvec
+ lda $BF6F ; Protection for pages $B8 - $BF
+ cmp #%00000001 ; Exactly system global page is protected
+ beq setvec
; Get highest available mem addr from BASIC.SYSTEM
- ldx HIMEM+1 ; High byte
- bne setbuf ; Branch always
+ ldx HIMEM+1 ; High byte
+ bne setbuf ; Branch always
; BIN programs are supposed to quit through one of the two DOS
; vectors so we set up those to point to the ProDOS dispatcher
-setvec: ldx #$03 - 1 ; Size of JMP opcode
-: lda dosvec,x
- sta DOSWARM,x ; DOS warm start
- sta DOSWARM + 3,x ; DOS cold start
+setvec: ldx #$03 - 1 ; Size of JMP opcode
+: lda dosvec,x
+ sta DOSWARM,x ; DOS warm start
+ sta DOSWARM + 3,x ; DOS cold start
dex
- bpl :-
+ bpl :-
; No BASIC.SYSTEM so use addr of ProDOS system global page
-prodos: ldx #>$BF00 ; High byte
+prodos: ldx #>$BF00 ; High byte
; The I/O buffer needs to be page aligned
-setbuf: lda #$00 ; Low byte
+setbuf: lda #$00 ; Low byte
; The I/O buffer needs four pages
dex
@@ -114,109 +114,109 @@ setbuf: lda #$00 ; Low byte
dex
; Set I/O buffer
- sta mliparam + MLI::OPEN::IO_BUFFER
- stx mliparam + MLI::OPEN::IO_BUFFER+1
+ sta mliparam + MLI::OPEN::IO_BUFFER
+ stx mliparam + MLI::OPEN::IO_BUFFER+1
; PATHNAME already set
.assert MLI::OPEN::PATHNAME = MLI::INFO::PATHNAME, error
; Lower file level to avoid program file
; being closed by C libary shutdown code
- ldx LEVEL
- stx level
- beq :+
- dec LEVEL
+ ldx LEVEL
+ stx level
+ beq :+
+ dec LEVEL
; Open file
-: lda #OPEN_CALL
- ldx #OPEN_COUNT
- jsr callmli
+: lda #OPEN_CALL
+ ldx #OPEN_COUNT
+ jsr callmli
; Restore file level
- ldx level
- stx LEVEL
- bcc :+
- jmp oserr
+ ldx level
+ stx LEVEL
+ bcc :+
+ jmp oserr
; Get and save fd
-: lda mliparam + MLI::OPEN::REF_NUM
- sta read_ref
- sta close_ref
+: lda mliparam + MLI::OPEN::REF_NUM
+ sta read_ref
+ sta close_ref
.ifdef __APPLE2ENH__
; Calling the 80 column firmware needs the ROM switched
; in, otherwise it copies the F8 ROM to the LC (@ $CEF4)
- bit $C082
+ bit $C082
; ProDOS TechRefMan, chapter 5.3.1.3:
; "80-column text cards -- and other Apple IIe features -- can
; be turned off using the following sequence of instructions:"
- lda #$15
- jsr $C300
+ lda #$15
+ jsr $C300
; Switch in LC bank 2 for R/O
- bit $C080
+ bit $C080
.endif
; Call loader stub after C libary shutdown
- lda #target
- sta done
- stx done+1
+ lda #target
+ sta done
+ stx done+1
; Initiate C libary shutdown
- jmp _exit
+ jmp _exit
.bss
-level : .res 1
+level : .res 1
.rodata
; Read whole program file
-source: jsr $BF00
- .byte READ_CALL
- .word read_param
- bcs :+
+source: jsr $BF00
+ .byte READ_CALL
+ .word read_param
+ bcs :+
; Close program file
- jsr $BF00
- .byte CLOSE_CALL
- .word close_param
- bcs :+
+ jsr $BF00
+ .byte CLOSE_CALL
+ .word close_param
+ bcs :+
; Go for it ...
- jmp (data_buffer)
+ jmp (data_buffer)
read_param = * - source + target
- .byte $04 ; PARAM_COUNT
+ .byte $04 ; PARAM_COUNT
read_ref = * - source + target
- .byte $00 ; REF_NUM
+ .byte $00 ; REF_NUM
data_buffer = * - source + target
- .addr $2000 ; DATA_BUFFER
- .word $FFFF ; REQUEST_COUNT
- .word $0000 ; TRANS_COUNT
+ .addr $2000 ; DATA_BUFFER
+ .word $FFFF ; REQUEST_COUNT
+ .word $0000 ; TRANS_COUNT
close_param = * - source + target
- .byte $01 ; PARAM_COUNT
+ .byte $01 ; PARAM_COUNT
close_ref = * - source + target
- .byte $00 ; REF_NUM
+ .byte $00 ; REF_NUM
; Quit to ProDOS dispatcher
quit = * - source + target
-: jsr $BF00
- .byte $65 ; QUIT
- .word quit_param
+: jsr $BF00
+ .byte $65 ; QUIT
+ .word quit_param
quit_param = * - source + target
- .byte $04 ; PARAM_COUNT
- .byte $00 ; QUIT_TYPE
- .word $0000 ; RESERVED
- .byte $00 ; RESERVED
- .word $0000 ; RESERVED
+ .byte $04 ; PARAM_COUNT
+ .byte $00 ; QUIT_TYPE
+ .word $0000 ; RESERVED
+ .byte $00 ; RESERVED
+ .word $0000 ; RESERVED
size = * - source
target = DOSWARM - size
-dosvec: jmp quit
+dosvec: jmp quit
diff --git a/libsrc/apple2/exehdr.s b/libsrc/apple2/exehdr.s
index f66b14a5c..eb05e66be 100644
--- a/libsrc/apple2/exehdr.s
+++ b/libsrc/apple2/exehdr.s
@@ -5,12 +5,12 @@
; containing the load address and load length.
;
- .export __EXEHDR__ : absolute = 1 ; Linker referenced
- .import __LOADADDR__, __LOADSIZE__ ; Linker generated
+ .export __EXEHDR__ : absolute = 1 ; Linker referenced
+ .import __LOADADDR__, __LOADSIZE__ ; Linker generated
; ------------------------------------------------------------------------
.segment "EXEHDR"
- .addr __LOADADDR__ ; Load address
- .word __LOADSIZE__ ; Load length
+ .addr __LOADADDR__ ; Load address
+ .word __LOADSIZE__ ; Load length
diff --git a/libsrc/apple2/extra/iobuf-0800.s b/libsrc/apple2/extra/iobuf-0800.s
index 69fd6a657..7951ccbb0 100644
--- a/libsrc/apple2/extra/iobuf-0800.s
+++ b/libsrc/apple2/extra/iobuf-0800.s
@@ -5,16 +5,16 @@
; location $0800 and the cc65 program start address
;
- .constructor initiobuf
- .export iobuf_alloc, iobuf_free
- .import __STARTUP_RUN__
- .import incsp2, popax
+ .constructor initiobuf
+ .export iobuf_alloc, iobuf_free
+ .import __STARTUP_RUN__
+ .import incsp2, popax
- .include "zeropage.inc"
- .include "errno.inc"
- .include "../filedes.inc"
+ .include "zeropage.inc"
+ .include "errno.inc"
+ .include "../filedes.inc"
- .segment "INIT"
+ .segment "INIT"
initiobuf:
; Convert end address highbyte to table index
@@ -40,10 +40,10 @@ initiobuf:
iobuf_alloc:
; Get and save "memptr"
- jsr incsp2
- jsr popax
- sta ptr1
- stx ptr1+1
+ jsr incsp2
+ jsr popax
+ sta ptr1
+ stx ptr1+1
; Search table for free entry
ldx #$00
@@ -67,11 +67,11 @@ iobuf_alloc:
adc #>$0800
; Store address in "memptr"
- ldy #$01
- sta (ptr1),y
- dey
- tya
- sta (ptr1),y
+ ldy #$01
+ sta (ptr1),y
+ dey
+ tya
+ sta (ptr1),y
rts
iobuf_free:
@@ -86,7 +86,7 @@ iobuf_free:
tax
lda #$00
sta table,x
- rts
+ rts
; ------------------------------------------------------------------------
diff --git a/libsrc/apple2/filedes.s b/libsrc/apple2/filedes.s
index e177acbe4..04b4416e9 100644
--- a/libsrc/apple2/filedes.s
+++ b/libsrc/apple2/filedes.s
@@ -4,18 +4,18 @@
; File descriptor management for the POSIX I/O routines
;
- .include "errno.inc"
- .include "fcntl.inc"
- .include "filedes.inc"
+ .include "errno.inc"
+ .include "fcntl.inc"
+ .include "filedes.inc"
getfd:
; Check for handle >= 256
- cpx #$00
- bne error
+ cpx #$00
+ bne error
; Check for handle >= MAX_FDS
- cmp #MAX_FDS
- bcs error
+ cmp #MAX_FDS
+ bcs error
; Convert handle to fdtab slot
.assert .sizeof(FD) = 4, error
@@ -24,15 +24,15 @@ getfd:
; Check for fdtab slot in use
tay
- lda fdtab + FD::REF_NUM,y
- beq error
+ lda fdtab + FD::REF_NUM,y
+ beq error
; Return success
clc
rts
; Load errno code and return error
-error: lda #EINVAL
+error: lda #EINVAL
sec
rts
@@ -40,16 +40,16 @@ error: lda #EINVAL
fdtab: .assert .sizeof(FD) = 4, error
- .byte $80 ; STDIN_FILENO ::REF_NUM
- .byte O_RDONLY ; STDIN_FILENO ::FLAGS
- .addr $0000 ; STDIN_FILENO ::BUFFER
+ .byte $80 ; STDIN_FILENO ::REF_NUM
+ .byte O_RDONLY ; STDIN_FILENO ::FLAGS
+ .addr $0000 ; STDIN_FILENO ::BUFFER
- .byte $80 ; STDOUT_FILENO::REF_NUM
- .byte O_WRONLY ; STDOUT_FILENO::FLAGS
- .addr $0000 ; STDOUT_FILENO::BUFFER
+ .byte $80 ; STDOUT_FILENO::REF_NUM
+ .byte O_WRONLY ; STDOUT_FILENO::FLAGS
+ .addr $0000 ; STDOUT_FILENO::BUFFER
- .byte $80 ; STDERR_FILENO::REF_NUM
- .byte O_WRONLY ; STDERR_FILENO::FLAGS
- .addr $0000 ; STDERR_FILENO::BUFFER
+ .byte $80 ; STDERR_FILENO::REF_NUM
+ .byte O_WRONLY ; STDERR_FILENO::FLAGS
+ .addr $0000 ; STDERR_FILENO::BUFFER
- .res (MAX_FDS - 3) * .sizeof(FD)
+ .res (MAX_FDS - 3) * .sizeof(FD)
diff --git a/libsrc/apple2/filename.s b/libsrc/apple2/filename.s
index 1bf17af50..aaef6ec2d 100644
--- a/libsrc/apple2/filename.s
+++ b/libsrc/apple2/filename.s
@@ -4,88 +4,88 @@
; File name handling for ProDOS 8 file I/O
;
- .export pushname, popname
- .import subysp, addysp, decsp1
+ .export pushname, popname
+ .import subysp, addysp, decsp1
- .include "zeropage.inc"
- .include "mli.inc"
+ .include "zeropage.inc"
+ .include "mli.inc"
pushname:
- sta ptr1
- stx ptr1+1
+ sta ptr1
+ stx ptr1+1
; Alloc pathname buffer
- ldy #64+1 ; Max pathname length + zero
- jsr subysp
+ ldy #64+1 ; Max pathname length + zero
+ jsr subysp
; Check for full pathname
- ldy #$00
- lda (ptr1),y
- cmp #'/'
- beq copy
+ ldy #$00
+ lda (ptr1),y
+ cmp #'/'
+ beq copy
; Check for system prefix
- lda PFIXPTR
- bne copy
+ lda PFIXPTR
+ bne copy
; Use unit number of most recent accessed device
- lda DEVNUM
- sta mliparam + MLI::ON_LINE::UNIT_NUM
+ lda DEVNUM
+ sta mliparam + MLI::ON_LINE::UNIT_NUM
; Use allocated pathname buffer
- lda sp
- ldx sp+1
- sta mliparam + MLI::ON_LINE::DATA_BUFFER
- stx mliparam + MLI::ON_LINE::DATA_BUFFER+1
+ lda sp
+ ldx sp+1
+ sta mliparam + MLI::ON_LINE::DATA_BUFFER
+ stx mliparam + MLI::ON_LINE::DATA_BUFFER+1
; Get volume name
- lda #ON_LINE_CALL
- ldx #ON_LINE_COUNT
- jsr callmli
- bcs addsp65
+ lda #ON_LINE_CALL
+ ldx #ON_LINE_COUNT
+ jsr callmli
+ bcs addsp65
; Get volume name length
- lda (sp),y
- and #15 ; Max volume name length
+ lda (sp),y
+ and #15 ; Max volume name length
; Bracket volume name with slashes to form prefix
- sta tmp1
- lda #'/'
- sta (sp),y
- ldy tmp1
- iny ; Leading slash
- sta (sp),y
- iny ; Trailing slash
+ sta tmp1
+ lda #'/'
+ sta (sp),y
+ ldy tmp1
+ iny ; Leading slash
+ sta (sp),y
+ iny ; Trailing slash
; Adjust source pointer for copy
- sty tmp1
- lda ptr1
+ sty tmp1
+ lda ptr1
sec
- sbc tmp1
- bcs :+
- dec ptr1+1
-: sta ptr1
+ sbc tmp1
+ bcs :+
+ dec ptr1+1
+: sta ptr1
; Copy source to allocated pathname buffer
-copy: lda (ptr1),y
- sta (sp),y
- beq setlen
+copy: lda (ptr1),y
+ sta (sp),y
+ beq setlen
iny
- cpy #64+1 ; Max pathname length + zero
- bcc copy
+ cpy #64+1 ; Max pathname length + zero
+ bcc copy
; Load oserror code
- lda #$40 ; "Invalid pathname"
+ lda #$40 ; "Invalid pathname"
; Free pathname buffer
addsp65:ldy #64+1
- bne addsp ; Branch always
+ bne addsp ; Branch always
; Alloc and set length byte
setlen: tya
- jsr decsp1 ; Preserves A
- ldy #$00
- sta (sp),y
+ jsr decsp1 ; Preserves A
+ ldy #$00
+ sta (sp),y
; Return success
tya
@@ -93,5 +93,5 @@ setlen: tya
popname:
; Cleanup stack
- ldy #1 + 64+1 ; Length byte + max pathname length + zero
-addsp: jmp addysp ; Preserves A
+ ldy #1 + 64+1 ; Length byte + max pathname length + zero
+addsp: jmp addysp ; Preserves A
diff --git a/libsrc/apple2/get_ostype.s b/libsrc/apple2/get_ostype.s
index a041c3477..68ae865ac 100644
--- a/libsrc/apple2/get_ostype.s
+++ b/libsrc/apple2/get_ostype.s
@@ -24,38 +24,38 @@ nogs: ldx #$FF
next: inx
lda value,x
ldy index,x
- beq done ; $00 is no valid index
+ beq done ; $00 is no valid index
cmp $FB00,y
beq next
: inx
ldy index,x
bne :-
- beq next ; Branch always
+ beq next ; Branch always
-index: .byte $B3, $00 ; Apple ][
- .byte $B3, $1E, $00 ; Apple ][+
- .byte $B3, $1E, $00 ; Apple /// (emulation)
- .byte $B3, $C0, $00 ; Apple //e
- .byte $B3, $C0, $DD, $BE, $00 ; Apple //e Option Card
- .byte $B3, $C0, $00 ; Apple //e (enhanced)
- .byte $B3, $C0, $BF, $00 ; Apple //c
- .byte $B3, $C0, $BF, $00 ; Apple //c (3.5 ROM)
- .byte $B3, $C0, $BF, $00 ; Apple //c (Mem. Exp.)
- .byte $B3, $C0, $BF, $00 ; Apple //c (Rev. Mem. Exp.)
- .byte $B3, $C0, $BF, $00 ; Apple //c Plus
+index: .byte $B3, $00 ; Apple ][
+ .byte $B3, $1E, $00 ; Apple ][+
+ .byte $B3, $1E, $00 ; Apple /// (emulation)
+ .byte $B3, $C0, $00 ; Apple //e
+ .byte $B3, $C0, $DD, $BE, $00 ; Apple //e Option Card
+ .byte $B3, $C0, $00 ; Apple //e (enhanced)
+ .byte $B3, $C0, $BF, $00 ; Apple //c
+ .byte $B3, $C0, $BF, $00 ; Apple //c (3.5 ROM)
+ .byte $B3, $C0, $BF, $00 ; Apple //c (Mem. Exp.)
+ .byte $B3, $C0, $BF, $00 ; Apple //c (Rev. Mem. Exp.)
+ .byte $B3, $C0, $BF, $00 ; Apple //c Plus
.byte $00
-value: .byte $38, $10 ; Apple ][
- .byte $EA, $AD, $11 ; Apple ][+
- .byte $EA, $8A, $20 ; Apple /// (emulation)
- .byte $06, $EA, $30 ; Apple //e
- .byte $06, $E0, $02, $00, $40 ; Apple //e Option Card
- .byte $06, $E0, $31 ; Apple //e (enhanced)
- .byte $06, $00, $FF, $50 ; Apple //c
- .byte $06, $00, $00, $51 ; Apple //c (3.5 ROM)
- .byte $06, $00, $03, $53 ; Apple //c (Mem. Exp.)
- .byte $06, $00, $04, $54 ; Apple //c (Rev. Mem. Exp.)
- .byte $06, $00, $05, $55 ; Apple //c Plus
+value: .byte $38, $10 ; Apple ][
+ .byte $EA, $AD, $11 ; Apple ][+
+ .byte $EA, $8A, $20 ; Apple /// (emulation)
+ .byte $06, $EA, $30 ; Apple //e
+ .byte $06, $E0, $02, $00, $40 ; Apple //e Option Card
+ .byte $06, $E0, $31 ; Apple //e (enhanced)
+ .byte $06, $00, $FF, $50 ; Apple //c
+ .byte $06, $00, $00, $51 ; Apple //c (3.5 ROM)
+ .byte $06, $00, $03, $53 ; Apple //c (Mem. Exp.)
+ .byte $06, $00, $04, $54 ; Apple //c (Rev. Mem. Exp.)
+ .byte $06, $00, $05, $55 ; Apple //c Plus
.byte $00
.code
diff --git a/libsrc/apple2/gotoxy.s b/libsrc/apple2/gotoxy.s
index 0c6c800be..dc96ac75e 100644
--- a/libsrc/apple2/gotoxy.s
+++ b/libsrc/apple2/gotoxy.s
@@ -13,10 +13,10 @@
_gotoxy:
clc
adc WNDTOP
- sta CV ; Store Y
+ sta CV ; Store Y
jsr VTABZ
- jsr popa ; Get X
+ jsr popa ; Get X
_gotox:
- sta CH ; Store X
+ sta CH ; Store X
rts
diff --git a/libsrc/apple2/gotoy.s b/libsrc/apple2/gotoy.s
index 66d929c34..707b8fc50 100644
--- a/libsrc/apple2/gotoy.s
+++ b/libsrc/apple2/gotoy.s
@@ -12,7 +12,7 @@
_gotoy:
clc
adc WNDTOP
- sta CV ; Store Y
+ sta CV ; Store Y
jmp VTABZ
diff --git a/libsrc/apple2/home.s b/libsrc/apple2/home.s
index de5334c93..02899beb4 100644
--- a/libsrc/apple2/home.s
+++ b/libsrc/apple2/home.s
@@ -4,17 +4,17 @@
; HOME routine
;
- .export HOME
+ .export HOME
- .include "apple2.inc"
+ .include "apple2.inc"
- .segment "LOWCODE"
+ .segment "LOWCODE"
HOME:
- ; Switch in ROM and call HOME
- bit $C082
- jsr $FC58 ; Clear current text screen
+ ; Switch in ROM and call HOME
+ bit $C082
+ jsr $FC58 ; Clear current text screen
- ; Switch in LC bank 2 for R/O and return
- bit $C080
- rts
+ ; Switch in LC bank 2 for R/O and return
+ bit $C080
+ rts
diff --git a/libsrc/apple2/initcwd.s b/libsrc/apple2/initcwd.s
index 6ed914ca6..044076e3f 100644
--- a/libsrc/apple2/initcwd.s
+++ b/libsrc/apple2/initcwd.s
@@ -3,15 +3,15 @@
;
.export initcwd
- .import __cwd
+ .import __cwd
- .include "zeropage.inc"
+ .include "zeropage.inc"
.include "mli.inc"
initcwd:
; Set static prefix buffer
- lda #<__cwd
- ldx #>__cwd
+ lda #<__cwd
+ ldx #>__cwd
sta mliparam + MLI::PREFIX::PATHNAME
stx mliparam + MLI::PREFIX::PATHNAME+1
@@ -21,20 +21,20 @@ initcwd:
jsr callmli
; Check for null prefix
- lda __cwd
- beq done
+ lda __cwd
+ beq done
- ; Remove length byte and trailing slash
- sta tmp1
- ldx #$01
-: lda __cwd,x
- sta __cwd - 1,x
- inx
- cpx tmp1
- bcc :-
+ ; Remove length byte and trailing slash
+ sta tmp1
+ ldx #$01
+: lda __cwd,x
+ sta __cwd - 1,x
+ inx
+ cpx tmp1
+ bcc :-
- ; Add terminating zero
- lda #$00
- sta __cwd - 1,x
-
-done: rts
+ ; Add terminating zero
+ lda #$00
+ sta __cwd - 1,x
+
+done: rts
diff --git a/libsrc/apple2/iobuf.s b/libsrc/apple2/iobuf.s
index 88a4503d0..77433ce61 100644
--- a/libsrc/apple2/iobuf.s
+++ b/libsrc/apple2/iobuf.s
@@ -4,8 +4,8 @@
; Default ProDOS 8 I/O buffer management
;
- .export iobuf_alloc, iobuf_free
- .import _posix_memalign, _free
+ .export iobuf_alloc, iobuf_free
+ .import _posix_memalign, _free
iobuf_alloc := _posix_memalign
iobuf_free := _free
diff --git a/libsrc/apple2/joy/a2.stdjoy.s b/libsrc/apple2/joy/a2.stdjoy.s
index 1608f5acc..eecdd6a8a 100644
--- a/libsrc/apple2/joy/a2.stdjoy.s
+++ b/libsrc/apple2/joy/a2.stdjoy.s
@@ -7,9 +7,9 @@
; Using the readjoy code from Stefan Haubenthal
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "joy-kernel.inc"
+ .include "joy-kernel.inc"
.include "joy-error.inc"
.include "apple2.inc"
@@ -17,24 +17,24 @@
; Constants
-THRESHOLD = 20 ; Deviation from center triggering movement
+THRESHOLD = 20 ; Deviation from center triggering movement
; ------------------------------------------------------------------------
; ROM entry points
-PREAD := $FB1E ; Read paddle in X, return AD conv. value in Y
+PREAD := $FB1E ; Read paddle in X, return AD conv. value in Y
; ------------------------------------------------------------------------
; Header. Includes jump table.
- .segment "JUMPTABLE"
+ .segment "JUMPTABLE"
; Driver signature
- .byte $6A, $6F, $79 ; "joy"
- .byte JOY_API_VERSION ; Driver API version number
+ .byte $6A, $6F, $79 ; "joy"
+ .byte JOY_API_VERSION ; Driver API version number
; Button state masks (8 values)
@@ -57,7 +57,7 @@ PREAD := $FB1E ; Read paddle in X, return AD conv. value in Y
; ------------------------------------------------------------------------
- .code
+ .code
; INSTALL routine. Is called after the driver is loaded into memory. If
; possible, check if the hardware is present and determine the amount of
@@ -66,7 +66,7 @@ PREAD := $FB1E ; Read paddle in X, return AD conv. value in Y
INSTALL:
lda #JOY_ERR_OK
- ; Fall through
+ ; Fall through
; UNINSTALL routine. Is called before the driver is removed from memory.
; Can do cleanup or whatever. Must not return anything.
@@ -75,55 +75,55 @@ UNINSTALL:
; COUNT: Return the total number of available joysticks in a/x.
COUNT:
- lda #$02 ; Number of joysticks we support
+ lda #$02 ; Number of joysticks we support
ldx #$00
rts
; READ: Read a particular joystick passed in A.
READJOY:
- bit $C082 ; Switch in ROM
- and #$01 ; Restrict joystick number
+ bit $C082 ; Switch in ROM
+ and #$01 ; Restrict joystick number
- ; Read horizontal paddle
- asl ; Joystick number -> paddle number
- tax ; Set paddle number (0, 2)
+ ; Read horizontal paddle
+ asl ; Joystick number -> paddle number
+ tax ; Set paddle number (0, 2)
jsr PREAD ; Read paddle value
- lda #$00 ; 0 0 0 0 0 0 0 0
+ lda #$00 ; 0 0 0 0 0 0 0 0
cpy #127 - THRESHOLD
- ror ; !LEFT 0 0 0 0 0 0 0
+ ror ; !LEFT 0 0 0 0 0 0 0
cpy #127 + THRESHOLD
- ror ; RIGHT !LEFT 0 0 0 0 0 0
+ ror ; RIGHT !LEFT 0 0 0 0 0 0
- ; Read vertical paddle
+ ; Read vertical paddle
pha
- inx ; Set paddle number (1, 3)
+ inx ; Set paddle number (1, 3)
jsr PREAD ; Read paddle value
pla
cpy #127 - THRESHOLD
- ror ; !UP RIGHT !LEFT 0 0 0 0 0
+ ror ; !UP RIGHT !LEFT 0 0 0 0 0
cpy #127 + THRESHOLD
- ror ; DOWN !UP RIGHT !LEFT 0 0 0 0
+ ror ; DOWN !UP RIGHT !LEFT 0 0 0 0
- ; Read primary button
- tay
- lda BUTN0-1,x ; Check button (1, 3)
+ ; Read primary button
+ tay
+ lda BUTN0-1,x ; Check button (1, 3)
asl
tya
- ror ; FIRE DOWN !UP RIGHT !LEFT 0 0 0
-
- ; Read secondary button
- tay
- inx
- txa
- and #$03 ; IIgs has fourth button at TAPEIN
- tax
- lda BUTN0-1,x ; Check button (2, 0)
+ ror ; FIRE DOWN !UP RIGHT !LEFT 0 0 0
+
+ ; Read secondary button
+ tay
+ inx
+ txa
+ and #$03 ; IIgs has fourth button at TAPEIN
+ tax
+ lda BUTN0-1,x ; Check button (2, 0)
asl
tya
- ror ; FIRE2 FIRE DOWN !UP RIGHT !LEFT 0 0
+ ror ; FIRE2 FIRE DOWN !UP RIGHT !LEFT 0 0
- ; Finalize
+ ; Finalize
eor #%00010100 ; FIRE2 FIRE DOWN UP RIGHT LEFT 0 0
ldx #$00
- bit $C080 ; Switch in LC bank 2 for R/O
+ bit $C080 ; Switch in LC bank 2 for R/O
rts
diff --git a/libsrc/apple2/joy_stat_stddrv.s b/libsrc/apple2/joy_stat_stddrv.s
index bf6b0f53c..d129020bd 100644
--- a/libsrc/apple2/joy_stat_stddrv.s
+++ b/libsrc/apple2/joy_stat_stddrv.s
@@ -6,16 +6,16 @@
; const void joy_static_stddrv[];
;
- .export _joy_static_stddrv
- .ifdef __APPLE2ENH__
- .import _a2e_stdjoy_joy
+ .export _joy_static_stddrv
+ .ifdef __APPLE2ENH__
+ .import _a2e_stdjoy_joy
.else
- .import _a2_stdjoy_joy
+ .import _a2_stdjoy_joy
.endif
.rodata
- .ifdef __APPLE2ENH__
+ .ifdef __APPLE2ENH__
_joy_static_stddrv := _a2e_stdjoy_joy
.else
_joy_static_stddrv := _a2_stdjoy_joy
diff --git a/libsrc/apple2/joy_stddrv.s b/libsrc/apple2/joy_stddrv.s
index e4a360dab..0c3bf677b 100644
--- a/libsrc/apple2/joy_stddrv.s
+++ b/libsrc/apple2/joy_stddrv.s
@@ -6,14 +6,14 @@
; const char joy_stddrv[];
;
- .export _joy_stddrv
+ .export _joy_stddrv
.rodata
_joy_stddrv:
- .ifdef __APPLE2ENH__
- .asciiz "A2E.STDJOY.JOY"
+ .ifdef __APPLE2ENH__
+ .asciiz "A2E.STDJOY.JOY"
.else
- .asciiz "A2.STDJOY.JOY"
+ .asciiz "A2.STDJOY.JOY"
.endif
diff --git a/libsrc/apple2/mainargs.s b/libsrc/apple2/mainargs.s
index 2de10bd53..6b0df4ded 100644
--- a/libsrc/apple2/mainargs.s
+++ b/libsrc/apple2/mainargs.s
@@ -22,11 +22,11 @@
; TO-DO:
; Add a control-character quoting mechanism.
- .constructor initmainargs, 24
- .import __argc, __argv, __dos_type
+ .constructor initmainargs, 24
+ .import __argc, __argv, __dos_type
- .include "zeropage.inc"
- .include "apple2.inc"
+ .include "zeropage.inc"
+ .include "apple2.inc"
; Maximum number of arguments allowed in the argument table.
; (An argument contains a comma, at least.)
@@ -44,7 +44,7 @@ BUF_LEN = 122
BASIC_BUF = $200
FNAM_LEN = $280
FNAM = $281
-REM = $B2 ; BASIC token-code
+REM = $B2 ; BASIC token-code
; Get possible command-line arguments. Goes into the special INIT segment,
; which may be reused after the startup code is run.
@@ -56,25 +56,25 @@ initmainargs:
; Assume that the program was loaded, a moment ago, by the traditional BLOAD
; statement of BASIC.SYSTEM. Save the filename as argument #0 if available.
- ldx __dos_type ; No ProDOS -> argv[0] = ""
- beq :+
+ ldx __dos_type ; No ProDOS -> argv[0] = ""
+ beq :+
; Terminate the filename with a zero to make it a valid C string.
- ldx FNAM_LEN
-: lda #$00
- sta FNAM,x
+ ldx FNAM_LEN
+: lda #$00
+ sta FNAM,x
- inc __argc ; argc always is equal to, at least, 1
+ inc __argc ; argc always is equal to, at least, 1
; Find the "rem" token.
- ldx #$00
-: lda BASIC_BUF,x
- beq done ; No "rem" -> no args
+ ldx #$00
+: lda BASIC_BUF,x
+ beq done ; No "rem" -> no args
inx
- cmp #REM
- bne :-
+ cmp #REM
+ bne :-
; If a clock is present it is called by ProDOS on file operations. On machines
; with a slot-based clock (like the Thunder Clock) the clock firmware places
@@ -82,18 +82,18 @@ initmainargs:
; of the command-line in a different buffer before the original is potentially
; destroyed.
- ldy #$00
-: lda BASIC_BUF,x
- sta buffer,y
- inx
- iny
- cpy #BUF_LEN - 1 ; Keep the terminating zero intact
- bcc :-
+ ldy #$00
+: lda BASIC_BUF,x
+ sta buffer,y
+ inx
+ iny
+ cpy #BUF_LEN - 1 ; Keep the terminating zero intact
+ bcc :-
; Start processing the arguments.
- ldx #$00
- ldy #$01 * 2 ; Start with argv[1]
+ ldx #$00
+ ldy #$01 * 2 ; Start with argv[1]
; Find the next argument. Stop if the end of the string or a character with the
; hibit set is reached. The later is true if the string isn't already parsed by
@@ -105,65 +105,65 @@ initmainargs:
; for the REM token we stumbled across the first '2' character ($32+$80 = $B2)
; and interpreted the rest of the date as a spurious command-line parameter.
-next: lda buffer,x
- beq done
- bmi done
+next: lda buffer,x
+ beq done
+ bmi done
inx
- cmp #' ' ; Skip leading spaces
- beq next
+ cmp #' ' ; Skip leading spaces
+ beq next
; Found start of next argument. We've incremented the pointer in X already, so
; it points to the second character of the argument. This is useful since we
; will check now for a quoted argument, in which case we will have to skip this
; first character.
- cmp #'"' ; Is the argument quoted?
- beq :+ ; Jump if so
- dex ; Reset pointer to first argument character
- lda #' ' ; A space ends the argument
-: sta tmp1 ; Set end of argument marker
+ cmp #'"' ; Is the argument quoted?
+ beq :+ ; Jump if so
+ dex ; Reset pointer to first argument character
+ lda #' ' ; A space ends the argument
+: sta tmp1 ; Set end of argument marker
; Now store a pointer to the argument into the next slot.
- txa ; Get low byte
+ txa ; Get low byte
clc
- adc #buffer
- sta argv,y
+ lda #$00
+ adc #>buffer
+ sta argv,y
iny
- inc __argc ; Found another arg
+ inc __argc ; Found another arg
; Search for the end of the argument.
: lda buffer,x
- beq done
+ beq done
inx
- cmp tmp1
- bne :-
+ cmp tmp1
+ bne :-
; We've found the end of the argument. X points one character behind it, and
; A contains the terminating character. To make the argument a valid C string,
; replace the terminating character by a zero.
- lda #$00
- sta buffer-1,x
+ lda #$00
+ sta buffer-1,x
; Check if the maximum number of command-line arguments is reached. If not,
; parse the next one.
- lda __argc ; Get low byte of argument count
- cmp #MAXARGS ; Maximum number of arguments reached?
- bcc next ; Parse next one if not
+ lda __argc ; Get low byte of argument count
+ cmp #MAXARGS ; Maximum number of arguments reached?
+ bcc next ; Parse next one if not
; (The last vector in argv[] already is NULL.)
-done: lda #argv
- sta __argv
- stx __argv+1
+done: lda #argv
+ sta __argv
+ stx __argv+1
rts
; This array is zeroed before initmainargs is called.
@@ -171,9 +171,9 @@ done: lda #$0400 ; 000001CD
- sta getscr+2
- sta setscr+2
- txa ; ABCDExxx
- ror ; EABCDExx
- and #%11100000 ; EAB00000
- ora getscr+1 ; EABABCDE
- and #%11111000 ; EABAB000
- sta getscr+1
- sta setscr+1
- rts
+ tax ; ABCDExxx
+ lsr ; 0ABCDExx
+ lsr ; 00ABCDEx
+ lsr ; 000ABCDE
+ sta getscr+1
+ lsr ; 0000ABCD
+ and #%00000011 ; 000000CD
+ ora #>$0400 ; 000001CD
+ sta getscr+2
+ sta setscr+2
+ txa ; ABCDExxx
+ ror ; EABCDExx
+ and #%11100000 ; EAB00000
+ ora getscr+1 ; EABABCDE
+ and #%11111000 ; EABAB000
+ sta getscr+1
+ sta setscr+1
+ rts
diff --git a/libsrc/apple2/mli.inc b/libsrc/apple2/mli.inc
index 86950fbc4..42363d9c9 100644
--- a/libsrc/apple2/mli.inc
+++ b/libsrc/apple2/mli.inc
@@ -94,8 +94,8 @@ EOF_COUNT = 2
DATA_BUFFER .addr
.endstruct
.struct PREFIX
- PARAM_COUNT .byte
- PATHNAME .addr
+ PARAM_COUNT .byte
+ PATHNAME .addr
.endstruct
.struct OPEN
PARAM_COUNT .byte
@@ -130,12 +130,12 @@ EOF_COUNT = 2
.global mliparam
.global callmli
-DEVNUM := $BF30 ; Most recent accessed device
-DEVCNT := $BF31 ; Number of on-line devices (minus 1)
-DEVLST := $BF32 ; Up to 14 units may be active
-DATELO := $BF90 ; Bits 15-9 = year, 8-5 = month, 4-0 = day
-TIMELO := $BF92 ; Bits 12-8 = hour, 5-0 = minute
-LEVEL := $BF94 ; File level: used in open, flush, close
-MACHID := $BF98 ; Machine identification
-PFIXPTR := $BF9A ; If = 0, no prefix active
+DEVNUM := $BF30 ; Most recent accessed device
+DEVCNT := $BF31 ; Number of on-line devices (minus 1)
+DEVLST := $BF32 ; Up to 14 units may be active
+DATELO := $BF90 ; Bits 15-9 = year, 8-5 = month, 4-0 = day
+TIMELO := $BF92 ; Bits 12-8 = hour, 5-0 = minute
+LEVEL := $BF94 ; File level: used in open, flush, close
+MACHID := $BF98 ; Machine identification
+PFIXPTR := $BF9A ; If = 0, no prefix active
KVERSION:= $BFFF ; Kernel version number
diff --git a/libsrc/apple2/mli.s b/libsrc/apple2/mli.s
index fa826cc61..3e4771400 100644
--- a/libsrc/apple2/mli.s
+++ b/libsrc/apple2/mli.s
@@ -24,12 +24,12 @@ callmli:
beq oserr
; Call MLI and return
- jsr $BF00 ; MLI call entry point
+ jsr $BF00 ; MLI call entry point
call: .byte $00
.addr mliparam
rts
; Load oserror code and return
-oserr: lda #$01 ; "Bad system call number"
+oserr: lda #$01 ; "Bad system call number"
sec
rts
diff --git a/libsrc/apple2/mou/a2.stdmou.s b/libsrc/apple2/mou/a2.stdmou.s
index af44a48ff..30ef85c54 100644
--- a/libsrc/apple2/mou/a2.stdmou.s
+++ b/libsrc/apple2/mou/a2.stdmou.s
@@ -4,219 +4,219 @@
; Oliver Schmidt, 03.09.2005
;
- .include "zeropage.inc"
- .include "mouse-kernel.inc"
- .include "apple2.inc"
+ .include "zeropage.inc"
+ .include "mouse-kernel.inc"
+ .include "apple2.inc"
; ------------------------------------------------------------------------
-SETMOUSE = $12 ; Sets mouse mode
-SERVEMOUSE = $13 ; Services mouse interrupt
-READMOUSE = $14 ; Reads mouse position
-CLEARMOUSE = $15 ; Clears mouse position to 0 (for delta mode)
-POSMOUSE = $16 ; Sets mouse position to a user-defined pos
-CLAMPMOUSE = $17 ; Sets mouse bounds in a window
-HOMEMOUSE = $18 ; Sets mouse to upper-left corner of clamp win
-INITMOUSE = $19 ; Resets mouse clamps to default values and
- ; sets mouse position to 0,0
-
-pos1_lo := $0478
-pos1_hi := $0578
-pos2_lo := $04F8
-pos2_hi := $05F8
-status := $0778
+SETMOUSE = $12 ; Sets mouse mode
+SERVEMOUSE = $13 ; Services mouse interrupt
+READMOUSE = $14 ; Reads mouse position
+CLEARMOUSE = $15 ; Clears mouse position to 0 (for delta mode)
+POSMOUSE = $16 ; Sets mouse position to a user-defined pos
+CLAMPMOUSE = $17 ; Sets mouse bounds in a window
+HOMEMOUSE = $18 ; Sets mouse to upper-left corner of clamp win
+INITMOUSE = $19 ; Resets mouse clamps to default values and
+ ; sets mouse position to 0,0
+
+pos1_lo := $0478
+pos1_hi := $0578
+pos2_lo := $04F8
+pos2_hi := $05F8
+status := $0778
; ------------------------------------------------------------------------
- .segment "JUMPTABLE"
-
- ; Driver signature
- .byte $6D, $6F, $75 ; "mou"
- .byte MOUSE_API_VERSION ; Mouse driver API version number
-
- ; Jump table.
- .addr INSTALL
- .addr UNINSTALL
- .addr HIDE
- .addr SHOW
- .addr SETBOX
- .addr GETBOX
- .addr MOVE
- .addr BUTTONS
- .addr POS
- .addr INFO
- .addr IOCTL
- .addr IRQ
+ .segment "JUMPTABLE"
+
+ ; Driver signature
+ .byte $6D, $6F, $75 ; "mou"
+ .byte MOUSE_API_VERSION ; Mouse driver API version number
+
+ ; Jump table.
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr HIDE
+ .addr SHOW
+ .addr SETBOX
+ .addr GETBOX
+ .addr MOVE
+ .addr BUTTONS
+ .addr POS
+ .addr INFO
+ .addr IOCTL
+ .addr IRQ
; Mouse driver flags
.byte MOUSE_FLAG_EARLY_IRQ
- ; Callback table, set by the kernel before INSTALL is called
-CHIDE: jmp $0000 ; Hide the cursor
-CSHOW: jmp $0000 ; Show the cursor
-CMOVEX: jmp $0000 ; Move the cursor to X coord
-CMOVEY: jmp $0000 ; Move the cursor to Y coord
+ ; Callback table, set by the kernel before INSTALL is called
+CHIDE: jmp $0000 ; Hide the cursor
+CSHOW: jmp $0000 ; Show the cursor
+CMOVEX: jmp $0000 ; Move the cursor to X coord
+CMOVEY: jmp $0000 ; Move the cursor to Y coord
; ------------------------------------------------------------------------
- .bss
+ .bss
-box: .tag MOUSE_BOX
-info: .tag MOUSE_INFO
-slot: .res 1
-visible:.res 1
+box: .tag MOUSE_BOX
+info: .tag MOUSE_INFO
+slot: .res 1
+visible:.res 1
; ------------------------------------------------------------------------
- .rodata
+ .rodata
-offsets:.byte $05 ; Pascal 1.0 ID byte
- .byte $07 ; Pascal 1.0 ID byte
- .byte $0B ; Pascal 1.1 generic signature byte
- .byte $0C ; Device signature byte
+offsets:.byte $05 ; Pascal 1.0 ID byte
+ .byte $07 ; Pascal 1.0 ID byte
+ .byte $0B ; Pascal 1.1 generic signature byte
+ .byte $0C ; Device signature byte
-values: .byte $38 ; Fixed
- .byte $18 ; Fixed
- .byte $01 ; Fixed
- .byte $20 ; X-Y pointing device type 0
+values: .byte $38 ; Fixed
+ .byte $18 ; Fixed
+ .byte $01 ; Fixed
+ .byte $20 ; X-Y pointing device type 0
-size = * - values
+size = * - values
-inibox: .word 0 ; MinX
- .word 0 ; MinY
- .word 279 ; MaxX
- .word 191 ; MaxY
+inibox: .word 0 ; MinX
+ .word 0 ; MinY
+ .word 279 ; MaxX
+ .word 191 ; MaxY
; ------------------------------------------------------------------------
- .data
+ .data
firmware:
- ; Lookup and patch firmware address lobyte
-lookup: ldy $FF00,x ; Patched at runtime
- sty jump+1 ; Modify code below
+ ; Lookup and patch firmware address lobyte
+lookup: ldy $FF00,x ; Patched at runtime
+ sty jump+1 ; Modify code below
- ; Apple II Mouse TechNote #1, Interrupt Environment with the Mouse:
- ; "Enter all mouse routines (...) with the X register set to $Cn
- ; and Y register set to $n0, where n = the slot number."
-xparam: ldx #$FF ; Patched at runtime
-yparam: ldy #$FF ; Patched at runtime
+ ; Apple II Mouse TechNote #1, Interrupt Environment with the Mouse:
+ ; "Enter all mouse routines (...) with the X register set to $Cn
+ ; and Y register set to $n0, where n = the slot number."
+xparam: ldx #$FF ; Patched at runtime
+yparam: ldy #$FF ; Patched at runtime
-jump: jmp $FFFF ; Patched at runtime
+jump: jmp $FFFF ; Patched at runtime
; ------------------------------------------------------------------------
- .code
+ .code
; INSTALL: Is called after the driver is loaded into memory. If possible,
; check if the hardware is present. Must return an MOUSE_ERR_xx code in A/X.
INSTALL:
- lda #<$C000
- sta ptr1
- lda #>$C000
- sta ptr1+1
-
- ; Search for AppleMouse II firmware in slots 1 - 7
-next: inc ptr1+1
- lda ptr1+1
- cmp #>$C800
- bcc :+
-
- ; Mouse firmware not found
- lda #MOUSE_ERR_NO_DEVICE
- rts
-
- ; Check Pascal 1.1 Firmware Protocol ID bytes
-: ldx #size - 1
-: ldy offsets,x
- lda values,x
- cmp (ptr1),y
- bne next
- dex
- bpl :-
-
- ; Get and patch firmware address hibyte
- lda ptr1+1
- sta lookup+2
- sta xparam+1
- sta jump+2
-
- ; Disable interrupts now because setting the slot number makes
- ; the IRQ handler (maybe called due to some non-mouse IRQ) try
- ; calling the firmware which isn't correctly set up yet
- sei
-
- ; Convert to and save slot number
- and #$0F
- sta slot
-
- ; Convert to and patch I/O register index
- asl
- asl
- asl
- asl
- sta yparam+1
-
- ; The AppleMouse II Card needs the ROM switched in
- ; to be able to detect an Apple //e and use RDVBL
- bit $C082
-
- ; Reset mouse hardware
- ldx #INITMOUSE
- jsr firmware
-
- ; Switch in LC bank 2 for R/O
- bit $C080
-
- ; Turn mouse on
- lda #%00000001
- ldx #SETMOUSE
- jsr firmware
-
- ; Set initial mouse clamps
- lda #inibox
- jsr SETBOX
-
- ; Set initial mouse position
- ldx slot
- lda #<(279 / 2)
- sta pos1_lo,x
- lda #>(279 / 2)
- sta pos1_hi,x
- lda #<(191 / 2)
- sta pos2_lo,x
- lda #>(191 / 2)
- sta pos2_hi,x
- ldx #POSMOUSE
- jsr firmware
-
- ; Update cursor
- jsr update
-
- ; Turn VBL interrupt on
- lda #%00001001
- ldx #SETMOUSE
-common: jsr firmware
-
- ; Enable interrupts and return success
- cli
- lda #MOUSE_ERR_OK
- rts
+ lda #<$C000
+ sta ptr1
+ lda #>$C000
+ sta ptr1+1
+
+ ; Search for AppleMouse II firmware in slots 1 - 7
+next: inc ptr1+1
+ lda ptr1+1
+ cmp #>$C800
+ bcc :+
+
+ ; Mouse firmware not found
+ lda #MOUSE_ERR_NO_DEVICE
+ rts
+
+ ; Check Pascal 1.1 Firmware Protocol ID bytes
+: ldx #size - 1
+: ldy offsets,x
+ lda values,x
+ cmp (ptr1),y
+ bne next
+ dex
+ bpl :-
+
+ ; Get and patch firmware address hibyte
+ lda ptr1+1
+ sta lookup+2
+ sta xparam+1
+ sta jump+2
+
+ ; Disable interrupts now because setting the slot number makes
+ ; the IRQ handler (maybe called due to some non-mouse IRQ) try
+ ; calling the firmware which isn't correctly set up yet
+ sei
+
+ ; Convert to and save slot number
+ and #$0F
+ sta slot
+
+ ; Convert to and patch I/O register index
+ asl
+ asl
+ asl
+ asl
+ sta yparam+1
+
+ ; The AppleMouse II Card needs the ROM switched in
+ ; to be able to detect an Apple //e and use RDVBL
+ bit $C082
+
+ ; Reset mouse hardware
+ ldx #INITMOUSE
+ jsr firmware
+
+ ; Switch in LC bank 2 for R/O
+ bit $C080
+
+ ; Turn mouse on
+ lda #%00000001
+ ldx #SETMOUSE
+ jsr firmware
+
+ ; Set initial mouse clamps
+ lda #inibox
+ jsr SETBOX
+
+ ; Set initial mouse position
+ ldx slot
+ lda #<(279 / 2)
+ sta pos1_lo,x
+ lda #>(279 / 2)
+ sta pos1_hi,x
+ lda #<(191 / 2)
+ sta pos2_lo,x
+ lda #>(191 / 2)
+ sta pos2_hi,x
+ ldx #POSMOUSE
+ jsr firmware
+
+ ; Update cursor
+ jsr update
+
+ ; Turn VBL interrupt on
+ lda #%00001001
+ ldx #SETMOUSE
+common: jsr firmware
+
+ ; Enable interrupts and return success
+ cli
+ lda #MOUSE_ERR_OK
+ rts
; UNINSTALL: Is called before the driver is removed from memory.
; No return code required (the driver is removed from memory on return).
UNINSTALL:
- ; Hide cursor
- sei
- jsr CHIDE
+ ; Hide cursor
+ sei
+ jsr CHIDE
- ; Turn mouse off
- lda #%00000000
- ldx #SETMOUSE
- bne common ; Branch always
+ ; Turn mouse off
+ lda #%00000000
+ ldx #SETMOUSE
+ bne common ; Branch always
; SETBOX: Set the mouse bounding box. The parameters are passed as they come
; from the C program, that is, a pointer to a mouse_box struct in A/X.
@@ -224,62 +224,62 @@ UNINSTALL:
; of the caller. It is not necessary to validate the parameters, trust the
; caller and save some code here. No return code required.
SETBOX:
- sta ptr1
- stx ptr1+1
+ sta ptr1
+ stx ptr1+1
+
+ ; Set x clamps
+ ldx #$00
+ ldy #MOUSE_BOX::MINX
+ jsr :+
- ; Set x clamps
- ldx #$00
- ldy #MOUSE_BOX::MINX
- jsr :+
-
- ; Set y clamps
- ldx #$01
- ldy #MOUSE_BOX::MINY
-
- ; Apple II Mouse TechNote #1, Interrupt Environment with the Mouse:
- ; "Disable interrupts before placing position information in the
- ; screen holes."
-: sei
-
- ; Set low clamp
- lda (ptr1),y
- sta box,y
- sta pos1_lo
- iny
- lda (ptr1),y
- sta box,y
- sta pos1_hi
-
- ; Skip one word
- iny
- iny
-
- ; Set high clamp
- iny
- lda (ptr1),y
- sta box,y
- sta pos2_lo
- iny
- lda (ptr1),y
- sta box,y
- sta pos2_hi
-
- txa
- ldx #CLAMPMOUSE
- bne common ; Branch always
+ ; Set y clamps
+ ldx #$01
+ ldy #MOUSE_BOX::MINY
+
+ ; Apple II Mouse TechNote #1, Interrupt Environment with the Mouse:
+ ; "Disable interrupts before placing position information in the
+ ; screen holes."
+: sei
+
+ ; Set low clamp
+ lda (ptr1),y
+ sta box,y
+ sta pos1_lo
+ iny
+ lda (ptr1),y
+ sta box,y
+ sta pos1_hi
+
+ ; Skip one word
+ iny
+ iny
+
+ ; Set high clamp
+ iny
+ lda (ptr1),y
+ sta box,y
+ sta pos2_lo
+ iny
+ lda (ptr1),y
+ sta box,y
+ sta pos2_hi
+
+ txa
+ ldx #CLAMPMOUSE
+ bne common ; Branch always
; GETBOX: Return the mouse bounding box. The parameters are passed as they
; come from the C program, that is, a pointer to a mouse_box struct in A/X.
GETBOX:
- sta ptr1
- stx ptr1+1
+ sta ptr1
+ stx ptr1+1
- ldy #.sizeof(MOUSE_BOX)-1
-: lda box,y
- sta (ptr1),y
- dey
- bpl :-
- rts
+ ldy #.sizeof(MOUSE_BOX)-1
+: lda box,y
+ sta (ptr1),y
+ dey
+ bpl :-
+ rts
; MOVE: Move the mouse to a new position. The position is passed as it comes
; from the C program, that is: x on the stack and y in A/X. The C wrapper will
@@ -287,148 +287,148 @@ GETBOX:
; No checks are done if the new position is valid (within the bounding box or
; the screen). No return code required.
MOVE:
- ldy slot
- sei
+ ldy slot
+ sei
- ; Set y
- sta pos2_lo,y
- txa
- sta pos2_hi,y
+ ; Set y
+ sta pos2_lo,y
+ txa
+ sta pos2_hi,y
- tya
- tax
- ldy #$00 ; Start at top of stack
+ tya
+ tax
+ ldy #$00 ; Start at top of stack
- ; Set x
- lda (sp),y
- iny
- sta pos1_lo,x
- lda (sp),y
- sta pos1_hi,x
+ ; Set x
+ lda (sp),y
+ iny
+ sta pos1_lo,x
+ lda (sp),y
+ sta pos1_hi,x
- ; Update cursor
- jsr update
+ ; Update cursor
+ jsr update
- ldx #POSMOUSE
- bne common ; Branch always
+ ldx #POSMOUSE
+ bne common ; Branch always
; HIDE: Is called to hide the mouse cursor. The mouse kernel manages a
; counter for calls to show/hide, and the driver entry point is only called
; if the mouse is currently visible and should get hidden. For most drivers,
-; no special action is required besides hiding the mouse cursor.
+; no special action is required besides hiding the mouse cursor.
; No return code required.
HIDE:
- dec visible
- sei
- jsr CHIDE
- cli
- rts
+ dec visible
+ sei
+ jsr CHIDE
+ cli
+ rts
-; SHOW: Is called to show the mouse cursor. The mouse kernel manages a
+; SHOW: Is called to show the mouse cursor. The mouse kernel manages a
; counter for calls to show/hide, and the driver entry point is only called
; if the mouse is currently hidden and should become visible. For most drivers,
-; no special action is required besides enabling the mouse cursor.
+; no special action is required besides enabling the mouse cursor.
; No return code required.
SHOW:
- inc visible
- rts
+ inc visible
+ rts
; BUTTONS: Return the button mask in A/X.
BUTTONS:
- lda info + MOUSE_INFO::BUTTONS
- ldx #$00
- rts
+ lda info + MOUSE_INFO::BUTTONS
+ ldx #$00
+ rts
; POS: Return the mouse position in the MOUSE_POS struct pointed to by ptr1.
; No return code required.
POS:
- ldy #.sizeof(MOUSE_POS)-1
- bne copy ; Branch always
+ ldy #.sizeof(MOUSE_POS)-1
+ bne copy ; Branch always
; INFO: Returns mouse position and current button mask in the MOUSE_INFO
; struct pointed to by ptr1. No return code required.
INFO:
- ldy #.sizeof(MOUSE_INFO)-1
-copy: sei
-: lda info,y
- sta (ptr1),y
- dey
- bpl :-
- cli
- rts
+ ldy #.sizeof(MOUSE_INFO)-1
+copy: sei
+: lda info,y
+ sta (ptr1),y
+ dey
+ bpl :-
+ cli
+ rts
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an MOUSE_ERR_xx code in A/X.
IOCTL:
- lda #MOUSE_ERR_INV_IOCTL
- rts
+ lda #MOUSE_ERR_INV_IOCTL
+ rts
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; registers are already saved, no parameters are passed, but the carry flag
; is clear on entry. The routine must return with carry set if the interrupt
; was handled, otherwise with carry clear.
IRQ:
- ; Check for installed mouse
- lda slot
- beq done
-
- ; Check for mouse interrupt
- ldx #SERVEMOUSE
- jsr firmware
- bcc :+
- clc ; Interrupt not handled
-done: rts
-
-: ldx #READMOUSE
- jsr firmware
-
- ; Get status
- ldy slot
- lda status,y
- tax ; Save status
-
- ; Extract button down values
- asl ; C = Button 0 is currently down
- and #%00100000 ; !Z = Button 1 is currently down
-
- ; Set button mask
- beq :+
- lda #MOUSE_BTN_RIGHT
-: bcc :+
- ora #MOUSE_BTN_LEFT
-: sta info + MOUSE_INFO::BUTTONS
-
- ; Check for mouse movement
- txa ; Restore status
- and #%00100000 ; X or Y changed since last READMOUSE
- beq :+
-
- ; Remove the cursor at the old position
-update: jsr CHIDE
-
- ; Get and set the new X position
- ldy slot
- lda pos1_lo,y
- ldx pos1_hi,y
- sta info + MOUSE_POS::XCOORD
- stx info + MOUSE_POS::XCOORD+1
- jsr CMOVEX
-
- ; Get and set the new Y position
- ldy slot
- lda pos2_lo,y
- ldx pos2_hi,y
- sta info + MOUSE_POS::YCOORD
- stx info + MOUSE_POS::YCOORD+1
- jsr CMOVEY
-
- ; Check for visibility
-: lda visible
- beq :+
-
- ; Draw the cursor at the new position
- jsr CSHOW
-: sec ; Interrupt handled
- rts
+ ; Check for installed mouse
+ lda slot
+ beq done
+
+ ; Check for mouse interrupt
+ ldx #SERVEMOUSE
+ jsr firmware
+ bcc :+
+ clc ; Interrupt not handled
+done: rts
+
+: ldx #READMOUSE
+ jsr firmware
+
+ ; Get status
+ ldy slot
+ lda status,y
+ tax ; Save status
+
+ ; Extract button down values
+ asl ; C = Button 0 is currently down
+ and #%00100000 ; !Z = Button 1 is currently down
+
+ ; Set button mask
+ beq :+
+ lda #MOUSE_BTN_RIGHT
+: bcc :+
+ ora #MOUSE_BTN_LEFT
+: sta info + MOUSE_INFO::BUTTONS
+
+ ; Check for mouse movement
+ txa ; Restore status
+ and #%00100000 ; X or Y changed since last READMOUSE
+ beq :+
+
+ ; Remove the cursor at the old position
+update: jsr CHIDE
+
+ ; Get and set the new X position
+ ldy slot
+ lda pos1_lo,y
+ ldx pos1_hi,y
+ sta info + MOUSE_POS::XCOORD
+ stx info + MOUSE_POS::XCOORD+1
+ jsr CMOVEX
+
+ ; Get and set the new Y position
+ ldy slot
+ lda pos2_lo,y
+ ldx pos2_hi,y
+ sta info + MOUSE_POS::YCOORD
+ stx info + MOUSE_POS::YCOORD+1
+ jsr CMOVEY
+
+ ; Check for visibility
+: lda visible
+ beq :+
+
+ ; Draw the cursor at the new position
+ jsr CSHOW
+: sec ; Interrupt handled
+ rts
diff --git a/libsrc/apple2/mouse_stat_stddrv.s b/libsrc/apple2/mouse_stat_stddrv.s
index 4ca1e7f04..dcb3be9ca 100644
--- a/libsrc/apple2/mouse_stat_stddrv.s
+++ b/libsrc/apple2/mouse_stat_stddrv.s
@@ -6,16 +6,16 @@
; const void mouse_static_stddrv[];
;
- .export _mouse_static_stddrv
- .ifdef __APPLE2ENH__
- .import _a2e_stdmou_mou
+ .export _mouse_static_stddrv
+ .ifdef __APPLE2ENH__
+ .import _a2e_stdmou_mou
.else
- .import _a2_stdmou_mou
+ .import _a2_stdmou_mou
.endif
.rodata
- .ifdef __APPLE2ENH__
+ .ifdef __APPLE2ENH__
_mouse_static_stddrv := _a2e_stdmou_mou
.else
_mouse_static_stddrv := _a2_stdmou_mou
diff --git a/libsrc/apple2/mouse_stddrv.s b/libsrc/apple2/mouse_stddrv.s
index a58767e0d..876fbb4af 100644
--- a/libsrc/apple2/mouse_stddrv.s
+++ b/libsrc/apple2/mouse_stddrv.s
@@ -6,13 +6,13 @@
; const char mouse_stddrv[];
;
- .export _mouse_stddrv
+ .export _mouse_stddrv
.rodata
_mouse_stddrv:
- .ifdef __APPLE2ENH__
- .asciiz "A2E.STDMOU.MOU"
+ .ifdef __APPLE2ENH__
+ .asciiz "A2E.STDMOU.MOU"
.else
- .asciiz "A2.STDMOU.MOU"
+ .asciiz "A2.STDMOU.MOU"
.endif
diff --git a/libsrc/apple2/open.s b/libsrc/apple2/open.s
index 078cfdd48..db40c3c74 100644
--- a/libsrc/apple2/open.s
+++ b/libsrc/apple2/open.s
@@ -4,28 +4,28 @@
; int open (const char* name, int flags, ...);
;
- .export _open, closedirect, freebuffer
- .export __filetype, __auxtype
- .constructor raisefilelevel
- .destructor closeallfiles, 5
+ .export _open, closedirect, freebuffer
+ .export __filetype, __auxtype
+ .constructor raisefilelevel
+ .destructor closeallfiles, 5
- .import pushname, popname, __dos_type
- .import iobuf_alloc, iobuf_free
- .import addysp, incsp4, incaxy, pushax, popax
+ .import pushname, popname, __dos_type
+ .import iobuf_alloc, iobuf_free
+ .import addysp, incsp4, incaxy, pushax, popax
- .include "zeropage.inc"
- .include "errno.inc"
- .include "fcntl.inc"
- .include "mli.inc"
- .include "filedes.inc"
+ .include "zeropage.inc"
+ .include "errno.inc"
+ .include "fcntl.inc"
+ .include "mli.inc"
+ .include "filedes.inc"
- .segment "INIT"
+ .segment "INIT"
raisefilelevel:
; Raise file level
- lda __dos_type
- beq :+
- inc LEVEL
+ lda __dos_type
+ beq :+
+ inc LEVEL
: rts
.code
@@ -37,14 +37,14 @@ _open:
dey
dey
dey
- jsr addysp
+ jsr addysp
; Start with first fdtab slot
- ldy #$00
+ ldy #$00
; Check for free fdtab slot
-: lda fdtab + FD::REF_NUM,y
- beq found
+: lda fdtab + FD::REF_NUM,y
+ beq found
; Advance to next fdtab slot
.assert .sizeof(FD) = 4, error
@@ -54,149 +54,149 @@ _open:
iny
; Check for end of fdtab
- cpy #MAX_FDS * .sizeof(FD)
- bcc :-
+ cpy #MAX_FDS * .sizeof(FD)
+ bcc :-
; Load errno code
- lda #EMFILE
+ lda #EMFILE
; Cleanup stack
-errno: jsr incsp4 ; Preserves A
+errno: jsr incsp4 ; Preserves A
; Set __errno
- jmp __directerrno
+ jmp __directerrno
; Save fdtab slot
found: tya
pha
; Alloc I/O buffer
- lda #<(fdtab + FD::BUFFER)
- ldx #>(fdtab + FD::BUFFER)
- jsr incaxy
- jsr pushax
- lda #$00
- ldx #>$0100
- jsr pushax ; Preserves A
- ldx #>$0400
- jsr iobuf_alloc
- tay ; Save errno code
+ lda #<(fdtab + FD::BUFFER)
+ ldx #>(fdtab + FD::BUFFER)
+ jsr incaxy
+ jsr pushax
+ lda #$00
+ ldx #>$0100
+ jsr pushax ; Preserves A
+ ldx #>$0400
+ jsr iobuf_alloc
+ tay ; Save errno code
; Restore fdtab slot
pla
- sta tmp2 ; Save fdtab slot
+ sta tmp2 ; Save fdtab slot
; Check for error
- tya ; Restore errno code
- bne errno
+ tya ; Restore errno code
+ bne errno
; Get and save flags
- jsr popax
- sta tmp3
+ jsr popax
+ sta tmp3
; Get and push name
- jsr popax
- jsr pushname
- bne oserr1
+ jsr popax
+ jsr pushname
+ bne oserr1
; Set pushed name
- lda sp
- ldx sp+1
- sta mliparam + MLI::OPEN::PATHNAME
- stx mliparam + MLI::OPEN::PATHNAME+1
+ lda sp
+ ldx sp+1
+ sta mliparam + MLI::OPEN::PATHNAME
+ stx mliparam + MLI::OPEN::PATHNAME+1
; Check for create flag
- lda tmp3 ; Restore flags
- and #O_CREAT
- beq open
+ lda tmp3 ; Restore flags
+ and #O_CREAT
+ beq open
; PATHNAME already set
.assert MLI::CREATE::PATHNAME = MLI::OPEN::PATHNAME, error
; Set all other parameters from template
- ldx #(MLI::CREATE::CREATE_TIME+1) - (MLI::CREATE::PATHNAME+1) - 1
-: lda CREATE,x
- sta mliparam + MLI::CREATE::ACCESS,x
+ ldx #(MLI::CREATE::CREATE_TIME+1) - (MLI::CREATE::PATHNAME+1) - 1
+: lda CREATE,x
+ sta mliparam + MLI::CREATE::ACCESS,x
dex
- bpl :-
+ bpl :-
; Create file
- lda #CREATE_CALL
- ldx #CREATE_COUNT
- jsr callmli
- bcc open
+ lda #CREATE_CALL
+ ldx #CREATE_COUNT
+ jsr callmli
+ bcc open
; Check for ordinary errors
- cmp #$47 ; "Duplicate filename"
- bne oserr2
+ cmp #$47 ; "Duplicate filename"
+ bne oserr2
; Check for exclusive flag
- lda tmp3 ; Restore flags
- and #O_EXCL
- beq open
+ lda tmp3 ; Restore flags
+ and #O_EXCL
+ beq open
- lda #$47 ; "Duplicate filename"
+ lda #$47 ; "Duplicate filename"
; Cleanup name
-oserr2: jsr popname ; Preserves A
+oserr2: jsr popname ; Preserves A
-oserr1: ldy tmp2 ; Restore fdtab slot
+oserr1: ldy tmp2 ; Restore fdtab slot
; Cleanup I/O buffer
- pha ; Save oserror code
- jsr freebuffer
- pla ; Restore oserror code
+ pha ; Save oserror code
+ jsr freebuffer
+ pla ; Restore oserror code
; Set __oserror
- jmp __mappederrno
+ jmp __mappederrno
-open: ldy tmp2 ; Restore fdtab slot
+open: ldy tmp2 ; Restore fdtab slot
; Set allocated I/O buffer
- ldx fdtab + FD::BUFFER+1,y
- sta mliparam + MLI::OPEN::IO_BUFFER ; A = 0
- stx mliparam + MLI::OPEN::IO_BUFFER+1
+ ldx fdtab + FD::BUFFER+1,y
+ sta mliparam + MLI::OPEN::IO_BUFFER ; A = 0
+ stx mliparam + MLI::OPEN::IO_BUFFER+1
; Open file
- lda #OPEN_CALL
- ldx #OPEN_COUNT
- jsr callmli
- bcs oserr2
+ lda #OPEN_CALL
+ ldx #OPEN_COUNT
+ jsr callmli
+ bcs oserr2
; Get and save fd
- ldx mliparam + MLI::OPEN::REF_NUM
- stx tmp1 ; Save fd
+ ldx mliparam + MLI::OPEN::REF_NUM
+ stx tmp1 ; Save fd
; Set flags and check for truncate flag
- lda tmp3 ; Restore flags
- sta fdtab + FD::FLAGS,y
- and #O_TRUNC
- beq done
+ lda tmp3 ; Restore flags
+ sta fdtab + FD::FLAGS,y
+ and #O_TRUNC
+ beq done
; Set fd and zero size
- stx mliparam + MLI::EOF::REF_NUM
- ldx #$02
- lda #$00
-: sta mliparam + MLI::EOF::EOF,x
+ stx mliparam + MLI::EOF::REF_NUM
+ ldx #$02
+ lda #$00
+: sta mliparam + MLI::EOF::EOF,x
dex
- bpl :-
+ bpl :-
; Set file size
- lda #SET_EOF_CALL
- ldx #EOF_COUNT
- jsr callmli
- bcc done
+ lda #SET_EOF_CALL
+ ldx #EOF_COUNT
+ jsr callmli
+ bcc done
; Cleanup file
- pha ; Save oserror code
- lda tmp1 ; Restore fd
- jsr closedirect
- pla ; Restore oserror code
- bne oserr2 ; Branch always
+ pha ; Save oserror code
+ lda tmp1 ; Restore fd
+ jsr closedirect
+ pla ; Restore oserror code
+ bne oserr2 ; Branch always
; Store fd
-done: lda tmp1 ; Restore fd
- sta fdtab + FD::REF_NUM,y
+done: lda tmp1 ; Restore fd
+ sta fdtab + FD::REF_NUM,y
; Convert fdtab slot to handle
.assert .sizeof(FD) = 4, error
@@ -205,46 +205,46 @@ done: lda tmp1 ; Restore fd
lsr
; Cleanup name
- jsr popname ; Preserves A
+ jsr popname ; Preserves A
; Return success
- ldx #$00
- stx __oserror
+ ldx #$00
+ stx __oserror
rts
freebuffer:
; Free I/O buffer
- lda #$00
- ldx fdtab + FD::BUFFER+1,y
- jmp iobuf_free
+ lda #$00
+ ldx fdtab + FD::BUFFER+1,y
+ jmp iobuf_free
closedirect:
; Set fd
- sta mliparam + MLI::CLOSE::REF_NUM
+ sta mliparam + MLI::CLOSE::REF_NUM
; Call close
- lda #CLOSE_CALL
- ldx #CLOSE_COUNT
- jmp callmli
+ lda #CLOSE_CALL
+ ldx #CLOSE_COUNT
+ jmp callmli
closeallfiles:
; All open files with current level (or higher)
- lda #$00
- jsr closedirect
+ lda #$00
+ jsr closedirect
; Restore original file level
- lda __dos_type
- beq :+
- dec LEVEL
+ lda __dos_type
+ beq :+
+ dec LEVEL
: rts
.data
-CREATE: .byte %11000011 ; ACCESS: Standard full access
+CREATE: .byte %11000011 ; ACCESS: Standard full access
__filetype:
- .byte $06 ; FILE_TYPE: Standard binary file
+ .byte $06 ; FILE_TYPE: Standard binary file
__auxtype:
- .word $0000 ; AUX_TYPE: Load address N/A
- .byte $01 ; STORAGE_TYPE: Standard seedling file
- .word $0000 ; CREATE_DATE: Current date
- .word $0000 ; CREATE_TIME: Current time
+ .word $0000 ; AUX_TYPE: Load address N/A
+ .byte $01 ; STORAGE_TYPE: Standard seedling file
+ .word $0000 ; CREATE_DATE: Current date
+ .word $0000 ; CREATE_TIME: Current time
diff --git a/libsrc/apple2/opendir.c b/libsrc/apple2/opendir.c
index 3b6c45d94..040593118 100644
--- a/libsrc/apple2/opendir.c
+++ b/libsrc/apple2/opendir.c
@@ -52,7 +52,7 @@ extern char _cwd[FILENAME_MAX];
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
@@ -64,44 +64,44 @@ DIR* __fastcall__ opendir (register const char* name)
/* Alloc DIR */
if ((dir = malloc (sizeof (*dir))) == NULL) {
- /* May not have been done by malloc() */
- _directerrno (ENOMEM);
+ /* May not have been done by malloc() */
+ _directerrno (ENOMEM);
- /* Return failure */
- return NULL;
+ /* Return failure */
+ return NULL;
}
/* Interpret dot as current working directory */
if (*name == '.') {
- name = _cwd;
+ name = _cwd;
}
/* Open directory file */
if ((dir->fd = open (name, O_RDONLY)) != -1) {
- /* Read directory key block */
- if (read (dir->fd,
- dir->block.bytes,
- sizeof (dir->block)) == sizeof (dir->block)) {
+ /* Read directory key block */
+ if (read (dir->fd,
+ dir->block.bytes,
+ sizeof (dir->block)) == sizeof (dir->block)) {
- /* Get directory entry infos from directory header */
- dir->entry_length = dir->block.bytes[0x23];
- dir->entries_per_block = dir->block.bytes[0x24];
+ /* Get directory entry infos from directory header */
+ dir->entry_length = dir->block.bytes[0x23];
+ dir->entries_per_block = dir->block.bytes[0x24];
- /* Skip directory header entry */
- dir->current_entry = 1;
+ /* Skip directory header entry */
+ dir->current_entry = 1;
- /* Return success */
- return dir;
- }
+ /* Return success */
+ return dir;
+ }
- /* EOF: Most probably no directory file at all */
- if (_oserror == 0) {
- _directerrno (EINVAL);
- }
+ /* EOF: Most probably no directory file at all */
+ if (_oserror == 0) {
+ _directerrno (EINVAL);
+ }
- /* Cleanup directory file */
- close (dir->fd);
+ /* Cleanup directory file */
+ close (dir->fd);
}
/* Cleanup DIR */
diff --git a/libsrc/apple2/oserrlist.s b/libsrc/apple2/oserrlist.s
index 2ec5c6f19..6fd711ee8 100644
--- a/libsrc/apple2/oserrlist.s
+++ b/libsrc/apple2/oserrlist.s
@@ -41,36 +41,36 @@ End:
.rodata
__sys_oserrlist:
- sys_oserr_entry $01, "Bad system call number"
- sys_oserr_entry $04, "Bad system call parameter count"
- sys_oserr_entry $25, "Interrupt table full"
- sys_oserr_entry $27, "I/O error"
- sys_oserr_entry $28, "No device connected"
- sys_oserr_entry $2B, "Disk write protected"
- sys_oserr_entry $2E, "Disk switched"
- sys_oserr_entry $2F, "Device off-line"
- sys_oserr_entry $40, "Invalid pathname"
- sys_oserr_entry $42, "Maximum number of files open"
- sys_oserr_entry $43, "Invalid reference number"
- sys_oserr_entry $44, "Directory not found"
- sys_oserr_entry $45, "Volume not found"
- sys_oserr_entry $46, "File not found"
- sys_oserr_entry $47, "Duplicate filename"
- sys_oserr_entry $48, "Volume full"
- sys_oserr_entry $49, "Volume directory full"
- sys_oserr_entry $4A, "Incompatible file format"
- sys_oserr_entry $4B, "Unsupported storage_type"
- sys_oserr_entry $4C, "End of file encountered"
- sys_oserr_entry $4D, "Position out of range"
- sys_oserr_entry $4E, "File access error"
- sys_oserr_entry $50, "File is open"
- sys_oserr_entry $51, "Directory structure damaged"
- sys_oserr_entry $52, "Not a ProDOS disk"
- sys_oserr_entry $53, "Invalid system call parameter"
- sys_oserr_entry $55, "Volume Control Block table full"
- sys_oserr_entry $56, "Bad buffer address"
- sys_oserr_entry $57, "Duplicate volume"
- sys_oserr_entry $5A, "File structure damaged"
+ sys_oserr_entry $01, "Bad system call number"
+ sys_oserr_entry $04, "Bad system call parameter count"
+ sys_oserr_entry $25, "Interrupt table full"
+ sys_oserr_entry $27, "I/O error"
+ sys_oserr_entry $28, "No device connected"
+ sys_oserr_entry $2B, "Disk write protected"
+ sys_oserr_entry $2E, "Disk switched"
+ sys_oserr_entry $2F, "Device off-line"
+ sys_oserr_entry $40, "Invalid pathname"
+ sys_oserr_entry $42, "Maximum number of files open"
+ sys_oserr_entry $43, "Invalid reference number"
+ sys_oserr_entry $44, "Directory not found"
+ sys_oserr_entry $45, "Volume not found"
+ sys_oserr_entry $46, "File not found"
+ sys_oserr_entry $47, "Duplicate filename"
+ sys_oserr_entry $48, "Volume full"
+ sys_oserr_entry $49, "Volume directory full"
+ sys_oserr_entry $4A, "Incompatible file format"
+ sys_oserr_entry $4B, "Unsupported storage_type"
+ sys_oserr_entry $4C, "End of file encountered"
+ sys_oserr_entry $4D, "Position out of range"
+ sys_oserr_entry $4E, "File access error"
+ sys_oserr_entry $50, "File is open"
+ sys_oserr_entry $51, "Directory structure damaged"
+ sys_oserr_entry $52, "Not a ProDOS disk"
+ sys_oserr_entry $53, "Invalid system call parameter"
+ sys_oserr_entry $55, "Volume Control Block table full"
+ sys_oserr_entry $56, "Bad buffer address"
+ sys_oserr_entry $57, "Duplicate volume"
+ sys_oserr_entry $5A, "File structure damaged"
sys_oserr_sentinel "Unknown error"
diff --git a/libsrc/apple2/oserror.s b/libsrc/apple2/oserror.s
index 293c4c866..f16aa4960 100644
--- a/libsrc/apple2/oserror.s
+++ b/libsrc/apple2/oserror.s
@@ -4,59 +4,59 @@
; int __fastcall__ _osmaperrno (unsigned char oserror);
;
- .export __osmaperrno
+ .export __osmaperrno
- .include "errno.inc"
+ .include "errno.inc"
__osmaperrno:
- ldx #ErrTabSize
-: cmp ErrTab-2,x ; Search for the error code
- beq :+ ; Jump if found
+ ldx #ErrTabSize
+: cmp ErrTab-2,x ; Search for the error code
+ beq :+ ; Jump if found
dex
dex
- bne :- ; Next entry
+ bne :- ; Next entry
; Code not found, return EUNKNOWN
- lda #EUNKNOWN
+ lda #EUNKNOWN
rts
; Found the code
-: lda ErrTab-1,x
- ldx #$00 ; High byte always zero
+: lda ErrTab-1,x
+ ldx #$00 ; High byte always zero
rts
.rodata
-ErrTab: .byte $01, ENOSYS ; Bad system call number
- .byte $04, EINVAL ; Bad system call parameter count
- .byte $25, ENOMEM ; Interrupt table full
- .byte $27, EIO ; I/O error
- .byte $28, ENODEV ; No device connected
- .byte $2B, EACCES ; Disk write protected
-; .byte $2E, EUNKNOWN ; Disk switched
- .byte $2F, ENODEV ; Device off-line
- .byte $40, EINVAL ; Invalid pathname
- .byte $42, EMFILE ; Maximum number of files open
- .byte $43, EINVAL ; Invalid reference number
- .byte $44, ENOENT ; Directory not found
- .byte $45, ENOENT ; Volume not found
- .byte $46, ENOENT ; File not found
- .byte $47, EEXIST ; Duplicate filename
- .byte $48, ENOSPC ; Volume full
- .byte $49, ENOSPC ; Volume directory full
-; .byte $4A, EUNKNOWN ; Incompatible file format
- .byte $4B, EINVAL ; Unsupported storage_type
-; .byte $4C, EUNKNOWN ; End of file encountered
- .byte $4D, ESPIPE ; Position out of range
- .byte $4E, EACCES ; File access error
- .byte $50, EINVAL ; File is open
-; .byte $51, EUNKNOWN ; Directory structure damaged
- .byte $52, ENODEV ; Not a ProDOS volume
- .byte $53, ERANGE ; Invalid system call parameter
- .byte $55, EMFILE ; Volume Control Block table full
- .byte $56, EINVAL ; Bad buffer address
-; .byte $57, EUNKNOWN ; Duplicate volume
-; .byte $5A, EUNKNOWN ; File structure damaged
+ErrTab: .byte $01, ENOSYS ; Bad system call number
+ .byte $04, EINVAL ; Bad system call parameter count
+ .byte $25, ENOMEM ; Interrupt table full
+ .byte $27, EIO ; I/O error
+ .byte $28, ENODEV ; No device connected
+ .byte $2B, EACCES ; Disk write protected
+; .byte $2E, EUNKNOWN ; Disk switched
+ .byte $2F, ENODEV ; Device off-line
+ .byte $40, EINVAL ; Invalid pathname
+ .byte $42, EMFILE ; Maximum number of files open
+ .byte $43, EINVAL ; Invalid reference number
+ .byte $44, ENOENT ; Directory not found
+ .byte $45, ENOENT ; Volume not found
+ .byte $46, ENOENT ; File not found
+ .byte $47, EEXIST ; Duplicate filename
+ .byte $48, ENOSPC ; Volume full
+ .byte $49, ENOSPC ; Volume directory full
+; .byte $4A, EUNKNOWN ; Incompatible file format
+ .byte $4B, EINVAL ; Unsupported storage_type
+; .byte $4C, EUNKNOWN ; End of file encountered
+ .byte $4D, ESPIPE ; Position out of range
+ .byte $4E, EACCES ; File access error
+ .byte $50, EINVAL ; File is open
+; .byte $51, EUNKNOWN ; Directory structure damaged
+ .byte $52, ENODEV ; Not a ProDOS volume
+ .byte $53, ERANGE ; Invalid system call parameter
+ .byte $55, EMFILE ; Volume Control Block table full
+ .byte $56, EINVAL ; Bad buffer address
+; .byte $57, EUNKNOWN ; Duplicate volume
+; .byte $5A, EUNKNOWN ; File structure damaged
ErrTabSize = (* - ErrTab)
diff --git a/libsrc/apple2/randomize.s b/libsrc/apple2/randomize.s
index 76e8dd60f..1558d85a7 100644
--- a/libsrc/apple2/randomize.s
+++ b/libsrc/apple2/randomize.s
@@ -5,8 +5,8 @@
; /* Initialize the random number generator */
;
- .export __randomize
- .import _srand
+ .export __randomize
+ .import _srand
.include "apple2.inc"
diff --git a/libsrc/apple2/rdkey.s b/libsrc/apple2/rdkey.s
index d07888844..15ba4b345 100644
--- a/libsrc/apple2/rdkey.s
+++ b/libsrc/apple2/rdkey.s
@@ -4,17 +4,17 @@
; RDKEY routine
;
- .export RDKEY
+ .export RDKEY
- .include "apple2.inc"
+ .include "apple2.inc"
- .segment "LOWCODE"
+ .segment "LOWCODE"
RDKEY:
- ; Switch in ROM and call RDKEY
- bit $C082
- jsr $FD0C ; Display prompt and read key from user input routine
+ ; Switch in ROM and call RDKEY
+ bit $C082
+ jsr $FD0C ; Display prompt and read key from user input routine
- ; Switch in LC bank 2 for R/O and return
- bit $C080
- rts
+ ; Switch in LC bank 2 for R/O and return
+ bit $C080
+ rts
diff --git a/libsrc/apple2/read.s b/libsrc/apple2/read.s
index dccde611f..ef994d6aa 100644
--- a/libsrc/apple2/read.s
+++ b/libsrc/apple2/read.s
@@ -4,104 +4,104 @@
; int __fastcall__ read (int fd, void* buf, unsigned count);
;
- .constructor initprompt
- .export _read
- .import rwprolog, rwcommon
- .import RDKEY, COUT
+ .constructor initprompt
+ .export _read
+ .import rwprolog, rwcommon
+ .import RDKEY, COUT
- .include "zeropage.inc"
- .include "errno.inc"
- .include "fcntl.inc"
- .include "mli.inc"
- .include "filedes.inc"
- .include "apple2.inc"
+ .include "zeropage.inc"
+ .include "errno.inc"
+ .include "fcntl.inc"
+ .include "mli.inc"
+ .include "filedes.inc"
+ .include "apple2.inc"
- .segment "INIT"
+ .segment "INIT"
initprompt:
; Set prompt <> ']' to let DOS 3.3 know that we're
; not in Applesoft immediate mode and thus keep it
; from scanning our device I/O for DOS commands.
- lda #$80 ; Same value used at $D52C
- sta PROMPT
+ lda #$80 ; Same value used at $D52C
+ sta PROMPT
rts
.code
_read:
; Get parameters
- jsr rwprolog
- bcs errno
- tax ; Save fd
+ jsr rwprolog
+ bcs errno
+ tax ; Save fd
; Check for read access
- lda fdtab + FD::FLAGS,y
- and #O_RDONLY
- beq einval
+ lda fdtab + FD::FLAGS,y
+ and #O_RDONLY
+ beq einval
; Check for device
- txa ; Restore fd
- bmi device
+ txa ; Restore fd
+ bmi device
; Do read
- ldy #READ_CALL
- jmp rwcommon
+ ldy #READ_CALL
+ jmp rwcommon
; Device succeeds always
-device: lda #$00
- sta __oserror
+device: lda #$00
+ sta __oserror
; Set counter to zero
- sta ptr3
- sta ptr3+1
+ sta ptr3
+ sta ptr3+1
; Check for zero count
- lda ptr2
- ora ptr2+1
- beq check
+ lda ptr2
+ ora ptr2+1
+ beq check
; Read from device and echo to device
-next: jsr RDKEY
- jsr COUT
+next: jsr RDKEY
+ jsr COUT
; Clear hi bit and check for '\r'
- and #$7F
- cmp #$0D
- bne :+
+ and #$7F
+ cmp #$0D
+ bne :+
; Replace with '\n' and set count to zero
- lda #$0A
- ldy #$00
- sty ptr2
- sty ptr2+1
+ lda #$0A
+ ldy #$00
+ sty ptr2
+ sty ptr2+1
; Put char into buf
-: ldy #$00
- sta (ptr1),y
+: ldy #$00
+ sta (ptr1),y
; Increment pointer
- inc ptr1
- bne :+
- inc ptr1+1
+ inc ptr1
+ bne :+
+ inc ptr1+1
; Increment counter
-: inc ptr3
- bne check
- inc ptr3+1
+: inc ptr3
+ bne check
+ inc ptr3+1
; Check for counter less than count
-check: lda ptr3
- cmp ptr2
- bcc next
- ldx ptr3+1
- cpx ptr2+1
- bcc next
+check: lda ptr3
+ cmp ptr2
+ bcc next
+ ldx ptr3+1
+ cpx ptr2+1
+ bcc next
; Return success, AX already set
rts
; Load errno code
-einval: lda #EINVAL
+einval: lda #EINVAL
; Set __errno
-errno: jmp __directerrno
+errno: jmp __directerrno
diff --git a/libsrc/apple2/readdir.c b/libsrc/apple2/readdir.c
index 84c782ea1..8acfbbe8b 100644
--- a/libsrc/apple2/readdir.c
+++ b/libsrc/apple2/readdir.c
@@ -38,7 +38,7 @@
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
@@ -50,27 +50,27 @@ struct dirent* __fastcall__ readdir (register DIR* dir)
/* Search for the next active directory entry */
do {
- /* Read next directory block if necessary */
- if (dir->current_entry == dir->entries_per_block) {
- if (read (dir->fd,
- dir->block.bytes,
- sizeof (dir->block)) != sizeof (dir->block)) {
+ /* Read next directory block if necessary */
+ if (dir->current_entry == dir->entries_per_block) {
+ if (read (dir->fd,
+ dir->block.bytes,
+ sizeof (dir->block)) != sizeof (dir->block)) {
- /* Just return failure as read() has */
- /* set errno if (and only if) no EOF */
- return NULL;
- }
+ /* Just return failure as read() has */
+ /* set errno if (and only if) no EOF */
+ return NULL;
+ }
- /* Start with first entry in next block */
- dir->current_entry = 0;
- }
+ /* Start with first entry in next block */
+ dir->current_entry = 0;
+ }
- /* Compute pointer to current entry */
- entry = dir->block.content.entries +
- dir->current_entry * dir->entry_length;
+ /* Compute pointer to current entry */
+ entry = dir->block.content.entries +
+ dir->current_entry * dir->entry_length;
- /* Switch to next entry */
- ++dir->current_entry;
+ /* Switch to next entry */
+ ++dir->current_entry;
} while (entry[0x00] == 0);
/* Move creation date/time to allow for next step below */
diff --git a/libsrc/apple2/revers.s b/libsrc/apple2/revers.s
index 474bf5760..83fcb2ae7 100644
--- a/libsrc/apple2/revers.s
+++ b/libsrc/apple2/revers.s
@@ -4,19 +4,19 @@
; unsigned char __fastcall__ revers (unsigned char onoff)
;
- .export _revers
+ .export _revers
- .include "apple2.inc"
+ .include "apple2.inc"
_revers:
- tax ; Test onoff
- beq normal ; If zero, "normal" must be set
- ldx #$3F+1 ; Set "inverse"
+ tax ; Test onoff
+ beq normal ; If zero, "normal" must be set
+ ldx #$3F+1 ; Set "inverse"
normal: dex ; $00->$FF, $40->$3F
- lda #$00 ; Preload return code for "normal"
- ldy INVFLG ; Load current flag value
- stx INVFLG ; Save new flag value
- bmi :+ ; Jump if current value is $FF (normal)
- lda #$01 ; Return "inverse"
-: ldx #$00
+ lda #$00 ; Preload return code for "normal"
+ ldy INVFLG ; Load current flag value
+ stx INVFLG ; Save new flag value
+ bmi :+ ; Jump if current value is $FF (normal)
+ lda #$01 ; Return "inverse"
+: ldx #$00
rts
diff --git a/libsrc/apple2/rewinddir.c b/libsrc/apple2/rewinddir.c
index 7ff0cd70d..3329852d8 100644
--- a/libsrc/apple2/rewinddir.c
+++ b/libsrc/apple2/rewinddir.c
@@ -39,7 +39,7 @@
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
@@ -49,17 +49,17 @@ void __fastcall__ rewinddir (register DIR* dir)
/* Rewind directory file */
if (lseek (dir->fd, 0, SEEK_SET)) {
- /* Read directory key block */
- if (read (dir->fd,
- dir->block.bytes,
- sizeof (dir->block)) == sizeof (dir->block)) {
+ /* Read directory key block */
+ if (read (dir->fd,
+ dir->block.bytes,
+ sizeof (dir->block)) == sizeof (dir->block)) {
- /* Skip directory header entry */
- dir->current_entry = 1;
+ /* Skip directory header entry */
+ dir->current_entry = 1;
- /* Return success */
- return;
- }
+ /* Return success */
+ return;
+ }
}
/* Assert that no subsequent readdir() finds an active entry */
diff --git a/libsrc/apple2/rwcommon.s b/libsrc/apple2/rwcommon.s
index c74ed1377..3180a875d 100644
--- a/libsrc/apple2/rwcommon.s
+++ b/libsrc/apple2/rwcommon.s
@@ -2,59 +2,59 @@
; Oliver Schmidt, 12.01.2005
;
- .export rwprolog, rwcommon, rwepilog
- .import popax
+ .export rwprolog, rwcommon, rwepilog
+ .import popax
- .include "zeropage.inc"
- .include "errno.inc"
- .include "fcntl.inc"
- .include "mli.inc"
- .include "filedes.inc"
+ .include "zeropage.inc"
+ .include "errno.inc"
+ .include "fcntl.inc"
+ .include "mli.inc"
+ .include "filedes.inc"
rwprolog:
; Save count
- sta ptr2
- stx ptr2+1
+ sta ptr2
+ stx ptr2+1
; Get and save buf
- jsr popax
- sta ptr1
- stx ptr1+1
+ jsr popax
+ sta ptr1
+ stx ptr1+1
; Get and process fd
- jsr popax
- jmp getfd ; Returns A, Y and C
+ jsr popax
+ jmp getfd ; Returns A, Y and C
rwcommon:
; Set fd
- sta mliparam + MLI::RW::REF_NUM
+ sta mliparam + MLI::RW::REF_NUM
; Set buf
- lda ptr1
- ldx ptr1+1
- sta mliparam + MLI::RW::DATA_BUFFER
- stx mliparam + MLI::RW::DATA_BUFFER+1
+ lda ptr1
+ ldx ptr1+1
+ sta mliparam + MLI::RW::DATA_BUFFER
+ stx mliparam + MLI::RW::DATA_BUFFER+1
; Set count
- lda ptr2
- ldx ptr2+1
- sta mliparam + MLI::RW::REQUEST_COUNT
- stx mliparam + MLI::RW::REQUEST_COUNT+1
+ lda ptr2
+ ldx ptr2+1
+ sta mliparam + MLI::RW::REQUEST_COUNT
+ stx mliparam + MLI::RW::REQUEST_COUNT+1
; Call read or write
tya
- ldx #RW_COUNT
- jsr callmli
- bcc rwepilog
- cmp #$4C ; "End of file encountered"
- bne oserr
+ ldx #RW_COUNT
+ jsr callmli
+ bcc rwepilog
+ cmp #$4C ; "End of file encountered"
+ bne oserr
rwepilog:
; Return success
- sta __oserror ; A = 0
- lda mliparam + MLI::RW::TRANS_COUNT
- ldx mliparam + MLI::RW::TRANS_COUNT+1
+ sta __oserror ; A = 0
+ lda mliparam + MLI::RW::TRANS_COUNT
+ ldx mliparam + MLI::RW::TRANS_COUNT+1
rts
; Set __oserror
-oserr: jmp __mappederrno
+oserr: jmp __mappederrno
diff --git a/libsrc/apple2/ser/a2.ssc.s b/libsrc/apple2/ser/a2.ssc.s
index cb9ff2ec1..374505638 100644
--- a/libsrc/apple2/ser/a2.ssc.s
+++ b/libsrc/apple2/ser/a2.ssc.s
@@ -21,115 +21,115 @@
; interrupt handling assumes that the 65816 is in 6502-emulation mode.
;
- .include "zeropage.inc"
- .include "ser-kernel.inc"
- .include "ser-error.inc"
+ .include "zeropage.inc"
+ .include "ser-kernel.inc"
+ .include "ser-error.inc"
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "JUMPTABLE"
- ; Driver signature
- .byte $73, $65, $72 ; "ser"
- .byte SER_API_VERSION ; Serial API version number
+ ; Driver signature
+ .byte $73, $65, $72 ; "ser"
+ .byte SER_API_VERSION ; Serial API version number
- ; Jump table.
- .addr INSTALL
- .addr UNINSTALL
- .addr OPEN
- .addr CLOSE
- .addr GET
- .addr PUT
- .addr STATUS
- .addr IOCTL
- .addr IRQ
+ ; Jump table.
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr OPEN
+ .addr CLOSE
+ .addr GET
+ .addr PUT
+ .addr STATUS
+ .addr IOCTL
+ .addr IRQ
;----------------------------------------------------------------------------
; I/O definitions
-ACIA = $C088
-ACIA_DATA = ACIA+0 ; Data register
-ACIA_STATUS = ACIA+1 ; Status register
-ACIA_CMD = ACIA+2 ; Command register
-ACIA_CTRL = ACIA+3 ; Control register
+ACIA = $C088
+ACIA_DATA = ACIA+0 ; Data register
+ACIA_STATUS = ACIA+1 ; Status register
+ACIA_CMD = ACIA+2 ; Command register
+ACIA_CTRL = ACIA+3 ; Control register
;----------------------------------------------------------------------------
; Global variables
- .bss
-
-RecvHead: .res 1 ; Head of receive buffer
-RecvTail: .res 1 ; Tail of receive buffer
-RecvFreeCnt: .res 1 ; Number of bytes in receive buffer
-SendHead: .res 1 ; Head of send buffer
-SendTail: .res 1 ; Tail of send buffer
-SendFreeCnt: .res 1 ; Number of bytes in send buffer
-
-Stopped: .res 1 ; Flow-stopped flag
-RtsOff: .res 1 ;
-
-RecvBuf: .res 256 ; Receive buffers: 256 bytes
-SendBuf: .res 256 ; Send buffers: 256 bytes
-
-Index: .res 1 ; I/O register index
-
- .data
-
-Slot: .byte $02 ; Default to SSC in slot 2
-
- .rodata
-
- ; Tables used to translate RS232 params into register values
-BaudTable: ; bit7 = 1 means setting is invalid
- .byte $FF ; SER_BAUD_45_5
- .byte $01 ; SER_BAUD_50
- .byte $02 ; SER_BAUD_75
- .byte $03 ; SER_BAUD_110
- .byte $04 ; SER_BAUD_134_5
- .byte $05 ; SER_BAUD_150
- .byte $06 ; SER_BAUD_300
- .byte $07 ; SER_BAUD_600
- .byte $08 ; SER_BAUD_1200
- .byte $09 ; SER_BAUD_1800
- .byte $0A ; SER_BAUD_2400
- .byte $0B ; SER_BAUD_3600
- .byte $0C ; SER_BAUD_4800
- .byte $0D ; SER_BAUD_7200
- .byte $0E ; SER_BAUD_9600
- .byte $0F ; SER_BAUD_19200
- .byte $FF ; SER_BAUD_38400
- .byte $FF ; SER_BAUD_57600
- .byte $FF ; SER_BAUD_115200
- .byte $FF ; SER_BAUD_230400
+ .bss
+
+RecvHead: .res 1 ; Head of receive buffer
+RecvTail: .res 1 ; Tail of receive buffer
+RecvFreeCnt: .res 1 ; Number of bytes in receive buffer
+SendHead: .res 1 ; Head of send buffer
+SendTail: .res 1 ; Tail of send buffer
+SendFreeCnt: .res 1 ; Number of bytes in send buffer
+
+Stopped: .res 1 ; Flow-stopped flag
+RtsOff: .res 1 ;
+
+RecvBuf: .res 256 ; Receive buffers: 256 bytes
+SendBuf: .res 256 ; Send buffers: 256 bytes
+
+Index: .res 1 ; I/O register index
+
+ .data
+
+Slot: .byte $02 ; Default to SSC in slot 2
+
+ .rodata
+
+ ; Tables used to translate RS232 params into register values
+BaudTable: ; bit7 = 1 means setting is invalid
+ .byte $FF ; SER_BAUD_45_5
+ .byte $01 ; SER_BAUD_50
+ .byte $02 ; SER_BAUD_75
+ .byte $03 ; SER_BAUD_110
+ .byte $04 ; SER_BAUD_134_5
+ .byte $05 ; SER_BAUD_150
+ .byte $06 ; SER_BAUD_300
+ .byte $07 ; SER_BAUD_600
+ .byte $08 ; SER_BAUD_1200
+ .byte $09 ; SER_BAUD_1800
+ .byte $0A ; SER_BAUD_2400
+ .byte $0B ; SER_BAUD_3600
+ .byte $0C ; SER_BAUD_4800
+ .byte $0D ; SER_BAUD_7200
+ .byte $0E ; SER_BAUD_9600
+ .byte $0F ; SER_BAUD_19200
+ .byte $FF ; SER_BAUD_38400
+ .byte $FF ; SER_BAUD_57600
+ .byte $FF ; SER_BAUD_115200
+ .byte $FF ; SER_BAUD_230400
BitTable:
- .byte $60 ; SER_BITS_5
- .byte $40 ; SER_BITS_6
- .byte $20 ; SER_BITS_7
- .byte $00 ; SER_BITS_8
+ .byte $60 ; SER_BITS_5
+ .byte $40 ; SER_BITS_6
+ .byte $20 ; SER_BITS_7
+ .byte $00 ; SER_BITS_8
StopTable:
- .byte $00 ; SER_STOP_1
- .byte $80 ; SER_STOP_2
+ .byte $00 ; SER_STOP_1
+ .byte $80 ; SER_STOP_2
ParityTable:
- .byte $00 ; SER_PAR_NONE
- .byte $20 ; SER_PAR_ODD
- .byte $60 ; SER_PAR_EVEN
- .byte $A0 ; SER_PAR_MARK
- .byte $E0 ; SER_PAR_SPACE
+ .byte $00 ; SER_PAR_NONE
+ .byte $20 ; SER_PAR_ODD
+ .byte $60 ; SER_PAR_EVEN
+ .byte $A0 ; SER_PAR_MARK
+ .byte $E0 ; SER_PAR_SPACE
IdOfsTable:
- .byte $05 ; Pascal 1.0 ID byte
- .byte $07 ; Pascal 1.0 ID byte
- .byte $0B ; Pascal 1.1 generic signature byte
- .byte $0C ; Device signature byte
+ .byte $05 ; Pascal 1.0 ID byte
+ .byte $07 ; Pascal 1.0 ID byte
+ .byte $0B ; Pascal 1.1 generic signature byte
+ .byte $0C ; Device signature byte
IdValTable:
- .byte $38 ; Fixed
- .byte $18 ; Fixed
- .byte $01 ; Fixed
- .byte $31 ; Serial or parallel I/O card type 1
+ .byte $38 ; Fixed
+ .byte $18 ; Fixed
+ .byte $01 ; Fixed
+ .byte $31 ; Serial or parallel I/O card type 1
-IdTableLen = * - IdValTable
+IdTableLen = * - IdValTable
- .code
+ .code
;----------------------------------------------------------------------------
; INSTALL: Is called after the driver is loaded into memory. If possible,
@@ -149,119 +149,119 @@ IdTableLen = * - IdValTable
INSTALL:
UNINSTALL:
CLOSE:
- ldx Index ; Check for open port
- beq :+
+ ldx Index ; Check for open port
+ beq :+
- ; Deactivate DTR and disable 6551 interrupts
- lda #%00001010
- sta ACIA_CMD,x
+ ; Deactivate DTR and disable 6551 interrupts
+ lda #%00001010
+ sta ACIA_CMD,x
- ; Done, return an error code
-: lda #$C000
- ora Slot
- sta ptr2+1
-
- ; Check Pascal 1.1 Firmware Protocol ID bytes
-: ldy IdOfsTable,x
- lda IdValTable,x
- cmp (ptr2),y
- bne NoDevice
- inx
- cpx #IdTableLen
- bcc :-
-
- ; Convert slot to I/O register index
- lda Slot
- asl
- asl
- asl
- asl
- tax
-
- ; Check if the handshake setting is valid
- ldy #SER_PARAMS::HANDSHAKE ; Handshake
- lda (ptr1),y
- cmp #SER_HS_HW ; This is all we support
- bne InvParam
-
- ; Initialize buffers
- ldy #$00
- sty Stopped
- sty RecvHead
- sty RecvTail
- sty SendHead
- sty SendTail
- dey ; Y = 255
- sty RecvFreeCnt
- sty SendFreeCnt
-
- ; Set the value for the control register, which contains stop bits,
- ; word length and the baud rate.
- ldy #SER_PARAMS::BAUDRATE
- lda (ptr1),y ; Baudrate index
- tay
- lda BaudTable,y ; Get 6551 value
- bmi InvBaud ; Branch if rate not supported
- sta tmp1
-
- ldy #SER_PARAMS::DATABITS ; Databits
- lda (ptr1),y
- tay
- lda BitTable,y
- ora tmp1
- sta tmp1
-
- ldy #SER_PARAMS::STOPBITS ; Stopbits
- lda (ptr1),y
- tay
- lda StopTable,y
- ora tmp1
- ora #%00010000 ; Receiver clock source = baudrate
- sta ACIA_CTRL,x
-
- ; Set the value for the command register. We remember the base value
- ; in RtsOff, since we will have to manipulate ACIA_CMD often.
- ldy #SER_PARAMS::PARITY ; Parity
- lda (ptr1),y
- tay
- lda ParityTable,y
- ora #%00000001 ; DTR active
- sta RtsOff
- ora #%00001000 ; Enable receive interrupts
- sta ACIA_CMD,x
-
- ; Done
- stx Index ; Mark port as open
- lda #SER_ERR_NO_DEVICE
- rts
-
- ; Invalid parameter
-InvParam:lda #SER_ERR_INIT_FAILED
- rts
-
- ; Baud rate not available
-InvBaud:lda #SER_ERR_BAUD_UNAVAIL
- rts
+OPEN:
+ ldx #<$C000
+ stx ptr2
+ lda #>$C000
+ ora Slot
+ sta ptr2+1
+
+ ; Check Pascal 1.1 Firmware Protocol ID bytes
+: ldy IdOfsTable,x
+ lda IdValTable,x
+ cmp (ptr2),y
+ bne NoDevice
+ inx
+ cpx #IdTableLen
+ bcc :-
+
+ ; Convert slot to I/O register index
+ lda Slot
+ asl
+ asl
+ asl
+ asl
+ tax
+
+ ; Check if the handshake setting is valid
+ ldy #SER_PARAMS::HANDSHAKE ; Handshake
+ lda (ptr1),y
+ cmp #SER_HS_HW ; This is all we support
+ bne InvParam
+
+ ; Initialize buffers
+ ldy #$00
+ sty Stopped
+ sty RecvHead
+ sty RecvTail
+ sty SendHead
+ sty SendTail
+ dey ; Y = 255
+ sty RecvFreeCnt
+ sty SendFreeCnt
+
+ ; Set the value for the control register, which contains stop bits,
+ ; word length and the baud rate.
+ ldy #SER_PARAMS::BAUDRATE
+ lda (ptr1),y ; Baudrate index
+ tay
+ lda BaudTable,y ; Get 6551 value
+ bmi InvBaud ; Branch if rate not supported
+ sta tmp1
+
+ ldy #SER_PARAMS::DATABITS ; Databits
+ lda (ptr1),y
+ tay
+ lda BitTable,y
+ ora tmp1
+ sta tmp1
+
+ ldy #SER_PARAMS::STOPBITS ; Stopbits
+ lda (ptr1),y
+ tay
+ lda StopTable,y
+ ora tmp1
+ ora #%00010000 ; Receiver clock source = baudrate
+ sta ACIA_CTRL,x
+
+ ; Set the value for the command register. We remember the base value
+ ; in RtsOff, since we will have to manipulate ACIA_CMD often.
+ ldy #SER_PARAMS::PARITY ; Parity
+ lda (ptr1),y
+ tay
+ lda ParityTable,y
+ ora #%00000001 ; DTR active
+ sta RtsOff
+ ora #%00001000 ; Enable receive interrupts
+ sta ACIA_CMD,x
+
+ ; Done
+ stx Index ; Mark port as open
+ lda #SER_ERR_NO_DEVICE
+ rts
+
+ ; Invalid parameter
+InvParam:lda #SER_ERR_INIT_FAILED
+ rts
+
+ ; Baud rate not available
+InvBaud:lda #SER_ERR_BAUD_UNAVAIL
+ rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
@@ -269,86 +269,86 @@ InvBaud:lda #SER_ERR_NO_DATA
- rts
-
- ; Check for flow stopped & enough free: release flow control
-: ldy Stopped ; (34)
- beq :+
- cmp #63
- bcc :+
- lda #$00
- sta Stopped
- lda RtsOff
- ora #%00001000
- sta ACIA_CMD,x
-
- ; Get byte from buffer
-: ldy RecvHead ; (41)
- lda RecvBuf,y
- inc RecvHead
- inc RecvFreeCnt
- ldx #$00 ; (59)
- sta (ptr1,x)
- txa ; Return code = 0
- rts
+ ldx Index
+ ldy SendFreeCnt ; Send data if necessary
+ iny ; Y == $FF?
+ beq :+
+ lda #$00 ; TryHard = false
+ jsr TryToSend
+
+ ; Check for buffer empty
+: lda RecvFreeCnt ; (25)
+ cmp #$FF
+ bne :+
+ lda #SER_ERR_NO_DATA
+ rts
+
+ ; Check for flow stopped & enough free: release flow control
+: ldy Stopped ; (34)
+ beq :+
+ cmp #63
+ bcc :+
+ lda #$00
+ sta Stopped
+ lda RtsOff
+ ora #%00001000
+ sta ACIA_CMD,x
+
+ ; Get byte from buffer
+: ldy RecvHead ; (41)
+ lda RecvBuf,y
+ inc RecvHead
+ inc RecvFreeCnt
+ ldx #$00 ; (59)
+ sta (ptr1,x)
+ txa ; Return code = 0
+ rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; Must return an SER_ERR_xx code in a/x.
PUT:
- ldx Index
-
- ; Try to send
- ldy SendFreeCnt
- iny ; Y = $FF?
- beq :+
- pha
- lda #$00 ; TryHard = false
- jsr TryToSend
- pla
-
- ; Put byte into send buffer & send
-: ldy SendFreeCnt
- bne :+
- lda #SER_ERR_OVERFLOW
- rts
-
-: ldy SendTail
- sta SendBuf,y
- inc SendTail
- dec SendFreeCnt
- lda #$FF ; TryHard = true
- jsr TryToSend
- lda #SER_ERR_OVERFLOW
+ rts
+
+: ldy SendTail
+ sta SendBuf,y
+ inc SendTail
+ dec SendFreeCnt
+ lda #$FF ; TryHard = true
+ jsr TryToSend
+ lda #SER_ERR_INV_IOCTL
- rts
+: lda #SER_ERR_INV_IOCTL
+ rts
;----------------------------------------------------------------------------
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
@@ -381,55 +381,55 @@ IOCTL:
; was handled, otherwise with carry clear.
IRQ:
- ldx Index ; Check for open port
- beq Done
- lda ACIA_STATUS,x ; Check ACIA status for receive interrupt
- and #$08
- beq Done ; Jump if no ACIA interrupt
- lda ACIA_DATA,x ; Get byte from ACIA
- ldy RecvFreeCnt ; Check if we have free space left
- beq Flow ; Jump if no space in receive buffer
- ldy RecvTail ; Load buffer pointer
- sta RecvBuf,y ; Store received byte in buffer
- inc RecvTail ; Increment buffer pointer
- dec RecvFreeCnt ; Decrement free space counter
- ldy RecvFreeCnt ; Check for buffer space low
- cpy #33
- bcc Flow ; Assert flow control if buffer space low
- rts ; Interrupt handled (carry already set)
-
- ; Assert flow control if buffer space too low
-Flow: lda RtsOff
- sta ACIA_CMD,x
- sta Stopped
- sec ; Interrupt handled
-Done: rts
+ ldx Index ; Check for open port
+ beq Done
+ lda ACIA_STATUS,x ; Check ACIA status for receive interrupt
+ and #$08
+ beq Done ; Jump if no ACIA interrupt
+ lda ACIA_DATA,x ; Get byte from ACIA
+ ldy RecvFreeCnt ; Check if we have free space left
+ beq Flow ; Jump if no space in receive buffer
+ ldy RecvTail ; Load buffer pointer
+ sta RecvBuf,y ; Store received byte in buffer
+ inc RecvTail ; Increment buffer pointer
+ dec RecvFreeCnt ; Decrement free space counter
+ ldy RecvFreeCnt ; Check for buffer space low
+ cpy #33
+ bcc Flow ; Assert flow control if buffer space low
+ rts ; Interrupt handled (carry already set)
+
+ ; Assert flow control if buffer space too low
+Flow: lda RtsOff
+ sta ACIA_CMD,x
+ sta Stopped
+ sec ; Interrupt handled
+Done: rts
;----------------------------------------------------------------------------
; Try to send a byte. Internal routine. A = TryHard
TryToSend:
- sta tmp1 ; Remember tryHard flag
-Again: lda SendFreeCnt
- cmp #$FF
- beq Quit ; Bail out
-
- ; Check for flow stopped
- lda Stopped
- bne Quit ; Bail out
-
- ; Check that ACIA is ready to send
- lda ACIA_STATUS,x
- and #$10
- bne Send
- bit tmp1 ; Keep trying if must try hard
- bmi Again
-Quit: rts
-
- ; Send byte and try again
-Send: ldy SendHead
- lda SendBuf,y
- sta ACIA_DATA,x
- inc SendHead
- inc SendFreeCnt
- jmp Again
+ sta tmp1 ; Remember tryHard flag
+Again: lda SendFreeCnt
+ cmp #$FF
+ beq Quit ; Bail out
+
+ ; Check for flow stopped
+ lda Stopped
+ bne Quit ; Bail out
+
+ ; Check that ACIA is ready to send
+ lda ACIA_STATUS,x
+ and #$10
+ bne Send
+ bit tmp1 ; Keep trying if must try hard
+ bmi Again
+Quit: rts
+
+ ; Send byte and try again
+Send: ldy SendHead
+ lda SendBuf,y
+ sta ACIA_DATA,x
+ inc SendHead
+ inc SendFreeCnt
+ jmp Again
diff --git a/libsrc/apple2/syschdir.s b/libsrc/apple2/syschdir.s
index 7eb67e1ab..8afc3af0b 100644
--- a/libsrc/apple2/syschdir.s
+++ b/libsrc/apple2/syschdir.s
@@ -5,33 +5,33 @@
;
.export __syschdir
- .import pushname, popname
- .import initcwd
+ .import pushname, popname
+ .import initcwd
- .include "zeropage.inc"
- .include "mli.inc"
+ .include "zeropage.inc"
+ .include "mli.inc"
__syschdir:
; Push name
- jsr pushname
- bne oserr
+ jsr pushname
+ bne oserr
; Set pushed name
- lda sp
- ldx sp+1
- sta mliparam + MLI::PREFIX::PATHNAME
- stx mliparam + MLI::PREFIX::PATHNAME+1
+ lda sp
+ ldx sp+1
+ sta mliparam + MLI::PREFIX::PATHNAME
+ stx mliparam + MLI::PREFIX::PATHNAME+1
; Change directory
- lda #SET_PREFIX_CALL
- ldx #PREFIX_COUNT
- jsr callmli
- bcs cleanup
+ lda #SET_PREFIX_CALL
+ ldx #PREFIX_COUNT
+ jsr callmli
+ bcs cleanup
- ; Update current working directory
- jsr initcwd ; Returns with A = 0
+ ; Update current working directory
+ jsr initcwd ; Returns with A = 0
; Cleanup name
-cleanup:jsr popname ; Preserves A
+cleanup:jsr popname ; Preserves A
-oserr: rts
+oserr: rts
diff --git a/libsrc/apple2/sysmkdir.s b/libsrc/apple2/sysmkdir.s
index 1281fc5ae..7759da260 100644
--- a/libsrc/apple2/sysmkdir.s
+++ b/libsrc/apple2/sysmkdir.s
@@ -5,51 +5,51 @@
;
.export __sysmkdir
- .import pushname, popname
- .import addysp, popax
+ .import pushname, popname
+ .import addysp, popax
- .include "zeropage.inc"
- .include "mli.inc"
+ .include "zeropage.inc"
+ .include "mli.inc"
__sysmkdir:
; Throw away all parameters except the name
dey
dey
- jsr addysp
+ jsr addysp
; Get and push name
- jsr popax
- jsr pushname
- bne oserr
+ jsr popax
+ jsr pushname
+ bne oserr
; Set pushed name
- lda sp
- ldx sp+1
- sta mliparam + MLI::CREATE::PATHNAME
- stx mliparam + MLI::CREATE::PATHNAME+1
+ lda sp
+ ldx sp+1
+ sta mliparam + MLI::CREATE::PATHNAME
+ stx mliparam + MLI::CREATE::PATHNAME+1
; Set all other parameters from template
- ldx #(MLI::CREATE::CREATE_TIME+1) - (MLI::CREATE::PATHNAME+1) - 1
-: lda CREATE,x
- sta mliparam + MLI::CREATE::ACCESS,x
+ ldx #(MLI::CREATE::CREATE_TIME+1) - (MLI::CREATE::PATHNAME+1) - 1
+: lda CREATE,x
+ sta mliparam + MLI::CREATE::ACCESS,x
dex
- bpl :-
+ bpl :-
; Make directory
- lda #CREATE_CALL
- ldx #CREATE_COUNT
- jsr callmli
+ lda #CREATE_CALL
+ ldx #CREATE_COUNT
+ jsr callmli
; Cleanup name
- jsr popname ; Preserves A
+ jsr popname ; Preserves A
-oserr: rts
+oserr: rts
.rodata
-CREATE: .byte %11000011 ; ACCESS: Standard full access
- .byte $0F ; FILE_TYPE: Directory file
- .word $0000 ; AUX_TYPE: N/A
- .byte $0D ; STORAGE_TYPE: Linked directory file
- .word $0000 ; CREATE_DATE: Current date
- .word $0000 ; CREATE_TIME: Current time
+CREATE: .byte %11000011 ; ACCESS: Standard full access
+ .byte $0F ; FILE_TYPE: Directory file
+ .word $0000 ; AUX_TYPE: N/A
+ .byte $0D ; STORAGE_TYPE: Linked directory file
+ .word $0000 ; CREATE_DATE: Current date
+ .word $0000 ; CREATE_TIME: Current time
diff --git a/libsrc/apple2/sysremove.s b/libsrc/apple2/sysremove.s
index 7483b9320..08c4dff68 100644
--- a/libsrc/apple2/sysremove.s
+++ b/libsrc/apple2/sysremove.s
@@ -5,28 +5,28 @@
;
.export __sysremove
- .import pushname, popname
+ .import pushname, popname
- .include "zeropage.inc"
- .include "mli.inc"
+ .include "zeropage.inc"
+ .include "mli.inc"
__sysremove:
; Push name
- jsr pushname
- bne oserr
+ jsr pushname
+ bne oserr
; Set pushed name
- lda sp
- ldx sp+1
- sta mliparam + MLI::DESTROY::PATHNAME
- stx mliparam + MLI::DESTROY::PATHNAME+1
+ lda sp
+ ldx sp+1
+ sta mliparam + MLI::DESTROY::PATHNAME
+ stx mliparam + MLI::DESTROY::PATHNAME+1
; Remove file
- lda #DESTROY_CALL
- ldx #DESTROY_COUNT
- jsr callmli
+ lda #DESTROY_CALL
+ ldx #DESTROY_COUNT
+ jsr callmli
; Cleanup name
- jsr popname ; Preserves A
+ jsr popname ; Preserves A
-oserr: rts
+oserr: rts
diff --git a/libsrc/apple2/sysrename.s b/libsrc/apple2/sysrename.s
index af57e1405..0fe8dd7b1 100644
--- a/libsrc/apple2/sysrename.s
+++ b/libsrc/apple2/sysrename.s
@@ -5,55 +5,55 @@
;
.export __sysrename
- .import pushname, popname
- .import popax
+ .import pushname, popname
+ .import popax
- .include "zeropage.inc"
- .include "mli.inc"
+ .include "zeropage.inc"
+ .include "mli.inc"
__sysrename:
- ; Save newname
- sta ptr2
- stx ptr2+1
+ ; Save newname
+ sta ptr2
+ stx ptr2+1
; Get and push oldname
- jsr popax
- jsr pushname
- bne oserr1
+ jsr popax
+ jsr pushname
+ bne oserr1
- ; Save pushed oldname
- lda sp
- ldx sp+1
- sta ptr3
- stx ptr3+1
+ ; Save pushed oldname
+ lda sp
+ ldx sp+1
+ sta ptr3
+ stx ptr3+1
; Restore and push newname
- lda ptr2
- ldx ptr2+1
- jsr pushname
- bne oserr2
+ lda ptr2
+ ldx ptr2+1
+ jsr pushname
+ bne oserr2
; Restore and set pushed oldname
- lda ptr3
- ldx ptr3+1
- sta mliparam + MLI::RENAME::PATHNAME
- stx mliparam + MLI::RENAME::PATHNAME+1
+ lda ptr3
+ ldx ptr3+1
+ sta mliparam + MLI::RENAME::PATHNAME
+ stx mliparam + MLI::RENAME::PATHNAME+1
; Set pushed newname
- lda sp
- ldx sp+1
- sta mliparam + MLI::RENAME::NEW_PATHNAME
- stx mliparam + MLI::RENAME::NEW_PATHNAME+1
+ lda sp
+ ldx sp+1
+ sta mliparam + MLI::RENAME::NEW_PATHNAME
+ stx mliparam + MLI::RENAME::NEW_PATHNAME+1
; Rename file
- lda #RENAME_CALL
- ldx #RENAME_COUNT
- jsr callmli
+ lda #RENAME_CALL
+ ldx #RENAME_COUNT
+ jsr callmli
; Cleanup newname
- jsr popname ; Preserves A
+ jsr popname ; Preserves A
; Cleanup oldname
-oserr2: jmp popname ; Preserves A
+oserr2: jmp popname ; Preserves A
-oserr1: rts
+oserr1: rts
diff --git a/libsrc/apple2/sysrmdir.s b/libsrc/apple2/sysrmdir.s
index 668be1208..11ac1f7e7 100644
--- a/libsrc/apple2/sysrmdir.s
+++ b/libsrc/apple2/sysrmdir.s
@@ -5,6 +5,6 @@
;
.export __sysrmdir
- .import __sysremove
+ .import __sysremove
__sysrmdir := __sysremove
diff --git a/libsrc/apple2/systime.s b/libsrc/apple2/systime.s
index 0a5f530ba..98d39a278 100644
--- a/libsrc/apple2/systime.s
+++ b/libsrc/apple2/systime.s
@@ -10,54 +10,54 @@
;
.include "time.inc"
- .include "zeropage.inc"
- .include "mli.inc"
+ .include "zeropage.inc"
+ .include "mli.inc"
__systime:
- ; Update time
- lda #GET_TIME_CALL
- ldx #GET_TIME_COUNT
- jsr callmli
- bcs err
-
- lda DATELO+1
- lsr
- php ; Save month msb
- cmp #70 ; Year < 70?
- bcs :+ ; No, leave alone
- adc #100 ; Move 19xx to 20xx
-: sta TM + tm::tm_year
- lda DATELO
- tax ; Save day
- plp ; Restore month msb
- ror
- lsr
- lsr
- lsr
- lsr
- beq err ; [1..12] allows for validity check
- tay
- dey ; Move [1..12] to [0..11]
- sty TM + tm::tm_mon
- txa ; Restore day
- and #%00011111
- sta TM + tm::tm_mday
-
- lda TIMELO+1
- sta TM + tm::tm_hour
- lda TIMELO
- sta TM + tm::tm_min
-
- lda #TM
- jmp _mktime
-
-err: lda #$FF
- tax
- sta sreg
- sta sreg+1
- rts ; Return -1
-
- .bss
-
-TM: .tag tm
+ ; Update time
+ lda #GET_TIME_CALL
+ ldx #GET_TIME_COUNT
+ jsr callmli
+ bcs err
+
+ lda DATELO+1
+ lsr
+ php ; Save month msb
+ cmp #70 ; Year < 70?
+ bcs :+ ; No, leave alone
+ adc #100 ; Move 19xx to 20xx
+: sta TM + tm::tm_year
+ lda DATELO
+ tax ; Save day
+ plp ; Restore month msb
+ ror
+ lsr
+ lsr
+ lsr
+ lsr
+ beq err ; [1..12] allows for validity check
+ tay
+ dey ; Move [1..12] to [0..11]
+ sty TM + tm::tm_mon
+ txa ; Restore day
+ and #%00011111
+ sta TM + tm::tm_mday
+
+ lda TIMELO+1
+ sta TM + tm::tm_hour
+ lda TIMELO
+ sta TM + tm::tm_min
+
+ lda #TM
+ jmp _mktime
+
+err: lda #$FF
+ tax
+ sta sreg
+ sta sreg+1
+ rts ; Return -1
+
+ .bss
+
+TM: .tag tm
diff --git a/libsrc/apple2/targetutil/loader.cfg b/libsrc/apple2/targetutil/loader.cfg
index aa7a8c437..ead1dca39 100644
--- a/libsrc/apple2/targetutil/loader.cfg
+++ b/libsrc/apple2/targetutil/loader.cfg
@@ -1,5 +1,5 @@
#################################################################################
-# #
+# #
# LOADER.SYSTEM - an Apple][ ProDOS 8 loader for cc65 programs (Oliver Schmidt) #
# #
#################################################################################
diff --git a/libsrc/apple2/targetutil/loader.s b/libsrc/apple2/targetutil/loader.s
index 71d79140e..0173f6105 100644
--- a/libsrc/apple2/targetutil/loader.s
+++ b/libsrc/apple2/targetutil/loader.s
@@ -4,231 +4,231 @@
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-A1L := $3C
-A1H := $3D
-STACK := $0100
-BUF := $0200
-PATHNAME := $0280
-MLI := $BF00
-VERSION := $FBB3
-RDKEY := $FD0C
-PRBYTE := $FDDA
-COUT := $FDED
-
-QUIT_CALL = $65
+A1L := $3C
+A1H := $3D
+STACK := $0100
+BUF := $0200
+PATHNAME := $0280
+MLI := $BF00
+VERSION := $FBB3
+RDKEY := $FD0C
+PRBYTE := $FDDA
+COUT := $FDED
+
+QUIT_CALL = $65
GET_FILE_INFO_CALL = $C4
-OPEN_CALL = $C8
-READ_CALL = $CA
-CLOSE_CALL = $CC
+OPEN_CALL = $C8
+READ_CALL = $CA
+CLOSE_CALL = $CC
FILE_NOT_FOUND_ERR = $46
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- .import __CODE_0300_SIZE__, __DATA_0300_SIZE__
- .import __CODE_0300_LOAD__, __CODE_0300_RUN__
+ .import __CODE_0300_SIZE__, __DATA_0300_SIZE__
+ .import __CODE_0300_LOAD__, __CODE_0300_RUN__
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-.segment "DATA_2000"
+.segment "DATA_2000"
GET_FILE_INFO_PARAM:
- .byte $0A ;PARAM_COUNT
- .addr PATHNAME ;PATHNAME
- .byte $00 ;ACCESS
- .byte $00 ;FILE_TYPE
-FILE_INFO_ADDR: .word $0000 ;AUX_TYPE
- .byte $00 ;STORAGE_TYPE
- .word $0000 ;BLOCKS_USED
- .word $0000 ;MOD_DATE
- .word $0000 ;MOD_TIME
- .word $0000 ;CREATE_DATE
- .word $0000 ;CREATE_TIME
+ .byte $0A ;PARAM_COUNT
+ .addr PATHNAME ;PATHNAME
+ .byte $00 ;ACCESS
+ .byte $00 ;FILE_TYPE
+FILE_INFO_ADDR: .word $0000 ;AUX_TYPE
+ .byte $00 ;STORAGE_TYPE
+ .word $0000 ;BLOCKS_USED
+ .word $0000 ;MOD_DATE
+ .word $0000 ;MOD_TIME
+ .word $0000 ;CREATE_DATE
+ .word $0000 ;CREATE_TIME
OPEN_PARAM:
- .byte $03 ;PARAM_COUNT
- .addr PATHNAME ;PATHNAME
- .addr MLI - 1024 ;IO_BUFFER
-OPEN_REF: .byte $00 ;REF_NUM
+ .byte $03 ;PARAM_COUNT
+ .addr PATHNAME ;PATHNAME
+ .addr MLI - 1024 ;IO_BUFFER
+OPEN_REF: .byte $00 ;REF_NUM
LOADING:
- .byte $0D
- .asciiz "Loading "
+ .byte $0D
+ .asciiz "Loading "
ELLIPSES:
- .byte " ...", $0D, $0D, $00
+ .byte " ...", $0D, $0D, $00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-.segment "DATA_0300"
+.segment "DATA_0300"
READ_PARAM:
- .byte $04 ;PARAM_COUNT
-READ_REF: .byte $00 ;REF_NUM
-READ_ADDR: .addr $0000 ;DATA_BUFFER
- .word $FFFF ;REQUEST_COUNT
- .word $0000 ;TRANS_COUNT
+ .byte $04 ;PARAM_COUNT
+READ_REF: .byte $00 ;REF_NUM
+READ_ADDR: .addr $0000 ;DATA_BUFFER
+ .word $FFFF ;REQUEST_COUNT
+ .word $0000 ;TRANS_COUNT
CLOSE_PARAM:
- .byte $01 ;PARAM_COUNT
-CLOSE_REF: .byte $00 ;REF_NUM
+ .byte $01 ;PARAM_COUNT
+CLOSE_REF: .byte $00 ;REF_NUM
QUIT_PARAM:
- .byte $04 ;PARAM_COUNT
- .byte $00 ;QUIT_TYPE
- .word $0000 ;RESERVED
- .byte $00 ;RESERVED
- .word $0000 ;RESERVED
+ .byte $04 ;PARAM_COUNT
+ .byte $00 ;QUIT_TYPE
+ .word $0000 ;RESERVED
+ .byte $00 ;RESERVED
+ .word $0000 ;RESERVED
FILE_NOT_FOUND:
- .asciiz "... File Not Found"
-
+ .asciiz "... File Not Found"
+
ERROR_NUMBER:
- .asciiz "... Error $"
+ .asciiz "... Error $"
PRESS_ANY_KEY:
- .asciiz " - Press Any Key "
+ .asciiz " - Press Any Key "
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-.segment "CODE_2000"
-
- jmp :+
- .byte $EE
- .byte $EE
- .byte 65
-STARTUP:.res 65
-
- ; Reset stack
-: ldx #$FF
- txs
-
- ; Relocate CODE_0300 and DATA_0300
- ldx #<(__CODE_0300_SIZE__ + __DATA_0300_SIZE__)
-: lda __CODE_0300_LOAD__ - 1,x
- sta __CODE_0300_RUN__ - 1,x
- dex
- bne :-
-
- ; Remove ".SYSTEM" from pathname
- lda PATHNAME
- sec
- sbc #.strlen(".SYSTEM")
- sta PATHNAME
-
- ; Add trailing '\0' to pathname
- tax
- lda #$00
- sta PATHNAME + 1,x
-
- ; Copy ProDOS startup filename and trailing '\0' to stack
- ldx STARTUP
- lda #$00
- beq :++ ; bra
-: lda STARTUP + 1,x
-: sta STACK,x
- dex
- bpl :--
-
- ; Provide some user feedback
- lda #LOADING
- jsr PRINT
- lda #<(PATHNAME + 1)
- ldx #>(PATHNAME + 1)
- jsr PRINT
- lda #ELLIPSES
- jsr PRINT
-
- jsr MLI
- .byte GET_FILE_INFO_CALL
- .word GET_FILE_INFO_PARAM
- bcc :+
- jmp ERROR
-
-: jsr MLI
- .byte OPEN_CALL
- .word OPEN_PARAM
- bcc :+
- jmp ERROR
-
- ; Copy file reference number
-: lda OPEN_REF
- sta READ_REF
- sta CLOSE_REF
-
- ; Get load address from aux-type
- lda FILE_INFO_ADDR
- ldx FILE_INFO_ADDR + 1
- sta READ_ADDR
- stx READ_ADDR + 1
-
- ; It's high time to leave this place
- jmp __CODE_0300_RUN__
+.segment "CODE_2000"
+
+ jmp :+
+ .byte $EE
+ .byte $EE
+ .byte 65
+STARTUP:.res 65
+
+ ; Reset stack
+: ldx #$FF
+ txs
+
+ ; Relocate CODE_0300 and DATA_0300
+ ldx #<(__CODE_0300_SIZE__ + __DATA_0300_SIZE__)
+: lda __CODE_0300_LOAD__ - 1,x
+ sta __CODE_0300_RUN__ - 1,x
+ dex
+ bne :-
+
+ ; Remove ".SYSTEM" from pathname
+ lda PATHNAME
+ sec
+ sbc #.strlen(".SYSTEM")
+ sta PATHNAME
+
+ ; Add trailing '\0' to pathname
+ tax
+ lda #$00
+ sta PATHNAME + 1,x
+
+ ; Copy ProDOS startup filename and trailing '\0' to stack
+ ldx STARTUP
+ lda #$00
+ beq :++ ; bra
+: lda STARTUP + 1,x
+: sta STACK,x
+ dex
+ bpl :--
+
+ ; Provide some user feedback
+ lda #LOADING
+ jsr PRINT
+ lda #<(PATHNAME + 1)
+ ldx #>(PATHNAME + 1)
+ jsr PRINT
+ lda #ELLIPSES
+ jsr PRINT
+
+ jsr MLI
+ .byte GET_FILE_INFO_CALL
+ .word GET_FILE_INFO_PARAM
+ bcc :+
+ jmp ERROR
+
+: jsr MLI
+ .byte OPEN_CALL
+ .word OPEN_PARAM
+ bcc :+
+ jmp ERROR
+
+ ; Copy file reference number
+: lda OPEN_REF
+ sta READ_REF
+ sta CLOSE_REF
+
+ ; Get load address from aux-type
+ lda FILE_INFO_ADDR
+ ldx FILE_INFO_ADDR + 1
+ sta READ_ADDR
+ stx READ_ADDR + 1
+
+ ; It's high time to leave this place
+ jmp __CODE_0300_RUN__
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-.segment "CODE_0300"
-
- jsr MLI
- .byte READ_CALL
- .word READ_PARAM
- bcs ERROR
-
- jsr MLI
- .byte CLOSE_CALL
- .word CLOSE_PARAM
- bcs ERROR
-
- ; Copy REM token and startup filename to BASIC input buffer
- ldx #$00
- lda #$B2
- bne :++ ; bra
-: inx
- lda a:STACK - 1,x
-: sta BUF,x
- bne :--
-
- ; Go for it ...
- jmp (READ_ADDR)
+.segment "CODE_0300"
+
+ jsr MLI
+ .byte READ_CALL
+ .word READ_PARAM
+ bcs ERROR
+
+ jsr MLI
+ .byte CLOSE_CALL
+ .word CLOSE_PARAM
+ bcs ERROR
+
+ ; Copy REM token and startup filename to BASIC input buffer
+ ldx #$00
+ lda #$B2
+ bne :++ ; bra
+: inx
+ lda a:STACK - 1,x
+: sta BUF,x
+ bne :--
+
+ ; Go for it ...
+ jmp (READ_ADDR)
PRINT:
- sta A1L
- stx A1H
- ldx VERSION
- ldy #$00
-: lda (A1L),y
- beq :++
- cpx #$06 ; //e ?
- beq :+
- cmp #$60 ; lowercase ?
- bcc :+
- and #$5F ; -> uppercase
-: ora #$80
- jsr COUT
- iny
- bne :-- ; bra
-: rts
+ sta A1L
+ stx A1H
+ ldx VERSION
+ ldy #$00
+: lda (A1L),y
+ beq :++
+ cpx #$06 ; //e ?
+ beq :+
+ cmp #$60 ; lowercase ?
+ bcc :+
+ and #$5F ; -> uppercase
+: ora #$80
+ jsr COUT
+ iny
+ bne :-- ; bra
+: rts
ERROR:
- cmp #FILE_NOT_FOUND_ERR
- bne :+
- lda #FILE_NOT_FOUND
- jsr PRINT
- beq :++ ; bra
-: pha
- lda #ERROR_NUMBER
- jsr PRINT
- pla
- jsr PRBYTE
-: lda #PRESS_ANY_KEY
- jsr PRINT
- jsr RDKEY
- jsr MLI
- .byte QUIT_CALL
- .word QUIT_PARAM
+ cmp #FILE_NOT_FOUND_ERR
+ bne :+
+ lda #FILE_NOT_FOUND
+ jsr PRINT
+ beq :++ ; bra
+: pha
+ lda #ERROR_NUMBER
+ jsr PRINT
+ pla
+ jsr PRBYTE
+: lda #PRESS_ANY_KEY
+ jsr PRINT
+ jsr RDKEY
+ jsr MLI
+ .byte QUIT_CALL
+ .word QUIT_PARAM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/libsrc/apple2/textframe.s b/libsrc/apple2/textframe.s
index e57337e92..d5e9b80d7 100644
--- a/libsrc/apple2/textframe.s
+++ b/libsrc/apple2/textframe.s
@@ -9,12 +9,12 @@
;
.ifdef __APPLE2ENH__
- .export _textframexy, _textframe
- .import popa, pusha, _gotoxy
- .import chlinedirect, cvlinedirect
+ .export _textframexy, _textframe
+ .import popa, pusha, _gotoxy
+ .import chlinedirect, cvlinedirect
- .include "zeropage.inc"
- .include "apple2.inc"
+ .include "zeropage.inc"
+ .include "apple2.inc"
WIDTH = tmp2
HEIGHT = tmp3
@@ -23,60 +23,60 @@ YORIGIN = ptr1
_textframexy:
sec
- bra :+
+ bra :+
_textframe:
clc
-: ldx INVFLG
- phx ; Save character display mode
- ldx #$FF
- stx INVFLG ; Set normal character display mode
- pha ; Save index
- jsr popa ; Get height
- sta HEIGHT
- jsr popa ; Get width
- sta WIDTH
- lda CH
- ldx CV
- bcc noxy
- jsr popa ; Get y
+: ldx INVFLG
+ phx ; Save character display mode
+ ldx #$FF
+ stx INVFLG ; Set normal character display mode
+ pha ; Save index
+ jsr popa ; Get height
+ sta HEIGHT
+ jsr popa ; Get width
+ sta WIDTH
+ lda CH
+ ldx CV
+ bcc noxy
+ jsr popa ; Get y
tax
- jsr popa ; Get x
-noxy: sta XORIGIN
- stx YORIGIN
- plx ; Restore index
-loop: lda XOFFS,x
+ jsr popa ; Get x
+noxy: sta XORIGIN
+ stx YORIGIN
+ plx ; Restore index
+loop: lda XOFFS,x
clc
- bpl :+ ; Relative to left edge?
- adc WIDTH
-: adc XORIGIN
- jsr pusha
- lda YOFFS,x
+ bpl :+ ; Relative to left edge?
+ adc WIDTH
+: adc XORIGIN
+ jsr pusha
+ lda YOFFS,x
clc
- bpl :+ ; Relative to top?
- adc HEIGHT
-: adc YORIGIN
- jsr _gotoxy ; Call this one, will pop params
+ bpl :+ ; Relative to top?
+ adc HEIGHT
+: adc YORIGIN
+ jsr _gotoxy ; Call this one, will pop params
txa
tay
- lsr ; Get bit 0 (vline) into carry
- lda LENGTH,x
- phx ; Save index
- ldx CHAR,y
- bcc hline
+ lsr ; Get bit 0 (vline) into carry
+ lda LENGTH,x
+ phx ; Save index
+ ldx CHAR,y
+ bcc hline
clc
- adc HEIGHT
- jsr cvlinedirect
- bra next
-hline: adc WIDTH
- jsr chlinedirect
-next: plx ; Restore index
+ adc HEIGHT
+ jsr cvlinedirect
+ bra next
+hline: adc WIDTH
+ jsr chlinedirect
+next: plx ; Restore index
inx
txa
- and #$03 ; Mask style
- bne loop
+ and #$03 ; Mask style
+ bne loop
pla
- sta INVFLG ; Restore character display mode
+ sta INVFLG ; Restore character display mode
rts
.rodata
@@ -88,21 +88,21 @@ next: plx ; Restore index
; x offset for the line starting point
; - a positive value means relative to the frame left edge
; - a negative value menas relative to the frame right edge
-XOFFS: .byte 0, 0, 0, <-2, 1, 0, 1, <-2
+XOFFS: .byte 0, 0, 0, <-2, 1, 0, 1, <-2
; y offset for the line starting point
; - a positive value means relative to the frame top
; - a negative value menas relative to the frame bottom
-YOFFS: .byte 0, 1, <-2, 1, 0, 0, <-2, 0
+YOFFS: .byte 0, 1, <-2, 1, 0, 0, <-2, 0
; length of the line relative to the frame size
; - a negative value for hlines means shorter than the width
; - a negative value for vlines menas shorter than the height
-LENGTH: .byte 0, <-2, 0, <-2, <-2, 0, <-2, 0
+LENGTH: .byte 0, <-2, 0, <-2, <-2, 0, <-2, 0
; character to use for drawing the line
; - hibit set means normal printable character
; - hibit clear means MouseText character
-CHAR: .byte '_'|$80, '_', 'L', 'Z', 'L', 'Z', '_'|$80, '_'
+CHAR: .byte '_'|$80, '_', 'L', 'Z', 'L', 'Z', '_'|$80, '_'
.endif ; __APPLE2ENH__
diff --git a/libsrc/apple2/tgi/a2.hi.s b/libsrc/apple2/tgi/a2.hi.s
index ce2814a1c..145b78e4a 100644
--- a/libsrc/apple2/tgi/a2.hi.s
+++ b/libsrc/apple2/tgi/a2.hi.s
@@ -5,55 +5,55 @@
; Oliver Schmidt
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
- .include "apple2.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
+ .include "apple2.inc"
; ------------------------------------------------------------------------
; Zero page stuff
-HBASL := $26
-HMASK := $30
-PAGE := $E6
-SCALE := $E7
-ROT := $F9
+HBASL := $26
+HMASK := $30
+PAGE := $E6
+SCALE := $E7
+ROT := $F9
; Graphics entry points, by cbmnut (applenut??) cbmnut@hushmail.com
-TEXT := $F399 ; Return to text screen
-HGR2 := $F3D8 ; Initialize and clear hi-res page 2.
-HGR := $F3E2 ; Initialize and clear hi-res page 1.
-HCLR := $F3F2 ; Clear the current hi-res screen to black.
-BKGND := $F3F6 ; Clear the current hi-res screen to the
+TEXT := $F399 ; Return to text screen
+HGR2 := $F3D8 ; Initialize and clear hi-res page 2.
+HGR := $F3E2 ; Initialize and clear hi-res page 1.
+HCLR := $F3F2 ; Clear the current hi-res screen to black.
+BKGND := $F3F6 ; Clear the current hi-res screen to the
; last plotted color (from ($1C).
-HPOSN := $F411 ; Positions the hi-res cursor without
+HPOSN := $F411 ; Positions the hi-res cursor without
; plotting a point.
; Enter with (A) = Y-coordinate, and
; (Y,X) = X-coordinate.
-HPLOT := $F457 ; Calls HPOSN and tries to plot a dot at
+HPLOT := $F457 ; Calls HPOSN and tries to plot a dot at
; the cursor's position. If you are
; trying to plot a non-white color at
; a complementary color position, no
; dot will be plotted.
-HLIN := $F53A ; Draws a line from the last plotted
+HLIN := $F53A ; Draws a line from the last plotted
; point or line destination to:
; (X,A) = X-coordinate, and
; (Y) = Y-coordinate.
-HFIND := $F5CB ; Converts the hi-res coursor's position
+HFIND := $F5CB ; Converts the hi-res coursor's position
; back to X- and Y-coordinates; stores
; X-coordinate at $E0,E1 and Y-coordinate
; at $E2.
-DRAW := $F601 ; Draws a shape. Enter with (Y,X) = the
+DRAW := $F601 ; Draws a shape. Enter with (Y,X) = the
; address of the shape table, and (A) =
; the rotation factor. Uses the current
; color.
-XDRAW := $F65D ; Draws a shape by inverting the existing
+XDRAW := $F65D ; Draws a shape by inverting the existing
; color of the dots the shape draws over.
; Same entry parameters as DRAW.
-SETHCOL := $F6EC ; Set the hi-res color to (X), where (X)
+SETHCOL := $F6EC ; Set the hi-res color to (X), where (X)
; must be between 0 and 7.
; ------------------------------------------------------------------------
@@ -61,100 +61,100 @@ SETHCOL := $F6EC ; Set the hi-res color to (X), where (X)
; Variables mapped to the zero page segment variables. Some of these are
; used for passing parameters to the driver.
-X1 := ptr1
-Y1 := ptr2
-X2 := ptr3
-Y2 := ptr4
+X1 := ptr1
+Y1 := ptr2
+X2 := ptr3
+Y2 := ptr4
; ------------------------------------------------------------------------
- .segment "JUMPTABLE"
+ .segment "JUMPTABLE"
; Header. Includes jump table and constants.
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
- .byte $74, $67, $69 ; "tgi"
- .byte TGI_API_VERSION ; TGI API version number
- .word 280 ; X resolution
- .word 192 ; Y resolution
- .byte 8 ; Number of drawing colors
-pages: .byte 2 ; Number of screens available
- .byte 7 ; System font X size
- .byte 8 ; System font Y size
- .word $00EA ; Aspect ratio (based on 4/3 display)
+ .byte $74, $67, $69 ; "tgi"
+ .byte TGI_API_VERSION ; TGI API version number
+ .word 280 ; X resolution
+ .word 192 ; Y resolution
+ .byte 8 ; Number of drawing colors
+pages: .byte 2 ; Number of screens available
+ .byte 7 ; System font X size
+ .byte 8 ; System font Y size
+ .word $00EA ; Aspect ratio (based on 4/3 display)
.byte 0 ; TGI driver flags
; Next comes the jump table. With the exception of IRQ, all entries must be
; valid and may point to an RTS for test versions (function not implemented).
- .addr INSTALL
- .addr UNINSTALL
- .addr INIT
- .addr DONE
- .addr GETERROR
- .addr CONTROL
- .addr CLEAR
- .addr SETVIEWPAGE
- .addr SETDRAWPAGE
- .addr SETCOLOR
- .addr SETPALETTE
- .addr GETPALETTE
- .addr GETDEFPALETTE
- .addr SETPIXEL
- .addr GETPIXEL
- .addr LINE
- .addr BAR
- .addr TEXTSTYLE
- .addr OUTTEXT
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr INIT
+ .addr DONE
+ .addr GETERROR
+ .addr CONTROL
+ .addr CLEAR
+ .addr SETVIEWPAGE
+ .addr SETDRAWPAGE
+ .addr SETCOLOR
+ .addr SETPALETTE
+ .addr GETPALETTE
+ .addr GETDEFPALETTE
+ .addr SETPIXEL
+ .addr GETPIXEL
+ .addr LINE
+ .addr BAR
+ .addr TEXTSTYLE
+ .addr OUTTEXT
.addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
- .bss
+ .bss
; Absolute variables used in the code
-ERROR: .res 1 ; Error code
+ERROR: .res 1 ; Error code
; ------------------------------------------------------------------------
- .rodata
+ .rodata
; Constants and tables
DEFPALETTE: .byte $00, $01, $02, $03, $04, $05, $06, $07
FONT:
- ; Beagle Bros Shape Mechanic font F.ASCII.SMALL
- ; modified to exactly reproduce the text glyphs
- .incbin "a2.hi.fnt"
+ ; Beagle Bros Shape Mechanic font F.ASCII.SMALL
+ ; modified to exactly reproduce the text glyphs
+ .incbin "a2.hi.fnt"
; ------------------------------------------------------------------------
- .code
+ .code
; INSTALL routine. Is called after the driver is loaded into memory. May
; initialize anything that has to be done just once. Is probably empty
; most of the time.
; Must set an error code: NO
INSTALL:
- .ifdef __APPLE2ENH__
- ; No page switching if 80 column store is enabled
- bit RD80COL
- bpl :+
- lda #$01
- sta pages
-: .endif
+ .ifdef __APPLE2ENH__
+ ; No page switching if 80 column store is enabled
+ bit RD80COL
+ bpl :+
+ lda #$01
+ sta pages
+: .endif
- ; Fall through
+ ; Fall through
; UNINSTALL routine. Is called before the driver is removed from memory. May
; clean up anything done by INSTALL but is probably empty most of the time.
; Must set an error code: NO
UNINSTALL:
- rts
+ rts
; INIT: Changes an already installed device from text mode to graphics mode.
; Note that INIT/DONE may be called multiple times while the driver
@@ -166,132 +166,132 @@ UNINSTALL:
; active, so there is no need to protect against that.
; Must set an error code: YES
INIT:
- ; Switch into graphics mode
- bit MIXCLR
- bit HIRES
- bit TXTCLR
+ ; Switch into graphics mode
+ bit MIXCLR
+ bit HIRES
+ bit TXTCLR
- ; Beagle Bros Shape Mechanic fonts don't
- ; scale well so use fixed scaling factor
- lda #$01
- sta SCALE
+ ; Beagle Bros Shape Mechanic fonts don't
+ ; scale well so use fixed scaling factor
+ lda #$01
+ sta SCALE
- ; Done, reset the error code
- lda #TGI_ERR_OK
- sta ERROR
- rts
+ ; Done, reset the error code
+ lda #TGI_ERR_OK
+ sta ERROR
+ rts
; DONE: Will be called to switch the graphics device back into text mode.
; The graphics kernel will never call DONE when no graphics mode is active,
; so there is no need to protect against that.
; Must set an error code: NO
DONE:
- ; Switch into text mode
- bit TXTSET
- bit LOWSCR
+ ; Switch into text mode
+ bit TXTSET
+ bit LOWSCR
- .ifdef __APPLE2ENH__
- ; Limit SET80COL-HISCR to text
- bit LORES
- .endif
+ .ifdef __APPLE2ENH__
+ ; Limit SET80COL-HISCR to text
+ bit LORES
+ .endif
- ; Reset the text window top
- lda #$00
- sta WNDTOP
- rts
+ ; Reset the text window top
+ lda #$00
+ sta WNDTOP
+ rts
; GETERROR: Return the error code in A and clear it.
GETERROR:
- lda ERROR
- ldx #TGI_ERR_OK
- stx ERROR
- rts
+ lda ERROR
+ ldx #TGI_ERR_OK
+ stx ERROR
+ rts
; CONTROL: Platform/driver specific entry point.
; Must set an error code: YES
CONTROL:
- ; Check data msb and code to be 0
- ora ptr1+1
- bne err
-
- ; Check data lsb to be [0..1]
- lda ptr1
- cmp #1+1
- bcs err
-
- ; Set text window top
- tax
- beq :+
- lda #20
-: sta WNDTOP
-
- ; Switch 4 lines of text
- .assert MIXCLR + 1 = MIXSET, error
- lda MIXCLR,x ; No BIT absolute,X available
-
- ; Done, reset the error code
- lda #TGI_ERR_OK
- beq :+ ; Branch always
-
- ; Done, set the error code
-err: lda #TGI_ERR_INV_ARG
-: sta ERROR
- rts
+ ; Check data msb and code to be 0
+ ora ptr1+1
+ bne err
+
+ ; Check data lsb to be [0..1]
+ lda ptr1
+ cmp #1+1
+ bcs err
+
+ ; Set text window top
+ tax
+ beq :+
+ lda #20
+: sta WNDTOP
+
+ ; Switch 4 lines of text
+ .assert MIXCLR + 1 = MIXSET, error
+ lda MIXCLR,x ; No BIT absolute,X available
+
+ ; Done, reset the error code
+ lda #TGI_ERR_OK
+ beq :+ ; Branch always
+
+ ; Done, set the error code
+err: lda #TGI_ERR_INV_ARG
+: sta ERROR
+ rts
; CLEAR: Clears the screen.
; Must set an error code: NO
CLEAR:
- bit $C082 ; Switch in ROM
- jsr HCLR
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ jsr HCLR
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; SETVIEWPAGE: Set the visible page. Called with the new page in A (0..n).
; The page number is already checked to be valid by the graphics kernel.
; Must set an error code: NO (will only be called if page ok)
SETVIEWPAGE:
- tax
- .assert LOWSCR + 1 = HISCR, error
- lda LOWSCR,x ; No BIT absolute,X available
- rts
+ tax
+ .assert LOWSCR + 1 = HISCR, error
+ lda LOWSCR,x ; No BIT absolute,X available
+ rts
; SETDRAWPAGE: Set the drawable page. Called with the new page in A (0..n).
; The page number is already checked to be valid by the graphics kernel.
; Must set an error code: NO (will only be called if page ok)
SETDRAWPAGE:
- tax
- beq :+
- lda #>$4000 ; Page 2
- .byte $2C ; BIT absolute
-: lda #>$2000 ; Page 1
- sta PAGE
- rts
+ tax
+ beq :+
+ lda #>$4000 ; Page 2
+ .byte $2C ; BIT absolute
+: lda #>$2000 ; Page 1
+ sta PAGE
+ rts
; SETCOLOR: Set the drawing color (in A). The new color is already checked
; to be in a valid range (0..maxcolor-1).
; Must set an error code: NO (will only be called if color ok)
SETCOLOR:
- bit $C082 ; Switch in ROM
- tax
- jsr SETHCOL
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ tax
+ jsr SETHCOL
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; SETPALETTE: Set the palette (not available with all drivers/hardware).
; A pointer to the palette is passed in ptr1. Must set an error if palettes
; are not supported
; Must set an error code: YES
SETPALETTE:
- lda #TGI_ERR_INV_FUNC
- sta ERROR
- rts
+ lda #TGI_ERR_INV_FUNC
+ sta ERROR
+ rts
; GETPALETTE: Return the current palette in A/X. Even drivers that cannot
; set the palette should return the default palette here, so there's no
; way for this function to fail.
; Must set an error code: NO
GETPALETTE:
- ; Fall through
+ ; Fall through
; GETDEFPALETTE: Return the default palette for the driver in A/X. All
; drivers should return something reasonable here, even drivers that don't
@@ -299,147 +299,147 @@ GETPALETTE:
; of the (not changeable) palette.
; Must set an error code: NO (all drivers must have a default palette)
GETDEFPALETTE:
- lda #DEFPALETTE
- rts
+ lda #DEFPALETTE
+ rts
; SETPIXEL: Draw one pixel at X1/Y1 = ptr1/ptr2 with the current drawing
; color. The coordinates passed to this function are never outside the
; visible screen area, so there is no need for clipping inside this function.
; Must set an error code: NO
SETPIXEL:
- bit $C082 ; Switch in ROM
- ldx X1
- ldy X1+1
- lda Y1
- jsr HPLOT
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ ldx X1
+ ldy X1+1
+ lda Y1
+ jsr HPLOT
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; GETPIXEL: Read the color value of a pixel and return it in A/X. The
; coordinates passed to this function are never outside the visible screen
; area, so there is no need for clipping inside this function.
GETPIXEL:
- bit $C082 ; Switch in ROM
- ldx X1
- ldy X1+1
- lda Y1
- jsr HPOSN
- lda (HBASL),y
- and HMASK
- asl
- beq :+ ; 0 (black)
- lda #$03 ; 3 (white)
-: bcc :+
- adc #$03 ; += 4 (black -> black2, white -> white2)
-: ldx #$00
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ ldx X1
+ ldy X1+1
+ lda Y1
+ jsr HPOSN
+ lda (HBASL),y
+ and HMASK
+ asl
+ beq :+ ; 0 (black)
+ lda #$03 ; 3 (white)
+: bcc :+
+ adc #$03 ; += 4 (black -> black2, white -> white2)
+: ldx #$00
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; LINE: Draw a line from X1/Y1 to X2/Y2, where X1/Y1 = ptr1/ptr2 and
; X2/Y2 = ptr3/ptr4 using the current drawing color.
; Must set an error code: NO
LINE:
- bit $C082 ; Switch in ROM
- ldx X1
- ldy X1+1
- lda Y1
- jsr HPOSN
- lda X2
- ldx X2+1
- ldy Y2
- jsr HLIN
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ ldx X1
+ ldy X1+1
+ lda Y1
+ jsr HPOSN
+ lda X2
+ ldx X2+1
+ ldy Y2
+ jsr HLIN
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; BAR: Draw a filled rectangle with the corners X1/Y1, X2/Y2, where
; X1/Y1 = ptr1/ptr2 and X2/Y2 = ptr3/ptr4 using the current drawing color.
; Contrary to most other functions, the graphics kernel will sort and clip
; the coordinates before calling the driver, so on entry the following
; conditions are valid:
-; X1 <= X2
-; Y1 <= Y2
-; (X1 >= 0) && (X1 < XRES)
-; (X2 >= 0) && (X2 < XRES)
-; (Y1 >= 0) && (Y1 < YRES)
-; (Y2 >= 0) && (Y2 < YRES)
+; X1 <= X2
+; Y1 <= Y2
+; (X1 >= 0) && (X1 < XRES)
+; (X2 >= 0) && (X2 < XRES)
+; (Y1 >= 0) && (Y1 < YRES)
+; (Y2 >= 0) && (Y2 < YRES)
; Must set an error code: NO
BAR:
- inc Y2
-: lda Y2
- pha
- lda Y1
- sta Y2
- jsr LINE
- pla
- sta Y2
- inc Y1
- cmp Y1
- bne :-
- rts
+ inc Y2
+: lda Y2
+ pha
+ lda Y1
+ sta Y2
+ jsr LINE
+ pla
+ sta Y2
+ inc Y1
+ cmp Y1
+ bne :-
+ rts
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y
; direction is passend in X/Y, the text direction is passed in A.
; Must set an error code: NO
TEXTSTYLE:
- cmp #TGI_TEXT_VERTICAL
- bne :+
- lda #48
-: sta ROT
- rts
+ cmp #TGI_TEXT_VERTICAL
+ bne :+
+ lda #48
+: sta ROT
+ rts
; OUTTEXT: Output text at X/Y = ptr1/ptr2 using the current color and the
; current text style. The text to output is given as a zero terminated
; string with address in ptr3.
; Must set an error code: NO
OUTTEXT:
- bit $C082 ; Switch in ROM
- lda X1
- ldy X1+1
- ldx ROT
- php ; Save Z flag
- beq :+ ; Not horizontal
- sec
- sbc #$07 ; Adjust X
- bcs :+
- dey
-: tax
- lda Y1
- plp ; Restore Z flag
- bne :+ ; Not vertical
- sec
- sbc #$07 ; Adjust Y
-: jsr HPOSN
- clc
- lda FONT+2*99 ; "connection char"
- adc #FONT
- sta ptr4+1
- ldy #$00
-: lda (ptr3),y
- beq :+
- sty tmp1 ; Save string index
- sec
- sbc #$1F ; No control chars
- asl ; Offset * 2
- tay
- clc
- lda FONT,y
- adc #FONT
- tay
- lda ROT
- jsr DRAW ; Draw char from string
- ldx ptr4
- ldy ptr4+1
- lda ROT
- jsr DRAW ; Draw "connection char"
- ldy tmp1 ; Restore string index
- iny
- bne :- ; Branch always
-: bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ lda X1
+ ldy X1+1
+ ldx ROT
+ php ; Save Z flag
+ beq :+ ; Not horizontal
+ sec
+ sbc #$07 ; Adjust X
+ bcs :+
+ dey
+: tax
+ lda Y1
+ plp ; Restore Z flag
+ bne :+ ; Not vertical
+ sec
+ sbc #$07 ; Adjust Y
+: jsr HPOSN
+ clc
+ lda FONT+2*99 ; "connection char"
+ adc #FONT
+ sta ptr4+1
+ ldy #$00
+: lda (ptr3),y
+ beq :+
+ sty tmp1 ; Save string index
+ sec
+ sbc #$1F ; No control chars
+ asl ; Offset * 2
+ tay
+ clc
+ lda FONT,y
+ adc #FONT
+ tay
+ lda ROT
+ jsr DRAW ; Draw char from string
+ ldx ptr4
+ ldy ptr4+1
+ lda ROT
+ jsr DRAW ; Draw "connection char"
+ ldy tmp1 ; Restore string index
+ iny
+ bne :- ; Branch always
+: bit $C080 ; Switch in LC bank 2 for R/O
+ rts
diff --git a/libsrc/apple2/tgi/a2.lo.s b/libsrc/apple2/tgi/a2.lo.s
index edea841be..7ac43e6cc 100644
--- a/libsrc/apple2/tgi/a2.lo.s
+++ b/libsrc/apple2/tgi/a2.lo.s
@@ -5,106 +5,106 @@
; Oliver Schmidt
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
- .include "apple2.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
+ .include "apple2.inc"
; ------------------------------------------------------------------------
; Zero page stuff
-H2 := $2C
-COLOR := $30
+H2 := $2C
+COLOR := $30
; ROM entry points
-TEXT := $F399
-PLOT := $F800
-HLINE := $F819
-CLRSC2 := $F838
-SETCOL := $F864
-SCRN := $F871
-SETGR := $FB40
-HOME := $FC58
+TEXT := $F399
+PLOT := $F800
+HLINE := $F819
+CLRSC2 := $F838
+SETCOL := $F864
+SCRN := $F871
+SETGR := $FB40
+HOME := $FC58
; Used for passing parameters to the driver
-X1 := ptr1
-Y1 := ptr2
-X2 := ptr3
-Y2 := ptr4
+X1 := ptr1
+Y1 := ptr2
+X2 := ptr3
+Y2 := ptr4
; ------------------------------------------------------------------------
- .segment "JUMPTABLE"
+ .segment "JUMPTABLE"
; Header. Includes jump table and constants.
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
- .byte $74, $67, $69 ; "tgi"
- .byte TGI_API_VERSION ; TGI API version number
- .word 40 ; X resolution
- .word 48 ; Y resolution
- .byte 16 ; Number of drawing colors
- .byte 1 ; Number of screens available
- .byte 8 ; System font X size
- .byte 8 ; System font Y size
- .word $0198 ; Aspect ratio (based on 4/3 display)
+ .byte $74, $67, $69 ; "tgi"
+ .byte TGI_API_VERSION ; TGI API version number
+ .word 40 ; X resolution
+ .word 48 ; Y resolution
+ .byte 16 ; Number of drawing colors
+ .byte 1 ; Number of screens available
+ .byte 8 ; System font X size
+ .byte 8 ; System font Y size
+ .word $0198 ; Aspect ratio (based on 4/3 display)
.byte 0 ; TGI driver flags
; Next comes the jump table. With the exception of IRQ, all entries must be
; valid and may point to an RTS for test versions (function not implemented).
- .addr INSTALL
- .addr UNINSTALL
- .addr INIT
- .addr DONE
- .addr GETERROR
- .addr CONTROL
- .addr CLEAR
- .addr SETVIEWPAGE
- .addr SETDRAWPAGE
- .addr SETCOLOR
- .addr SETPALETTE
- .addr GETPALETTE
- .addr GETDEFPALETTE
- .addr SETPIXEL
- .addr GETPIXEL
- .addr LINE
- .addr BAR
- .addr TEXTSTYLE
- .addr OUTTEXT
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr INIT
+ .addr DONE
+ .addr GETERROR
+ .addr CONTROL
+ .addr CLEAR
+ .addr SETVIEWPAGE
+ .addr SETDRAWPAGE
+ .addr SETCOLOR
+ .addr SETPALETTE
+ .addr GETPALETTE
+ .addr GETDEFPALETTE
+ .addr SETPIXEL
+ .addr GETPIXEL
+ .addr LINE
+ .addr BAR
+ .addr TEXTSTYLE
+ .addr OUTTEXT
.addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
- .bss
+ .bss
-ERROR: .res 1 ; Error code
-MIX: .res 1 ; 4 lines of text
+ERROR: .res 1 ; Error code
+MIX: .res 1 ; 4 lines of text
; ------------------------------------------------------------------------
- .rodata
+ .rodata
DEFPALETTE: .byte $00, $01, $02, $03, $04, $05, $06, $07
- .byte $08, $09, $0A, $0B, $0C, $0D, $0E, $0F
+ .byte $08, $09, $0A, $0B, $0C, $0D, $0E, $0F
TGI2COL: .byte $00, $0C, $03, $0F, $01, $09, $06, $02
- .byte $04, $05, $07, $08, $0A, $0B, $0D, $0E
+ .byte $04, $05, $07, $08, $0A, $0B, $0D, $0E
COL2TGI: .byte $00, $04, $07, $02, $08, $09, $06, $0A
- .byte $0B, $05, $0C, $0D, $01, $0E, $0F, $03
+ .byte $0B, $05, $0C, $0D, $01, $0E, $0F, $03
-MAXY: .byte 47, 39
+MAXY: .byte 47, 39
; ------------------------------------------------------------------------
- .code
+ .code
; INIT: Changes an already installed device from text mode to graphics mode.
; Note that INIT/DONE may be called multiple times while the driver
@@ -116,168 +116,168 @@ MAXY: .byte 47, 39
; active, so there is no need to protect against that.
; Must set an error code: YES
INIT:
- ; Switch into graphics mode
- bit $C082 ; Switch in ROM
- jsr SETGR
- bit MIXCLR
- bit $C080 ; Switch in LC bank 2 for R/O
+ ; Switch into graphics mode
+ bit $C082 ; Switch in ROM
+ jsr SETGR
+ bit MIXCLR
+ bit $C080 ; Switch in LC bank 2 for R/O
- ; Done, reset the error code
- lda #TGI_ERR_OK
- sta ERROR
- sta MIX
+ ; Done, reset the error code
+ lda #TGI_ERR_OK
+ sta ERROR
+ sta MIX
- ; Fall through
+ ; Fall through
; INSTALL routine. Is called after the driver is loaded into memory. May
; initialize anything that has to be done just once. Is probably empty
; most of the time.
; Must set an error code: NO
INSTALL:
- ; Fall through
+ ; Fall through
; UNINSTALL routine. Is called before the driver is removed from memory. May
; clean up anything done by INSTALL but is probably empty most of the time.
; Must set an error code: NO
UNINSTALL:
- ; Fall through
+ ; Fall through
; SETVIEWPAGE: Set the visible page. Called with the new page in A (0..n).
; The page number is already checked to be valid by the graphics kernel.
; Must set an error code: NO (will only be called if page ok)
SETVIEWPAGE:
- ; Fall through
+ ; Fall through
; SETDRAWPAGE: Set the drawable page. Called with the new page in A (0..n).
; The page number is already checked to be valid by the graphics kernel.
; Must set an error code: NO (will only be called if page ok)
SETDRAWPAGE:
- ; Fall through
+ ; Fall through
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y
; direction is passend in X/Y, the text direction is passed in A.
; Must set an error code: NO
TEXTSTYLE:
- ; Fall through
+ ; Fall through
; OUTTEXT: Output text at X/Y = ptr1/ptr2 using the current color and the
; current text style. The text to output is given as a zero terminated
; string with address in ptr3.
; Must set an error code: NO
OUTTEXT:
- rts
+ rts
; DONE: Will be called to switch the graphics device back into text mode.
; The graphics kernel will never call DONE when no graphics mode is active,
; so there is no need to protect against that.
; Must set an error code: NO
DONE:
- bit $C082 ; Switch in ROM
- jsr TEXT
- jsr HOME
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ jsr TEXT
+ jsr HOME
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; GETERROR: Return the error code in A and clear it.
GETERROR:
- lda ERROR
- ldx #TGI_ERR_OK
- stx ERROR
- rts
+ lda ERROR
+ ldx #TGI_ERR_OK
+ stx ERROR
+ rts
; CLEAR: Clears the screen.
; Must set an error code: NO
CLEAR:
- bit $C082 ; Switch in ROM
- lda COLOR ; Save current drawing color
- pha
- ldx MIX
- ldy MAXY,x ; Max Y depends on 4 lines of text
- jsr CLRSC2
- pla
- sta COLOR ; Restore current drawing color
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ lda COLOR ; Save current drawing color
+ pha
+ ldx MIX
+ ldy MAXY,x ; Max Y depends on 4 lines of text
+ jsr CLRSC2
+ pla
+ sta COLOR ; Restore current drawing color
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; SETCOLOR: Set the drawing color (in A). The new color is already checked
; to be in a valid range (0..maxcolor-1).
; Must set an error code: NO (will only be called if color ok)
SETCOLOR:
- bit $C082 ; Switch in ROM
- tax
- lda TGI2COL,x
- jsr SETCOL
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ tax
+ lda TGI2COL,x
+ jsr SETCOL
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; CONTROL: Platform/driver specific entry point.
; Must set an error code: YES
CONTROL:
- ; Check data msb and code to be 0
- ora ptr1+1
- bne err
-
- ; Check data lsb to be [0..1]
- lda ptr1
- cmp #1+1
- bcs err
- bit $C082 ; Switch in ROM
-
- ; Switch 4 lines of text
- tax
- .assert MIXCLR + 1 = MIXSET, error
- lda MIXCLR,x ; No BIT absolute,X available
-
- ; Save current switch setting
- txa
- sta MIX
- bne text
-
- ; Clear 8 lines of graphics
- lda COLOR ; Save current drawing color
- pha
- lda #39 ; Rightmost column
- sta H2
- ldx #40 ; First line
-: txa
- ldy #$00 ; Leftmost column
- sty COLOR ; Black
- jsr HLINE ; Preserves X
- inx
- cpx #47+1 ; Last line
- bcc :-
- pla
- sta COLOR ; Restore current drawing color
- bcs :+ ; Branch always
-
- ; Clear 4 lines of text
-text: jsr HOME
-: bit $C080 ; Switch in LC bank 2 for R/O
-
- ; Done, reset the error code
- lda #TGI_ERR_OK
- beq :+ ; Branch always
-
- ; Done, set the error code
-err: lda #TGI_ERR_INV_ARG
-: sta ERROR
- rts
+ ; Check data msb and code to be 0
+ ora ptr1+1
+ bne err
+
+ ; Check data lsb to be [0..1]
+ lda ptr1
+ cmp #1+1
+ bcs err
+ bit $C082 ; Switch in ROM
+
+ ; Switch 4 lines of text
+ tax
+ .assert MIXCLR + 1 = MIXSET, error
+ lda MIXCLR,x ; No BIT absolute,X available
+
+ ; Save current switch setting
+ txa
+ sta MIX
+ bne text
+
+ ; Clear 8 lines of graphics
+ lda COLOR ; Save current drawing color
+ pha
+ lda #39 ; Rightmost column
+ sta H2
+ ldx #40 ; First line
+: txa
+ ldy #$00 ; Leftmost column
+ sty COLOR ; Black
+ jsr HLINE ; Preserves X
+ inx
+ cpx #47+1 ; Last line
+ bcc :-
+ pla
+ sta COLOR ; Restore current drawing color
+ bcs :+ ; Branch always
+
+ ; Clear 4 lines of text
+text: jsr HOME
+: bit $C080 ; Switch in LC bank 2 for R/O
+
+ ; Done, reset the error code
+ lda #TGI_ERR_OK
+ beq :+ ; Branch always
+
+ ; Done, set the error code
+err: lda #TGI_ERR_INV_ARG
+: sta ERROR
+ rts
; SETPALETTE: Set the palette (not available with all drivers/hardware).
; A pointer to the palette is passed in ptr1. Must set an error if palettes
; are not supported
; Must set an error code: YES
SETPALETTE:
- lda #TGI_ERR_INV_FUNC
- sta ERROR
- rts
+ lda #TGI_ERR_INV_FUNC
+ sta ERROR
+ rts
; GETPALETTE: Return the current palette in A/X. Even drivers that cannot
; set the palette should return the default palette here, so there's no
; way for this function to fail.
; Must set an error code: NO
GETPALETTE:
- ; Fall through
+ ; Fall through
; GETDEFPALETTE: Return the default palette for the driver in A/X. All
; drivers should return something reasonable here, even drivers that don't
@@ -285,63 +285,63 @@ GETPALETTE:
; of the (not changeable) palette.
; Must set an error code: NO (all drivers must have a default palette)
GETDEFPALETTE:
- lda #DEFPALETTE
- rts
+ lda #DEFPALETTE
+ rts
; SETPIXEL: Draw one pixel at X1/Y1 = ptr1/ptr2 with the current drawing
; color. The coordinates passed to this function are never outside the
; visible screen area, so there is no need for clipping inside this function.
; Must set an error code: NO
SETPIXEL:
- bit $C082 ; Switch in ROM
- ldy X1
- lda Y1
- jsr PLOT
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ ldy X1
+ lda Y1
+ jsr PLOT
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; GETPIXEL: Read the color value of a pixel and return it in A/X. The
; coordinates passed to this function are never outside the visible screen
; area, so there is no need for clipping inside this function.
GETPIXEL:
- bit $C082 ; Switch in ROM
- ldy X1
- lda Y1
- jsr SCRN
- tax
- lda COL2TGI,x
- ldx #$00
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ ldy X1
+ lda Y1
+ jsr SCRN
+ tax
+ lda COL2TGI,x
+ ldx #$00
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; BAR: Draw a filled rectangle with the corners X1/Y1, X2/Y2, where
; X1/Y1 = ptr1/ptr2 and X2/Y2 = ptr3/ptr4 using the current drawing color.
; Contrary to most other functions, the graphics kernel will sort and clip
; the coordinates before calling the driver, so on entry the following
; conditions are valid:
-; X1 <= X2
-; Y1 <= Y2
-; (X1 >= 0) && (X1 < XRES)
-; (X2 >= 0) && (X2 < XRES)
-; (Y1 >= 0) && (Y1 < YRES)
-; (Y2 >= 0) && (Y2 < YRES)
+; X1 <= X2
+; Y1 <= Y2
+; (X1 >= 0) && (X1 < XRES)
+; (X2 >= 0) && (X2 < XRES)
+; (Y1 >= 0) && (Y1 < YRES)
+; (Y2 >= 0) && (Y2 < YRES)
; Must set an error code: NO
BAR:
- bit $C082 ; Switch in ROM
- lda X2
- sta H2
- inc Y2
- ldx Y1
-: txa
- ldy X1
- jsr HLINE ; Preserves X
- inx
- cpx Y2
- bcc :-
- bit $C080 ; Switch in LC bank 2 for R/O
- rts
+ bit $C082 ; Switch in ROM
+ lda X2
+ sta H2
+ inc Y2
+ ldx Y1
+: txa
+ ldy X1
+ jsr HLINE ; Preserves X
+ inx
+ cpx Y2
+ bcc :-
+ bit $C080 ; Switch in LC bank 2 for R/O
+ rts
; ------------------------------------------------------------------------
-.include "../../tgi/tgidrv_line.inc"
+.include "../../tgi/tgidrv_line.inc"
diff --git a/libsrc/apple2/tgi_colors.s b/libsrc/apple2/tgi_colors.s
index 8bc369809..53505b33d 100644
--- a/libsrc/apple2/tgi_colors.s
+++ b/libsrc/apple2/tgi_colors.s
@@ -2,7 +2,7 @@
; Target-specific black & white values for use by the target-shared TGI kernel
;
- .include "tgi-kernel.inc"
+ .include "tgi-kernel.inc"
- .export tgi_color_black:zp = $00
- .export tgi_color_white:zp = $03
+ .export tgi_color_black:zp = $00
+ .export tgi_color_white:zp = $03
diff --git a/libsrc/apple2/tgi_stat_stddrv.s b/libsrc/apple2/tgi_stat_stddrv.s
index e9affe3b3..9fc1ca902 100644
--- a/libsrc/apple2/tgi_stat_stddrv.s
+++ b/libsrc/apple2/tgi_stat_stddrv.s
@@ -6,16 +6,16 @@
; const void tgi_static_stddrv[];
;
- .export _tgi_static_stddrv
- .ifdef __APPLE2ENH__
- .import _a2e_hi_tgi
+ .export _tgi_static_stddrv
+ .ifdef __APPLE2ENH__
+ .import _a2e_hi_tgi
.else
- .import _a2_hi_tgi
+ .import _a2_hi_tgi
.endif
.rodata
- .ifdef __APPLE2ENH__
+ .ifdef __APPLE2ENH__
_tgi_static_stddrv := _a2e_hi_tgi
.else
_tgi_static_stddrv := _a2_hi_tgi
diff --git a/libsrc/apple2/tgi_stddrv.s b/libsrc/apple2/tgi_stddrv.s
index 15d56127c..451b4c2fa 100644
--- a/libsrc/apple2/tgi_stddrv.s
+++ b/libsrc/apple2/tgi_stddrv.s
@@ -6,13 +6,13 @@
; const char tgi_stddrv[];
;
- .export _tgi_stddrv
+ .export _tgi_stddrv
.rodata
_tgi_stddrv:
- .ifdef __APPLE2ENH__
- .asciiz "A2E.HI.TGI"
+ .ifdef __APPLE2ENH__
+ .asciiz "A2E.HI.TGI"
.else
- .asciiz "A2.HI.TGI"
+ .asciiz "A2.HI.TGI"
.endif
diff --git a/libsrc/apple2/toascii.s b/libsrc/apple2/toascii.s
index 586606553..a3f946e64 100644
--- a/libsrc/apple2/toascii.s
+++ b/libsrc/apple2/toascii.s
@@ -3,7 +3,7 @@
; /* Convert a target specific character to ascii */
;
- .export _toascii
+ .export _toascii
_toascii:
ldx #$00
diff --git a/libsrc/apple2/videomode.s b/libsrc/apple2/videomode.s
index 7a0493384..1da997472 100644
--- a/libsrc/apple2/videomode.s
+++ b/libsrc/apple2/videomode.s
@@ -5,7 +5,7 @@
;
.ifdef __APPLE2ENH__
- .export _videomode
+ .export _videomode
.import COUT
.include "apple2.inc"
diff --git a/libsrc/apple2/vtabz.s b/libsrc/apple2/vtabz.s
index 5ad350598..31de544c7 100644
--- a/libsrc/apple2/vtabz.s
+++ b/libsrc/apple2/vtabz.s
@@ -4,17 +4,17 @@
; VTABZ routine
;
- .export VTABZ
+ .export VTABZ
- .include "apple2.inc"
+ .include "apple2.inc"
- .segment "LOWCODE"
+ .segment "LOWCODE"
VTABZ:
- ; Switch in ROM and call VTABZ
- bit $C082
- jsr $FC24 ; Generate text base address
+ ; Switch in ROM and call VTABZ
+ bit $C082
+ jsr $FC24 ; Generate text base address
- ; Switch in LC bank 2 and return
- bit $C080
- rts
+ ; Switch in LC bank 2 and return
+ bit $C080
+ rts
diff --git a/libsrc/apple2/wherex.s b/libsrc/apple2/wherex.s
index 1d67a2fd9..bd717a22b 100644
--- a/libsrc/apple2/wherex.s
+++ b/libsrc/apple2/wherex.s
@@ -4,11 +4,11 @@
; unsigned char wherex (void);
;
- .export _wherex
+ .export _wherex
- .include "apple2.inc"
+ .include "apple2.inc"
_wherex:
- lda CH
+ lda CH
ldx #$00
rts
diff --git a/libsrc/apple2/wherey.s b/libsrc/apple2/wherey.s
index 1ac7b6a75..daacaaba7 100644
--- a/libsrc/apple2/wherey.s
+++ b/libsrc/apple2/wherey.s
@@ -4,13 +4,13 @@
; unsigned char wherey (void);
;
- .export _wherey
+ .export _wherey
- .include "apple2.inc"
+ .include "apple2.inc"
_wherey:
- lda CV
+ lda CV
sec
- sbc WNDTOP
+ sbc WNDTOP
ldx #$00
rts
diff --git a/libsrc/apple2/write.s b/libsrc/apple2/write.s
index d8f7fcd84..21f4a45a4 100644
--- a/libsrc/apple2/write.s
+++ b/libsrc/apple2/write.s
@@ -4,44 +4,44 @@
; int __fastcall__ write (int fd, const void* buf, unsigned count);
;
- .export _write
- .import rwprolog, rwcommon, rwepilog
- .import COUT
+ .export _write
+ .import rwprolog, rwcommon, rwepilog
+ .import COUT
- .include "zeropage.inc"
- .include "errno.inc"
- .include "fcntl.inc"
- .include "mli.inc"
- .include "filedes.inc"
+ .include "zeropage.inc"
+ .include "errno.inc"
+ .include "fcntl.inc"
+ .include "mli.inc"
+ .include "filedes.inc"
_write:
; Get parameters
- jsr rwprolog
- bcs errno
- tax ; Save fd
+ jsr rwprolog
+ bcs errno
+ tax ; Save fd
; Check for write access
- lda fdtab + FD::FLAGS,y
- and #O_WRONLY
- beq einval
+ lda fdtab + FD::FLAGS,y
+ and #O_WRONLY
+ beq einval
; Check for device
- txa ; Restore fd
- bmi device
+ txa ; Restore fd
+ bmi device
- ; Check for append flag
- lda fdtab + FD::FLAGS,y
- and #O_APPEND
- beq write
+ ; Check for append flag
+ lda fdtab + FD::FLAGS,y
+ and #O_APPEND
+ beq write
; Set fd
- stx mliparam + MLI::EOF::REF_NUM
+ stx mliparam + MLI::EOF::REF_NUM
; Get file size
- lda #GET_EOF_CALL
- ldx #EOF_COUNT
- jsr callmli
- bcs oserr
+ lda #GET_EOF_CALL
+ ldx #EOF_COUNT
+ jsr callmli
+ bcs oserr
; REF_NUM already set
.assert MLI::MARK::REF_NUM = MLI::EOF::REF_NUM, error
@@ -50,65 +50,65 @@ _write:
.assert MLI::MARK::POSITION = MLI::EOF::EOF, error
; Set file pointer
- lda #SET_MARK_CALL
- ldx #MARK_COUNT
- jsr callmli
- bcs oserr
+ lda #SET_MARK_CALL
+ ldx #MARK_COUNT
+ jsr callmli
+ bcs oserr
; Do write
-write: lda fdtab + FD::REF_NUM,y
- ldy #WRITE_CALL
- jmp rwcommon
+write: lda fdtab + FD::REF_NUM,y
+ ldy #WRITE_CALL
+ jmp rwcommon
; Save count for epilog
-device: ldx ptr2
- lda ptr2+1
- stx mliparam + MLI::RW::TRANS_COUNT
- sta mliparam + MLI::RW::TRANS_COUNT+1
+device: ldx ptr2
+ lda ptr2+1
+ stx mliparam + MLI::RW::TRANS_COUNT
+ sta mliparam + MLI::RW::TRANS_COUNT+1
; Check for zero count
- ora ptr2
- beq done
+ ora ptr2
+ beq done
; Get char from buf
- ldy #$00
-next: lda (ptr1),y
+ ldy #$00
+next: lda (ptr1),y
; Replace '\n' with '\r'
- cmp #$0A
- bne :+
- lda #$0D
+ cmp #$0A
+ bne :+
+ lda #$0D
; Set hi bit and write to device
-: ora #$80
- .ifndef __APPLE2ENH__
- cmp #$E0 ; Test for lowercase
- bcc output
- and #$DF ; Convert to uppercase
+: ora #$80
+ .ifndef __APPLE2ENH__
+ cmp #$E0 ; Test for lowercase
+ bcc output
+ and #$DF ; Convert to uppercase
.endif
-output: jsr COUT ; Preserves X and Y
+output: jsr COUT ; Preserves X and Y
; Increment pointer
iny
- bne :+
- inc ptr1+1
+ bne :+
+ inc ptr1+1
; Decrement count
: dex
- bne next
- dec ptr2+1
- bpl next
+ bne next
+ dec ptr2+1
+ bpl next
; Return success
-done: lda #$00
- jmp rwepilog
+done: lda #$00
+ jmp rwepilog
; Load errno code
-einval: lda #EINVAL
+einval: lda #EINVAL
; Set __errno
-errno: jmp __directerrno
+errno: jmp __directerrno
; Set __oserror
-oserr: jmp __mappederrno
+oserr: jmp __mappederrno
diff --git a/libsrc/atari/_scrsize.s b/libsrc/atari/_scrsize.s
index 2d69d669e..c827ba397 100644
--- a/libsrc/atari/_scrsize.s
+++ b/libsrc/atari/_scrsize.s
@@ -4,8 +4,8 @@
; Screen size variables
;
- .export screensize
- .include "atari.inc"
+ .export screensize
+ .include "atari.inc"
.proc screensize
diff --git a/libsrc/atari/break.s b/libsrc/atari/break.s
index ebad1cb3d..a53ed9803 100644
--- a/libsrc/atari/break.s
+++ b/libsrc/atari/break.s
@@ -5,65 +5,65 @@
; void reset_brk (void);
;
- .export _set_brk, _reset_brk
- .destructor _reset_brk
- .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
+ .export _set_brk, _reset_brk
+ .destructor _reset_brk
+ .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
- .include "atari.inc"
+ .include "atari.inc"
.bss
-_brk_a: .res 1
-_brk_x: .res 1
-_brk_y: .res 1
-_brk_sr: .res 1
-_brk_pc: .res 2
+_brk_a: .res 1
+_brk_x: .res 1
+_brk_y: .res 1
+_brk_sr: .res 1
+_brk_pc: .res 2
-oldvec: .res 2 ; Old vector
+oldvec: .res 2 ; Old vector
.data
-uservec: jmp $FFFF ; Patched at runtime
+uservec: jmp $FFFF ; Patched at runtime
.code
; Set the break vector
-.proc _set_brk
+.proc _set_brk
- sta uservec+1
- stx uservec+2 ; Set the user vector
+ sta uservec+1
+ stx uservec+2 ; Set the user vector
- lda oldvec
- ora oldvec+1 ; Did we save the vector already?
- bne L1 ; Jump if we installed the handler already
+ lda oldvec
+ ora oldvec+1 ; Did we save the vector already?
+ bne L1 ; Jump if we installed the handler already
- lda VBREAK
- sta oldvec
- lda VBREAK+1
- sta oldvec+1 ; Save the old vector
+ lda VBREAK
+ sta oldvec
+ lda VBREAK+1
+ sta oldvec+1 ; Save the old vector
-L1: lda #brk_handler
- sta VBREAK+1
- rts
+L1: lda #brk_handler
+ sta VBREAK+1
+ rts
.endproc
; Reset the break vector
-.proc _reset_brk
-
- lda oldvec
- ldx oldvec+1
- beq @L9 ; Jump if vector not installed
- sta VBREAK
- stx VBREAK+1
- lda #$00
- sta oldvec ; Clear the old vector
- stx oldvec+1
-@L9: rts
+.proc _reset_brk
+
+ lda oldvec
+ ldx oldvec+1
+ beq @L9 ; Jump if vector not installed
+ sta VBREAK
+ stx VBREAK+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
+@L9: rts
.endproc
@@ -71,35 +71,35 @@ L1: lda # don't close yet
- lda #CLOSE
- sta ICCOM,x
- jsr CIOV
- bmi closerr
-ok: ldx #0
- stx __oserror ; clear system specific error code
- txa
- rts
+.proc _close
+ jsr fdtoiocb_down ; get iocb index into X and decr. usage count
+ bmi inverr
+ bne ok ; not last one -> don't close yet
+ lda #CLOSE
+ sta ICCOM,x
+ jsr CIOV
+ bmi closerr
+ok: ldx #0
+ stx __oserror ; clear system specific error code
+ txa
+ rts
-inverr: jmp __inviocb
-closerr:jmp __do_oserror
+inverr: jmp __inviocb
+closerr:jmp __do_oserror
.endproc
diff --git a/libsrc/atari/clrscr.s b/libsrc/atari/clrscr.s
index b352a83de..58fb63137 100644
--- a/libsrc/atari/clrscr.s
+++ b/libsrc/atari/clrscr.s
@@ -4,33 +4,33 @@
; void clrscr (void);
;
- .export _clrscr
- .include "atari.inc"
- .importzp ptr1
- .import setcursor
+ .export _clrscr
+ .include "atari.inc"
+ .importzp ptr1
+ .import setcursor
-_clrscr:lda SAVMSC ; screen memory
- sta ptr1
- lda SAVMSC+1
- clc
- adc #>(40*24)
- sta ptr1+1
- lda #0 ; screen code of space char
- sta OLDCHR
- ldy #<(40*24) ; 40x24: size of default atari screen
- ldx #>(40*24)
-_clr1: sta (ptr1),y
- dey
- bne _clr1
- sta (ptr1),y
- dex
- bmi done
- ldy ptr1+1
- dey
- sty ptr1+1
- ldy #255
- jmp _clr1
+_clrscr:lda SAVMSC ; screen memory
+ sta ptr1
+ lda SAVMSC+1
+ clc
+ adc #>(40*24)
+ sta ptr1+1
+ lda #0 ; screen code of space char
+ sta OLDCHR
+ ldy #<(40*24) ; 40x24: size of default atari screen
+ ldx #>(40*24)
+_clr1: sta (ptr1),y
+ dey
+ bne _clr1
+ sta (ptr1),y
+ dex
+ bmi done
+ ldy ptr1+1
+ dey
+ sty ptr1+1
+ ldy #255
+ jmp _clr1
-done: sta COLCRS
- sta ROWCRS
- jmp setcursor
+done: sta COLCRS
+ sta ROWCRS
+ jmp setcursor
diff --git a/libsrc/atari/color.s b/libsrc/atari/color.s
index 52432499d..57d0036c9 100644
--- a/libsrc/atari/color.s
+++ b/libsrc/atari/color.s
@@ -2,33 +2,33 @@
; Christian Groessler, 27-Dec-2002
;
- .export _textcolor, _bgcolor, _bordercolor
- .import return1
+ .export _textcolor, _bgcolor, _bordercolor
+ .import return1
- .include "atari.inc"
+ .include "atari.inc"
-_textcolor = return1
+_textcolor = return1
_bgcolor:
- ldx COLOR2 ; get old value
- sta COLOR2 ; set new value
- and #$0e
- cmp #8
- bcs bright
- lda #$0e
- .byte $2c ; bit opcode, eats the next 2 bytes
-bright: lda #0
- sta COLOR1
- txa
- ldx #0 ; fix X
- rts
+ ldx COLOR2 ; get old value
+ sta COLOR2 ; set new value
+ and #$0e
+ cmp #8
+ bcs bright
+ lda #$0e
+ .byte $2c ; bit opcode, eats the next 2 bytes
+bright: lda #0
+ sta COLOR1
+ txa
+ ldx #0 ; fix X
+ rts
_bordercolor:
- ldx COLOR4 ; get old value
- sta COLOR4 ; set new value
- txa
- ldx #0 ; fix X
- rts
+ ldx COLOR4 ; get old value
+ sta COLOR4 ; set new value
+ txa
+ ldx #0 ; fix X
+ rts
diff --git a/libsrc/atari/cputc.s b/libsrc/atari/cputc.s
index 906a79282..cd2aefe79 100644
--- a/libsrc/atari/cputc.s
+++ b/libsrc/atari/cputc.s
@@ -5,91 +5,91 @@
; void cputc (char c);
;
- .export _cputcxy, _cputc
- .export plot, cputdirect, putchar
- .import popa, _gotoxy, mul40
- .importzp tmp4,ptr4
- .import _revflag,setcursor
+ .export _cputcxy, _cputc
+ .export plot, cputdirect, putchar
+ .import popa, _gotoxy, mul40
+ .importzp tmp4,ptr4
+ .import _revflag,setcursor
- .include "atari.inc"
+ .include "atari.inc"
_cputcxy:
- pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
- pla ; Restore C
+ pha ; Save C
+ jsr popa ; Get Y
+ jsr _gotoxy ; Set cursor, drop x
+ pla ; Restore C
_cputc:
- cmp #$0D ; CR
- bne L4
- lda #0
- sta COLCRS
- beq plot ; return
+ cmp #$0D ; CR
+ bne L4
+ lda #0
+ sta COLCRS
+ beq plot ; return
-L4: cmp #$0A ; LF
- beq newline
- cmp #ATEOL ; Atari-EOL?
- beq newline
+L4: cmp #$0A ; LF
+ beq newline
+ cmp #ATEOL ; Atari-EOL?
+ beq newline
- tay
- rol a
- rol a
- rol a
- rol a
- and #3
- tax
- tya
- and #$9f
- ora ataint,x
+ tay
+ rol a
+ rol a
+ rol a
+ rol a
+ and #3
+ tax
+ tya
+ and #$9f
+ ora ataint,x
-cputdirect: ; accepts screen code
- jsr putchar
+cputdirect: ; accepts screen code
+ jsr putchar
; advance cursor
- inc COLCRS
- lda COLCRS
- cmp #40
- bcc plot
- lda #0
- sta COLCRS
+ inc COLCRS
+ lda COLCRS
+ cmp #40
+ bcc plot
+ lda #0
+ sta COLCRS
- .export newline
+ .export newline
newline:
- inc ROWCRS
- lda ROWCRS
- cmp #24
- bne plot
- lda #0
- sta ROWCRS
-plot: jsr setcursor
- ldy COLCRS
- ldx ROWCRS
- rts
+ inc ROWCRS
+ lda ROWCRS
+ cmp #24
+ bne plot
+ lda #0
+ sta ROWCRS
+plot: jsr setcursor
+ ldy COLCRS
+ ldx ROWCRS
+ rts
; turn off cursor, update screen, turn on cursor
putchar:
- pha ; save char
+ pha ; save char
- ldy #0
- lda OLDCHR
- sta (OLDADR),y
+ ldy #0
+ lda OLDCHR
+ sta (OLDADR),y
- lda ROWCRS
- jsr mul40 ; destroys tmp4
- clc
- adc SAVMSC ; add start of screen memory
- sta ptr4
- txa
- adc SAVMSC+1
- sta ptr4+1
- pla ; get char again
+ lda ROWCRS
+ jsr mul40 ; destroys tmp4
+ clc
+ adc SAVMSC ; add start of screen memory
+ sta ptr4
+ txa
+ adc SAVMSC+1
+ sta ptr4+1
+ pla ; get char again
- ora _revflag
- sta OLDCHR
+ ora _revflag
+ sta OLDCHR
- ldy COLCRS
- sta (ptr4),y
- jmp setcursor
+ ldy COLCRS
+ sta (ptr4),y
+ jmp setcursor
- .rodata
-ataint: .byte 64,0,32,96
+ .rodata
+ataint: .byte 64,0,32,96
diff --git a/libsrc/atari/crt0.s b/libsrc/atari/crt0.s
index 1a404f021..f007e64ad 100644
--- a/libsrc/atari/crt0.s
+++ b/libsrc/atari/crt0.s
@@ -2,165 +2,165 @@
; Startup code for cc65 (ATARI version)
;
; Contributing authors:
-; Mark Keates
-; Freddy Offenga
-; Christian Groessler
-; Stefan Haubenthal
+; Mark Keates
+; Freddy Offenga
+; Christian Groessler
+; Stefan Haubenthal
;
- .export _exit
- .export __STARTUP__ : absolute = 1 ; Mark as startup
+ .export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
- .import initlib, donelib
- .import callmain, zerobss
- .import __STARTUP_LOAD__, __ZPSAVE_LOAD__
- .import __RESERVED_MEMORY__
+ .import initlib, donelib
+ .import callmain, zerobss
+ .import __STARTUP_LOAD__, __ZPSAVE_LOAD__
+ .import __RESERVED_MEMORY__
- .include "zeropage.inc"
- .include "atari.inc"
+ .include "zeropage.inc"
+ .include "atari.inc"
; ------------------------------------------------------------------------
; EXE header
-.segment "EXEHDR"
+.segment "EXEHDR"
- .word $FFFF
- .word __STARTUP_LOAD__
- .word __ZPSAVE_LOAD__ - 1
+ .word $FFFF
+ .word __STARTUP_LOAD__
+ .word __ZPSAVE_LOAD__ - 1
; ------------------------------------------------------------------------
; Actual code
-.segment "STARTUP"
+.segment "STARTUP"
- rts ; fix for SpartaDOS / OS/A+
- ; they first call the entry point from AUTOSTRT and
- ; then the load addess (this rts here).
- ; We point AUTOSTRT directly after the rts.
+ rts ; fix for SpartaDOS / OS/A+
+ ; they first call the entry point from AUTOSTRT and
+ ; then the load addess (this rts here).
+ ; We point AUTOSTRT directly after the rts.
; Real entry point:
; Save the zero page locations we need
- ldx #zpspace-1
-L1: lda sp,x
- sta zpsave,x
- dex
- bpl L1
+ ldx #zpspace-1
+L1: lda sp,x
+ sta zpsave,x
+ dex
+ bpl L1
; Clear the BSS data
- jsr zerobss
+ jsr zerobss
; Setup the stack
- tsx
- stx spsave
+ tsx
+ stx spsave
; Report memory usage
- lda APPMHI
- sta appmsav ; remember old APPMHI value
- lda APPMHI+1
- sta appmsav+1
-
- sec
- lda MEMTOP
- sbc #<__RESERVED_MEMORY__
- sta APPMHI ; initialize our APPMHI value
- sta sp ; setup runtime stack part 1
- lda MEMTOP+1
- sbc #>__RESERVED_MEMORY__
- sta APPMHI+1
- sta sp+1 ; setup runtime stack part 2
+ lda APPMHI
+ sta appmsav ; remember old APPMHI value
+ lda APPMHI+1
+ sta appmsav+1
+
+ sec
+ lda MEMTOP
+ sbc #<__RESERVED_MEMORY__
+ sta APPMHI ; initialize our APPMHI value
+ sta sp ; setup runtime stack part 1
+ lda MEMTOP+1
+ sbc #>__RESERVED_MEMORY__
+ sta APPMHI+1
+ sta sp+1 ; setup runtime stack part 2
; Call module constructors
- jsr initlib
+ jsr initlib
; Set left margin to 0
- lda LMARGN
- sta old_lmargin
- ldy #0
- sty LMARGN
+ lda LMARGN
+ sta old_lmargin
+ ldy #0
+ sty LMARGN
; Set keyb to upper/lowercase mode
- ldx SHFLOK
- stx old_shflok
- sty SHFLOK
+ ldx SHFLOK
+ stx old_shflok
+ sty SHFLOK
; Initialize conio stuff
- dey ; Set X to $FF
- sty CH
+ dey ; Set X to $FF
+ sty CH
; Push arguments and call main
- jsr callmain
+ jsr callmain
; Call module destructors. This is also the _exit entry.
-_exit: jsr donelib ; Run module destructors
+_exit: jsr donelib ; Run module destructors
; Restore system stuff
- ldx spsave
- txs ; Restore stack pointer
+ ldx spsave
+ txs ; Restore stack pointer
; Restore left margin
- lda old_lmargin
- sta LMARGN
+ lda old_lmargin
+ sta LMARGN
; Restore kb mode
- lda old_shflok
- sta SHFLOK
+ lda old_shflok
+ sta SHFLOK
; Restore APPMHI
- lda appmsav
- sta APPMHI
- lda appmsav+1
- sta APPMHI+1
+ lda appmsav
+ sta APPMHI
+ lda appmsav+1
+ sta APPMHI+1
; Copy back the zero page stuff
- ldx #zpspace-1
-L2: lda zpsave,x
- sta sp,x
- dex
- bpl L2
+ ldx #zpspace-1
+L2: lda zpsave,x
+ sta sp,x
+ dex
+ bpl L2
; Turn on cursor
- inx
- stx CRSINH
+ inx
+ stx CRSINH
; Back to DOS
- rts
+ rts
; *** end of main startup code
; ------------------------------------------------------------------------
-.segment "ZPSAVE"
+.segment "ZPSAVE"
-zpsave: .res zpspace
+zpsave: .res zpspace
; ------------------------------------------------------------------------
.bss
-spsave: .res 1
-appmsav: .res 1
-old_shflok: .res 1
-old_lmargin: .res 1
+spsave: .res 1
+appmsav: .res 1
+old_shflok: .res 1
+old_lmargin: .res 1
- .segment "AUTOSTRT"
- .word RUNAD ; defined in atari.h
- .word RUNAD+1
- .word __STARTUP_LOAD__ + 1
+ .segment "AUTOSTRT"
+ .word RUNAD ; defined in atari.h
+ .word RUNAD+1
+ .word __STARTUP_LOAD__ + 1
diff --git a/libsrc/atari/ctype.s b/libsrc/atari/ctype.s
index 8dbed2700..73553dc15 100644
--- a/libsrc/atari/ctype.s
+++ b/libsrc/atari/ctype.s
@@ -35,267 +35,267 @@
; 6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v')
; 7 - Space or tab character
- .export __ctype
+ .export __ctype
__ctype:
- .byte $00 ; 0/00 ___heart____
- .byte $00 ; 1/01 ___l_tee____
- .byte $00 ; 2/02 ___ctrl_B___
- .byte $00 ; 3/03 ___ctrl_C___
- .byte $00 ; 4/04 ___r_tee____
- .byte $00 ; 5/05 ___ctrl_E___
- .byte $00 ; 6/06 ___ctrl_F___
- .byte $00 ; 7/07 ___ctrl_G___
- .byte $00 ; 8/08 ___ctrl_H___
- .byte $00 ; 9/09 ___ctrl_I___
- .byte $00 ; 10/0a ___ctrl_J___
- .byte $00 ; 11/0b ___ctrl_K___
- .byte $00 ; 12/0c ___ctrl_L___
- .byte $00 ; 13/0d ___ctrl_M___
- .byte $00 ; 14/0e ___ctrl_N___
- .byte $00 ; 15/0f ___ctrl_O___
- .byte $00 ; 16/10 ____club____
- .byte $00 ; 17/11 ___ctrl_Q___
- .byte $00 ; 18/12 ___h_line___
- .byte $00 ; 19/13 ___ctrl_S___
- .byte $00 ; 20/14 ____ball____
- .byte $00 ; 21/15 ___ctrl_U___
- .byte $00 ; 22/16 ___ctrl_V___
- .byte $00 ; 23/17 ___t_tee____
- .byte $00 ; 24/18 ___b_tee____
- .byte $00 ; 25/19 ___ctrl_Y___
- .byte $00 ; 26/1a ___ctrl_Z___
- .byte $10 ; 27/1b ____ESC_____
- .byte $10 ; 28/1c ___crsr_up__
- .byte $10 ; 29/1d ___crsr_dn__
- .byte $10 ; 30/1e ___crsr_lf__
- .byte $10 ; 31/1f ___crsr_rg__
- .byte $A0 ; 32/20 ___SPACE___
- .byte $00 ; 33/21 _____!_____
- .byte $00 ; 34/22 _____"_____
- .byte $00 ; 35/23 _____#_____
- .byte $00 ; 36/24 _____$_____
- .byte $00 ; 37/25 _____%_____
- .byte $00 ; 38/26 _____&_____
- .byte $00 ; 39/27 _____'_____
- .byte $00 ; 40/28 _____(_____
- .byte $00 ; 41/29 _____)_____
- .byte $00 ; 42/2a _____*_____
- .byte $00 ; 43/2b _____+_____
- .byte $00 ; 44/2c _____,_____
- .byte $00 ; 45/2d _____-_____
- .byte $00 ; 46/2e _____._____
- .byte $00 ; 47/2f _____/_____
- .byte $0C ; 48/30 _____0_____
- .byte $0C ; 49/31 _____1_____
- .byte $0C ; 50/32 _____2_____
- .byte $0C ; 51/33 _____3_____
- .byte $0C ; 52/34 _____4_____
- .byte $0C ; 53/35 _____5_____
- .byte $0C ; 54/36 _____6_____
- .byte $0C ; 55/37 _____7_____
- .byte $0C ; 56/38 _____8_____
- .byte $0C ; 57/39 _____9_____
- .byte $00 ; 58/3a _____:_____
- .byte $00 ; 59/3b _____;_____
- .byte $00 ; 60/3c _____<_____
- .byte $00 ; 61/3d _____=_____
- .byte $00 ; 62/3e _____>_____
- .byte $00 ; 63/3f _____?_____
+ .byte $00 ; 0/00 ___heart____
+ .byte $00 ; 1/01 ___l_tee____
+ .byte $00 ; 2/02 ___ctrl_B___
+ .byte $00 ; 3/03 ___ctrl_C___
+ .byte $00 ; 4/04 ___r_tee____
+ .byte $00 ; 5/05 ___ctrl_E___
+ .byte $00 ; 6/06 ___ctrl_F___
+ .byte $00 ; 7/07 ___ctrl_G___
+ .byte $00 ; 8/08 ___ctrl_H___
+ .byte $00 ; 9/09 ___ctrl_I___
+ .byte $00 ; 10/0a ___ctrl_J___
+ .byte $00 ; 11/0b ___ctrl_K___
+ .byte $00 ; 12/0c ___ctrl_L___
+ .byte $00 ; 13/0d ___ctrl_M___
+ .byte $00 ; 14/0e ___ctrl_N___
+ .byte $00 ; 15/0f ___ctrl_O___
+ .byte $00 ; 16/10 ____club____
+ .byte $00 ; 17/11 ___ctrl_Q___
+ .byte $00 ; 18/12 ___h_line___
+ .byte $00 ; 19/13 ___ctrl_S___
+ .byte $00 ; 20/14 ____ball____
+ .byte $00 ; 21/15 ___ctrl_U___
+ .byte $00 ; 22/16 ___ctrl_V___
+ .byte $00 ; 23/17 ___t_tee____
+ .byte $00 ; 24/18 ___b_tee____
+ .byte $00 ; 25/19 ___ctrl_Y___
+ .byte $00 ; 26/1a ___ctrl_Z___
+ .byte $10 ; 27/1b ____ESC_____
+ .byte $10 ; 28/1c ___crsr_up__
+ .byte $10 ; 29/1d ___crsr_dn__
+ .byte $10 ; 30/1e ___crsr_lf__
+ .byte $10 ; 31/1f ___crsr_rg__
+ .byte $A0 ; 32/20 ___SPACE___
+ .byte $00 ; 33/21 _____!_____
+ .byte $00 ; 34/22 _____"_____
+ .byte $00 ; 35/23 _____#_____
+ .byte $00 ; 36/24 _____$_____
+ .byte $00 ; 37/25 _____%_____
+ .byte $00 ; 38/26 _____&_____
+ .byte $00 ; 39/27 _____'_____
+ .byte $00 ; 40/28 _____(_____
+ .byte $00 ; 41/29 _____)_____
+ .byte $00 ; 42/2a _____*_____
+ .byte $00 ; 43/2b _____+_____
+ .byte $00 ; 44/2c _____,_____
+ .byte $00 ; 45/2d _____-_____
+ .byte $00 ; 46/2e _____._____
+ .byte $00 ; 47/2f _____/_____
+ .byte $0C ; 48/30 _____0_____
+ .byte $0C ; 49/31 _____1_____
+ .byte $0C ; 50/32 _____2_____
+ .byte $0C ; 51/33 _____3_____
+ .byte $0C ; 52/34 _____4_____
+ .byte $0C ; 53/35 _____5_____
+ .byte $0C ; 54/36 _____6_____
+ .byte $0C ; 55/37 _____7_____
+ .byte $0C ; 56/38 _____8_____
+ .byte $0C ; 57/39 _____9_____
+ .byte $00 ; 58/3a _____:_____
+ .byte $00 ; 59/3b _____;_____
+ .byte $00 ; 60/3c _____<_____
+ .byte $00 ; 61/3d _____=_____
+ .byte $00 ; 62/3e _____>_____
+ .byte $00 ; 63/3f _____?_____
- .byte $00 ; 64/40 _____@_____
- .byte $0A ; 65/41 _____A_____
- .byte $0A ; 66/42 _____B_____
- .byte $0A ; 67/43 _____C_____
- .byte $0A ; 68/44 _____D_____
- .byte $0A ; 69/45 _____E_____
- .byte $0A ; 70/46 _____F_____
- .byte $02 ; 71/47 _____G_____
- .byte $02 ; 72/48 _____H_____
- .byte $02 ; 73/49 _____I_____
- .byte $02 ; 74/4a _____J_____
- .byte $02 ; 75/4b _____K_____
- .byte $02 ; 76/4c _____L_____
- .byte $02 ; 77/4d _____M_____
- .byte $02 ; 78/4e _____N_____
- .byte $02 ; 79/4f _____O_____
- .byte $02 ; 80/50 _____P_____
- .byte $02 ; 81/51 _____Q_____
- .byte $02 ; 82/52 _____R_____
- .byte $02 ; 83/53 _____S_____
- .byte $02 ; 84/54 _____T_____
- .byte $02 ; 85/55 _____U_____
- .byte $02 ; 86/56 _____V_____
- .byte $02 ; 87/57 _____W_____
- .byte $02 ; 88/58 _____X_____
- .byte $02 ; 89/59 _____Y_____
- .byte $02 ; 90/5a _____Z_____
- .byte $00 ; 91/5b _____[_____
- .byte $00 ; 92/5c _____\_____
- .byte $00 ; 93/5d _____]_____
- .byte $00 ; 94/5e _____^_____
- .byte $00 ; 95/5f _UNDERLINE_
- .byte $00 ; 96/60 __diamond__
- .byte $09 ; 97/61 _____a_____
- .byte $09 ; 98/62 _____b_____
- .byte $09 ; 99/63 _____c_____
- .byte $09 ; 100/64 _____d_____
- .byte $09 ; 101/65 _____e_____
- .byte $09 ; 102/66 _____f_____
- .byte $01 ; 103/67 _____g_____
- .byte $01 ; 104/68 _____h_____
- .byte $01 ; 105/69 _____i_____
- .byte $01 ; 106/6a _____j_____
- .byte $01 ; 107/6b _____k_____
- .byte $01 ; 108/6c _____l_____
- .byte $01 ; 109/6d _____m_____
- .byte $01 ; 110/6e _____n_____
- .byte $01 ; 111/6f _____o_____
- .byte $01 ; 112/70 _____p_____
- .byte $01 ; 113/71 _____q_____
- .byte $01 ; 114/72 _____r_____
- .byte $01 ; 115/73 _____s_____
- .byte $01 ; 116/74 _____t_____
- .byte $01 ; 117/75 _____u_____
- .byte $01 ; 118/76 _____v_____
- .byte $01 ; 119/77 _____w_____
- .byte $01 ; 120/78 _____x_____
- .byte $01 ; 121/79 _____y_____
- .byte $01 ; 122/7a _____z_____
- .byte $00 ; 123/7b ___spade___
- .byte $00 ; 124/7c __v_line___
- .byte $10 ; 125/7d __CLRSCR___
- .byte $D0 ; 126/7e __backtab__
- .byte $D0 ; 127/7f ____tab____
+ .byte $00 ; 64/40 _____@_____
+ .byte $0A ; 65/41 _____A_____
+ .byte $0A ; 66/42 _____B_____
+ .byte $0A ; 67/43 _____C_____
+ .byte $0A ; 68/44 _____D_____
+ .byte $0A ; 69/45 _____E_____
+ .byte $0A ; 70/46 _____F_____
+ .byte $02 ; 71/47 _____G_____
+ .byte $02 ; 72/48 _____H_____
+ .byte $02 ; 73/49 _____I_____
+ .byte $02 ; 74/4a _____J_____
+ .byte $02 ; 75/4b _____K_____
+ .byte $02 ; 76/4c _____L_____
+ .byte $02 ; 77/4d _____M_____
+ .byte $02 ; 78/4e _____N_____
+ .byte $02 ; 79/4f _____O_____
+ .byte $02 ; 80/50 _____P_____
+ .byte $02 ; 81/51 _____Q_____
+ .byte $02 ; 82/52 _____R_____
+ .byte $02 ; 83/53 _____S_____
+ .byte $02 ; 84/54 _____T_____
+ .byte $02 ; 85/55 _____U_____
+ .byte $02 ; 86/56 _____V_____
+ .byte $02 ; 87/57 _____W_____
+ .byte $02 ; 88/58 _____X_____
+ .byte $02 ; 89/59 _____Y_____
+ .byte $02 ; 90/5a _____Z_____
+ .byte $00 ; 91/5b _____[_____
+ .byte $00 ; 92/5c _____\_____
+ .byte $00 ; 93/5d _____]_____
+ .byte $00 ; 94/5e _____^_____
+ .byte $00 ; 95/5f _UNDERLINE_
+ .byte $00 ; 96/60 __diamond__
+ .byte $09 ; 97/61 _____a_____
+ .byte $09 ; 98/62 _____b_____
+ .byte $09 ; 99/63 _____c_____
+ .byte $09 ; 100/64 _____d_____
+ .byte $09 ; 101/65 _____e_____
+ .byte $09 ; 102/66 _____f_____
+ .byte $01 ; 103/67 _____g_____
+ .byte $01 ; 104/68 _____h_____
+ .byte $01 ; 105/69 _____i_____
+ .byte $01 ; 106/6a _____j_____
+ .byte $01 ; 107/6b _____k_____
+ .byte $01 ; 108/6c _____l_____
+ .byte $01 ; 109/6d _____m_____
+ .byte $01 ; 110/6e _____n_____
+ .byte $01 ; 111/6f _____o_____
+ .byte $01 ; 112/70 _____p_____
+ .byte $01 ; 113/71 _____q_____
+ .byte $01 ; 114/72 _____r_____
+ .byte $01 ; 115/73 _____s_____
+ .byte $01 ; 116/74 _____t_____
+ .byte $01 ; 117/75 _____u_____
+ .byte $01 ; 118/76 _____v_____
+ .byte $01 ; 119/77 _____w_____
+ .byte $01 ; 120/78 _____x_____
+ .byte $01 ; 121/79 _____y_____
+ .byte $01 ; 122/7a _____z_____
+ .byte $00 ; 123/7b ___spade___
+ .byte $00 ; 124/7c __v_line___
+ .byte $10 ; 125/7d __CLRSCR___
+ .byte $D0 ; 126/7e __backtab__
+ .byte $D0 ; 127/7f ____tab____
- .byte $00 ; 128/80 _inv_heart___
- .byte $00 ; 129/81 _inv_l_tee___
- .byte $00 ; 130/82 _inv_ctrl_B__
- .byte $00 ; 131/83 _inv_ctrl_C__
- .byte $00 ; 132/84 _inv_r_tee___
- .byte $00 ; 133/85 _inv_ctrl_E__
- .byte $00 ; 134/86 _inv_ctrl_F__
- .byte $00 ; 135/87 _inv_ctrl_G__
- .byte $00 ; 136/88 _inv_ctrl_H__
- .byte $00 ; 137/89 _inv_ctrl_I__
- .byte $00 ; 138/8a _inv_ctrl_J__
- .byte $00 ; 139/8b _inv_ctrl_K__
- .byte $00 ; 140/8c _inv_ctrl_L__
- .byte $00 ; 141/8d _inv_ctrl_M__
- .byte $00 ; 142/8e _inv_ctrl_N__
- .byte $00 ; 143/8f _inv_ctrl_O__
- .byte $00 ; 144/90 __inv__club__
- .byte $00 ; 145/91 _inv_ctrl_Q__
- .byte $00 ; 146/92 _inv_h_line__
- .byte $00 ; 147/93 _inv_ctrl_S__
- .byte $00 ; 148/94 __inv__ball__
- .byte $00 ; 149/95 _inv_ctrl_U__
- .byte $00 ; 150/96 _inv_ctrl_V__
- .byte $00 ; 151/97 __inv_t_tee__
- .byte $00 ; 152/98 __inv_b_tee__
- .byte $00 ; 153/99 _inv_ctrl_Y__
- .byte $00 ; 154/9a _inv_ctrl_Z__
- .byte $50 ; 155/9b _____EOL_____
- .byte $10 ; 156/9c ___CLRLINE___
- .byte $10 ; 157/9d ___INSLINE___
- .byte $10 ; 158/9e ____CLRTAB___
- .byte $10 ; 159/9f ____INSTAB___
- .byte $A0 ; 160/a0 __inv_SPACE__
- .byte $00 ; 161/a1 ___inv_!_____
- .byte $00 ; 162/a2 ___inv_"_____
- .byte $00 ; 163/a3 ___inv_#_____
- .byte $00 ; 164/a4 ___inv_$_____
- .byte $00 ; 165/a5 ___inv_%_____
- .byte $00 ; 166/a6 ___inv_&_____
- .byte $00 ; 167/a7 ___inv_'_____
- .byte $00 ; 168/a8 ___inv_(_____
- .byte $00 ; 169/a9 ___inv_)_____
- .byte $00 ; 170/aa ___inv_*_____
- .byte $00 ; 171/ab ___inv_+_____
- .byte $00 ; 172/ac ___inv_,_____
- .byte $00 ; 173/ad ___inv_-_____
- .byte $00 ; 174/ae ___inv_._____
- .byte $00 ; 175/af ___inv_/_____
- .byte $0C ; 176/b0 ___inv_0_____
- .byte $0C ; 177/b1 ___inv_1_____
- .byte $0C ; 178/b2 ___inv_2_____
- .byte $0C ; 179/b3 ___inv_3_____
- .byte $0C ; 180/b4 ___inv_4_____
- .byte $0C ; 181/b5 ___inv_5_____
- .byte $0C ; 182/b6 ___inv_6_____
- .byte $0C ; 183/b7 ___inv_7_____
- .byte $0C ; 184/b8 ___inv_8_____
- .byte $0C ; 185/b9 ___inv_9_____
- .byte $00 ; 186/ba ___inv_:_____
- .byte $00 ; 187/bb ___inv_;_____
- .byte $00 ; 188/bc ___inv_<_____
- .byte $00 ; 189/bd ___inv_=_____
- .byte $00 ; 190/be ___inv_>_____
- .byte $00 ; 191/bf ___inv_?_____
+ .byte $00 ; 128/80 _inv_heart___
+ .byte $00 ; 129/81 _inv_l_tee___
+ .byte $00 ; 130/82 _inv_ctrl_B__
+ .byte $00 ; 131/83 _inv_ctrl_C__
+ .byte $00 ; 132/84 _inv_r_tee___
+ .byte $00 ; 133/85 _inv_ctrl_E__
+ .byte $00 ; 134/86 _inv_ctrl_F__
+ .byte $00 ; 135/87 _inv_ctrl_G__
+ .byte $00 ; 136/88 _inv_ctrl_H__
+ .byte $00 ; 137/89 _inv_ctrl_I__
+ .byte $00 ; 138/8a _inv_ctrl_J__
+ .byte $00 ; 139/8b _inv_ctrl_K__
+ .byte $00 ; 140/8c _inv_ctrl_L__
+ .byte $00 ; 141/8d _inv_ctrl_M__
+ .byte $00 ; 142/8e _inv_ctrl_N__
+ .byte $00 ; 143/8f _inv_ctrl_O__
+ .byte $00 ; 144/90 __inv__club__
+ .byte $00 ; 145/91 _inv_ctrl_Q__
+ .byte $00 ; 146/92 _inv_h_line__
+ .byte $00 ; 147/93 _inv_ctrl_S__
+ .byte $00 ; 148/94 __inv__ball__
+ .byte $00 ; 149/95 _inv_ctrl_U__
+ .byte $00 ; 150/96 _inv_ctrl_V__
+ .byte $00 ; 151/97 __inv_t_tee__
+ .byte $00 ; 152/98 __inv_b_tee__
+ .byte $00 ; 153/99 _inv_ctrl_Y__
+ .byte $00 ; 154/9a _inv_ctrl_Z__
+ .byte $50 ; 155/9b _____EOL_____
+ .byte $10 ; 156/9c ___CLRLINE___
+ .byte $10 ; 157/9d ___INSLINE___
+ .byte $10 ; 158/9e ____CLRTAB___
+ .byte $10 ; 159/9f ____INSTAB___
+ .byte $A0 ; 160/a0 __inv_SPACE__
+ .byte $00 ; 161/a1 ___inv_!_____
+ .byte $00 ; 162/a2 ___inv_"_____
+ .byte $00 ; 163/a3 ___inv_#_____
+ .byte $00 ; 164/a4 ___inv_$_____
+ .byte $00 ; 165/a5 ___inv_%_____
+ .byte $00 ; 166/a6 ___inv_&_____
+ .byte $00 ; 167/a7 ___inv_'_____
+ .byte $00 ; 168/a8 ___inv_(_____
+ .byte $00 ; 169/a9 ___inv_)_____
+ .byte $00 ; 170/aa ___inv_*_____
+ .byte $00 ; 171/ab ___inv_+_____
+ .byte $00 ; 172/ac ___inv_,_____
+ .byte $00 ; 173/ad ___inv_-_____
+ .byte $00 ; 174/ae ___inv_._____
+ .byte $00 ; 175/af ___inv_/_____
+ .byte $0C ; 176/b0 ___inv_0_____
+ .byte $0C ; 177/b1 ___inv_1_____
+ .byte $0C ; 178/b2 ___inv_2_____
+ .byte $0C ; 179/b3 ___inv_3_____
+ .byte $0C ; 180/b4 ___inv_4_____
+ .byte $0C ; 181/b5 ___inv_5_____
+ .byte $0C ; 182/b6 ___inv_6_____
+ .byte $0C ; 183/b7 ___inv_7_____
+ .byte $0C ; 184/b8 ___inv_8_____
+ .byte $0C ; 185/b9 ___inv_9_____
+ .byte $00 ; 186/ba ___inv_:_____
+ .byte $00 ; 187/bb ___inv_;_____
+ .byte $00 ; 188/bc ___inv_<_____
+ .byte $00 ; 189/bd ___inv_=_____
+ .byte $00 ; 190/be ___inv_>_____
+ .byte $00 ; 191/bf ___inv_?_____
- .byte $00 ; 192/c0 ___inv_@_____
- .byte $0A ; 193/c1 ___inv_A_____
- .byte $0A ; 194/c2 ___inv_B_____
- .byte $0A ; 195/c3 ___inv_C_____
- .byte $0A ; 196/c4 ___inv_D_____
- .byte $0A ; 197/c5 ___inv_E_____
- .byte $0A ; 198/c6 ___inv_F_____
- .byte $02 ; 199/c7 ___inv_G_____
- .byte $02 ; 200/c8 ___inv_H_____
- .byte $02 ; 201/c9 ___inv_I_____
- .byte $02 ; 202/ca ___inv_J_____
- .byte $02 ; 203/cb ___inv_K_____
- .byte $02 ; 204/cc ___inv_L_____
- .byte $02 ; 205/cd ___inv_M_____
- .byte $02 ; 206/ce ___inv_N_____
- .byte $02 ; 207/cf ___inv_O_____
- .byte $02 ; 208/d0 ___inv_P_____
- .byte $02 ; 209/d1 ___inv_Q_____
- .byte $02 ; 210/d2 ___inv_R_____
- .byte $02 ; 211/d3 ___inv_S_____
- .byte $02 ; 212/d4 ___inv_T_____
- .byte $02 ; 213/d5 ___inv_U_____
- .byte $02 ; 214/d6 ___inv_V_____
- .byte $02 ; 215/d7 ___inv_W_____
- .byte $02 ; 216/d8 ___inv_X_____
- .byte $02 ; 217/d9 ___inv_Y_____
- .byte $02 ; 218/da ___inv_Z_____
- .byte $00 ; 219/db ___inv_[_____
- .byte $00 ; 220/dc ___inv_\_____
- .byte $00 ; 221/dd ___inv_]_____
- .byte $00 ; 222/de ___inv_^_____
- .byte $00 ; 223/df _inv_UNDRLIN_
- .byte $00 ; 224/e0 _inv_diamond_
- .byte $09 ; 225/e1 ___inv_a_____
- .byte $09 ; 226/e2 ___inv_b_____
- .byte $09 ; 227/e3 ___inv_c_____
- .byte $09 ; 228/e4 ___inv_d_____
- .byte $09 ; 229/e5 ___inv_e_____
- .byte $09 ; 230/e6 ___inv_f_____
- .byte $01 ; 231/e7 ___inv_g_____
- .byte $01 ; 232/e8 ___inv_h_____
- .byte $01 ; 233/e9 ___inv_i_____
- .byte $01 ; 234/ea ___inv_j_____
- .byte $01 ; 235/eb ___inv_k_____
- .byte $01 ; 236/ec ___inv_l_____
- .byte $01 ; 237/ed ___inv_m_____
- .byte $01 ; 238/ee ___inv_n_____
- .byte $01 ; 239/ef ___inv_o_____
- .byte $01 ; 240/f0 ___inv_p_____
- .byte $01 ; 241/f1 ___inv_q_____
- .byte $01 ; 242/f2 ___inv_r_____
- .byte $01 ; 243/f3 ___inv_s_____
- .byte $01 ; 244/f4 ___inv_t_____
- .byte $01 ; 245/f5 ___inv_u_____
- .byte $01 ; 246/f6 ___inv_v_____
- .byte $01 ; 247/f7 ___inv_w_____
- .byte $01 ; 248/f8 ___inv_x_____
- .byte $01 ; 249/f9 ___inv_y_____
- .byte $01 ; 250/fa ___inv_z_____
- .byte $00 ; 251/fb __inv_spade__
- .byte $00 ; 252/fc __inv_v_line_
- .byte $10 ; 253/fd ____BEEP_____
- .byte $10 ; 254/fe ____DELBS____
- .byte $10 ; 255/ff ___INSERT____
+ .byte $00 ; 192/c0 ___inv_@_____
+ .byte $0A ; 193/c1 ___inv_A_____
+ .byte $0A ; 194/c2 ___inv_B_____
+ .byte $0A ; 195/c3 ___inv_C_____
+ .byte $0A ; 196/c4 ___inv_D_____
+ .byte $0A ; 197/c5 ___inv_E_____
+ .byte $0A ; 198/c6 ___inv_F_____
+ .byte $02 ; 199/c7 ___inv_G_____
+ .byte $02 ; 200/c8 ___inv_H_____
+ .byte $02 ; 201/c9 ___inv_I_____
+ .byte $02 ; 202/ca ___inv_J_____
+ .byte $02 ; 203/cb ___inv_K_____
+ .byte $02 ; 204/cc ___inv_L_____
+ .byte $02 ; 205/cd ___inv_M_____
+ .byte $02 ; 206/ce ___inv_N_____
+ .byte $02 ; 207/cf ___inv_O_____
+ .byte $02 ; 208/d0 ___inv_P_____
+ .byte $02 ; 209/d1 ___inv_Q_____
+ .byte $02 ; 210/d2 ___inv_R_____
+ .byte $02 ; 211/d3 ___inv_S_____
+ .byte $02 ; 212/d4 ___inv_T_____
+ .byte $02 ; 213/d5 ___inv_U_____
+ .byte $02 ; 214/d6 ___inv_V_____
+ .byte $02 ; 215/d7 ___inv_W_____
+ .byte $02 ; 216/d8 ___inv_X_____
+ .byte $02 ; 217/d9 ___inv_Y_____
+ .byte $02 ; 218/da ___inv_Z_____
+ .byte $00 ; 219/db ___inv_[_____
+ .byte $00 ; 220/dc ___inv_\_____
+ .byte $00 ; 221/dd ___inv_]_____
+ .byte $00 ; 222/de ___inv_^_____
+ .byte $00 ; 223/df _inv_UNDRLIN_
+ .byte $00 ; 224/e0 _inv_diamond_
+ .byte $09 ; 225/e1 ___inv_a_____
+ .byte $09 ; 226/e2 ___inv_b_____
+ .byte $09 ; 227/e3 ___inv_c_____
+ .byte $09 ; 228/e4 ___inv_d_____
+ .byte $09 ; 229/e5 ___inv_e_____
+ .byte $09 ; 230/e6 ___inv_f_____
+ .byte $01 ; 231/e7 ___inv_g_____
+ .byte $01 ; 232/e8 ___inv_h_____
+ .byte $01 ; 233/e9 ___inv_i_____
+ .byte $01 ; 234/ea ___inv_j_____
+ .byte $01 ; 235/eb ___inv_k_____
+ .byte $01 ; 236/ec ___inv_l_____
+ .byte $01 ; 237/ed ___inv_m_____
+ .byte $01 ; 238/ee ___inv_n_____
+ .byte $01 ; 239/ef ___inv_o_____
+ .byte $01 ; 240/f0 ___inv_p_____
+ .byte $01 ; 241/f1 ___inv_q_____
+ .byte $01 ; 242/f2 ___inv_r_____
+ .byte $01 ; 243/f3 ___inv_s_____
+ .byte $01 ; 244/f4 ___inv_t_____
+ .byte $01 ; 245/f5 ___inv_u_____
+ .byte $01 ; 246/f6 ___inv_v_____
+ .byte $01 ; 247/f7 ___inv_w_____
+ .byte $01 ; 248/f8 ___inv_x_____
+ .byte $01 ; 249/f9 ___inv_y_____
+ .byte $01 ; 250/fa ___inv_z_____
+ .byte $00 ; 251/fb __inv_spade__
+ .byte $00 ; 252/fc __inv_v_line_
+ .byte $10 ; 253/fd ____BEEP_____
+ .byte $10 ; 254/fe ____DELBS____
+ .byte $10 ; 255/ff ___INSERT____
diff --git a/libsrc/atari/cvline.s b/libsrc/atari/cvline.s
index ca3795aca..608da23de 100644
--- a/libsrc/atari/cvline.s
+++ b/libsrc/atari/cvline.s
@@ -4,32 +4,32 @@
; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
; void cvline (unsigned char length);
;
- .include "atari.inc"
-
- .export _cvlinexy, _cvline
- .import popa, _gotoxy, putchar, setcursor
- .importzp tmp1
+ .include "atari.inc"
+
+ .export _cvlinexy, _cvline
+ .import popa, _gotoxy, putchar, setcursor
+ .importzp tmp1
_cvlinexy:
- pha ; Save the length
- jsr popa ; Get y
- jsr _gotoxy ; Call this one, will pop params
- pla ; Restore the length and run into _cvline
+ pha ; Save the length
+ jsr popa ; Get y
+ jsr _gotoxy ; Call this one, will pop params
+ pla ; Restore the length and run into _cvline
_cvline:
- cmp #0 ; Is the length zero?
- beq L9 ; Jump if done
- sta tmp1
-L1: lda COLCRS
- pha
- lda #$7C ; Vertical bar
- jsr putchar ; Write, no cursor advance
- pla
- sta COLCRS
- inc ROWCRS
- dec tmp1
- bne L1
-L9: jmp setcursor
+ cmp #0 ; Is the length zero?
+ beq L9 ; Jump if done
+ sta tmp1
+L1: lda COLCRS
+ pha
+ lda #$7C ; Vertical bar
+ jsr putchar ; Write, no cursor advance
+ pla
+ sta COLCRS
+ inc ROWCRS
+ dec tmp1
+ bne L1
+L9: jmp setcursor
diff --git a/libsrc/atari/dio_cts.s b/libsrc/atari/dio_cts.s
index f76a06b8a..551b9c0f6 100644
--- a/libsrc/atari/dio_cts.s
+++ b/libsrc/atari/dio_cts.s
@@ -9,60 +9,60 @@
; sector number it got
;
; unsigned char __fastcall__ dio_phys_to_log(dhandle_t handle,
-; dio_phys_pos *physpos, /* input */
-; unsigned *sectnum); /* output */
+; dio_phys_pos *physpos, /* input */
+; unsigned *sectnum); /* output */
;
; dhandle_t - 16bit (ptr)
;
- .export _dio_phys_to_log
- .import popax,__oserror
- .importzp ptr1,ptr2,ptr3
- .include "atari.inc"
+ .export _dio_phys_to_log
+ .import popax,__oserror
+ .importzp ptr1,ptr2,ptr3
+ .include "atari.inc"
-.proc _dio_phys_to_log
+.proc _dio_phys_to_log
- sta ptr1
- stx ptr1+1 ; pointer to result
+ sta ptr1
+ stx ptr1+1 ; pointer to result
- jsr popax
- sta ptr2
- stx ptr2+1 ; pointer to input structure
+ jsr popax
+ sta ptr2
+ stx ptr2+1 ; pointer to input structure
- jsr popax
- sta ptr3
- stx ptr3+1 ; pointer to handle
+ jsr popax
+ sta ptr3
+ stx ptr3+1 ; pointer to handle
- ldy #sst_flag
- lda (ptr3),y
- and #128
- beq _inv_hand ; handle not open or invalid
+ ldy #sst_flag
+ lda (ptr3),y
+ and #128
+ beq _inv_hand ; handle not open or invalid
; ignore head and track and return the sector value
- ldy #diopp_sector
- lda (ptr2),y
- tax
- iny
- lda (ptr2),y
- ldy #1
- sta (ptr1),y
- dey
- txa
- sta (ptr1),y
+ ldy #diopp_sector
+ lda (ptr2),y
+ tax
+ iny
+ lda (ptr2),y
+ ldy #1
+ sta (ptr1),y
+ dey
+ txa
+ sta (ptr1),y
- ldx #0
- txa
+ ldx #0
+ txa
ret:
- sta __oserror
- rts ; return success
+ sta __oserror
+ rts ; return success
; invalid handle
_inv_hand:
- ldx #0
- lda #BADIOC
- bne ret
+ ldx #0
+ lda #BADIOC
+ bne ret
.endproc
diff --git a/libsrc/atari/dio_stc.s b/libsrc/atari/dio_stc.s
index 617989cbd..52b3af4a6 100644
--- a/libsrc/atari/dio_stc.s
+++ b/libsrc/atari/dio_stc.s
@@ -8,65 +8,65 @@
; cylinder and head 0 and as sector the sectnum it got
;
; unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle,
-; unsigned *sectnum, /* input */
-; dio_phys_pos *physpos); /* output */
+; unsigned *sectnum, /* input */
+; dio_phys_pos *physpos); /* output */
;
; dhandle_t - 16bit (ptr)
;
- .export _dio_log_to_phys
- .include "atari.inc"
- .importzp ptr1,ptr2,ptr3
- .import popax,__oserror
+ .export _dio_log_to_phys
+ .include "atari.inc"
+ .importzp ptr1,ptr2,ptr3
+ .import popax,__oserror
-.proc _dio_log_to_phys
+.proc _dio_log_to_phys
- sta ptr2
- stx ptr2+1 ; pointer to output structure
+ sta ptr2
+ stx ptr2+1 ; pointer to output structure
- jsr popax
- sta ptr1
- stx ptr1+1 ; save pointer to input data
+ jsr popax
+ sta ptr1
+ stx ptr1+1 ; save pointer to input data
- jsr popax
- sta ptr3
- stx ptr3+1 ; pointer to handle
+ jsr popax
+ sta ptr3
+ stx ptr3+1 ; pointer to handle
- ldy #sst_flag
- lda (ptr3),y
- and #128
- beq _inv_hand ; handle not open or invalid
+ ldy #sst_flag
+ lda (ptr3),y
+ and #128
+ beq _inv_hand ; handle not open or invalid
- lda #0
- tay
- tax
- sta (ptr2),y ; head
- iny
- sta (ptr2),y ; track (low)
- iny
- sta (ptr2),y ; track (high)
- iny
+ lda #0
+ tay
+ tax
+ sta (ptr2),y ; head
+ iny
+ sta (ptr2),y ; track (low)
+ iny
+ sta (ptr2),y ; track (high)
+ iny
- lda (ptr1,x)
- sta (ptr2),y
- iny
- inc ptr1
- bne _l1
- inc ptr1+1
-_l1: lda (ptr1,x)
- sta (ptr2),y
+ lda (ptr1,x)
+ sta (ptr2),y
+ iny
+ inc ptr1
+ bne _l1
+ inc ptr1+1
+_l1: lda (ptr1,x)
+ sta (ptr2),y
- txa
+ txa
ret:
- sta __oserror
- rts ; return success
+ sta __oserror
+ rts ; return success
; invalid handle
_inv_hand:
- ldx #0
- lda #BADIOC
- bne ret
+ ldx #0
+ lda #BADIOC
+ bne ret
.endproc
diff --git a/libsrc/atari/diopncls.s b/libsrc/atari/diopncls.s
index f4c806076..2cdeba78b 100644
--- a/libsrc/atari/diopncls.s
+++ b/libsrc/atari/diopncls.s
@@ -8,156 +8,156 @@
; _dio_write functions. To query the sector size, the _dio_open
; accesses the disk drive.
;
-; dhandle_t __fastcall__ dio_open (unsigned char device);
+; dhandle_t __fastcall__ dio_open (unsigned char device);
; unsigned char __fastcall__ dio_close (dhandle_t handle);
;
- .export _dio_open, _dio_close
- .export sectsizetab
- .import __oserror, __sio_call, _dio_read
- .import pushax, addysp, subysp
- .importzp ptr2, sp
- .include "atari.inc"
+ .export _dio_open, _dio_close
+ .export sectsizetab
+ .import __oserror, __sio_call, _dio_read
+ .import pushax, addysp, subysp
+ .importzp ptr2, sp
+ .include "atari.inc"
.bss
sectsizetab:
- .res NUMDRVS * sst_size
+ .res NUMDRVS * sst_size
.code
; code for _dio_open
_inv_drive:
- lda #NONDEV ; non-existent device
- sta __oserror
- lda #0
- tax
- rts ; return NULL
+ lda #NONDEV ; non-existent device
+ sta __oserror
+ lda #0
+ tax
+ rts ; return NULL
_dio_open:
- cmp #NUMDRVS ; valid drive id?
- bcs _inv_drive
- tay ; drive #
- asl a ; make index from drive id
- asl a
- tax
- lda #128 ; preset sectsize
- sta sectsizetab+sst_sectsize,x
- sta sectsizetab+sst_flag,x ; set flag that drive is "open"
- lda #0
- sta sectsizetab+sst_sectsize+1,x
- sta __oserror ; success
- tya
- sta sectsizetab+sst_driveno,x
- stx ptr2
- lda #sectsizetab
- adc #0
- tax
- stx ptr2+1 ; ptr2: pointer to sectsizetab entry
+ cmp #NUMDRVS ; valid drive id?
+ bcs _inv_drive
+ tay ; drive #
+ asl a ; make index from drive id
+ asl a
+ tax
+ lda #128 ; preset sectsize
+ sta sectsizetab+sst_sectsize,x
+ sta sectsizetab+sst_flag,x ; set flag that drive is "open"
+ lda #0
+ sta sectsizetab+sst_sectsize+1,x
+ sta __oserror ; success
+ tya
+ sta sectsizetab+sst_driveno,x
+ stx ptr2
+ lda #sectsizetab
+ adc #0
+ tax
+ stx ptr2+1 ; ptr2: pointer to sectsizetab entry
; query drive for current sector size
; procedure:
; - read sector #4 (SIO command $54) to update drive status;
; read length is 128 bytes, buffer is allocated on the stack,
-; sector data is ignored;
+; sector data is ignored;
; returned command status is ignored, we will get an error with
-; a DD disk anyway (read size 128 vs. sector size 256);
+; a DD disk anyway (read size 128 vs. sector size 256);
; - issue SIO command $53 (get status) to retrieve the sector size;
; use the DVSTAT system area as return buffer;
; if the command returns with an error, set sector size to 128
-; bytes;
+; bytes;
;
- ldy #128
- jsr subysp ; allocate buffer on the stack
+ ldy #128
+ jsr subysp ; allocate buffer on the stack
- lda sp
- pha
- lda sp+1
- pha ; save sp (buffer address) on processor stack
+ lda sp
+ pha
+ lda sp+1
+ pha ; save sp (buffer address) on processor stack
- lda ptr2
- ldx ptr2+1
- jsr pushax ; handle
+ lda ptr2
+ ldx ptr2+1
+ jsr pushax ; handle
- ldx #0
- lda #4
- jsr pushax ; sect_num
+ ldx #0
+ lda #4
+ jsr pushax ; sect_num
- pla
- tax
- pla ; AX - buffer address
+ pla
+ tax
+ pla ; AX - buffer address
- ; sst_sectsize currently 128
- jsr _dio_read ; read sector to update status
+ ; sst_sectsize currently 128
+ jsr _dio_read ; read sector to update status
- ldy #128
- jsr addysp ; discard stack buffer
+ ldy #128
+ jsr addysp ; discard stack buffer
- lda ptr2
- ldx ptr2+1
- jsr pushax ; handle
+ lda ptr2
+ ldx ptr2+1
+ jsr pushax ; handle
- ldx #0
- lda #4
- jsr pushax ; dummy sector #, ignored by this SIO command,
- ; but set to circumvent the special 1-3 sector
- ; handling in __sio_call
+ ldx #0
+ lda #4
+ jsr pushax ; dummy sector #, ignored by this SIO command,
+ ; but set to circumvent the special 1-3 sector
+ ; handling in __sio_call
- ldx #>DVSTAT
- lda #DVSTAT
+ lda #
+ ldy #6 ; OS/A+ has a jmp here
+ cmp (DOSVEC),y
+ beq done
+ lda #OSADOS
+ .byte $2C ; BIT
-spdos: lda #SPARTADOS
- .byte $2C ; BIT
+spdos: lda #SPARTADOS
+ .byte $2C ; BIT
-mydos: lda #MYDOS
- .byte $2C ; BIT
+mydos: lda #MYDOS
+ .byte $2C ; BIT
-xdos: lda #XDOS
- sta __dos_type
-done: rts
+xdos: lda #XDOS
+ sta __dos_type
+done: rts
; ------------------------------------------------------------------------
; Data
- .bss
+ .bss
-__dos_type: .res 1 ; default to ATARIDOS
+__dos_type: .res 1 ; default to ATARIDOS
diff --git a/libsrc/atari/emd/atr130xe.s b/libsrc/atari/emd/atr130xe.s
index 6951bd346..b3c31a205 100644
--- a/libsrc/atari/emd/atr130xe.s
+++ b/libsrc/atari/emd/atr130xe.s
@@ -24,13 +24,13 @@
; Ullrich von Bassewitz, 2002-12-02
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "em-kernel.inc"
- .include "em-error.inc"
+ .include "em-kernel.inc"
+ .include "em-error.inc"
- .macpack generic
+ .macpack generic
; ------------------------------------------------------------------------
@@ -40,19 +40,19 @@
; Driver signature
- .byte $65, $6d, $64 ; "emd"
- .byte EMD_API_VERSION ; EM API version number
+ .byte $65, $6d, $64 ; "emd"
+ .byte EMD_API_VERSION ; EM API version number
; Jump table.
- .word INSTALL
- .word DEINSTALL
- .word PAGECOUNT
- .word MAP
- .word USE
- .word COMMIT
- .word COPYFROM
- .word COPYTO
+ .word INSTALL
+ .word DEINSTALL
+ .word PAGECOUNT
+ .word MAP
+ .word USE
+ .word COMMIT
+ .word COPYFROM
+ .word COPYTO
; ------------------------------------------------------------------------
; Constants
@@ -69,50 +69,50 @@ PAGES = 256 ; 4 x 16k banks
banks: .byte $E3,$E7,$EB,$EF ; 130XE banks for cpu banking
stacktest: sei
- ldy banks
- sty $D301
- tax ; A is set by caller
- inx
- stx $4000 ; change $4000
- ldy #$FF ; STACK+13
- sty $D301
- cmp $4000 ; changed?
- beq @1
- sec ; error
- bcs @2
+ ldy banks
+ sty $D301
+ tax ; A is set by caller
+ inx
+ stx $4000 ; change $4000
+ ldy #$FF ; STACK+13
+ sty $D301
+ cmp $4000 ; changed?
+ beq @1
+ sec ; error
+ bcs @2
@1: clc
@2: sta $4000 ; restore
- cli
- rts
+ cli
+ rts
stacktest_end:
stackcopy: sei ; disable interrupts
@1: dex ; pre-decrement (full page x=0)
- ldy #$FF ; this will be replaced STACK+3
- sty $D301 ; set bank
- lda $FF00,x ; address to copy from STACK+8,+9
- ldy #$FF ; this will be replaced STACK+11
- sty $D301
- sta $FF00,x ; address to copy to STACK+16,+17
- cpx #0
- bne @1
- ldy #$FF ; portb_save STACK+23
- sty $D301
- cli ; enable interrupts
- rts
+ ldy #$FF ; this will be replaced STACK+3
+ sty $D301 ; set bank
+ lda $FF00,x ; address to copy from STACK+8,+9
+ ldy #$FF ; this will be replaced STACK+11
+ sty $D301
+ sta $FF00,x ; address to copy to STACK+16,+17
+ cpx #0
+ bne @1
+ ldy #$FF ; portb_save STACK+23
+ sty $D301
+ cli ; enable interrupts
+ rts
stackcopy_end:
stackcopy_byte: sei
- ldy #$FF ; STACK+2
- sty $D301
- lda $FFFF ; STACK+7 +8
- ldy #$FF ; STACK+10
- sty $D301
- sta $FFFF ; STACK+15 +16
- ldy #$FF ; STACK+18
- sty $D301
- cli
- rts
+ ldy #$FF ; STACK+2
+ sty $D301
+ lda $FFFF ; STACK+7 +8
+ ldy #$FF ; STACK+10
+ sty $D301
+ sta $FFFF ; STACK+15 +16
+ ldy #$FF ; STACK+18
+ sty $D301
+ cli
+ rts
stackcopy_byte_end:
@@ -127,44 +127,44 @@ portb_save: .res 1 ; portb state
.code
install_transfer:
- ldx #stackcopy_end - stackcopy - 1
+ ldx #stackcopy_end - stackcopy - 1
@1: lda stackcopy,x
- sta STACK,x
- dex
- bpl @1
- rts
+ sta STACK,x
+ dex
+ bpl @1
+ rts
install_byte_transfer:
- ldx #stackcopy_byte_end - stackcopy_byte - 1
+ ldx #stackcopy_byte_end - stackcopy_byte - 1
@2: lda stackcopy_byte,x
- sta STACK,x
- dex
- bpl @2
- rts
+ sta STACK,x
+ dex
+ bpl @2
+ rts
install_test:
- ldx #stacktest_end - stacktest - 1
+ ldx #stacktest_end - stacktest - 1
@3: lda stacktest,x
- sta STACK,x
- dex
- bpl @3
- rts
+ sta STACK,x
+ dex
+ bpl @3
+ rts
setpage:
- tax ; save page
- and #$C0 ; mask out bank
- clc
- ror
- ror ; divide by 64
- ror ; 64 pages in each bank
- ror
- ror
- ror
- sta curbank ; Remember the new bank
- txa ; bring back page
- and #$3F ; mask out page
- sta curpage ; curpage in bank
- rts
+ tax ; save page
+ and #$C0 ; mask out bank
+ clc
+ ror
+ ror ; divide by 64
+ ror ; 64 pages in each bank
+ ror
+ ror
+ ror
+ sta curbank ; Remember the new bank
+ txa ; bring back page
+ and #$3F ; mask out page
+ sta curpage ; curpage in bank
+ rts
; ------------------------------------------------------------------------
@@ -175,20 +175,20 @@ setpage:
;
INSTALL:
- lda $D301 ; save state of portb
- sta portb_save
- tay
-
- jsr install_test ; doesn't touch Y
- sty STACK+13
-
- lda $4000 ; test for extended memory
- jsr STACK
- bcs @1
- lda #EM_ERR_OK
- rts
+ lda $D301 ; save state of portb
+ sta portb_save
+ tay
+
+ jsr install_test ; doesn't touch Y
+ sty STACK+13
+
+ lda $4000 ; test for extended memory
+ jsr STACK
+ bcs @1
+ lda #EM_ERR_OK
+ rts
@1: lda #EM_ERR_NO_DEVICE
- rts
+ rts
; ------------------------------------------------------------------------
; DEINSTALL routine. Is called before the driver is removed from memory.
@@ -196,7 +196,7 @@ INSTALL:
;
DEINSTALL:
- rts
+ rts
; ------------------------------------------------------------------------
@@ -204,9 +204,9 @@ DEINSTALL:
;
PAGECOUNT:
- lda #PAGES
- rts
+ lda #PAGES
+ rts
; ------------------------------------------------------------------------
; MAP: Map the page in a/x into memory and return a pointer to the page in
@@ -215,96 +215,96 @@ PAGECOUNT:
;
MAP: jsr setpage ; extract the bank/page
- add #>BANK ; $4000 + page (carry is cleared)
- sta ptr1+1
- ;ldy #$00
- ;sty ptr1
+ add #>BANK ; $4000 + page (carry is cleared)
+ sta ptr1+1
+ ;ldy #$00
+ ;sty ptr1
- lda #window
- sta ptr2+1
+ lda #window
+ sta ptr2+1
; Transfer one page
- jsr install_transfer ; Transfer one page
+ jsr install_transfer ; Transfer one page
- ldx curbank
- lda banks,x
- sta STACK+3 ; set bank to copy from
+ ldx curbank
+ lda banks,x
+ sta STACK+3 ; set bank to copy from
; lda ptr1
; sta STACK+8
- lda ptr1+1
- sta STACK+9 ; set copy from address
- lda portb_save
- sta STACK+11 ; set portb restore
- sta STACK+23 ; set final portb restore
- lda ptr2
- sta STACK+16
- lda ptr2+1
- sta STACK+17 ; set copy to address
-
- ldx #0 ; full page copy
- jsr STACK ; do the copy!
+ lda ptr1+1
+ sta STACK+9 ; set copy from address
+ lda portb_save
+ sta STACK+11 ; set portb restore
+ sta STACK+23 ; set final portb restore
+ lda ptr2
+ sta STACK+16
+ lda ptr2+1
+ sta STACK+17 ; set copy to address
+
+ ldx #0 ; full page copy
+ jsr STACK ; do the copy!
; Return the memory window
- lda #window ; Return the window address
+ lda #window ; Return the window address
- rts
+ rts
; ------------------------------------------------------------------------
; USE: Tell the driver that the window is now associated with a given page.
USE: ;sta curpage ; Remember the page
- jsr setpage ; extract bank/page
- lda #window ; Return the window
- rts
+ jsr setpage ; extract bank/page
+ lda #window ; Return the window
+ rts
; ------------------------------------------------------------------------
; COMMIT: Commit changes in the memory window to extended storage.
COMMIT: lda curpage ; Get the current page
- cmp #$FF
- beq commit_done ; Jump if no page mapped
+ cmp #$FF
+ beq commit_done ; Jump if no page mapped
- clc
- add #>BANK
- sta ptr2+1
- ;ldy #$00
- ;sty ptr2
+ clc
+ add #>BANK
+ sta ptr2+1
+ ;ldy #$00
+ ;sty ptr2
- lda #window
- sta ptr1+1
+ lda #window
+ sta ptr1+1
; Transfer one page/all bytes
- jsr install_transfer ; Transfer one page
-
- lda portb_save
- sta STACK+3 ; set bank to copy from
- sta STACK+23 ; set final portb restore
- lda ptr1
- sta STACK+8
- lda ptr1+1
- sta STACK+9 ; set copy from address
- ldx curbank
- lda banks,x
- sta STACK+11 ; set bank to copy to
- ;lda ptr2
- ;sta STACK+16
- lda ptr2+1
- sta STACK+17 ; set copy to address
-
- ldx #0 ; full page copy
- jsr STACK ; do the copy!
+ jsr install_transfer ; Transfer one page
+
+ lda portb_save
+ sta STACK+3 ; set bank to copy from
+ sta STACK+23 ; set final portb restore
+ lda ptr1
+ sta STACK+8
+ lda ptr1+1
+ sta STACK+9 ; set copy from address
+ ldx curbank
+ lda banks,x
+ sta STACK+11 ; set bank to copy to
+ ;lda ptr2
+ ;sta STACK+16
+ lda ptr2+1
+ sta STACK+17 ; set copy to address
+
+ ldx #0 ; full page copy
+ jsr STACK ; do the copy!
commit_done:
- rts
+ rts
; ------------------------------------------------------------------------
@@ -313,87 +313,87 @@ commit_done:
; The function must not return anything.
;
COPYFROM:
- sta ptr3
- stx ptr3+1 ; Save the passed em_copy pointer
-
- jsr install_byte_transfer ; install the stack copy routine
-
- ldy #EM_COPY::OFFS
- lda (ptr3),y
- sta STACK+7 ; offset goes into BANK low
-
- ldy #EM_COPY::PAGE
- lda (ptr3),y
- sta tmp1 ; save page for later
- ;add #>BANK
- ;sta STACK+8 ; BANK + page goes into BANK high
-
- ldy #EM_COPY::BUF
- lda (ptr3),y
- sta STACK+15 ; buffer goes into dest low
- iny
- lda (ptr3),y
- sta STACK+16 ; buffer goes into dest high
-
- ldy #EM_COPY::COUNT
- lda (ptr3),y ; Get bytes in last page
- sta ptr4
- iny
- lda (ptr3),y ; Get number of pages
- sta ptr4+1
-
- lda tmp1 ; extract bank/page
- jsr setpage ; sets curbank/curpage
- lda curpage
- add #>BANK ; add to BANK address
- sta STACK+8 ; current page in bank
- ldx curbank
- lda banks,x
- sta STACK+2 ; set bank in stack
- lda portb_save
- sta STACK+10 ; set bank restore in stack
- sta STACK+18 ; set final restore too
+ sta ptr3
+ stx ptr3+1 ; Save the passed em_copy pointer
+
+ jsr install_byte_transfer ; install the stack copy routine
+
+ ldy #EM_COPY::OFFS
+ lda (ptr3),y
+ sta STACK+7 ; offset goes into BANK low
+
+ ldy #EM_COPY::PAGE
+ lda (ptr3),y
+ sta tmp1 ; save page for later
+ ;add #>BANK
+ ;sta STACK+8 ; BANK + page goes into BANK high
+
+ ldy #EM_COPY::BUF
+ lda (ptr3),y
+ sta STACK+15 ; buffer goes into dest low
+ iny
+ lda (ptr3),y
+ sta STACK+16 ; buffer goes into dest high
+
+ ldy #EM_COPY::COUNT
+ lda (ptr3),y ; Get bytes in last page
+ sta ptr4
+ iny
+ lda (ptr3),y ; Get number of pages
+ sta ptr4+1
+
+ lda tmp1 ; extract bank/page
+ jsr setpage ; sets curbank/curpage
+ lda curpage
+ add #>BANK ; add to BANK address
+ sta STACK+8 ; current page in bank
+ ldx curbank
+ lda banks,x
+ sta STACK+2 ; set bank in stack
+ lda portb_save
+ sta STACK+10 ; set bank restore in stack
+ sta STACK+18 ; set final restore too
copyfrom_copy:
- lda ptr4 ; check if count is zero
- bne @4
- lda ptr4+1
- beq done
+ lda ptr4 ; check if count is zero
+ bne @4
+ lda ptr4+1
+ beq done
@4: jsr STACK ; copy one byte
- sec
- lda ptr4
- sub #1
- sta ptr4
- bcs @1
- lda ptr4+1
- beq @1
- sub #1
- sta ptr4+1
+ sec
+ lda ptr4
+ sub #1
+ sta ptr4
+ bcs @1
+ lda ptr4+1
+ beq @1
+ sub #1
+ sta ptr4+1
@1: inc STACK+7 ; increment address in BANK
- bne @2
- inc STACK+8
- lda STACK+8
- cmp #$80 ; we stepped outside bank
- bne @2
-
- inc curbank ; get next bank
- ldx curbank
- lda banks,x
- sta STACK+2 ; set new bank
- lda #$40 ; set address back to $4000
- sta STACK+8
+ bne @2
+ inc STACK+8
+ lda STACK+8
+ cmp #$80 ; we stepped outside bank
+ bne @2
+
+ inc curbank ; get next bank
+ ldx curbank
+ lda banks,x
+ sta STACK+2 ; set new bank
+ lda #$40 ; set address back to $4000
+ sta STACK+8
@2: inc STACK+15 ; increment buffer address
- bne @3
- inc STACK+16
+ bne @3
+ inc STACK+16
@3: jmp copyfrom_copy ; copy another byte
done:
- rts
+ rts
; ------------------------------------------------------------------------
; COPYTO: Copy from linear into extended memory. A pointer to a structure
@@ -402,82 +402,82 @@ done:
;
COPYTO:
- sta ptr3
- stx ptr3+1 ; Save the passed em_copy pointer
-
- jsr install_byte_transfer ; install the stack copy routine
-
- ldy #EM_COPY::OFFS
- lda (ptr3),y
- sta STACK+15 ; offset goes into BANK low
-
- ldy #EM_COPY::PAGE
- lda (ptr3),y
- sta tmp1 ; save page for later
- ;add #>BANK
- ;sta STACK+16 ; BANK + page goes into BANK high
-
- ldy #EM_COPY::BUF
- lda (ptr3),y
- sta STACK+7 ; buffer goes into dest low
- iny
- lda (ptr3),y
- sta STACK+8 ; buffer goes into dest high
-
- ldy #EM_COPY::COUNT
- lda (ptr3),y ; Get bytes in last page
- sta ptr4
- iny
- lda (ptr3),y ; Get number of pages
- sta ptr4+1
-
- lda tmp1 ; extract bank/page
- jsr setpage ; sets curbank/curpage
- lda curpage
- add #>BANK ; add to BANK address
- sta STACK+16 ; current page in bank
- ldx curbank
- lda banks,x
- sta STACK+10 ; set bank in stack
- lda portb_save
- sta STACK+2 ; set bank restore in stack
- sta STACK+18 ; set final restore too
+ sta ptr3
+ stx ptr3+1 ; Save the passed em_copy pointer
+
+ jsr install_byte_transfer ; install the stack copy routine
+
+ ldy #EM_COPY::OFFS
+ lda (ptr3),y
+ sta STACK+15 ; offset goes into BANK low
+
+ ldy #EM_COPY::PAGE
+ lda (ptr3),y
+ sta tmp1 ; save page for later
+ ;add #>BANK
+ ;sta STACK+16 ; BANK + page goes into BANK high
+
+ ldy #EM_COPY::BUF
+ lda (ptr3),y
+ sta STACK+7 ; buffer goes into dest low
+ iny
+ lda (ptr3),y
+ sta STACK+8 ; buffer goes into dest high
+
+ ldy #EM_COPY::COUNT
+ lda (ptr3),y ; Get bytes in last page
+ sta ptr4
+ iny
+ lda (ptr3),y ; Get number of pages
+ sta ptr4+1
+
+ lda tmp1 ; extract bank/page
+ jsr setpage ; sets curbank/curpage
+ lda curpage
+ add #>BANK ; add to BANK address
+ sta STACK+16 ; current page in bank
+ ldx curbank
+ lda banks,x
+ sta STACK+10 ; set bank in stack
+ lda portb_save
+ sta STACK+2 ; set bank restore in stack
+ sta STACK+18 ; set final restore too
copyto_copy:
- lda ptr4 ; check if count is zero
- bne @4
- lda ptr4+1
- beq done
+ lda ptr4 ; check if count is zero
+ bne @4
+ lda ptr4+1
+ beq done
@4: jsr STACK ; copy one byte
- sec
- lda ptr4
- sub #1
- sta ptr4
- bcs @1
- lda ptr4+1
- beq @1
- sub #1
- sta ptr4+1
+ sec
+ lda ptr4
+ sub #1
+ sta ptr4
+ bcs @1
+ lda ptr4+1
+ beq @1
+ sub #1
+ sta ptr4+1
@1: inc STACK+15 ; increment address in BANK
- bne @2
- inc STACK+16
- lda STACK+16
- cmp #$80 ; we stepped outside bank
- bne @2
-
- inc curbank ; get next bank
- ldx curbank
- lda banks,x
- sta STACK+10 ; set new bank
- lda #$40 ; set address back to $4000
- sta STACK+16
+ bne @2
+ inc STACK+16
+ lda STACK+16
+ cmp #$80 ; we stepped outside bank
+ bne @2
+
+ inc curbank ; get next bank
+ ldx curbank
+ lda banks,x
+ sta STACK+10 ; set new bank
+ lda #$40 ; set address back to $4000
+ sta STACK+16
@2: inc STACK+7 ; increment buffer address
- bne @3
- inc STACK+8
+ bne @3
+ inc STACK+8
@3: jmp copyto_copy ; copy another byte
diff --git a/libsrc/atari/fd.inc b/libsrc/atari/fd.inc
index 31175b3ca..aefc802c5 100644
--- a/libsrc/atari/fd.inc
+++ b/libsrc/atari/fd.inc
@@ -4,18 +4,18 @@
; offsets and defines for fdtable (internal use only)
;
-MAX_FD_INDEX = 12 ; max. # of open fds
-MAX_FD_VAL = 8 ; we have 8 IOCBs
+MAX_FD_INDEX = 12 ; max. # of open fds
+MAX_FD_VAL = 8 ; we have 8 IOCBs
-ft_entrylen = 4 ; length of table entry (it's not sufficient to change here!
- ; the code sometimes does two bit shifts to multiply/divide by
- ; this length)
+ft_entrylen = 4 ; length of table entry (it's not sufficient to change here!
+ ; the code sometimes does two bit shifts to multiply/divide by
+ ; this length)
-ft_usa = 0 ; usage counter
-ft_iocb = 1 ; iocb index (0,$10,$20,etc.), $ff for empty entry
-ft_dev = 2 ; device of open iocb (0 - device not remembered, eg. filename specified)
-ft_flag = 3 ; flags
- ; lower 3 bits: device number (for R: and D:)
- ; bit 3 - seeking supported by DOS/disk combination
- ; bit 4 - indicates a fd opened by the program as apposed to the
- ; inherited ones from program start (fd 0 to fd 2)
+ft_usa = 0 ; usage counter
+ft_iocb = 1 ; iocb index (0,$10,$20,etc.), $ff for empty entry
+ft_dev = 2 ; device of open iocb (0 - device not remembered, eg. filename specified)
+ft_flag = 3 ; flags
+ ; lower 3 bits: device number (for R: and D:)
+ ; bit 3 - seeking supported by DOS/disk combination
+ ; bit 4 - indicates a fd opened by the program as apposed to the
+ ; inherited ones from program start (fd 0 to fd 2)
diff --git a/libsrc/atari/fdtab.s b/libsrc/atari/fdtab.s
index 57598b600..0c90aefad 100644
--- a/libsrc/atari/fdtab.s
+++ b/libsrc/atari/fdtab.s
@@ -5,26 +5,26 @@
; the fdtable itself is defined here
;
- .include "fd.inc"
+ .include "fd.inc"
- .export fd_table,fd_index
- .export ___fd_table,___fd_index ; for test(debug purposes only
+ .export fd_table,fd_index
+ .export ___fd_table,___fd_index ; for test(debug purposes only
- .data
+ .data
___fd_index:
-fd_index: ; fd number is index into this table, entry's value specifies the fd_table entry
- .byte 0,0,0 ; at start, three first files are stdin/stdout/stderr.
- .res MAX_FD_INDEX-3,$ff
+fd_index: ; fd number is index into this table, entry's value specifies the fd_table entry
+ .byte 0,0,0 ; at start, three first files are stdin/stdout/stderr.
+ .res MAX_FD_INDEX-3,$ff
___fd_table:
-fd_table: ; each entry represents an open iocb
- .byte 3,0,'E',0 ; system console, app starts with opened iocb #0 for E:
- .byte 0,$ff,0,0
- .byte 0,$ff,0,0
- .byte 0,$ff,0,0
- .byte 0,$ff,0,0
- .byte 0,$ff,0,0
- .byte 0,$ff,0,0
- .byte 0,$ff,0,0
+fd_table: ; each entry represents an open iocb
+ .byte 3,0,'E',0 ; system console, app starts with opened iocb #0 for E:
+ .byte 0,$ff,0,0
+ .byte 0,$ff,0,0
+ .byte 0,$ff,0,0
+ .byte 0,$ff,0,0
+ .byte 0,$ff,0,0
+ .byte 0,$ff,0,0
+ .byte 0,$ff,0,0
diff --git a/libsrc/atari/fdtable.s b/libsrc/atari/fdtable.s
index 111f340d0..7e3325055 100644
--- a/libsrc/atari/fdtable.s
+++ b/libsrc/atari/fdtable.s
@@ -4,85 +4,85 @@
; fd indirection table & helper functions
;
- .include "atari.inc"
- .include "fd.inc"
- .importzp tmp1,tmp2,tmp3,ptr4,sp
- .import fd_table,fd_index
- .import fdt_to_fdi
- .export clriocb
- .export fdtoiocb_down
- .export findfreeiocb
- .export fddecusage
- .export newfd
-
- .code
+ .include "atari.inc"
+ .include "fd.inc"
+ .importzp tmp1,tmp2,tmp3,ptr4,sp
+ .import fd_table,fd_index
+ .import fdt_to_fdi
+ .export clriocb
+ .export fdtoiocb_down
+ .export findfreeiocb
+ .export fddecusage
+ .export newfd
+
+ .code
; gets fd in ax, decrements usage counter
; return iocb index in X
; return N bit set for invalid fd
; return Z bit set if last user
; all registers destroyed
-.proc fdtoiocb_down
-
- cpx #0
- bne inval
- cmp #MAX_FD_INDEX
- bcs inval
- tax
- lda fd_index,x ; get index
- tay
- lda #$ff
- sta fd_index,x ; clear entry
- tya
- asl a ; create index into fd table
- asl a
- tax
- lda #$ff
- cmp fd_table+ft_iocb,x ; entry in use?
- beq inval ; no, return error
- lda fd_table+ft_usa,x ; get usage counter
- beq ok_notlast ; 0? (shouldn't happen)
- sec
- sbc #1 ; decr usage counter
- sta fd_table+ft_usa,x
+.proc fdtoiocb_down
+
+ cpx #0
+ bne inval
+ cmp #MAX_FD_INDEX
+ bcs inval
+ tax
+ lda fd_index,x ; get index
+ tay
+ lda #$ff
+ sta fd_index,x ; clear entry
+ tya
+ asl a ; create index into fd table
+ asl a
+ tax
+ lda #$ff
+ cmp fd_table+ft_iocb,x ; entry in use?
+ beq inval ; no, return error
+ lda fd_table+ft_usa,x ; get usage counter
+ beq ok_notlast ; 0? (shouldn't happen)
+ sec
+ sbc #1 ; decr usage counter
+ sta fd_table+ft_usa,x
retiocb:php
- txa
- tay
- lda fd_table+ft_iocb,x ; get iocb
- tax
- plp
- bne cont
- lda #$ff
- sta fd_table+ft_iocb,y ; clear table entry
- lda fd_table+ft_flag,y
- and #16 ; opened by app?
- eor #16 ; return set Z if yes
-cont: rts
+ txa
+ tay
+ lda fd_table+ft_iocb,x ; get iocb
+ tax
+ plp
+ bne cont
+ lda #$ff
+ sta fd_table+ft_iocb,y ; clear table entry
+ lda fd_table+ft_flag,y
+ and #16 ; opened by app?
+ eor #16 ; return set Z if yes
+cont: rts
ok_notlast:
- lda #1 ; clears Z
- jmp retiocb
+ lda #1 ; clears Z
+ jmp retiocb
-.endproc ; fdtoiocb_down
+.endproc ; fdtoiocb_down
-inval: ldx #$ff ; sets N
- rts
+inval: ldx #$ff ; sets N
+ rts
; clear iocb except for ICHID field
; expects X to be index to IOCB (0,$10,$20,etc.)
; all registers destroyed
-.proc clriocb
+.proc clriocb
- inx ; don't clear ICHID
- ldy #15
- lda #0
-loop: sta ICHID,x
- inx
- dey
- bne loop
- rts
+ inx ; don't clear ICHID
+ ldy #15
+ lda #0
+loop: sta ICHID,x
+ inx
+ dey
+ bne loop
+ rts
.endproc
@@ -93,57 +93,57 @@ loop: sta ICHID,x
; index in X if found
; all registers destroyed
-.proc findfreeiocb
+.proc findfreeiocb
- ldx #0
- ldy #$FF
-loop: tya
- cmp ICHID,x
- beq found
- txa
- clc
- adc #$10
- tax
- cmp #$80
- bcc loop
- inx ; return ZF cleared
-found: rts
+ ldx #0
+ ldy #$FF
+loop: tya
+ cmp ICHID,x
+ beq found
+ txa
+ clc
+ adc #$10
+ tax
+ cmp #$80
+ bcc loop
+ inx ; return ZF cleared
+found: rts
-.endproc ; findfreeiocb
+.endproc ; findfreeiocb
; decrements usage counter for fd
; if 0 reached, it's marked as unused
; get fd index in tmp2
; Y register preserved
-.proc fddecusage
-
- lda tmp2 ; get fd
- cmp #MAX_FD_INDEX
- bcs ret ; invalid index, do nothing
- tax
- lda fd_index,x
- pha
- lda #$ff
- sta fd_index,x
- pla
- asl a ; create index into fd table
- asl a
- tax
- lda #$ff
- cmp fd_table+ft_iocb,x ; entry in use?
- beq ret ; no, do nothing
- lda fd_table+ft_usa,x ; get usage counter
- beq ret ; 0? should not happen
- sec
- sbc #1 ; decrement by one
- sta fd_table+ft_usa,x
- bne ret ; not 0
- lda #$ff ; 0, table entry unused now
- sta fd_table+ft_iocb,x ; clear table entry
-ret: rts
-
-.endproc ; fddecusage
+.proc fddecusage
+
+ lda tmp2 ; get fd
+ cmp #MAX_FD_INDEX
+ bcs ret ; invalid index, do nothing
+ tax
+ lda fd_index,x
+ pha
+ lda #$ff
+ sta fd_index,x
+ pla
+ asl a ; create index into fd table
+ asl a
+ tax
+ lda #$ff
+ cmp fd_table+ft_iocb,x ; entry in use?
+ beq ret ; no, do nothing
+ lda fd_table+ft_usa,x ; get usage counter
+ beq ret ; 0? should not happen
+ sec
+ sbc #1 ; decrement by one
+ sta fd_table+ft_usa,x
+ bne ret ; not 0
+ lda #$ff ; 0, table entry unused now
+ sta fd_table+ft_iocb,x ; clear table entry
+ret: rts
+
+.endproc ; fddecusage
; newfd
@@ -156,198 +156,198 @@ ret: rts
; a link to this open device is returned
;
; Calling parameters:
-; tmp3 - length of filename + 1
-; AX - points to filename
-; Y - iocb to use (if we need a new open)
+; tmp3 - length of filename + 1
+; AX - points to filename
+; Y - iocb to use (if we need a new open)
; Return parameters:
-; tmp2 - fd num ($ff and C=0 in case of error - no free slot)
-; C - 0/1 for no open needed/open should be performed
+; tmp2 - fd num ($ff and C=0 in case of error - no free slot)
+; C - 0/1 for no open needed/open should be performed
; all registers preserved!
- .bss
+ .bss
; local variables:
-loc_Y: .res 1
-loc_ptr4_l: .res 1
-loc_ptr4_h: .res 1
-loc_tmp1: .res 1
-loc_devnum: .res 1
-loc_size: .res 1
-
- .code
-
-.proc newfd
-
- pha
- txa
- pha
- tya
- pha
-
- ldx #0
- stx loc_devnum
- lda tmp1
- sta loc_tmp1
- stx tmp1 ; init tmp1
- stx tmp2 ; init tmp2
- lda ptr4+1
- sta loc_ptr4_h
- lda ptr4
- sta loc_ptr4_l
- pla
- sta loc_Y
- pla
- sta ptr4+1
- pla
- sta ptr4
-
- ; ptr4 points to filename
-
- ldy #1
- lda #':'
- cmp (ptr4),y ; "X:"
- beq colon1
- iny
- cmp (ptr4),y ; "Xn:"
- beq colon2
-
- ; no colon there!? OK, then we use a fresh iocb....
- ; return error here? no, the subsequent open call should fail
-
-do_open_nd: ; do open and don't remember device
- lda #2
- sta tmp1
-do_open:lda tmp1
- ora #1
- sta tmp1 ; set flag to return 'open needed' : C = 1
- ldx #ft_iocb
- ldy #$ff
+loc_Y: .res 1
+loc_ptr4_l: .res 1
+loc_ptr4_h: .res 1
+loc_tmp1: .res 1
+loc_devnum: .res 1
+loc_size: .res 1
+
+ .code
+
+.proc newfd
+
+ pha
+ txa
+ pha
+ tya
+ pha
+
+ ldx #0
+ stx loc_devnum
+ lda tmp1
+ sta loc_tmp1
+ stx tmp1 ; init tmp1
+ stx tmp2 ; init tmp2
+ lda ptr4+1
+ sta loc_ptr4_h
+ lda ptr4
+ sta loc_ptr4_l
+ pla
+ sta loc_Y
+ pla
+ sta ptr4+1
+ pla
+ sta ptr4
+
+ ; ptr4 points to filename
+
+ ldy #1
+ lda #':'
+ cmp (ptr4),y ; "X:"
+ beq colon1
+ iny
+ cmp (ptr4),y ; "Xn:"
+ beq colon2
+
+ ; no colon there!? OK, then we use a fresh iocb....
+ ; return error here? no, the subsequent open call should fail
+
+do_open_nd: ; do open and don't remember device
+ lda #2
+ sta tmp1
+do_open:lda tmp1
+ ora #1
+ sta tmp1 ; set flag to return 'open needed' : C = 1
+ ldx #ft_iocb
+ ldy #$ff
srchfree:
- tya
- cmp fd_table,x ; check ft_iocb field for $ff
- beq freefnd ; found a free slot
- txa
- clc
- adc #ft_entrylen
- tax
- cmp #(MAX_FD_VAL*4)+ft_iocb ; end of table reached?
- bcc srchfree
+ tya
+ cmp fd_table,x ; check ft_iocb field for $ff
+ beq freefnd ; found a free slot
+ txa
+ clc
+ adc #ft_entrylen
+ tax
+ cmp #(MAX_FD_VAL*4)+ft_iocb ; end of table reached?
+ bcc srchfree
; error: no free slot found
-noslot: ldx #0
- stx tmp1 ; return with C = 0
- dex
- stx tmp2 ; iocb: $ff marks error
- jmp finish
+noslot: ldx #0
+ stx tmp1 ; return with C = 0
+ dex
+ stx tmp2 ; iocb: $ff marks error
+ jmp finish
; found a free slot
freefnd:txa
- sec
- sbc #ft_iocb ; normalize
- tax
- lsr a
- lsr a
- sta tmp2 ; return fd
- lda #2
- bit tmp1 ; remember device?
- beq l1 ; yes
- lda #0 ; no, put 0 in field
- beq l2
-
-l1: ldy #0
- lda (sp),y ; get device
-l2: sta fd_table+ft_dev,x ; set device
- lda #1
- sta fd_table+ft_usa,x ; set usage counter
- lda loc_Y
- sta fd_table+ft_iocb,x ; set iocb index
- lda loc_devnum
- and #7 ; device number is 3 bits
- ora #16 ; indicated a fd actively opened by the app
- sta fd_table+ft_flag,x
- lda tmp2
- jsr fdt_to_fdi ; get new index
-noslot1:bcs noslot ; no one available (noslot1: helper label for branch out of range)
- ;cmp #$ff ; no one available
- ;beq noslot ;@@@ cleanup needed
- sta tmp2 ; return index
- jmp finish
+ sec
+ sbc #ft_iocb ; normalize
+ tax
+ lsr a
+ lsr a
+ sta tmp2 ; return fd
+ lda #2
+ bit tmp1 ; remember device?
+ beq l1 ; yes
+ lda #0 ; no, put 0 in field
+ beq l2
+
+l1: ldy #0
+ lda (sp),y ; get device
+l2: sta fd_table+ft_dev,x ; set device
+ lda #1
+ sta fd_table+ft_usa,x ; set usage counter
+ lda loc_Y
+ sta fd_table+ft_iocb,x ; set iocb index
+ lda loc_devnum
+ and #7 ; device number is 3 bits
+ ora #16 ; indicated a fd actively opened by the app
+ sta fd_table+ft_flag,x
+ lda tmp2
+ jsr fdt_to_fdi ; get new index
+noslot1:bcs noslot ; no one available (noslot1: helper label for branch out of range)
+ ;cmp #$ff ; no one available
+ ;beq noslot ;@@@ cleanup needed
+ sta tmp2 ; return index
+ jmp finish
; string in "Xn:xxx" format
-colon2: dey
- lda (ptr4),y ; get device number
- sec
- sbc #'0'
- and #7
- sta loc_devnum
- sta tmp2 ; save it for speed later here also
- lda #4 ; max. length if only device + number ("Xn:")
- cmp tmp3
- bcc do_open_nd ; string is longer -> contains filename
- bcs check_dev ; handle device only string
+colon2: dey
+ lda (ptr4),y ; get device number
+ sec
+ sbc #'0'
+ and #7
+ sta loc_devnum
+ sta tmp2 ; save it for speed later here also
+ lda #4 ; max. length if only device + number ("Xn:")
+ cmp tmp3
+ bcc do_open_nd ; string is longer -> contains filename
+ bcs check_dev ; handle device only string
; string in "X:xxx" format
-colon1: lda #3 ; max. length if device only ("X:")
- cmp tmp3
- bcc do_open_nd ; string is longer -> contains filename
+colon1: lda #3 ; max. length if device only ("X:")
+ cmp tmp3
+ bcc do_open_nd ; string is longer -> contains filename
; get device and search it in fd table
check_dev:
- ldy #0
- lda (ptr4),y ; get device id
- tay
- ldx #(MAX_FD_VAL*4) - ft_entrylen
-srchdev:lda #$ff
- cmp fd_table+ft_iocb,x ; is entry valid?
- beq srch2 ; no, skip this entry
- tya
- cmp fd_table+ft_dev,x
- beq fnddev
-srch2: txa
- sec
- sbc #ft_entrylen+1
- tax
- bpl srchdev
+ ldy #0
+ lda (ptr4),y ; get device id
+ tay
+ ldx #(MAX_FD_VAL*4) - ft_entrylen
+srchdev:lda #$ff
+ cmp fd_table+ft_iocb,x ; is entry valid?
+ beq srch2 ; no, skip this entry
+ tya
+ cmp fd_table+ft_dev,x
+ beq fnddev
+srch2: txa
+ sec
+ sbc #ft_entrylen+1
+ tax
+ bpl srchdev
; not found, open new iocb
- jmp do_open
+ jmp do_open
; found device in table, check device number (e.g R0 - R3)
-fnddev: lda fd_table+ft_flag,x
- and #7
- cmp tmp2 ; contains devnum
- bne srch2 ; different device numbers
+fnddev: lda fd_table+ft_flag,x
+ and #7
+ cmp tmp2 ; contains devnum
+ bne srch2 ; different device numbers
; found existing open iocb with same device
- txa
- lsr a
- lsr a
- sta tmp2
- inc fd_table+ft_usa,x ; increment usage counter
- jsr fdt_to_fdi ; get new index
- bcs noslot1 ; no one available
- sta tmp2 ; return index
+ txa
+ lsr a
+ lsr a
+ sta tmp2
+ inc fd_table+ft_usa,x ; increment usage counter
+ jsr fdt_to_fdi ; get new index
+ bcs noslot1 ; no one available
+ sta tmp2 ; return index
; clean up and go home
-finish: lda ptr4
- pha
- lda ptr4+1
- pha
- lda loc_Y
- pha
- lda tmp1
- pha
- lda loc_tmp1
- sta tmp1
- pla
- lsr a ; set C as needed
-
- pla
- tay
- pla
- tax
- pla
- rts
-
-.endproc ; newfd
+finish: lda ptr4
+ pha
+ lda ptr4+1
+ pha
+ lda loc_Y
+ pha
+ lda tmp1
+ pha
+ lda loc_tmp1
+ sta tmp1
+ pla
+ lsr a ; set C as needed
+
+ pla
+ tay
+ pla
+ tax
+ pla
+ rts
+
+.endproc ; newfd
diff --git a/libsrc/atari/fdtoiocb.s b/libsrc/atari/fdtoiocb.s
index 710ef9009..bd8c92dae 100644
--- a/libsrc/atari/fdtoiocb.s
+++ b/libsrc/atari/fdtoiocb.s
@@ -5,37 +5,37 @@
; Convert file descriptor to IOCB number
;
- .include "atari.inc"
- .include "fd.inc"
- .import fd_table,fd_index
- .export fdtoiocb
+ .include "atari.inc"
+ .include "fd.inc"
+ .import fd_table,fd_index
+ .export fdtoiocb
- .code
+ .code
; gets fd in ax
; return iocb index in A, fd_table index in X
; return N bit set for invalid fd
; all registers destroyed
-.proc fdtoiocb
+.proc fdtoiocb
- cpx #0
- bne inval
- cmp #MAX_FD_INDEX
- bcs inval
- tax
- lda fd_index,x
- asl a ; create index into fd table
- asl a
- tax
- lda #$ff
- cmp fd_table+ft_iocb,x ; entry in use?
- beq inval ; no, return error
- lda fd_table+ft_usa,x ; get usage counter
- beq inval ; 0? should not happen
- lda fd_table+ft_iocb,x ; get iocb
- rts
+ cpx #0
+ bne inval
+ cmp #MAX_FD_INDEX
+ bcs inval
+ tax
+ lda fd_index,x
+ asl a ; create index into fd table
+ asl a
+ tax
+ lda #$ff
+ cmp fd_table+ft_iocb,x ; entry in use?
+ beq inval ; no, return error
+ lda fd_table+ft_usa,x ; get usage counter
+ beq inval ; 0? should not happen
+ lda fd_table+ft_iocb,x ; get iocb
+ rts
-inval: ldx #$ff ; sets N
- rts
+inval: ldx #$ff ; sets N
+ rts
-.endproc ; fdtoiocb
+.endproc ; fdtoiocb
diff --git a/libsrc/atari/getargs.s b/libsrc/atari/getargs.s
index da7fd73aa..fdae55364 100644
--- a/libsrc/atari/getargs.s
+++ b/libsrc/atari/getargs.s
@@ -7,15 +7,15 @@
; startup code but is nevertheless included in the compiled program when
; needed.
-MAXARGS = 16 ; max. amount of arguments in arg. table
-CL_SIZE = 64 ; command line buffer size
-SPACE = 32 ; SPACE char.
+MAXARGS = 16 ; max. amount of arguments in arg. table
+CL_SIZE = 64 ; command line buffer size
+SPACE = 32 ; SPACE char.
- .include "atari.inc"
- .import __argc, __argv
- .importzp ptr1
- .import __dos_type
- .constructor initmainargs,25
+ .include "atari.inc"
+ .import __argc, __argv
+ .importzp ptr1
+ .import __dos_type
+ .constructor initmainargs,25
; --------------------------------------------------------------------------
; Get command line
@@ -23,121 +23,121 @@ SPACE = 32 ; SPACE char.
.segment "INIT"
initmainargs:
- lda #0
- sta __argc
- sta __argc+1
- sta __argv
- sta __argv+1
-
- lda __dos_type ; which DOS?
- cmp #ATARIDOS
- beq nargdos ; DOS does not support arguments
- cmp #MYDOS
- bne argdos ; DOS supports arguments
+ lda #0
+ sta __argc
+ sta __argc+1
+ sta __argv
+ sta __argv+1
+
+ lda __dos_type ; which DOS?
+ cmp #ATARIDOS
+ beq nargdos ; DOS does not support arguments
+ cmp #MYDOS
+ bne argdos ; DOS supports arguments
nargdos:rts
; Initialize ourcl buffer
-argdos: lda #ATEOL
- sta ourcl+CL_SIZE
+argdos: lda #ATEOL
+ sta ourcl+CL_SIZE
; Move SpartaDOS command line to our own buffer
- lda DOSVEC
- clc
- adc #LBUF
- sta ptr1+1
-
- ldy #0
-cpcl: lda (ptr1),y
- sta ourcl,y
- iny
- cmp #ATEOL
- beq movdon
- cpy #CL_SIZE
- bne cpcl
-
-movdon: lda #0
- sta ourcl,y ; null terminate behind ATEOL
+ lda DOSVEC
+ clc
+ adc #LBUF
+ sta ptr1+1
+
+ ldy #0
+cpcl: lda (ptr1),y
+ sta ourcl,y
+ iny
+ cmp #ATEOL
+ beq movdon
+ cpy #CL_SIZE
+ bne cpcl
+
+movdon: lda #0
+ sta ourcl,y ; null terminate behind ATEOL
; Turn command line into argv table
- ;ldy #0
- tay
-eatspc: lda ourcl,y ; eat spaces
- cmp #ATEOL
- beq finargs
- cmp #SPACE
- bne rpar ; begin of argument found
- iny
- cpy #CL_SIZE
- bne eatspc
- beq finargs ; only spaces is no argument
+ ;ldy #0
+ tay
+eatspc: lda ourcl,y ; eat spaces
+ cmp #ATEOL
+ beq finargs
+ cmp #SPACE
+ bne rpar ; begin of argument found
+ iny
+ cpy #CL_SIZE
+ bne eatspc
+ beq finargs ; only spaces is no argument
; Store argument vector
-rpar: lda __argc ; low-byte
- asl
- tax ; table index
- tya ; ourcl index
- clc
- adc #ourcl
- adc #0
- sta argv+1,x
- ldx __argc
- inx
- stx __argc
- cpx #MAXARGS
- beq finargs
+rpar: lda __argc ; low-byte
+ asl
+ tax ; table index
+ tya ; ourcl index
+ clc
+ adc #ourcl
+ adc #0
+ sta argv+1,x
+ ldx __argc
+ inx
+ stx __argc
+ cpx #MAXARGS
+ beq finargs
; Skip this arg.
skiparg:
- ldx ourcl,y
- cpx #ATEOL ; end of line?
- beq eopar
- cpx #SPACE
- beq eopar
- iny
- cpy #CL_SIZE
- bne skiparg
+ ldx ourcl,y
+ cpx #ATEOL ; end of line?
+ beq eopar
+ cpx #SPACE
+ beq eopar
+ iny
+ cpy #CL_SIZE
+ bne skiparg
; End of arg. -> place 0
eopar:
- lda #0
- sta ourcl,y
- iny ; y behind arg.
- cpx #ATEOL ; was it the last arg?
- bne eatspc
+ lda #0
+ sta ourcl,y
+ iny ; y behind arg.
+ cpx #ATEOL ; was it the last arg?
+ bne eatspc
; Finish args
finargs:
- lda __argc
- asl
- tax
- lda #0
- sta argv,x
- sta argv+1,x
- lda #argv
- sta __argv
- stx __argv+1
- rts
+ lda __argc
+ asl
+ tax
+ lda #0
+ sta argv,x
+ sta argv+1,x
+ lda #argv
+ sta __argv
+ stx __argv+1
+ rts
; --------------------------------------------------------------------------
; Data
.bss
-argv: .res (1 + MAXARGS) * 2
+argv: .res (1 + MAXARGS) * 2
; Buffer for command line / argv strings
-ourcl: .res CL_SIZE+1
+ourcl: .res CL_SIZE+1
diff --git a/libsrc/atari/getdefdev.s b/libsrc/atari/getdefdev.s
index a6d13e86e..13aa12e04 100644
--- a/libsrc/atari/getdefdev.s
+++ b/libsrc/atari/getdefdev.s
@@ -14,77 +14,77 @@
; ZCRNAME is slightly different from SpartaDOS. It will convert D:
; into Dn: where n is the default drive.
- .include "atari.inc"
- .import __dos_type
- .export __getdefdev ; get default device
- .export __defdev ; this is the default device string (e.g. "D1:")
-.ifdef DYNAMIC_DD
- .constructor __getdefdev,24
+ .include "atari.inc"
+ .import __dos_type
+ .export __getdefdev ; get default device
+ .export __defdev ; this is the default device string (e.g. "D1:")
+.ifdef DYNAMIC_DD
+ .constructor __getdefdev,24
.endif
; Get default device (LBUF will be destroyed!!)
__getdefdev:
- lda __dos_type ; which DOS?
- cmp #ATARIDOS
- beq finish
- cmp #MYDOS
- beq finish
+ lda __dos_type ; which DOS?
+ cmp #ATARIDOS
+ beq finish
+ cmp #MYDOS
+ beq finish
- ldy #BUFOFF
- lda #0
- sta (DOSVEC),y ; reset buffer offset
+ ldy #BUFOFF
+ lda #0
+ sta (DOSVEC),y ; reset buffer offset
; Store dummy argument
- ldy #LBUF
- lda #'X'
- sta (DOSVEC),y
- iny
- lda #ATEOL
- sta (DOSVEC),y
+ ldy #LBUF
+ lda #'X'
+ sta (DOSVEC),y
+ iny
+ lda #ATEOL
+ sta (DOSVEC),y
; One extra store to avoid the buggy sequence from OS/A+ DOS:
; <:> => drive number =
- iny
- sta (DOSVEC),y
+ iny
+ sta (DOSVEC),y
; Create crunch vector
- ldy #ZCRNAME+1
- lda (DOSVEC),y
- sta crvec+1
- iny
- lda (DOSVEC),y
- sta crvec+2
+ ldy #ZCRNAME+1
+ lda (DOSVEC),y
+ sta crvec+1
+ iny
+ lda (DOSVEC),y
+ sta crvec+2
-crvec: jsr $FFFF ; will be set to crunch vector
+crvec: jsr $FFFF ; will be set to crunch vector
; Get default device
- ldy #COMFNAM ; COMFNAM is always "Dn:"
- lda (DOSVEC),y
- sta __defdev
- iny
- lda (DOSVEC),y
- sta __defdev+1
+ ldy #COMFNAM ; COMFNAM is always "Dn:"
+ lda (DOSVEC),y
+ sta __defdev
+ iny
+ lda (DOSVEC),y
+ sta __defdev+1
; Return pointer to default device
-finish: lda #<__defdev
- ldx #>__defdev
- rts
+finish: lda #<__defdev
+ ldx #>__defdev
+ rts
- .data
+ .data
; Default device
__defdev:
-.ifdef DEFAULT_DEVICE
- .byte 'D', '0'+DEFAULT_DEVICE, ':', 0
+.ifdef DEFAULT_DEVICE
+ .byte 'D', '0'+DEFAULT_DEVICE, ':', 0
.else
- .byte "D1:", 0
+ .byte "D1:", 0
.endif
diff --git a/libsrc/atari/getfd.s b/libsrc/atari/getfd.s
index 8327e24ac..a4e34833b 100644
--- a/libsrc/atari/getfd.s
+++ b/libsrc/atari/getfd.s
@@ -4,15 +4,15 @@
; allocates a new fd in the indirection table
;
- .include "atari.inc"
- .include "fd.inc"
- .include "_file.inc"
- .importzp tmp1
- .import fd_table, fd_index
+ .include "atari.inc"
+ .include "fd.inc"
+ .include "_file.inc"
+ .importzp tmp1
+ .import fd_table, fd_index
- .export fdt_to_fdi,getfd
+ .export fdt_to_fdi,getfd
- .code
+ .code
; fdt_to_fdi
; returns a fd_index entry pointing to the given ft_table entry
@@ -20,24 +20,24 @@
; return C = 0/1 for OK/error
; return fd_index entry in A if OK
; registers destroyed
-.proc fdt_to_fdi
+.proc fdt_to_fdi
- tay
- lda #$ff
- tax
- inx
-loop: cmp fd_index,x
- beq found
- inx
- cpx #MAX_FD_INDEX
- bcc loop
- rts
+ tay
+ lda #$ff
+ tax
+ inx
+loop: cmp fd_index,x
+ beq found
+ inx
+ cpx #MAX_FD_INDEX
+ bcc loop
+ rts
-found: tya
- sta fd_index,x
- txa
- clc
- rts
+found: tya
+ sta fd_index,x
+ txa
+ clc
+ rts
.endproc
@@ -48,19 +48,19 @@ found: tya
; return C = 0/1 for OK/error
; returns fd in A if OK
; registers destroyed, tmp1 destroyed
-.proc getfd
+.proc getfd
- sta tmp1 ; save fd_table entry
- jsr fdt_to_fdi
- bcs error
+ sta tmp1 ; save fd_table entry
+ jsr fdt_to_fdi
+ bcs error
- pha
- lda tmp1
- asl a
- asl a ; also clears C
- tax
- inc fd_table+ft_usa,x ; increment usage counter
- pla
-error: rts
+ pha
+ lda tmp1
+ asl a
+ asl a ; also clears C
+ tax
+ inc fd_table+ft_usa,x ; increment usage counter
+ pla
+error: rts
.endproc
diff --git a/libsrc/atari/gotox.s b/libsrc/atari/gotox.s
index 385eead2b..d849bc71a 100644
--- a/libsrc/atari/gotox.s
+++ b/libsrc/atari/gotox.s
@@ -4,12 +4,12 @@
; void gotox (unsigned char x);
;
- .include "atari.inc"
- .export _gotox
- .import setcursor
+ .include "atari.inc"
+ .export _gotox
+ .import setcursor
_gotox:
- sta COLCRS ; Set X
- lda #0
- sta COLCRS+1
- jmp setcursor
+ sta COLCRS ; Set X
+ lda #0
+ sta COLCRS+1
+ jmp setcursor
diff --git a/libsrc/atari/gotoxy.s b/libsrc/atari/gotoxy.s
index 47342d74b..1f00c3b23 100644
--- a/libsrc/atari/gotoxy.s
+++ b/libsrc/atari/gotoxy.s
@@ -4,16 +4,16 @@
; void gotoxy (unsigned char x, unsigned char y);
;
- .include "atari.inc"
+ .include "atari.inc"
- .export _gotoxy
- .import popa
- .import setcursor
+ .export _gotoxy
+ .import popa
+ .import setcursor
-_gotoxy: ; Set the cursor position
- sta ROWCRS ; Set Y
- jsr popa ; Get X
- sta COLCRS ; Set X
- lda #0
- sta COLCRS+1 ;
- jmp setcursor
+_gotoxy: ; Set the cursor position
+ sta ROWCRS ; Set Y
+ jsr popa ; Get X
+ sta COLCRS ; Set X
+ lda #0
+ sta COLCRS+1 ;
+ jmp setcursor
diff --git a/libsrc/atari/gotoy.s b/libsrc/atari/gotoy.s
index 229ba95db..8a17096c6 100644
--- a/libsrc/atari/gotoy.s
+++ b/libsrc/atari/gotoy.s
@@ -4,10 +4,10 @@
; void gotoy (unsigned char y);
;
- .include "atari.inc"
- .export _gotoy
- .import setcursor
+ .include "atari.inc"
+ .export _gotoy
+ .import setcursor
_gotoy:
- sta ROWCRS ; Set Y
- jmp setcursor
+ sta ROWCRS ; Set Y
+ jmp setcursor
diff --git a/libsrc/atari/graphics.s b/libsrc/atari/graphics.s
index 120865f82..60f2ff789 100644
--- a/libsrc/atari/graphics.s
+++ b/libsrc/atari/graphics.s
@@ -7,101 +7,101 @@
;
;
- .export __graphics
+ .export __graphics
- .import findfreeiocb
- .import __do_oserror,__oserror
- .import fddecusage
- .import clriocb
- .import fdtoiocb
- .import newfd
- .importzp tmp1,tmp2,tmp3
+ .import findfreeiocb
+ .import __do_oserror,__oserror
+ .import fddecusage
+ .import clriocb
+ .import fdtoiocb
+ .import newfd
+ .importzp tmp1,tmp2,tmp3
- .include "atari.inc"
- .include "errno.inc"
+ .include "atari.inc"
+ .include "errno.inc"
- .code
+ .code
; set new grapics mode
; gets new mode in A
; returns handle or -1 on error
; uses tmp1, tmp2, tmp3, tmp4 (in subroutines)
-.proc __graphics
-
-; tax
-; and #15 ; get required graphics mode
-; cmp #12
-; bcs invmode ; invalid mode
-; txa
-; and #$c0 ; invalid bits set?
-; bne invmode
-
-; stx tmp1
- sta tmp1 ; remember graphics mode
-
-parmok: jsr findfreeiocb
- beq iocbok ; we found one
-
- lda #EINVAL
-; lda #scrdev
- jsr newfd
- tya
- tax
- bcs doopen ; C set: open needed
-
- ldx #0
- lda tmp2 ; get fd used
- jsr fdtoiocb
- tax
-
-doopen: txa
- ;brk
- pha
- jsr clriocb
- pla
- tax
- lda #scrdev
- sta ICBAH,x
- lda #OPEN
- sta ICCOM,x
- lda tmp1 ; get requested graphics mode
- and #15
- sta ICAX2,x
- lda tmp1
- and #$30
- eor #$10
- ora #12
- sta ICAX1,x
-
- jsr CIOV
- bmi cioerr
-
- lda tmp2 ; get fd
- ldx #0
- stx __oserror
- rts
-
-cioerr: jsr fddecusage ; decrement usage counter of fd as open failed
- jmp __do_oserror
-
-.endproc ; __graphics
-
-
- .rodata
-
-scrdev: .byte "S:", 0
+.proc __graphics
+
+; tax
+; and #15 ; get required graphics mode
+; cmp #12
+; bcs invmode ; invalid mode
+; txa
+; and #$c0 ; invalid bits set?
+; bne invmode
+
+; stx tmp1
+ sta tmp1 ; remember graphics mode
+
+parmok: jsr findfreeiocb
+ beq iocbok ; we found one
+
+ lda #EINVAL
+; lda #scrdev
+ jsr newfd
+ tya
+ tax
+ bcs doopen ; C set: open needed
+
+ ldx #0
+ lda tmp2 ; get fd used
+ jsr fdtoiocb
+ tax
+
+doopen: txa
+ ;brk
+ pha
+ jsr clriocb
+ pla
+ tax
+ lda #scrdev
+ sta ICBAH,x
+ lda #OPEN
+ sta ICCOM,x
+ lda tmp1 ; get requested graphics mode
+ and #15
+ sta ICAX2,x
+ lda tmp1
+ and #$30
+ eor #$10
+ ora #12
+ sta ICAX1,x
+
+ jsr CIOV
+ bmi cioerr
+
+ lda tmp2 ; get fd
+ ldx #0
+ stx __oserror
+ rts
+
+cioerr: jsr fddecusage ; decrement usage counter of fd as open failed
+ jmp __do_oserror
+
+.endproc ; __graphics
+
+
+ .rodata
+
+scrdev: .byte "S:", 0
diff --git a/libsrc/atari/initcwd.s b/libsrc/atari/initcwd.s
index 64009995f..19df6a5a4 100644
--- a/libsrc/atari/initcwd.s
+++ b/libsrc/atari/initcwd.s
@@ -2,30 +2,30 @@
; Stefan Haubenthal, 2008-04-29
;
- .export initcwd
- .import findfreeiocb
- .import __cwd
- .include "atari.inc"
+ .export initcwd
+ .import findfreeiocb
+ .import __cwd
+ .include "atari.inc"
-.proc initcwd
+.proc initcwd
- jsr findfreeiocb
- bne oserr
- lda #48
- sta ICCOM,x
- lda #<__cwd
- sta ICBLL,x
- lda #>__cwd
- sta ICBLH,x
- jsr CIOV
- bmi oserr
- ldx #0 ; ATEOL -> \0
-: lda __cwd,x
- inx
- cmp #ATEOL
- bne :-
- lda #0
- sta __cwd-1,x
-oserr: rts
+ jsr findfreeiocb
+ bne oserr
+ lda #48
+ sta ICCOM,x
+ lda #<__cwd
+ sta ICBLL,x
+ lda #>__cwd
+ sta ICBLH,x
+ jsr CIOV
+ bmi oserr
+ ldx #0 ; ATEOL -> \0
+: lda __cwd,x
+ inx
+ cmp #ATEOL
+ bne :-
+ lda #0
+ sta __cwd-1,x
+oserr: rts
.endproc
diff --git a/libsrc/atari/inviocb.s b/libsrc/atari/inviocb.s
index b7954dd11..c1c27ee03 100644
--- a/libsrc/atari/inviocb.s
+++ b/libsrc/atari/inviocb.s
@@ -1,10 +1,10 @@
;
; set EINVAL error code and returns -1
;
- .include "errno.inc"
+ .include "errno.inc"
- .export __inviocb
+ .export __inviocb
__inviocb:
- lda #IRQStub
- jsr SETVBV
- rts
+ lda VVBLKI
+ ldx VVBLKI+1
+ sta IRQInd+1
+ stx IRQInd+2
+ lda #6
+ ldy #IRQStub
+ jsr SETVBV
+ rts
; ------------------------------------------------------------------------
.code
doneirq:
- lda #6
- ldy IRQInd+1
- ldx IRQInd+2
- jsr SETVBV
- rts
+ lda #6
+ ldy IRQInd+1
+ ldx IRQInd+2
+ jsr SETVBV
+ rts
; ------------------------------------------------------------------------
-.segment "LOWCODE"
+.segment "LOWCODE"
IRQStub:
- cld ; Just to be sure
- jsr callirq ; Call the functions
- jmp IRQInd ; Jump to the saved IRQ vector
+ cld ; Just to be sure
+ jsr callirq ; Call the functions
+ jmp IRQInd ; Jump to the saved IRQ vector
; ------------------------------------------------------------------------
.data
-IRQInd: jmp $0000
+IRQInd: jmp $0000
diff --git a/libsrc/atari/joy/atarimj8.s b/libsrc/atari/joy/atarimj8.s
index 863737beb..777a52615 100644
--- a/libsrc/atari/joy/atarimj8.s
+++ b/libsrc/atari/joy/atarimj8.s
@@ -7,48 +7,48 @@
; Using code from Carsten Strotmann and help from Christian Groessler
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "joy-kernel.inc"
- .include "joy-error.inc"
- .include "atari.inc"
+ .include "joy-kernel.inc"
+ .include "joy-error.inc"
+ .include "atari.inc"
- .macpack generic
+ .macpack generic
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "JUMPTABLE"
; Driver signature
- .byte $6A, $6F, $79 ; "joy"
- .byte JOY_API_VERSION ; Driver API version number
+ .byte $6A, $6F, $79 ; "joy"
+ .byte JOY_API_VERSION ; Driver API version number
; Button state masks (8 values)
- .byte $02 ; JOY_UP
- .byte $04 ; JOY_DOWN
- .byte $08 ; JOY_LEFT
- .byte $10 ; JOY_RIGHT
- .byte $01 ; JOY_FIRE
- .byte $00 ; JOY_FIRE2 not available
- .byte $00 ; Future expansion
- .byte $00 ; Future expansion
+ .byte $02 ; JOY_UP
+ .byte $04 ; JOY_DOWN
+ .byte $08 ; JOY_LEFT
+ .byte $10 ; JOY_RIGHT
+ .byte $01 ; JOY_FIRE
+ .byte $00 ; JOY_FIRE2 not available
+ .byte $00 ; Future expansion
+ .byte $00 ; Future expansion
; Jump table.
- .addr INSTALL
- .addr UNINSTALL
- .addr COUNT
- .addr READJOY
- .addr 0 ; IRQ entry not used
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr COUNT
+ .addr READJOY
+ .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
-JOY_COUNT = 8 ; Number of joysticks we support
+JOY_COUNT = 8 ; Number of joysticks we support
; ------------------------------------------------------------------------
@@ -65,15 +65,15 @@ JOY_COUNT = 8 ; Number of joysticks we support
;
INSTALL:
- lda #$30
- sta PACTL
- lda #$F0
- sta PORTA
- lda #$34
- sta PACTL
- lda #JOY_ERR_OK
- ldx #0
-; rts ; Run into UNINSTALL instead
+ lda #$30
+ sta PACTL
+ lda #$F0
+ sta PORTA
+ lda #$34
+ sta PACTL
+ lda #JOY_ERR_OK
+ ldx #0
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -81,7 +81,7 @@ INSTALL:
;
UNINSTALL:
- rts
+ rts
; ------------------------------------------------------------------------
@@ -89,27 +89,27 @@ UNINSTALL:
;
COUNT:
- lda #JOY_COUNT
- ldx #0
- rts
+ lda #JOY_COUNT
+ ldx #0
+ rts
; ------------------------------------------------------------------------
; READ: Read a particular joystick passed in A.
;
READJOY:
- asl a
- asl a
- asl a
- asl a
- sta PORTA
+ asl a
+ asl a
+ asl a
+ asl a
+ sta PORTA
; Read joystick
- lda PORTA ; get position
- and #%00001111
- asl a
- ora TRIG0 ; add button information
- eor #%00011111
- ldx #0 ; fix X
- rts
+ lda PORTA ; get position
+ and #%00001111
+ asl a
+ ora TRIG0 ; add button information
+ eor #%00011111
+ ldx #0 ; fix X
+ rts
diff --git a/libsrc/atari/joy/ataristd.s b/libsrc/atari/joy/ataristd.s
index 53eff79fe..caca34cc5 100644
--- a/libsrc/atari/joy/ataristd.s
+++ b/libsrc/atari/joy/ataristd.s
@@ -6,48 +6,48 @@
; Using the readjoy code from Christian Groessler
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "joy-kernel.inc"
- .include "joy-error.inc"
- .include "atari.inc"
+ .include "joy-kernel.inc"
+ .include "joy-error.inc"
+ .include "atari.inc"
- .macpack generic
+ .macpack generic
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "JUMPTABLE"
; Driver signature
- .byte $6A, $6F, $79 ; "joy"
- .byte JOY_API_VERSION ; Driver API version number
+ .byte $6A, $6F, $79 ; "joy"
+ .byte JOY_API_VERSION ; Driver API version number
; Button state masks (8 values)
- .byte $01 ; JOY_UP
- .byte $02 ; JOY_DOWN
- .byte $04 ; JOY_LEFT
- .byte $08 ; JOY_RIGHT
- .byte $10 ; JOY_FIRE
- .byte $00 ; JOY_FIRE2 not available
- .byte $00 ; Future expansion
- .byte $00 ; Future expansion
+ .byte $01 ; JOY_UP
+ .byte $02 ; JOY_DOWN
+ .byte $04 ; JOY_LEFT
+ .byte $08 ; JOY_RIGHT
+ .byte $10 ; JOY_FIRE
+ .byte $00 ; JOY_FIRE2 not available
+ .byte $00 ; Future expansion
+ .byte $00 ; Future expansion
; Jump table.
- .addr INSTALL
- .addr UNINSTALL
- .addr COUNT
- .addr READJOY
- .addr 0 ; IRQ entry not used
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr COUNT
+ .addr READJOY
+ .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
-JOY_COUNT = 4 ; Number of joysticks we support
+JOY_COUNT = 4 ; Number of joysticks we support
; ------------------------------------------------------------------------
@@ -64,9 +64,9 @@ JOY_COUNT = 4 ; Number of joysticks we support
;
INSTALL:
- lda #JOY_ERR_OK
- ldx #0
-; rts ; Run into UNINSTALL instead
+ lda #JOY_ERR_OK
+ ldx #0
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -74,7 +74,7 @@ INSTALL:
;
UNINSTALL:
- rts
+ rts
; ------------------------------------------------------------------------
@@ -82,31 +82,31 @@ UNINSTALL:
;
COUNT:
- lda #JOY_COUNT
- ldx $fcd8
- cpx #$a2
- beq _400800
- lsr a ; XL and newer machines only have 2 ports
+ lda #JOY_COUNT
+ ldx $fcd8
+ cpx #$a2
+ beq _400800
+ lsr a ; XL and newer machines only have 2 ports
_400800:
- ldx #0
- rts
+ ldx #0
+ rts
; ------------------------------------------------------------------------
; READ: Read a particular joystick passed in A.
;
READJOY:
- and #3 ; fix joystick number
- tax ; Joystick number (0-3) into X
+ and #3 ; fix joystick number
+ tax ; Joystick number (0-3) into X
; Read joystick
- lda STRIG0,x ; get button
- asl a
- asl a
- asl a
- asl a
- ora STICK0,x ; add position information
- eor #$1F
- ldx #0 ; fix X
- rts
+ lda STRIG0,x ; get button
+ asl a
+ asl a
+ asl a
+ asl a
+ ora STICK0,x ; add position information
+ eor #$1F
+ ldx #0 ; fix X
+ rts
diff --git a/libsrc/atari/joy_stat_stddrv.s b/libsrc/atari/joy_stat_stddrv.s
index 2eca6d6b4..dffe40ebf 100644
--- a/libsrc/atari/joy_stat_stddrv.s
+++ b/libsrc/atari/joy_stat_stddrv.s
@@ -6,8 +6,8 @@
; const void joy_static_stddrv[];
;
- .export _joy_static_stddrv
- .import _ataristd_joy
+ .export _joy_static_stddrv
+ .import _ataristd_joy
.rodata
diff --git a/libsrc/atari/joy_stddrv.s b/libsrc/atari/joy_stddrv.s
index 8be458b85..aec33bf57 100644
--- a/libsrc/atari/joy_stddrv.s
+++ b/libsrc/atari/joy_stddrv.s
@@ -6,8 +6,8 @@
; const char joy_stddrv[];
;
- .export _joy_stddrv
+ .export _joy_stddrv
.rodata
-_joy_stddrv: .asciiz "ataristd.joy"
+_joy_stddrv: .asciiz "ataristd.joy"
diff --git a/libsrc/atari/kbhit.s b/libsrc/atari/kbhit.s
index 2aff6dad3..09ea8a905 100644
--- a/libsrc/atari/kbhit.s
+++ b/libsrc/atari/kbhit.s
@@ -4,19 +4,19 @@
; unsigned char kbhit (void);
;
- .export _kbhit
- .import return1
+ .export _kbhit
+ .import return1
- .include "atari.inc"
+ .include "atari.inc"
.proc _kbhit
- ldx CH ; last pressed key
- inx ; 255 means "no key"
- bne L1
+ ldx CH ; last pressed key
+ inx ; 255 means "no key"
+ bne L1
txa ; X = A = 0
rts
-L1: jmp return1
+L1: jmp return1
.endproc
diff --git a/libsrc/atari/lseek.s b/libsrc/atari/lseek.s
index 244095969..bf934294c 100644
--- a/libsrc/atari/lseek.s
+++ b/libsrc/atari/lseek.s
@@ -7,178 +7,178 @@
;
- .export _lseek
- .import incsp6,__oserror
- .import __inviocb,ldax0sp,ldaxysp,fdtoiocb
- .import __dos_type
- .import fd_table
- .importzp sreg,ptr1,ptr2,ptr3,ptr4
- .importzp tmp1,tmp2,tmp3
- .include "atari.inc"
- .include "errno.inc"
- .include "fd.inc"
+ .export _lseek
+ .import incsp6,__oserror
+ .import __inviocb,ldax0sp,ldaxysp,fdtoiocb
+ .import __dos_type
+ .import fd_table
+ .importzp sreg,ptr1,ptr2,ptr3,ptr4
+ .importzp tmp1,tmp2,tmp3
+ .include "atari.inc"
+ .include "errno.inc"
+ .include "fd.inc"
; seeking not supported, return -1 and ENOSYS errno value
-no_supp:jsr incsp6
- lda #EUNKNOWN
- rts
+inverr: lda #EUNKNOWN
+ rts
.endproc
.rodata
maptable:
- .byte EINTR ;BRKABT = 128 ;($80) BREAK key abort
- .byte EBUSY ;PRVOPN = 129 ;($81) IOCB already open error
- .byte ENODEV ;NONDEV = 130 ;($82) nonexistent device error
- .byte EACCES ;WRONLY = 131 ;($83) IOCB opened for write only error
- .byte ENOSYS ;NVALID = 132 ;($84) invalid command error
- .byte EINVAL ;NOTOPN = 133 ;($85) device/file not open error
- .byte EINVAL ;BADIOC = 134 ;($86) invalid IOCB index error
- .byte EACCES ;RDONLY = 135 ;($87) IOCB opened for read only error
- .byte EINVAL ;EOFERR = 136 ;($88) end of file error (should never come,
- ; specially handled by read.s)
- .byte EIO ;TRNRCD = 137 ;($89) truncated record error
- .byte EIO ;TIMOUT = 138 ;($8A) peripheral device timeout error
- .byte EIO ;DNACK = 139 ;($8B) device does not acknowledge command
- .byte EIO ;FRMERR = 140 ;($8C) serial bus framing error
- .byte EINVAL ;CRSROR = 141 ;($8D) cursor out of range error
- .byte EIO ;OVRRUN = 142 ;($8E) serial bus data overrun error
- .byte EIO ;CHKERR = 143 ;($8F) serial bus checksum error
- .byte EIO ;DERROR = 144 ;($90) general device failure
- .byte EINVAL ;BADMOD = 145 ;($91) bad screen mode number error
- .byte ENOSYS ;FNCNOT = 146 ;($92) function not implemented in handler
- .byte ENOMEM ;SCRMEM = 147 ;($93) insufficient memory for screen mode
+ .byte EINTR ;BRKABT = 128 ;($80) BREAK key abort
+ .byte EBUSY ;PRVOPN = 129 ;($81) IOCB already open error
+ .byte ENODEV ;NONDEV = 130 ;($82) nonexistent device error
+ .byte EACCES ;WRONLY = 131 ;($83) IOCB opened for write only error
+ .byte ENOSYS ;NVALID = 132 ;($84) invalid command error
+ .byte EINVAL ;NOTOPN = 133 ;($85) device/file not open error
+ .byte EINVAL ;BADIOC = 134 ;($86) invalid IOCB index error
+ .byte EACCES ;RDONLY = 135 ;($87) IOCB opened for read only error
+ .byte EINVAL ;EOFERR = 136 ;($88) end of file error (should never come,
+ ; specially handled by read.s)
+ .byte EIO ;TRNRCD = 137 ;($89) truncated record error
+ .byte EIO ;TIMOUT = 138 ;($8A) peripheral device timeout error
+ .byte EIO ;DNACK = 139 ;($8B) device does not acknowledge command
+ .byte EIO ;FRMERR = 140 ;($8C) serial bus framing error
+ .byte EINVAL ;CRSROR = 141 ;($8D) cursor out of range error
+ .byte EIO ;OVRRUN = 142 ;($8E) serial bus data overrun error
+ .byte EIO ;CHKERR = 143 ;($8F) serial bus checksum error
+ .byte EIO ;DERROR = 144 ;($90) general device failure
+ .byte EINVAL ;BADMOD = 145 ;($91) bad screen mode number error
+ .byte ENOSYS ;FNCNOT = 146 ;($92) function not implemented in handler
+ .byte ENOMEM ;SCRMEM = 147 ;($93) insufficient memory for screen mode
; codes below taken from "Mein Atari Computer" (german version of "Your Atari Computer")
; also SpartaDOS codes from http://www.atari-central.com/programming/cio_errors.txt
; MyDOS and XDOS codes from Stefan Haubenthal
- .byte EUNKNOWN ; 148 - [SpartaDOS] unrecognized disk format
- .byte EUNKNOWN ; 149 - [SpartaDOS] disk created by incompatible version of SD
- .byte EBUSY ; 150 - serial port already open
- ; [SpartaDOS] directory not found
- .byte EACCES ; 151 - concurrent mode I/O not enabled (serial)
- ; [SpartaDOS] file exists
- .byte EINVAL ; 152 - invalid buffer address for concurrent mode
- ; [SpartaDOS] not binary format
- .byte EAGAIN ; 153 - concurrent mode enabled (and another access tried)
- .byte EACCES ; 154 - concurrent mode I/O not active (serial)
- ; [SpartaDOS X] loader symbol not defined
- .byte EUNKNOWN ; 155 - haven't found documentation
- .byte EUNKNOWN ; 156 - [SpartaDOS X] bad parameter
- .byte EUNKNOWN ; 157 - haven't found documentation
- .byte EUNKNOWN ; 158 - [SpartaDOS X] out of memory
- .byte EUNKNOWN ; 159 - haven't found documentation
- .byte ENOENT ; 160 - drive number error (DOS)
- .byte EMFILE ; 161 - too many open files
- .byte ENOSPC ; 162 - disk full
- .byte EIO ; 163 - unrecoverable system data I/O error
- .byte ESPIPE ; 164 - file number mismatch (inv. seek or disk data strucs damaged)
- .byte ENOENT ; 165 - invalid file name (e.g. lowercase)
- .byte ESPIPE ; 166 - point data length error
- .byte EACCES ; 167 - file locked (read-only)
- .byte ENOSYS ; 168 - command invalid for disk
- .byte ENOSPC ; 169 - directory full
- .byte ENOENT ; 170 - file not found
- .byte ESPIPE ; 171 - point command invalid
- .byte EEXIST ; 172 - [MYDOS] already exists in parent directory
- .byte EUNKNOWN ; 173 - bad disk - format couldn't complete
- .byte EUNKNOWN ; 174 - [MYDOS] directory not in parent directory
- .byte EUNKNOWN ; 175 - [MYDOS] directory not empty
- .byte EUNKNOWN ; 176 - [DOS 3] incompatible file system
- .byte EUNKNOWN ; 177 - haven't found documentation
- .byte EUNKNOWN ; 178 - haven't found documentation
- .byte EUNKNOWN ; 179 - haven't found documentation
- .byte EUNKNOWN ; 180 - not a binary file
- .byte EUNKNOWN ; 181 - [MYDOS] invalid address range
- .byte EUNKNOWN ; 182 - [XDOS] invalid parameter
+ .byte EUNKNOWN ; 148 - [SpartaDOS] unrecognized disk format
+ .byte EUNKNOWN ; 149 - [SpartaDOS] disk created by incompatible version of SD
+ .byte EBUSY ; 150 - serial port already open
+ ; [SpartaDOS] directory not found
+ .byte EACCES ; 151 - concurrent mode I/O not enabled (serial)
+ ; [SpartaDOS] file exists
+ .byte EINVAL ; 152 - invalid buffer address for concurrent mode
+ ; [SpartaDOS] not binary format
+ .byte EAGAIN ; 153 - concurrent mode enabled (and another access tried)
+ .byte EACCES ; 154 - concurrent mode I/O not active (serial)
+ ; [SpartaDOS X] loader symbol not defined
+ .byte EUNKNOWN ; 155 - haven't found documentation
+ .byte EUNKNOWN ; 156 - [SpartaDOS X] bad parameter
+ .byte EUNKNOWN ; 157 - haven't found documentation
+ .byte EUNKNOWN ; 158 - [SpartaDOS X] out of memory
+ .byte EUNKNOWN ; 159 - haven't found documentation
+ .byte ENOENT ; 160 - drive number error (DOS)
+ .byte EMFILE ; 161 - too many open files
+ .byte ENOSPC ; 162 - disk full
+ .byte EIO ; 163 - unrecoverable system data I/O error
+ .byte ESPIPE ; 164 - file number mismatch (inv. seek or disk data strucs damaged)
+ .byte ENOENT ; 165 - invalid file name (e.g. lowercase)
+ .byte ESPIPE ; 166 - point data length error
+ .byte EACCES ; 167 - file locked (read-only)
+ .byte ENOSYS ; 168 - command invalid for disk
+ .byte ENOSPC ; 169 - directory full
+ .byte ENOENT ; 170 - file not found
+ .byte ESPIPE ; 171 - point command invalid
+ .byte EEXIST ; 172 - [MYDOS] already exists in parent directory
+ .byte EUNKNOWN ; 173 - bad disk - format couldn't complete
+ .byte EUNKNOWN ; 174 - [MYDOS] directory not in parent directory
+ .byte EUNKNOWN ; 175 - [MYDOS] directory not empty
+ .byte EUNKNOWN ; 176 - [DOS 3] incompatible file system
+ .byte EUNKNOWN ; 177 - haven't found documentation
+ .byte EUNKNOWN ; 178 - haven't found documentation
+ .byte EUNKNOWN ; 179 - haven't found documentation
+ .byte EUNKNOWN ; 180 - not a binary file
+ .byte EUNKNOWN ; 181 - [MYDOS] invalid address range
+ .byte EUNKNOWN ; 182 - [XDOS] invalid parameter
- .byte EINVAL ; 183 - dummy (used by cc65 rtl, see sysremove.s)
+ .byte EINVAL ; 183 - dummy (used by cc65 rtl, see sysremove.s)
MAX_OSERR_VAL = (* - maptable)
diff --git a/libsrc/atari/ostype.s b/libsrc/atari/ostype.s
index 86e88811d..d93b3ab88 100644
--- a/libsrc/atari/ostype.s
+++ b/libsrc/atari/ostype.s
@@ -4,149 +4,149 @@
;
; unsigned char get_ostype(void)
;
-; x x x x x x x x - 8 bit flag
+; x x x x x x x x - 8 bit flag
; | | | | | | | |
; | | | | | +-+-+-- main OS rev.
; | | +-+-+-------- minor OS rev.
; +-+-------------- unused
;
; main OS rev.:
-; 000 - unknown
-; 001 - 400/800 ROM
-; 010 - 1200XL ROM
-; 011 - XL/XE ROM
-; 1xx - unassigned
+; 000 - unknown
+; 001 - 400/800 ROM
+; 010 - 1200XL ROM
+; 011 - XL/XE ROM
+; 1xx - unassigned
; minor OS rev.: (depending on main OS rev.);
-; 400/800:
-; 000 - unknown
-; 001 - Rev. A PAL
-; 010 - Rev. B PAL
-; 011 - Rev. A NTSC
-; 100 - Rev. B NTSC
-; 101 - unassigned (up to 111)
-; 1200XL:
-; 000 - unknown
-; 001 - Rev. 10
-; 010 - Rev. 11
-; 011 - unassigned (up to 111)
-; XL/XE:
-; 000 - unknown
-; 001 - Rev. 1
-; 010 - Rev. 2
-; 011 - Rev. 3
-; 100 - Rev. 4
-; 101 - unassigned (up to 111)
+; 400/800:
+; 000 - unknown
+; 001 - Rev. A PAL
+; 010 - Rev. B PAL
+; 011 - Rev. A NTSC
+; 100 - Rev. B NTSC
+; 101 - unassigned (up to 111)
+; 1200XL:
+; 000 - unknown
+; 001 - Rev. 10
+; 010 - Rev. 11
+; 011 - unassigned (up to 111)
+; XL/XE:
+; 000 - unknown
+; 001 - Rev. 1
+; 010 - Rev. 2
+; 011 - Rev. 3
+; 100 - Rev. 4
+; 101 - unassigned (up to 111)
;
- .export _get_ostype
+ .export _get_ostype
-.proc _get_ostype
+.proc _get_ostype
- lda $fcd8
- cmp #$a2
- beq _400800
- lda $fff1
- cmp #1
- beq _1200xl
- lda $fff7
- cmp #1
- bcc _unknown
- cmp #5
- bcs _unknown
+ lda $fcd8
+ cmp #$a2
+ beq _400800
+ lda $fff1
+ cmp #1
+ beq _1200xl
+ lda $fff7
+ cmp #1
+ bcc _unknown
+ cmp #5
+ bcs _unknown
;XL/XE ROM
- sec
- asl a
- asl a
- asl a
- and #%00111000
- ora #%11
-_fin: ldx #0
- rts
+ sec
+ asl a
+ asl a
+ asl a
+ and #%00111000
+ ora #%11
+_fin: ldx #0
+ rts
; unknown ROM
_unknown:
- lda #0
- tax
- rts
+ lda #0
+ tax
+ rts
; 1200XL ROM
_1200xl:
- lda $fff7 ; revision #
- cmp #10
- beq _1200_10
- cmp #11
- beq _1200_11
- lda #0 ; for unknown
- beq _1200_fin
+ lda $fff7 ; revision #
+ cmp #10
+ beq _1200_10
+ cmp #11
+ beq _1200_11
+ lda #0 ; for unknown
+ beq _1200_fin
_1200_10:
- lda #%00001000
- bne _1200_fin
+ lda #%00001000
+ bne _1200_fin
_1200_11:
- lda #%00010000
+ lda #%00010000
_1200_fin:
- ora #%010
- bne _fin
+ ora #%010
+ bne _fin
; 400/800 ROM
_400800:
- lda $fff8
- ldx $fff9
- cmp #$dd
- bne _400800_1
- cpx #$57
- bne _400800_unknown
+ lda $fff8
+ ldx $fff9
+ cmp #$dd
+ bne _400800_1
+ cpx #$57
+ bne _400800_unknown
; 400/800 NTSC Rev. A
- lda #%00011001
- bne _fin
+ lda #%00011001
+ bne _fin
; 400/800 unknown
_400800_unknown:
- lda #%00000001
- bne _fin
+ lda #%00000001
+ bne _fin
_400800_1:
- cmp #$d6
- bne _400800_2
- cpx #$57
- bne _400800_unknown
+ cmp #$d6
+ bne _400800_2
+ cpx #$57
+ bne _400800_unknown
; 400/800 PAL Rev. A
- lda #%00001001
- bne _fin
+ lda #%00001001
+ bne _fin
_400800_2:
- cmp #$f3
- bne _400800_3
- cpx #$e6
- bne _400800_unknown
+ cmp #$f3
+ bne _400800_3
+ cpx #$e6
+ bne _400800_unknown
; 400/800 NTSC Rev. B
- lda #%00100001
- bne _fin
+ lda #%00100001
+ bne _fin
_400800_3:
- cmp #$22
- bne _400800_unknown
- cpx #$58
- bne _400800_unknown
+ cmp #$22
+ bne _400800_unknown
+ cpx #$58
+ bne _400800_unknown
; 400/800 PAL Rev. B
- lda #%00010001
- bne _fin
+ lda #%00010001
+ bne _fin
.endproc
diff --git a/libsrc/atari/posixdirent.s b/libsrc/atari/posixdirent.s
index cb84fca71..3417e4bfc 100644
--- a/libsrc/atari/posixdirent.s
+++ b/libsrc/atari/posixdirent.s
@@ -1,161 +1,161 @@
; Native: Shawn Jefferson, December 2005
; POSIX: Stefan Haubenthal, April 2008
- .include "atari.inc"
- .export _opendir, _readdir, _closedir
- .import findfreeiocb, clriocb
- .import __oserror, return0, __do_oserror
- .importzp ptr1, tmp1
+ .include "atari.inc"
+ .export _opendir, _readdir, _closedir
+ .import findfreeiocb, clriocb
+ .import __oserror, return0, __do_oserror
+ .importzp ptr1, tmp1
.ifdef DEFAULT_DEVICE
- .import __defdev
+ .import __defdev
.endif
-.proc _opendir
- sta ptr1
- stx ptr1+1
- jsr findfreeiocb
- beq @iocbok
- bne cioerr
-@iocbok: stx diriocb
- jsr clriocb
- ldx diriocb
- ldy #0 ; '.' -> "D:*.*"
- lda (ptr1),y
- cmp #'.'
- bne @use_parm
+.proc _opendir
+ sta ptr1
+ stx ptr1+1
+ jsr findfreeiocb
+ beq @iocbok
+ bne cioerr
+@iocbok: stx diriocb
+ jsr clriocb
+ ldx diriocb
+ ldy #0 ; '.' -> "D:*.*"
+ lda (ptr1),y
+ cmp #'.'
+ bne @use_parm
; "." was given as parameter, use default device/dir
.ifdef DEFAULT_DEVICE
- ; construct a "Dn:*.*" like string from the default drive
- lda __defdev+1
- sta dddefdev+1 ; copy drive number (overwrite 2nd 'D')
- lda #dddefdev
- sta ICBAH,x
- bne @cont
+ ; construct a "Dn:*.*" like string from the default drive
+ lda __defdev+1
+ sta dddefdev+1 ; copy drive number (overwrite 2nd 'D')
+ lda #dddefdev
+ sta ICBAH,x
+ bne @cont
.else
- lda #defdev
- sta ICBAH,x
- bne @cont
+ lda #defdev
+ sta ICBAH,x
+ bne @cont
.endif
-@use_parm: lda ptr1
- sta ICBAL,x
- lda ptr1+1
- sta ICBAH,x
-
-@cont: lda #OPEN
- sta ICCOM,x
- lda #OPNIN|DIRECT
- sta ICAX1,x
- jsr CIOV
- bmi cioerr
- lda #0
- sta __oserror
- tax
- lda diriocb
- rts
+@use_parm: lda ptr1
+ sta ICBAL,x
+ lda ptr1+1
+ sta ICBAH,x
+
+@cont: lda #OPEN
+ sta ICCOM,x
+ lda #OPNIN|DIRECT
+ sta ICAX1,x
+ jsr CIOV
+ bmi cioerr
+ lda #0
+ sta __oserror
+ tax
+ lda diriocb
+ rts
.endproc
-cioerr: sty __oserror
- jmp return0
-
-.proc _readdir
- tax
- lda #GETREC
- sta ICCOM,x
- lda #entry
- sta ICBAH,x
- sta ptr1+1
- lda #DSCTSZ
- sta ICBLL,x
- lda #0
- sta ICBLH,x
- jsr CIOV
- bmi cioerr
- ldy #0 ; FREE SECTORS
- lda (ptr1),y
- cmp #'0'
- bcs cioerr
- dey
-@next: iny ; remove trailing spaces
- iny
- iny
- lda (ptr1),y
- dey
- dey
- sta (ptr1),y
- cpy #8
- bcs @break
- cmp #' '
- bne @next
-
-@break: lda #'.' ; extension dot
- sta (ptr1),y
- iny ; copy extension
- sty tmp1
- ldy #10
- lda (ptr1),y
- cmp #' '
- bne @hasext
+cioerr: sty __oserror
+ jmp return0
+
+.proc _readdir
+ tax
+ lda #GETREC
+ sta ICCOM,x
+ lda #entry
+ sta ICBAH,x
+ sta ptr1+1
+ lda #DSCTSZ
+ sta ICBLL,x
+ lda #0
+ sta ICBLH,x
+ jsr CIOV
+ bmi cioerr
+ ldy #0 ; FREE SECTORS
+ lda (ptr1),y
+ cmp #'0'
+ bcs cioerr
+ dey
+@next: iny ; remove trailing spaces
+ iny
+ iny
+ lda (ptr1),y
+ dey
+ dey
+ sta (ptr1),y
+ cpy #8
+ bcs @break
+ cmp #' '
+ bne @next
+
+@break: lda #'.' ; extension dot
+ sta (ptr1),y
+ iny ; copy extension
+ sty tmp1
+ ldy #10
+ lda (ptr1),y
+ cmp #' '
+ bne @hasext
; no extension present: remove the trailing dot and be done
- ldy tmp1
- dey
- bne @done
-
-@hasext: jsr copychar
- ldy #13 ; d_type
- sta (ptr1),y
- ldy #11
- jsr copychar
- ldy #12
- jsr copychar
-
-@done: lda #0 ; end of string
- sta (ptr1),y
- lda ptr1
- ldx ptr1+1
- rts
-
-
-copychar: lda (ptr1),y ; src=y dest=tmp1
- ldy tmp1
- cmp #' '
- beq @break
- sta (ptr1),y
- iny
- sty tmp1
-@break: rts
+ ldy tmp1
+ dey
+ bne @done
+
+@hasext: jsr copychar
+ ldy #13 ; d_type
+ sta (ptr1),y
+ ldy #11
+ jsr copychar
+ ldy #12
+ jsr copychar
+
+@done: lda #0 ; end of string
+ sta (ptr1),y
+ lda ptr1
+ ldx ptr1+1
+ rts
+
+
+copychar: lda (ptr1),y ; src=y dest=tmp1
+ ldy tmp1
+ cmp #' '
+ beq @break
+ sta (ptr1),y
+ iny
+ sty tmp1
+@break: rts
.endproc
-.proc _closedir
- tax
- lda #CLOSE
- sta ICCOM,x
- jsr CIOV
- bmi @cioerr
- ldx #0
- stx __oserror ; clear system specific error code
- txa
- rts
-@cioerr: jmp __do_oserror
+.proc _closedir
+ tax
+ lda #CLOSE
+ sta ICCOM,x
+ jsr CIOV
+ bmi @cioerr
+ ldx #0
+ stx __oserror ; clear system specific error code
+ txa
+ rts
+@cioerr: jmp __do_oserror
.endproc
- .data
+ .data
.ifdef DEFAULT_DEVICE
-dddefdev: .byte "D"
+dddefdev: .byte "D"
.endif
-defdev: .asciiz "D:*.*"
+defdev: .asciiz "D:*.*"
- .bss
-diriocb: .res 1
-entry: .res DSCTSZ
+ .bss
+diriocb: .res 1
+entry: .res DSCTSZ
diff --git a/libsrc/atari/randomize.s b/libsrc/atari/randomize.s
index 067bcc151..ed4400b55 100644
--- a/libsrc/atari/randomize.s
+++ b/libsrc/atari/randomize.s
@@ -5,13 +5,13 @@
; /* Initialize the random number generator */
;
- .export __randomize
- .import _srand
+ .export __randomize
+ .import _srand
- .include "atari.inc"
+ .include "atari.inc"
-__randomize:
- ldx VCOUNT ; Use vertical line counter as high byte
- lda RTCLOK+2 ; Use clock as low byte
- jmp _srand ; Initialize generator
+__randomize:
+ ldx VCOUNT ; Use vertical line counter as high byte
+ lda RTCLOK+2 ; Use clock as low byte
+ jmp _srand ; Initialize generator
diff --git a/libsrc/atari/read.s b/libsrc/atari/read.s
index 19d33cb66..acb415efd 100644
--- a/libsrc/atari/read.s
+++ b/libsrc/atari/read.s
@@ -4,120 +4,120 @@
; int __fastcall__ read(int fd,void *buf,int count)
;
- .include "atari.inc"
- .import __rwsetup,__do_oserror,__inviocb,__oserror
- .export _read
-
-_read: jsr __rwsetup ; do common setup for read and write
- beq done ; if size 0, it's a no-op
- cpx #$FF ; invalid iocb?
- beq _inviocb
-
-.ifdef LINEBUF
- ; E: should be always at IOCB #0
- ; fixme: what happens when user closes and reopens stdin?
- cpx #0 ; E: handler (line oriented keyboard input)?
- beq do_line
+ .include "atari.inc"
+ .import __rwsetup,__do_oserror,__inviocb,__oserror
+ .export _read
+
+_read: jsr __rwsetup ; do common setup for read and write
+ beq done ; if size 0, it's a no-op
+ cpx #$FF ; invalid iocb?
+ beq _inviocb
+
+.ifdef LINEBUF
+ ; E: should be always at IOCB #0
+ ; fixme: what happens when user closes and reopens stdin?
+ cpx #0 ; E: handler (line oriented keyboard input)?
+ beq do_line
.endif
- lda #GETCHR ; iocb command code
- sta ICCOM,x
- jsr CIOV ; read it
- bpl done
- cpy #EOFERR ; eof is treated specially
- beq done
- jmp __do_oserror ; update errno
-
-done: lda ICBLL,x ; buf len lo
- pha ; save
- lda ICBLH,x ; get buf len hi
- tax ; to X
-okdone: lda #0
- sta __oserror ; clear system dependend error code
- pla ; get buf len lo
- rts
+ lda #GETCHR ; iocb command code
+ sta ICCOM,x
+ jsr CIOV ; read it
+ bpl done
+ cpy #EOFERR ; eof is treated specially
+ beq done
+ jmp __do_oserror ; update errno
+
+done: lda ICBLL,x ; buf len lo
+ pha ; save
+ lda ICBLH,x ; get buf len hi
+ tax ; to X
+okdone: lda #0
+ sta __oserror ; clear system dependend error code
+ pla ; get buf len lo
+ rts
_inviocb:
- jmp __inviocb
+ jmp __inviocb
-.ifdef LINEBUF
+.ifdef LINEBUF
; line oriented input
- .segment "EXTZP" : zeropage
+ .segment "EXTZP" : zeropage
-index: .res 1 ; index into line buffer
-buflen: .res 1 ; length of used part of buffer
-cbs: .res 1 ; current buffer size: buflen - index
-dataptr:.res 2 ; temp pointer to user buffer
-copylen:.res 1 ; temp counter
+index: .res 1 ; index into line buffer
+buflen: .res 1 ; length of used part of buffer
+cbs: .res 1 ; current buffer size: buflen - index
+dataptr:.res 2 ; temp pointer to user buffer
+copylen:.res 1 ; temp counter
- .bss
+ .bss
-linebuf:.res LINEBUF ; the line buffer
+linebuf:.res LINEBUF ; the line buffer
.code
do_line:
- lda buflen ; line buffer active?
- bne use_buf ; yes, get data from there
-
- ; save user buffer address & length
- ; update IOCB to point to line buffer
- lda ICBLL,x
- pha
- lda #LINEBUF
- sta ICBLL,x
- ;--------
- lda ICBLH,x
- pha
- lda #0
- sta ICBLH,x
- ;--------
- lda ICBAL,x
- pha
- lda #linebuf
- sta ICBAH,x
-
- lda #GETREC
- sta ICCOM,x
- jsr CIOV ; read input data
- bpl newbuf
- cpy #EOFERR ; eof is treated specially
- beq newbuf
- pla ; fix stack
- pla
- pla
- pla
- jmp __do_oserror ; update errno
+ lda buflen ; line buffer active?
+ bne use_buf ; yes, get data from there
+
+ ; save user buffer address & length
+ ; update IOCB to point to line buffer
+ lda ICBLL,x
+ pha
+ lda #LINEBUF
+ sta ICBLL,x
+ ;--------
+ lda ICBLH,x
+ pha
+ lda #0
+ sta ICBLH,x
+ ;--------
+ lda ICBAL,x
+ pha
+ lda #linebuf
+ sta ICBAH,x
+
+ lda #GETREC
+ sta ICCOM,x
+ jsr CIOV ; read input data
+ bpl newbuf
+ cpy #EOFERR ; eof is treated specially
+ beq newbuf
+ pla ; fix stack
+ pla
+ pla
+ pla
+ jmp __do_oserror ; update errno
newbuf:
- lda ICBLL,x ; get # of bytes read
- sta buflen
- lda #0
- sta index ; fresh buffer
-
- ; restore user buffer address & length
- pla
- sta ICBAH,x
- ;--------
- pla
- sta ICBAL,x
- ;--------
- pla
- sta ICBLH,x
- ;--------
- pla
- sta ICBLL,x
-
- ; fall into use_buf
- lda buflen
+ lda ICBLL,x ; get # of bytes read
+ sta buflen
+ lda #0
+ sta index ; fresh buffer
+
+ ; restore user buffer address & length
+ pla
+ sta ICBAH,x
+ ;--------
+ pla
+ sta ICBAL,x
+ ;--------
+ pla
+ sta ICBLH,x
+ ;--------
+ pla
+ sta ICBLL,x
+
+ ; fall into use_buf
+ lda buflen
; return bytes from line buffer
; use buflen and index to access buffer
@@ -125,58 +125,58 @@ newbuf:
; use dataptr as a temporary pointer
use_buf:
- sec
- sbc index ; size of unread data in the buffer
- sta cbs
+ sec
+ sbc index ; size of unread data in the buffer
+ sta cbs
- lda ICBLL,x ; buf len lo
- cmp cbs ; larger than buffer size?
- beq bl1
- bcs btsmall ; yes, adjust length
+ lda ICBLL,x ; buf len lo
+ cmp cbs ; larger than buffer size?
+ beq bl1
+ bcs btsmall ; yes, adjust length
-bl1: lda ICBLH,x ; get buf len hi
- bne btsmall ; buffer too small: buffer contents < read size
+bl1: lda ICBLH,x ; get buf len hi
+ bne btsmall ; buffer too small: buffer contents < read size
; copy ICBLL,x bytes
icbll_copy:
- lda ICBAL,x ; buffer address
- sta dataptr
- lda ICBAH,x ; buffer address
- sta dataptr+1
- lda ICBLL,x
- sta copylen
- pha ; remember for return value
- ldy #0
- ldx index
-
-copy: lda linebuf,x
- sta (dataptr),y
- iny
- inx
- dec copylen
- bne copy
-
- pla ; length
- pha ; save length to return at okdone
-
- clc
- adc index
- sta index
- cmp buflen ; buffer used up?
- bcc c1 ; not yet
-
- lda #0
- sta buflen ; indicate empty line buffer
-
-c1: ldx #0
- jmp okdone ; return to caller
+ lda ICBAL,x ; buffer address
+ sta dataptr
+ lda ICBAH,x ; buffer address
+ sta dataptr+1
+ lda ICBLL,x
+ sta copylen
+ pha ; remember for return value
+ ldy #0
+ ldx index
+
+copy: lda linebuf,x
+ sta (dataptr),y
+ iny
+ inx
+ dec copylen
+ bne copy
+
+ pla ; length
+ pha ; save length to return at okdone
+
+ clc
+ adc index
+ sta index
+ cmp buflen ; buffer used up?
+ bcc c1 ; not yet
+
+ lda #0
+ sta buflen ; indicate empty line buffer
+
+c1: ldx #0
+ jmp okdone ; return to caller
btsmall:
- lda cbs
- sta ICBLL,x
- bpl icbll_copy
+ lda cbs
+ sta ICBLL,x
+ bpl icbll_copy
-.endif ; .ifdef LINEBUF
+.endif ; .ifdef LINEBUF
diff --git a/libsrc/atari/revers.s b/libsrc/atari/revers.s
index ff22dbf28..719503940 100644
--- a/libsrc/atari/revers.s
+++ b/libsrc/atari/revers.s
@@ -3,26 +3,26 @@
;
; unsigned char revers (unsigned char onoff);
;
- .include "atari.inc"
-
- .export _revers
- .export _revflag
+ .include "atari.inc"
+
+ .export _revers
+ .export _revflag
_revers:
- ldx #$00 ; Assume revers off
- tay ; Test onoff
- beq L1 ; Jump if off
- ldx #$80 ; Load on value
-L1: ldy #$00 ; Assume old value is zero
- lda _revflag ; Load old value
- stx _revflag ; Set new value
- beq L2 ; Jump if old value zero
- iny ; Make old value = 1
-L2: ldx #$00 ; Load high byte of result
- tya ; Load low byte, set CC
- rts
+ ldx #$00 ; Assume revers off
+ tay ; Test onoff
+ beq L1 ; Jump if off
+ ldx #$80 ; Load on value
+L1: ldy #$00 ; Assume old value is zero
+ lda _revflag ; Load old value
+ stx _revflag ; Set new value
+ beq L2 ; Jump if old value zero
+ iny ; Make old value = 1
+L2: ldx #$00 ; Load high byte of result
+ tya ; Load low byte, set CC
+ rts
- .bss
+ .bss
_revflag:
- .res 1
+ .res 1
diff --git a/libsrc/atari/rs232.s_ b/libsrc/atari/rs232.s_
index 843827fb6..35f20ca4f 100644
--- a/libsrc/atari/rs232.s_
+++ b/libsrc/atari/rs232.s_
@@ -11,43 +11,43 @@
; unsigned char __fastcall__ rs232_pause (void); [TODO]
; unsigned char __fastcall__ rs232_unpause (void); [TODO]
; unsigned char __fastcall__ rs232_status (unsigned char* status,
-; unsigned char* errors); [TODO]
+; unsigned char* errors); [TODO]
;
- .import findfreeiocb
- .import __do_oserror
- .import fddecusage
- .import fdtoiocb
- .import __inviocb
- .import clriocb
- .import newfd
- .import _close, pushax, popax, popa
- .importzp ptr1, tmp2, tmp3
-
- .export _rs232_init, _rs232_params, _rs232_done, _rs232_get
- .export _rs232_put, _rs232_pause, _rs232_unpause, _rs232_status
-
- .include "atari.inc"
- .include "errno.inc"
+ .import findfreeiocb
+ .import __do_oserror
+ .import fddecusage
+ .import fdtoiocb
+ .import __inviocb
+ .import clriocb
+ .import newfd
+ .import _close, pushax, popax, popa
+ .importzp ptr1, tmp2, tmp3
+
+ .export _rs232_init, _rs232_params, _rs232_done, _rs232_get
+ .export _rs232_put, _rs232_pause, _rs232_unpause, _rs232_status
+
+ .include "atari.inc"
+ .include "errno.inc"
.include "rs232.inc"
- .rodata
+ .rodata
-rdev: .byte "R:", ATEOL, 0
+rdev: .byte "R:", ATEOL, 0
- .bss
+ .bss
; receive buffer
RECVBUF_SZ = 256
-recv_buf: .res RECVBUF_SZ
+recv_buf: .res RECVBUF_SZ
-cm_run: .res 1 ; concurrent mode running?
+cm_run: .res 1 ; concurrent mode running?
- .data
+ .data
-rshand: .word $ffff
+rshand: .word $ffff
- .code
+ .code
;----------------------------------------------------------------------------
;
@@ -57,60 +57,60 @@ rshand: .word $ffff
; */
;
-.proc _rs232_init
-
- jsr findfreeiocb
- bne init_err
- txa
- tay ; move iocb # into Y
- lda #3
- sta tmp3 ; name length + 1
- lda #rdev
- jsr newfd
- tya
- bcs doopen ; C set: open needed / device not already open
-
- pha
- jsr _rs232_done ;** shut down if started @@@TODO check this out!!
- pla
-
-doopen: tax
- pha
- jsr clriocb
- pla
- tax
- lda #rdev
- sta ICBAH,x
- lda #OPEN
- sta ICCOM,x
-
- lda #$0D ; mode in+out+concurrent
- sta ICAX1,x
- lda #0
- sta ICAX2,x
- sta ICBLL,x ; zap buf len
- sta ICBLH,x
- jsr CIOV
- bmi cioerr1
-
- lda tmp2 ; get fd
- sta rshand
- ldx #0
- stx rshand+1
- txa
- rts
-
-cioerr1:jsr fddecusage ; decrement usage counter of fd as open failed
+.proc _rs232_init
+
+ jsr findfreeiocb
+ bne init_err
+ txa
+ tay ; move iocb # into Y
+ lda #3
+ sta tmp3 ; name length + 1
+ lda #rdev
+ jsr newfd
+ tya
+ bcs doopen ; C set: open needed / device not already open
+
+ pha
+ jsr _rs232_done ;** shut down if started @@@TODO check this out!!
+ pla
+
+doopen: tax
+ pha
+ jsr clriocb
+ pla
+ tax
+ lda #rdev
+ sta ICBAH,x
+ lda #OPEN
+ sta ICCOM,x
+
+ lda #$0D ; mode in+out+concurrent
+ sta ICAX1,x
+ lda #0
+ sta ICAX2,x
+ sta ICBLL,x ; zap buf len
+ sta ICBLH,x
+ jsr CIOV
+ bmi cioerr1
+
+ lda tmp2 ; get fd
+ sta rshand
+ ldx #0
+ stx rshand+1
+ txa
+ rts
+
+cioerr1:jsr fddecusage ; decrement usage counter of fd as open failed
init_err:
- ldx #0
- lda #RS_ERR_INIT_FAILED
- rts
+ ldx #0
+ lda #RS_ERR_INIT_FAILED
+ rts
-.endproc ; _rs232_init
+.endproc ; _rs232_init
;----------------------------------------------------------------------------
@@ -126,64 +126,64 @@ init_err:
; using 8 bit word size. So only 8 bit is currently tested.
;
-.proc _rs232_params
-
- sta tmp2
- lda rshand
- cmp #$ff
- bne work ; work only if initialized
- lda #RS_ERR_NOT_INITIALIZED
- bne done
-work: lda rshand
- ldx #0
- jsr fdtoiocb ; get iocb index into X
- bmi inverr ; shouldn't happen
- tax
-
- ; set handshake lines
-
- lda #34 ; xio 34, set cts, dtr etc
- sta ICCOM,x
- lda #192+48+3 ; DTR on, RTS on, XMT on
- sta ICAX1,x
- lda #0
- sta ICBLL,x
- sta ICBLH,x
- sta ICBAL,x
- sta ICBAH,x
- sta ICAX2,x
- jsr CIOV
- bmi cioerr
-
- ; set baud rate, word size, stop bits and ready monitoring
-
- lda #36 ; xio 36, baud rate
- sta ICCOM,x
- jsr popa ; get parameter
- sta ICAX1,x
- ;ICAX2 = 0, monitor nothing
- jsr CIOV
- bmi cioerr
-
- ; set translation and parity
-
- lda #38 ; xio 38, translation and parity
- sta ICCOM,x
- lda tmp2
- ora #32 ; no translation
- sta ICAX1,x
- jsr CIOV
- bmi cioerr
-
- lda #0
-done: ldx #0
- rts
-
-inverr: jmp __inviocb
-
-.endproc ;_rs232_params
-
-cioerr: jmp __do_oserror
+.proc _rs232_params
+
+ sta tmp2
+ lda rshand
+ cmp #$ff
+ bne work ; work only if initialized
+ lda #RS_ERR_NOT_INITIALIZED
+ bne done
+work: lda rshand
+ ldx #0
+ jsr fdtoiocb ; get iocb index into X
+ bmi inverr ; shouldn't happen
+ tax
+
+ ; set handshake lines
+
+ lda #34 ; xio 34, set cts, dtr etc
+ sta ICCOM,x
+ lda #192+48+3 ; DTR on, RTS on, XMT on
+ sta ICAX1,x
+ lda #0
+ sta ICBLL,x
+ sta ICBLH,x
+ sta ICBAL,x
+ sta ICBAH,x
+ sta ICAX2,x
+ jsr CIOV
+ bmi cioerr
+
+ ; set baud rate, word size, stop bits and ready monitoring
+
+ lda #36 ; xio 36, baud rate
+ sta ICCOM,x
+ jsr popa ; get parameter
+ sta ICAX1,x
+ ;ICAX2 = 0, monitor nothing
+ jsr CIOV
+ bmi cioerr
+
+ ; set translation and parity
+
+ lda #38 ; xio 38, translation and parity
+ sta ICCOM,x
+ lda tmp2
+ ora #32 ; no translation
+ sta ICAX1,x
+ jsr CIOV
+ bmi cioerr
+
+ lda #0
+done: ldx #0
+ rts
+
+inverr: jmp __inviocb
+
+.endproc ;_rs232_params
+
+cioerr: jmp __do_oserror
;----------------------------------------------------------------------------
@@ -196,28 +196,28 @@ cioerr: jmp __do_oserror
; */
;
-.proc _rs232_done
-
- lda rshand
- cmp #$ff
- beq done
-work: ldx rshand+1
- jsr pushax
- jsr _close
- pha
- txa
- pha
- ldx #$ff
- stx rshand
- stx rshand+1
- inx
- stx cm_run
- pla
- tax
- pla
-done: rts
-
-.endproc ;rs232_done
+.proc _rs232_done
+
+ lda rshand
+ cmp #$ff
+ beq done
+work: ldx rshand+1
+ jsr pushax
+ jsr _close
+ pha
+ txa
+ pha
+ ldx #$ff
+ stx rshand
+ stx rshand+1
+ inx
+ stx cm_run
+ pla
+ tax
+ pla
+done: rts
+
+.endproc ;rs232_done
;----------------------------------------------------------------------------
@@ -228,61 +228,61 @@ done: rts
; */
;
-.proc _rs232_get
+.proc _rs232_get
- ldy rshand
- cpy #$ff
- bne work ; work only if initialized
- lda #RS_ERR_NOT_INITIALIZED
- bne nierr
+ ldy rshand
+ cpy #$ff
+ bne work ; work only if initialized
+ lda #RS_ERR_NOT_INITIALIZED
+ bne nierr
-work: sta ptr1
- stx ptr1+1 ; store pointer to received char
+work: sta ptr1
+ stx ptr1+1 ; store pointer to received char
- lda rshand
- ldx #0
- jsr fdtoiocb
- tax
- lda cm_run ; concurrent mode already running?
- bne go
- jsr ena_cm ; turn on concurrent mode
+ lda rshand
+ ldx #0
+ jsr fdtoiocb
+ tax
+ lda cm_run ; concurrent mode already running?
+ bne go
+ jsr ena_cm ; turn on concurrent mode
-go: ; check whether there is any input available
+go: ; check whether there is any input available
- lda #STATIS ; status request, returns bytes pending
- sta ICCOM,x
- jsr CIOV
- bmi cioerr ; @@@ error handling
+ lda #STATIS ; status request, returns bytes pending
+ sta ICCOM,x
+ jsr CIOV
+ bmi cioerr ; @@@ error handling
- lda DVSTAT+1 ; get byte count pending
- ora DVSTAT+2
- beq nix_da ; no input waiting...
+ lda DVSTAT+1 ; get byte count pending
+ ora DVSTAT+2
+ beq nix_da ; no input waiting...
- ; input is available: get it!
+ ; input is available: get it!
- lda #GETCHR ; get raw bytes
- sta ICCOM,x ; in command code
- lda #0
- sta ICBLL,x
- sta ICBLH,x
- sta ICBAL,x
- sta ICBAH,x
- jsr CIOV ; go get it
- bmi cioerr ; @@@ error handling
+ lda #GETCHR ; get raw bytes
+ sta ICCOM,x ; in command code
+ lda #0
+ sta ICBLL,x
+ sta ICBLH,x
+ sta ICBAL,x
+ sta ICBAH,x
+ jsr CIOV ; go get it
+ bmi cioerr ; @@@ error handling
- ldx #0
- sta (ptr1,x) ; return received byte
- txa
- rts
+ ldx #0
+ sta (ptr1,x) ; return received byte
+ txa
+ rts
-nierr: ldx #0
- rts
+nierr: ldx #0
+ rts
-nix_da: lda #RS_ERR_NO_DATA
- ldx #0
- rts
+nix_da: lda #RS_ERR_NO_DATA
+ ldx #0
+ rts
-.endproc ;_rs232_get
+.endproc ;_rs232_get
;----------------------------------------------------------------------------
@@ -294,39 +294,39 @@ nix_da: lda #RS_ERR_NO_DATA
; */
;
-.proc _rs232_put
-
- ldy rshand
- cpy #$ff
- bne work ; work only if initialized
- lda #RS_ERR_NOT_INITIALIZED
- bne nierr
-
-work: pha
- lda rshand
- ldx #0
- jsr fdtoiocb
- tax
- lda cm_run ; concurrent mode already running?
- bne go
- jsr ena_cm ; turn on concurrent mode
-
- ; @@@TODO: check output buffer overflow
-go: lda #PUTCHR ; put raw bytes
- sta ICCOM,x ; in command code
- lda #0
- sta ICBLL,x
- sta ICBLH,x
- sta ICBAL,x
- sta ICBAH,x
- pla ; get the char back
- jsr CIOV ; go do it
- rts
-
-nierr: ldx #0
- rts
-
-.endproc ;_rs232_put
+.proc _rs232_put
+
+ ldy rshand
+ cpy #$ff
+ bne work ; work only if initialized
+ lda #RS_ERR_NOT_INITIALIZED
+ bne nierr
+
+work: pha
+ lda rshand
+ ldx #0
+ jsr fdtoiocb
+ tax
+ lda cm_run ; concurrent mode already running?
+ bne go
+ jsr ena_cm ; turn on concurrent mode
+
+ ; @@@TODO: check output buffer overflow
+go: lda #PUTCHR ; put raw bytes
+ sta ICCOM,x ; in command code
+ lda #0
+ sta ICBLL,x
+ sta ICBLH,x
+ sta ICBAL,x
+ sta ICBAH,x
+ pla ; get the char back
+ jsr CIOV ; go do it
+ rts
+
+nierr: ldx #0
+ rts
+
+.endproc ;_rs232_put
;----------------------------------------------------------------------------
;
@@ -349,41 +349,41 @@ _rs232_unpause:
;----------------------------------------------------------------------------
;
; unsigned char __fastcall__ rs232_status (unsigned char* status,
-; unsigned char* errors);
+; unsigned char* errors);
; /* Return the serial port status. */
;
_rs232_status:
- lda #255
- tax
- rts
+ lda #255
+ tax
+ rts
; enable concurrent rs232 mode
; gets iocb index in X
; all registers destroyed
-.proc ena_cm
-
- lda #40 ; XIO 40, start concurrent IO
- sta ICCOM,x
- sta cm_run ; indicate concurrent mode is running
- lda #0
- sta ICAX1,x
- sta ICAX2,x
- lda #recv_buf
- sta ICBAH,x
- lda #RECVBUF_SZ
- sta ICBLH,x
- lda #$0D ; value from 850 man, p62. must be 0D?,
- sta ICAX1,x ; or any non-zero?
- jmp CIOV
-
-.endproc ;ena_cm
-
- .end
+.proc ena_cm
+
+ lda #40 ; XIO 40, start concurrent IO
+ sta ICCOM,x
+ sta cm_run ; indicate concurrent mode is running
+ lda #0
+ sta ICAX1,x
+ sta ICAX2,x
+ lda #recv_buf
+ sta ICBAH,x
+ lda #RECVBUF_SZ
+ sta ICBLH,x
+ lda #$0D ; value from 850 man, p62. must be 0D?,
+ sta ICAX1,x ; or any non-zero?
+ jmp CIOV
+
+.endproc ;ena_cm
+
+ .end
diff --git a/libsrc/atari/rwcommon.s b/libsrc/atari/rwcommon.s
index 349c7be01..5f51cc5f7 100644
--- a/libsrc/atari/rwcommon.s
+++ b/libsrc/atari/rwcommon.s
@@ -2,42 +2,42 @@
; common iocb setup routine for read, write
; expects __fastcall__ parameters (int fd, void *buf, int count)
;
- .include "atari.inc"
- .include "errno.inc"
- .import popax
- .import fdtoiocb
+ .include "atari.inc"
+ .include "errno.inc"
+ .import popax
+ .import fdtoiocb
- .export __rwsetup
+ .export __rwsetup
__rwsetup:
- pha ; push size in stack
- txa
- pha
- jsr popax ; get buffer address
- pha
- txa
- pha
- jsr popax ; get handle
- jsr fdtoiocb ; convert to iocb
- bmi iocberr ; negative (X=$FF or A>$7F) on error.
- tax
- pla ; store address
- sta ICBAH,x
- pla
- sta ICBAL,x
- pla ; store length
- sta ICBLH,x
- pla
- sta ICBLL,x
- ora ICBLH,x ; returns Z if length is 0
- rts
+ pha ; push size in stack
+ txa
+ pha
+ jsr popax ; get buffer address
+ pha
+ txa
+ pha
+ jsr popax ; get handle
+ jsr fdtoiocb ; convert to iocb
+ bmi iocberr ; negative (X=$FF or A>$7F) on error.
+ tax
+ pla ; store address
+ sta ICBAH,x
+ pla
+ sta ICBAL,x
+ pla ; store length
+ sta ICBLH,x
+ pla
+ sta ICBLL,x
+ ora ICBLH,x ; returns Z if length is 0
+ rts
iocberr:pla
- pla
- pla
- pla
- ldx #$FF ; indicate error + clear ZF
- rts
+ pla
+ pla
+ pla
+ ldx #$FF ; indicate error + clear ZF
+ rts
diff --git a/libsrc/atari/savevec.s b/libsrc/atari/savevec.s
index d2de4ef30..dd6dda125 100644
--- a/libsrc/atari/savevec.s
+++ b/libsrc/atari/savevec.s
@@ -6,10 +6,10 @@
; void _rest_vecs(void);
;
- .export __save_vecs,__rest_vecs
-.include "atari.inc"
+ .export __save_vecs,__rest_vecs
+.include "atari.inc"
- .bss
+ .bss
old_dli: .res 2
old_dlist: .res 2
@@ -20,86 +20,86 @@ old_dma: .res 1
old_prior: .res 1
old_cols: .res 8
old_set: .res 1
-old_rmargin: .res 1 ; lmargin saved in startup code
+old_rmargin: .res 1 ; lmargin saved in startup code
- .code
+ .code
-.proc __save_vecs
+.proc __save_vecs
- lda VDSLST
- sta old_dli
- lda VDSLST+1
- sta old_dli+1
- lda SDLSTL
- sta old_dlist
- lda SDLSTL+1
- sta old_dlist+1
- lda VVBLKI
- sta old_vbi
- lda VVBLKI+1
- sta old_vbi+1
- lda VVBLKD
- sta old_vbd
- lda VVBLKD+1
- sta old_vbd+1
- lda GRACTL
- sta old_gra
- lda SDMCTL
- sta old_dma
- lda GPRIOR
- sta old_prior
- lda CHBAS
- sta old_set
- lda RMARGN
- sta old_rmargin
+ lda VDSLST
+ sta old_dli
+ lda VDSLST+1
+ sta old_dli+1
+ lda SDLSTL
+ sta old_dlist
+ lda SDLSTL+1
+ sta old_dlist+1
+ lda VVBLKI
+ sta old_vbi
+ lda VVBLKI+1
+ sta old_vbi+1
+ lda VVBLKD
+ sta old_vbd
+ lda VVBLKD+1
+ sta old_vbd+1
+ lda GRACTL
+ sta old_gra
+ lda SDMCTL
+ sta old_dma
+ lda GPRIOR
+ sta old_prior
+ lda CHBAS
+ sta old_set
+ lda RMARGN
+ sta old_rmargin
- ldy #7
+ ldy #7
SETUP1:
- lda PCOLR0,y
- sta old_cols,y
- dey
- bpl SETUP1
- rts
+ lda PCOLR0,y
+ sta old_cols,y
+ dey
+ bpl SETUP1
+ rts
.endproc
-.proc __rest_vecs
+.proc __rest_vecs
- lda #6
- ldx old_vbi+1
- ldy old_vbi
- jsr SETVBV
- lda #7
- ldx old_vbd+1
- ldy old_vbd
- jsr SETVBV
- lda old_dli
- sta VDSLST
- lda old_dli+1
- sta VDSLST+1
- lda old_dlist
- sta SDLSTL
- lda old_dlist+1
- sta SDLSTL+1
- lda old_gra
- sta GRACTL
- lda old_prior
- sta GPRIOR
- lda old_dma
- sta SDMCTL
- lda old_set
- sta CHBAS
- lda old_rmargin
- sta RMARGN
- lda #$FF
- sta CH
- ldy #7
+ lda #6
+ ldx old_vbi+1
+ ldy old_vbi
+ jsr SETVBV
+ lda #7
+ ldx old_vbd+1
+ ldy old_vbd
+ jsr SETVBV
+ lda old_dli
+ sta VDSLST
+ lda old_dli+1
+ sta VDSLST+1
+ lda old_dlist
+ sta SDLSTL
+ lda old_dlist+1
+ sta SDLSTL+1
+ lda old_gra
+ sta GRACTL
+ lda old_prior
+ sta GPRIOR
+ lda old_dma
+ sta SDMCTL
+ lda old_set
+ sta CHBAS
+ lda old_rmargin
+ sta RMARGN
+ lda #$FF
+ sta CH
+ ldy #7
SETUP2:
- lda old_cols,Y
- sta PCOLR0,Y
- dey
- bpl SETUP2
- rts
+ lda old_cols,Y
+ sta PCOLR0,Y
+ dey
+ bpl SETUP2
+ rts
.endproc
diff --git a/libsrc/atari/scroll.s b/libsrc/atari/scroll.s
index 8f58e190c..5e8428cc2 100644
--- a/libsrc/atari/scroll.s
+++ b/libsrc/atari/scroll.s
@@ -6,159 +6,159 @@
; numlines < 0 scrolls down
;
- .include "atari.inc"
- .importzp tmp1,tmp4,ptr1,ptr2
- .import mul40,_clrscr
- .export __scroll
+ .include "atari.inc"
+ .importzp tmp1,tmp4,ptr1,ptr2
+ .import mul40,_clrscr
+ .export __scroll
-.proc __scroll
+.proc __scroll
- cmp #0
- beq jmpfin
-; cmp #$80
-; bcc up
- bpl up
+ cmp #0
+ beq jmpfin
+; cmp #$80
+; bcc up
+ bpl up
;scroll down
- eor #$ff
- clc
- adc #1 ; make positive
- sta tmp1
-
- cmp #24 ; scroll >= the whole screen?
- bcc down_ok
- jmp _clrscr
-
-down_ok:lda SAVMSC
- clc
- adc #<(40*23)
- sta ptr1
- sta ptr2
- lda SAVMSC+1
- adc #>(40*23)
- sta ptr1+1 ; point to last line on screen
- sta ptr2+1
-
- lda tmp1
- jsr mul40
- sta tmp4
- lda ptr2
- sec
- sbc tmp4
- sta ptr2
- stx tmp4
- lda ptr2+1
- sbc tmp4
- sta ptr2+1
-
- lda #24 ; # of lines on screen
- sec
- sbc tmp1 ; # of lines to move
- tax
-
- ;very simple, could be improved
-
-scrold: ldy #39 ; # of chars on a line - 1
-copy_d: lda (ptr2),y
- sta (ptr1),y
- dey
- bpl copy_d
- lda ptr1
- sec
- sbc #40
- sta ptr1
- bcs u1
- dec ptr1+1
-u1: lda ptr2
- sec
- sbc #40
- sta ptr2
- bcs u2
- dec ptr2+1
-u2: dex
- bne scrold
-
- ; fill new scrolled in lines with space
-
- ldx tmp1 ; # of new lines
-fild: lda #0
- ldy #39
-fill_d: sta (ptr1),y
- dey
- bpl fill_d
- dex
-jmpfin: beq finish
- lda ptr1
- sec
- sbc #40
- sta ptr1
- bcs u3
- dec ptr1+1
-u3: jmp fild
+ eor #$ff
+ clc
+ adc #1 ; make positive
+ sta tmp1
+
+ cmp #24 ; scroll >= the whole screen?
+ bcc down_ok
+ jmp _clrscr
+
+down_ok:lda SAVMSC
+ clc
+ adc #<(40*23)
+ sta ptr1
+ sta ptr2
+ lda SAVMSC+1
+ adc #>(40*23)
+ sta ptr1+1 ; point to last line on screen
+ sta ptr2+1
+
+ lda tmp1
+ jsr mul40
+ sta tmp4
+ lda ptr2
+ sec
+ sbc tmp4
+ sta ptr2
+ stx tmp4
+ lda ptr2+1
+ sbc tmp4
+ sta ptr2+1
+
+ lda #24 ; # of lines on screen
+ sec
+ sbc tmp1 ; # of lines to move
+ tax
+
+ ;very simple, could be improved
+
+scrold: ldy #39 ; # of chars on a line - 1
+copy_d: lda (ptr2),y
+ sta (ptr1),y
+ dey
+ bpl copy_d
+ lda ptr1
+ sec
+ sbc #40
+ sta ptr1
+ bcs u1
+ dec ptr1+1
+u1: lda ptr2
+ sec
+ sbc #40
+ sta ptr2
+ bcs u2
+ dec ptr2+1
+u2: dex
+ bne scrold
+
+ ; fill new scrolled in lines with space
+
+ ldx tmp1 ; # of new lines
+fild: lda #0
+ ldy #39
+fill_d: sta (ptr1),y
+ dey
+ bpl fill_d
+ dex
+jmpfin: beq finish
+ lda ptr1
+ sec
+ sbc #40
+ sta ptr1
+ bcs u3
+ dec ptr1+1
+u3: jmp fild
;scroll up
-up: sta tmp1 ; # of lines to scroll
- cmp #24 ; scroll >= the whole screen?
- bcc up_ok
- jmp _clrscr
-
- ;multiply by 40 (xsize)
-up_ok: jsr mul40
- clc
- adc SAVMSC ; add start of screen mem
- sta ptr2
- txa
- adc SAVMSC+1
- sta ptr2+1
- lda SAVMSC+1
- sta ptr1+1
- lda SAVMSC
- sta ptr1
- lda #24 ; # of lines on screen
- sec
- sbc tmp1 ; # of lines to move
- tax
-
- ;very simple, could be improved
-
-scroll: ldy #39 ; # of chars on a line - 1
-copy_l: lda (ptr2),y
- sta (ptr1),y
- dey
- bpl copy_l
- lda #40
- clc
- adc ptr1
- sta ptr1
- bcc l1
- inc ptr1+1
-l1: lda #40
- clc
- adc ptr2
- sta ptr2
- bcc l2
- inc ptr2+1
-l2: dex
- bne scroll
-
- ; fill new scrolled in lines with space
-
- ldx tmp1 ; # of new lines
-fill: lda #0
- ldy #39
-fill_l: sta (ptr1),y
- dey
- bpl fill_l
- dex
- beq finish
- lda #40
- clc
- adc ptr1
- sta ptr1
- bcc l3
- inc ptr1+1
-l3: jmp fill
-
-finish: rts
+up: sta tmp1 ; # of lines to scroll
+ cmp #24 ; scroll >= the whole screen?
+ bcc up_ok
+ jmp _clrscr
+
+ ;multiply by 40 (xsize)
+up_ok: jsr mul40
+ clc
+ adc SAVMSC ; add start of screen mem
+ sta ptr2
+ txa
+ adc SAVMSC+1
+ sta ptr2+1
+ lda SAVMSC+1
+ sta ptr1+1
+ lda SAVMSC
+ sta ptr1
+ lda #24 ; # of lines on screen
+ sec
+ sbc tmp1 ; # of lines to move
+ tax
+
+ ;very simple, could be improved
+
+scroll: ldy #39 ; # of chars on a line - 1
+copy_l: lda (ptr2),y
+ sta (ptr1),y
+ dey
+ bpl copy_l
+ lda #40
+ clc
+ adc ptr1
+ sta ptr1
+ bcc l1
+ inc ptr1+1
+l1: lda #40
+ clc
+ adc ptr2
+ sta ptr2
+ bcc l2
+ inc ptr2+1
+l2: dex
+ bne scroll
+
+ ; fill new scrolled in lines with space
+
+ ldx tmp1 ; # of new lines
+fill: lda #0
+ ldy #39
+fill_l: sta (ptr1),y
+ dey
+ bpl fill_l
+ dex
+ beq finish
+ lda #40
+ clc
+ adc ptr1
+ sta ptr1
+ bcc l3
+ inc ptr1+1
+l3: jmp fill
+
+finish: rts
.endproc
diff --git a/libsrc/atari/setcolor.s b/libsrc/atari/setcolor.s
index 355921011..bf3b89572 100644
--- a/libsrc/atari/setcolor.s
+++ b/libsrc/atari/setcolor.s
@@ -9,43 +9,43 @@
;
- .export __setcolor, __setcolor_low, __getcolor
- .import popa
- .include "atari.inc"
+ .export __setcolor, __setcolor_low, __getcolor
+ .import popa
+ .include "atari.inc"
-.proc __getcolor
+.proc __getcolor
- tax
- lda COLOR0,x ; get current value
- ldx #0
- rts
+ tax
+ lda COLOR0,x ; get current value
+ ldx #0
+ rts
.endproc
-.proc __setcolor
+.proc __setcolor
-; asl a ; not -> BASIC compatible
- sta lum ; remember luminance
- jsr popa ; get hue
- asl a
- asl a
- asl a
- asl a
- ora lum
-; jmp __setcolor_low
+; asl a ; not -> BASIC compatible
+ sta lum ; remember luminance
+ jsr popa ; get hue
+ asl a
+ asl a
+ asl a
+ asl a
+ ora lum
+; jmp __setcolor_low
.endproc
-.proc __setcolor_low
+.proc __setcolor_low
- pha
- jsr popa
- tax
- pla
- sta COLOR0,x
- rts
+ pha
+ jsr popa
+ tax
+ pla
+ sta COLOR0,x
+ rts
.endproc
- .bss
-lum: .res 1
+ .bss
+lum: .res 1
diff --git a/libsrc/atari/siocall.s b/libsrc/atari/siocall.s
index eea3f040a..3db37753f 100644
--- a/libsrc/atari/siocall.s
+++ b/libsrc/atari/siocall.s
@@ -7,83 +7,83 @@
; to save space with _dio_read and _dio_write functions.
;
; unsigned char __fastcall__ _sio_call(dhandle_t handle,
-; unsigned sect_num,
-; void *buffer,
-; unsigned sio_val);
+; unsigned sect_num,
+; void *buffer,
+; unsigned sio_val);
; dhandle_t - 16bit (ptr)
; sio_val is (sio_command | sio_direction << 8)
;
- .export __sio_call
- .include "atari.inc"
- .import popa,popax
- .import sectsizetab,__oserror
- .importzp ptr1
+ .export __sio_call
+ .include "atari.inc"
+ .import popa,popax
+ .import sectsizetab,__oserror
+ .importzp ptr1
-.proc __sio_call
+.proc __sio_call
- sta DCOMND ; set command into DCB
- stx DSTATS ; set data flow directon
- jsr popax ; get buffer address
- sta DBUFLO ; set buffer address into DCB
- stx DBUFHI
- jsr popax
- sta DAUX1 ; set sector #
- stx DAUX2
+ sta DCOMND ; set command into DCB
+ stx DSTATS ; set data flow directon
+ jsr popax ; get buffer address
+ sta DBUFLO ; set buffer address into DCB
+ stx DBUFHI
+ jsr popax
+ sta DAUX1 ; set sector #
+ stx DAUX2
- jsr popax
- sta ptr1
- stx ptr1+1
+ jsr popax
+ sta ptr1
+ stx ptr1+1
- ldy #sst_flag
- lda (ptr1),y
- and #128
- beq _inv_hand ; handle not open or invalid
+ ldy #sst_flag
+ lda (ptr1),y
+ and #128
+ beq _inv_hand ; handle not open or invalid
- ldy #sst_driveno
- lda (ptr1),y
+ ldy #sst_driveno
+ lda (ptr1),y
- clc
- adc #1
- sta DUNIT ; unit number (d1,d2,d3,...)
+ clc
+ adc #1
+ sta DUNIT ; unit number (d1,d2,d3,...)
- lda DAUX2 ; high byte sector #
- bne _realsz
- lda DAUX1
- cmp #4 ; sectors 1 to 3 are special (always 128 bytes)
- bcs _realsz
+ lda DAUX2 ; high byte sector #
+ bne _realsz
+ lda DAUX1
+ cmp #4 ; sectors 1 to 3 are special (always 128 bytes)
+ bcs _realsz
- lda #$80
- sta DBYTLO
- asl a
- sta DBYTHI
- beq _cont
+ lda #$80
+ sta DBYTLO
+ asl a
+ sta DBYTHI
+ beq _cont
-_realsz:ldy #sst_sectsize
- lda (ptr1),y
- sta DBYTLO
- iny
- lda (ptr1),y
- sta DBYTHI
+_realsz:ldy #sst_sectsize
+ lda (ptr1),y
+ sta DBYTLO
+ iny
+ lda (ptr1),y
+ sta DBYTHI
-_cont: lda #DISKID ; SIO bus ID of diskette drive
- sta DDEVIC
- lda #15
- sta DTIMLO ; value got from DOS source
+_cont: lda #DISKID ; SIO bus ID of diskette drive
+ sta DDEVIC
+ lda #15
+ sta DTIMLO ; value got from DOS source
- jsr SIOV ; execute
+ jsr SIOV ; execute
- ldx #0
- lda DSTATS
- bmi _req_err ; error occurred
- txa ; no error occurred
+ ldx #0
+ lda DSTATS
+ bmi _req_err ; error occurred
+ txa ; no error occurred
_req_err:
- sta __oserror
- rts
+ sta __oserror
+ rts
_inv_hand:
- ldx #0
- lda #BADIOC
- bne _req_err
+ ldx #0
+ lda #BADIOC
+ bne _req_err
.endproc
diff --git a/libsrc/atari/syschdir.s b/libsrc/atari/syschdir.s
index e91d7c83b..9fc45edbd 100644
--- a/libsrc/atari/syschdir.s
+++ b/libsrc/atari/syschdir.s
@@ -6,83 +6,83 @@
; for SpartaDOS and MyDOS
;
- .include "atari.inc"
- .import findfreeiocb
- .import __dos_type
- .import initcwd
- .importzp tmp4
-.ifdef UCASE_FILENAME
- .importzp tmp3
- .import addysp
- .import ucase_fn
+ .include "atari.inc"
+ .import findfreeiocb
+ .import __dos_type
+ .import initcwd
+ .importzp tmp4
+.ifdef UCASE_FILENAME
+ .importzp tmp3
+ .import addysp
+ .import ucase_fn
.endif
- .export __syschdir
+ .export __syschdir
-.proc __syschdir
+.proc __syschdir
- pha ; save input parameter
- txa
- pha
+ pha ; save input parameter
+ txa
+ pha
- jsr findfreeiocb
- beq iocbok ; we found one
+ jsr findfreeiocb
+ beq iocbok ; we found one
- pla
- pla ; fix up stack
+ pla
+ pla ; fix up stack
- lda #TMOF ; too many open files
- rts
+ lda #TMOF ; too many open files
+ rts
-iocbok: stx tmp4 ; remember IOCB index
- pla
- tax
- pla ; get argument again
+iocbok: stx tmp4 ; remember IOCB index
+ pla
+ tax
+ pla ; get argument again
-.ifdef UCASE_FILENAME
+.ifdef UCASE_FILENAME
- jsr ucase_fn
- bcc ucok1
+ jsr ucase_fn
+ bcc ucok1
- lda #183 ; see oserror.s
- rts
+ lda #183 ; see oserror.s
+ rts
ucok1:
-.endif ; defined UCASE_FILENAME
+.endif ; defined UCASE_FILENAME
- ldy tmp4 ; IOCB index
- sta ICBAL,y ; store pointer to filename
- txa
- sta ICBAH,y
- tya
- tax
- lda __dos_type
- cmp #SPARTADOS
- beq :+
- lda #41
- .byte $2C ; BIT
-: lda #44
- sta ICCOM,x
- lda #0
- sta ICAX1,x
- sta ICAX2,x
- sta ICBLL,x
- sta ICBLH,x
- jsr CIOV
+ ldy tmp4 ; IOCB index
+ sta ICBAL,y ; store pointer to filename
+ txa
+ sta ICBAH,y
+ tya
+ tax
+ lda __dos_type
+ cmp #SPARTADOS
+ beq :+
+ lda #41
+ .byte $2C ; BIT
+: lda #44
+ sta ICCOM,x
+ lda #0
+ sta ICAX1,x
+ sta ICAX2,x
+ sta ICBLL,x
+ sta ICBLH,x
+ jsr CIOV
-.ifdef UCASE_FILENAME
- tya
- pha
- ldy tmp3 ; get size
- jsr addysp ; free used space on the stack
- pla
- tay
-.endif ; defined UCASE_FILENAME
+.ifdef UCASE_FILENAME
+ tya
+ pha
+ ldy tmp3 ; get size
+ jsr addysp ; free used space on the stack
+ pla
+ tay
+.endif ; defined UCASE_FILENAME
- bmi cioerr
- jsr initcwd
- lda #0
- rts
-cioerr: tya
- rts
+ bmi cioerr
+ jsr initcwd
+ lda #0
+ rts
+cioerr: tya
+ rts
-.endproc ; __syschdir
+.endproc ; __syschdir
diff --git a/libsrc/atari/sysmkdir.s b/libsrc/atari/sysmkdir.s
index 68f1a5087..de3252ced 100644
--- a/libsrc/atari/sysmkdir.s
+++ b/libsrc/atari/sysmkdir.s
@@ -6,84 +6,84 @@
; for SpartaDOS and MYDOS
;
- .include "atari.inc"
- .include "errno.inc"
- .import addysp
- .import popax
- .import findfreeiocb
- .importzp tmp4
-.ifdef UCASE_FILENAME
- .importzp tmp3
- .import ucase_fn
+ .include "atari.inc"
+ .include "errno.inc"
+ .import addysp
+ .import popax
+ .import findfreeiocb
+ .importzp tmp4
+.ifdef UCASE_FILENAME
+ .importzp tmp3
+ .import ucase_fn
.endif
- .export __sysmkdir
+ .export __sysmkdir
-.proc __sysmkdir
+.proc __sysmkdir
- dey ; parm count < 2 shouldn't be needed to be...
- dey ; ...checked (it generates a C compiler warning)
- beq parmok ; branch if parameter count ok
- jsr addysp ; fix stack, throw away unused parameters
+ dey ; parm count < 2 shouldn't be needed to be...
+ dey ; ...checked (it generates a C compiler warning)
+ beq parmok ; branch if parameter count ok
+ jsr addysp ; fix stack, throw away unused parameters
-parmok: jsr popax ; get name
- pha ; save input parameter
- txa
- pha
+parmok: jsr popax ; get name
+ pha ; save input parameter
+ txa
+ pha
- jsr findfreeiocb
- beq iocbok ; we found one
+ jsr findfreeiocb
+ beq iocbok ; we found one
- pla
- pla ; fix up stack
+ pla
+ pla ; fix up stack
- lda #TMOF ; too many open files
- rts
+ lda #TMOF ; too many open files
+ rts
-iocbok: stx tmp4 ; remember IOCB index
- pla
- tax
- pla ; get argument again
+iocbok: stx tmp4 ; remember IOCB index
+ pla
+ tax
+ pla ; get argument again
-.ifdef UCASE_FILENAME
+.ifdef UCASE_FILENAME
- jsr ucase_fn
- bcc ucok1
+ jsr ucase_fn
+ bcc ucok1
- lda #183 ; see oserror.s
- rts
+ lda #183 ; see oserror.s
+ rts
ucok1:
-.endif ; defined UCASE_FILENAME
-
- ldy tmp4 ; IOCB index
- sta ICBAL,y ; store pointer to filename
- txa
- sta ICBAH,y
- tya
- tax
- lda #42
- sta ICCOM,x
- lda #8
- sta ICAX1,x
- lda #0
- sta ICAX2,x
- sta ICBLL,x
- sta ICBLH,x
- jsr CIOV
-
-.ifdef UCASE_FILENAME
- tya
- pha
- ldy tmp3 ; get size
- jsr addysp ; free used space on the stack
- pla
- tay
-.endif ; defined UCASE_FILENAME
-
- bmi cioerr
- lda #0
- rts
-cioerr: tya
- rts
-
-.endproc ; __sysmkdir
+.endif ; defined UCASE_FILENAME
+
+ ldy tmp4 ; IOCB index
+ sta ICBAL,y ; store pointer to filename
+ txa
+ sta ICBAH,y
+ tya
+ tax
+ lda #42
+ sta ICCOM,x
+ lda #8
+ sta ICAX1,x
+ lda #0
+ sta ICAX2,x
+ sta ICBLL,x
+ sta ICBLH,x
+ jsr CIOV
+
+.ifdef UCASE_FILENAME
+ tya
+ pha
+ ldy tmp3 ; get size
+ jsr addysp ; free used space on the stack
+ pla
+ tay
+.endif ; defined UCASE_FILENAME
+
+ bmi cioerr
+ lda #0
+ rts
+cioerr: tya
+ rts
+
+.endproc ; __sysmkdir
diff --git a/libsrc/atari/sysremove.s b/libsrc/atari/sysremove.s
index 581cbd945..1e7b4760f 100644
--- a/libsrc/atari/sysremove.s
+++ b/libsrc/atari/sysremove.s
@@ -4,76 +4,76 @@
; int remove (const char* name);
;
- .include "atari.inc"
- .include "errno.inc"
- .import findfreeiocb
- .importzp tmp4
-.ifdef UCASE_FILENAME
- .importzp tmp3
- .import addysp
- .import ucase_fn
+ .include "atari.inc"
+ .include "errno.inc"
+ .import findfreeiocb
+ .importzp tmp4
+.ifdef UCASE_FILENAME
+ .importzp tmp3
+ .import addysp
+ .import ucase_fn
.endif
- .export __sysremove
+ .export __sysremove
-.proc __sysremove
+.proc __sysremove
- pha ; save input parameter
- txa
- pha
+ pha ; save input parameter
+ txa
+ pha
- jsr findfreeiocb
- beq iocbok ; we found one
+ jsr findfreeiocb
+ beq iocbok ; we found one
- pla
- pla ; fix up stack
+ pla
+ pla ; fix up stack
- lda #TMOF ; too many open files
- rts
+ lda #TMOF ; too many open files
+ rts
-iocbok: stx tmp4 ; remember IOCB index
- pla
- tax
- pla ; get argument again
+iocbok: stx tmp4 ; remember IOCB index
+ pla
+ tax
+ pla ; get argument again
-.ifdef UCASE_FILENAME
+.ifdef UCASE_FILENAME
- jsr ucase_fn
- bcc ucok1
+ jsr ucase_fn
+ bcc ucok1
- lda #183 ; see oserror.s
- rts
+ lda #183 ; see oserror.s
+ rts
ucok1:
-.endif ; defined UCASE_FILENAME
+.endif ; defined UCASE_FILENAME
- ldy tmp4 ; IOCB index
- sta ICBAL,y ; store pointer to filename
- txa
- sta ICBAH,y
- tya
- tax
- lda #DELETE
- sta ICCOM,x
- lda #0
- sta ICAX1,x
- sta ICAX2,x
- sta ICBLL,x
- sta ICBLH,x
- jsr CIOV
+ ldy tmp4 ; IOCB index
+ sta ICBAL,y ; store pointer to filename
+ txa
+ sta ICBAH,y
+ tya
+ tax
+ lda #DELETE
+ sta ICCOM,x
+ lda #0
+ sta ICAX1,x
+ sta ICAX2,x
+ sta ICBLL,x
+ sta ICBLH,x
+ jsr CIOV
-.ifdef UCASE_FILENAME
- tya
- pha
- ldy tmp3 ; get size
- jsr addysp ; free used space on the stack
- pla
- tay
-.endif ; defined UCASE_FILENAME
+.ifdef UCASE_FILENAME
+ tya
+ pha
+ ldy tmp3 ; get size
+ jsr addysp ; free used space on the stack
+ pla
+ tay
+.endif ; defined UCASE_FILENAME
- bmi cioerr
- lda #0
- rts
-cioerr: tya
- rts
+ bmi cioerr
+ lda #0
+ rts
+cioerr: tya
+ rts
-.endproc ; __sysremove
+.endproc ; __sysremove
diff --git a/libsrc/atari/sysrmdir.s b/libsrc/atari/sysrmdir.s
index d3b2cf3f1..9c057ba44 100644
--- a/libsrc/atari/sysrmdir.s
+++ b/libsrc/atari/sysrmdir.s
@@ -4,7 +4,7 @@
; unsigned char __fastcall__ _sysrmdir (const char* name);
;
- .export __sysrmdir
- .import __sysremove
+ .export __sysrmdir
+ .import __sysremove
__sysrmdir := __sysremove
diff --git a/libsrc/atari/systime.s b/libsrc/atari/systime.s
index 1d039e80e..d22b8c596 100644
--- a/libsrc/atari/systime.s
+++ b/libsrc/atari/systime.s
@@ -9,7 +9,7 @@
; */
;
- .export __systime
+ .export __systime
.importzp sreg
diff --git a/libsrc/atari/tgi/atari10.s b/libsrc/atari/tgi/atari10.s
index a7da93b97..10271b7f0 100644
--- a/libsrc/atari/tgi/atari10.s
+++ b/libsrc/atari/tgi/atari10.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 10
+ grmode = 10
; X resolution
- x_res = 80
+ x_res = 80
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 9
+ colors = 9
; Pixels per byte
- ppb = 2
+ ppb = 2
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $0330 ; based on 4/3 display
+ aspect = $0330 ; based on 4/3 display
; Free memory needed
- mem_needed = 7147
+ mem_needed = 7147
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11110000, %00001111
- masks: ; Color masks
- .byte $00, $11, $22, $33, $44, $55, $66, $77, $88
- bar_table: ; Mask table for BAR
- .byte %11111111, %00001111, %00000000
- default_palette:
- .byte $00, $0E, $32, $96, $68, $C4, $74, $EE, $4A
+ mask_table: ; Mask table to set pixels
+ .byte %11110000, %00001111
+ masks: ; Color masks
+ .byte $00, $11, $22, $33, $44, $55, $66, $77, $88
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00001111, %00000000
+ default_palette:
+ .byte $00, $0E, $32, $96, $68, $C4, $74, $EE, $4A
.code
@@ -55,22 +55,22 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- sta PCOLR0,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ sta PCOLR0,y
+ dey
+ bpl loop
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari11.s b/libsrc/atari/tgi/atari11.s
index 2e2dfd842..74b7db3b9 100644
--- a/libsrc/atari/tgi/atari11.s
+++ b/libsrc/atari/tgi/atari11.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 11
+ grmode = 11
; X resolution
- x_res = 80
+ x_res = 80
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 16
+ colors = 16
; Pixels per byte
- ppb = 2
+ ppb = 2
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $0330 ; based on 4/3 display
+ aspect = $0330 ; based on 4/3 display
; Free memory needed
- mem_needed = 7147
+ mem_needed = 7147
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11110000, %00001111
- masks: ; Color masks
- .byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
- bar_table: ; Mask table for BAR
- .byte %11111111, %00001111, %00000000
- default_palette:
- .byte $00, $10, $20, $30, $40, $50, $60, $70, $80, $90, $A0, $B0, $C0, $D0, $E0, $F0
+ mask_table: ; Mask table to set pixels
+ .byte %11110000, %00001111
+ masks: ; Color masks
+ .byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00001111, %00000000
+ default_palette:
+ .byte $00, $10, $20, $30, $40, $50, $60, $70, $80, $90, $A0, $B0, $C0, $D0, $E0, $F0
.code
@@ -55,14 +55,14 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; No palettes
+ ; No palettes
lda #TGI_ERR_INV_FUNC
sta error
rts
diff --git a/libsrc/atari/tgi/atari14.s b/libsrc/atari/tgi/atari14.s
index ebd243067..e0ae9b579 100644
--- a/libsrc/atari/tgi/atari14.s
+++ b/libsrc/atari/tgi/atari14.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 14
+ grmode = 14
; X resolution
- x_res = 160
+ x_res = 160
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 2
+ colors = 2
; Pixels per byte
- ppb = 8
+ ppb = 8
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $0198 ; based on 4/3 display
+ aspect = $0198 ; based on 4/3 display
; Free memory needed
- mem_needed = 3305
+ mem_needed = 3305
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
- masks: ; Color masks
- .byte %00000000, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
- default_palette:
- .byte $00, $0E
+ mask_table: ; Mask table to set pixels
+ .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
+ masks: ; Color masks
+ .byte %00000000, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
+ default_palette:
+ .byte $00, $0E
.code
@@ -55,27 +55,27 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR4
- lda palette + 1
- sta COLOR0
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR4
+ lda palette + 1
+ sta COLOR0
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari15.s b/libsrc/atari/tgi/atari15.s
index 08497db37..d1b85f39a 100644
--- a/libsrc/atari/tgi/atari15.s
+++ b/libsrc/atari/tgi/atari15.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 15
+ grmode = 15
; X resolution
- x_res = 160
+ x_res = 160
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 4
+ colors = 4
; Pixels per byte
- ppb = 4
+ ppb = 4
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $0198 ; based on 4/3 display
+ aspect = $0198 ; based on 4/3 display
; Free memory needed
- mem_needed = 7147
+ mem_needed = 7147
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11000000, %00110000, %00001100, %00000011
- masks: ; Color masks
- .byte %00000000, %01010101, %10101010, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %00111111, %00001111, %00000011, %00000000
- default_palette:
- .byte $00, $0E, $32, $96
+ mask_table: ; Mask table to set pixels
+ .byte %11000000, %00110000, %00001100, %00000011
+ masks: ; Color masks
+ .byte %00000000, %01010101, %10101010, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00111111, %00001111, %00000011, %00000000
+ default_palette:
+ .byte $00, $0E, $32, $96
.code
@@ -55,31 +55,31 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR4
- lda palette + 1
- sta COLOR0
- lda palette + 2
- sta COLOR1
- lda palette + 3
- sta COLOR2
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR4
+ lda palette + 1
+ sta COLOR0
+ lda palette + 2
+ sta COLOR1
+ lda palette + 3
+ sta COLOR2
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari3.s b/libsrc/atari/tgi/atari3.s
index 24dca69de..7cacc185b 100644
--- a/libsrc/atari/tgi/atari3.s
+++ b/libsrc/atari/tgi/atari3.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 3
+ grmode = 3
; X resolution
- x_res = 40
+ x_res = 40
; Y resolution
- y_res = 24
+ y_res = 24
; Number of colors
- colors = 4
+ colors = 4
; Pixels per byte
- ppb = 4
+ ppb = 4
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $00CC ; based on 4/3 display
+ aspect = $00CC ; based on 4/3 display
; Free memory needed
- mem_needed = 1
+ mem_needed = 1
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11000000, %00110000, %00001100, %00000011
- masks: ; Color masks
- .byte %00000000, %01010101, %10101010, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %00111111, %00001111, %00000011, %00000000
- default_palette:
- .byte $00, $0E, $32, $96
+ mask_table: ; Mask table to set pixels
+ .byte %11000000, %00110000, %00001100, %00000011
+ masks: ; Color masks
+ .byte %00000000, %01010101, %10101010, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00111111, %00001111, %00000011, %00000000
+ default_palette:
+ .byte $00, $0E, $32, $96
.code
@@ -55,31 +55,31 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR4
- lda palette + 1
- sta COLOR0
- lda palette + 2
- sta COLOR1
- lda palette + 3
- sta COLOR2
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR4
+ lda palette + 1
+ sta COLOR0
+ lda palette + 2
+ sta COLOR1
+ lda palette + 3
+ sta COLOR2
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari4.s b/libsrc/atari/tgi/atari4.s
index 785e742e5..a37ec2fa3 100644
--- a/libsrc/atari/tgi/atari4.s
+++ b/libsrc/atari/tgi/atari4.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 4
+ grmode = 4
; X resolution
- x_res = 80
+ x_res = 80
; Y resolution
- y_res = 48
+ y_res = 48
; Number of colors
- colors = 2
+ colors = 2
; Pixels per byte
- ppb = 8
+ ppb = 8
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $00CC ; based on 4/3 display
+ aspect = $00CC ; based on 4/3 display
; Free memory needed
- mem_needed = 1
+ mem_needed = 1
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
- masks: ; Color masks
- .byte %00000000, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
- default_palette:
- .byte $00, $0E
+ mask_table: ; Mask table to set pixels
+ .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
+ masks: ; Color masks
+ .byte %00000000, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
+ default_palette:
+ .byte $00, $0E
.code
@@ -55,27 +55,27 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR4
- lda palette + 1
- sta COLOR0
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR4
+ lda palette + 1
+ sta COLOR0
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari5.s b/libsrc/atari/tgi/atari5.s
index c8c699753..cf917d573 100644
--- a/libsrc/atari/tgi/atari5.s
+++ b/libsrc/atari/tgi/atari5.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 5
+ grmode = 5
; X resolution
- x_res = 80
+ x_res = 80
; Y resolution
- y_res = 48
+ y_res = 48
; Number of colors
- colors = 4
+ colors = 4
; Pixels per byte
- ppb = 4
+ ppb = 4
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $00CC ; based on 4/3 display
+ aspect = $00CC ; based on 4/3 display
; Free memory needed
- mem_needed = 185
+ mem_needed = 185
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11000000, %00110000, %00001100, %00000011
- masks: ; Color masks
- .byte %00000000, %01010101, %10101010, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %00111111, %00001111, %00000011, %00000000
- default_palette:
- .byte $00, $0E, $32, $96
+ mask_table: ; Mask table to set pixels
+ .byte %11000000, %00110000, %00001100, %00000011
+ masks: ; Color masks
+ .byte %00000000, %01010101, %10101010, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00111111, %00001111, %00000011, %00000000
+ default_palette:
+ .byte $00, $0E, $32, $96
.code
@@ -55,31 +55,31 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR4
- lda palette + 1
- sta COLOR0
- lda palette + 2
- sta COLOR1
- lda palette + 3
- sta COLOR2
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR4
+ lda palette + 1
+ sta COLOR0
+ lda palette + 2
+ sta COLOR1
+ lda palette + 3
+ sta COLOR2
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari6.s b/libsrc/atari/tgi/atari6.s
index 091b698d4..be9f6b779 100644
--- a/libsrc/atari/tgi/atari6.s
+++ b/libsrc/atari/tgi/atari6.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 6
+ grmode = 6
; X resolution
- x_res = 160
+ x_res = 160
; Y resolution
- y_res = 96
+ y_res = 96
; Number of colors
- colors = 2
+ colors = 2
; Pixels per byte
- ppb = 8
+ ppb = 8
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $00CC ; based on 4/3 display
+ aspect = $00CC ; based on 4/3 display
; Free memory needed
- mem_needed = 1193
+ mem_needed = 1193
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
- masks: ; Color masks
- .byte %00000000, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
- default_palette:
- .byte $00, $0E
+ mask_table: ; Mask table to set pixels
+ .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
+ masks: ; Color masks
+ .byte %00000000, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
+ default_palette:
+ .byte $00, $0E
.code
@@ -55,27 +55,27 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR4
- lda palette + 1
- sta COLOR0
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR4
+ lda palette + 1
+ sta COLOR0
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari7.s b/libsrc/atari/tgi/atari7.s
index 95a05d4e8..6e9d49acb 100644
--- a/libsrc/atari/tgi/atari7.s
+++ b/libsrc/atari/tgi/atari7.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 7
+ grmode = 7
; X resolution
- x_res = 160
+ x_res = 160
; Y resolution
- y_res = 96
+ y_res = 96
; Number of colors
- colors = 4
+ colors = 4
; Pixels per byte
- ppb = 4
+ ppb = 4
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $00CC ; based on 4/3 display
+ aspect = $00CC ; based on 4/3 display
; Free memory needed
- mem_needed = 3209
+ mem_needed = 3209
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11000000, %00110000, %00001100, %00000011
- masks: ; Color masks
- .byte %00000000, %01010101, %10101010, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %00111111, %00001111, %00000011, %00000000
- default_palette:
- .byte $00, $0E, $32, $96
+ mask_table: ; Mask table to set pixels
+ .byte %11000000, %00110000, %00001100, %00000011
+ masks: ; Color masks
+ .byte %00000000, %01010101, %10101010, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00111111, %00001111, %00000011, %00000000
+ default_palette:
+ .byte $00, $0E, $32, $96
.code
@@ -55,31 +55,31 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR4
- lda palette + 1
- sta COLOR0
- lda palette + 2
- sta COLOR1
- lda palette + 3
- sta COLOR2
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR4
+ lda palette + 1
+ sta COLOR0
+ lda palette + 2
+ sta COLOR1
+ lda palette + 3
+ sta COLOR2
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari8.s b/libsrc/atari/tgi/atari8.s
index fe97a5a0a..7d2a63863 100644
--- a/libsrc/atari/tgi/atari8.s
+++ b/libsrc/atari/tgi/atari8.s
@@ -4,77 +4,77 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 8
+ grmode = 8
; X resolution
- x_res = 320
+ x_res = 320
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 2
+ colors = 2
; Pixels per byte
- ppb = 8
+ ppb = 8
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $00CC ; based on 4/3 display
+ aspect = $00CC ; based on 4/3 display
; Free memory needed
- mem_needed = 7147
+ mem_needed = 7147
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
- masks: ; Color masks
- .byte %00000000, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
- default_palette:
- .byte $00, $0E
+ mask_table: ; Mask table to set pixels
+ .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
+ masks: ; Color masks
+ .byte %00000000, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
+ default_palette:
+ .byte $00, $0E
.code
; ******************************************************************************
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR2
- lda palette + 1
- sta COLOR1
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR2
+ lda palette + 1
+ sta COLOR1
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atari9.s b/libsrc/atari/tgi/atari9.s
index 38e23702a..41c783de1 100644
--- a/libsrc/atari/tgi/atari9.s
+++ b/libsrc/atari/tgi/atari9.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 9
+ grmode = 9
; X resolution
- x_res = 80
+ x_res = 80
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 16
+ colors = 16
; Pixels per byte
- ppb = 2
+ ppb = 2
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $0330 ; based on 4/3 display
+ aspect = $0330 ; based on 4/3 display
; Free memory needed
- mem_needed = 7147
+ mem_needed = 7147
; Number of screen pages
- pages = 1
+ pages = 1
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11110000, %00001111
- masks: ; Color masks
- .byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
- bar_table: ; Mask table for BAR
- .byte %11111111, %00001111, %00000000
- default_palette:
- .byte $00, $0F, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E
+ mask_table: ; Mask table to set pixels
+ .byte %11110000, %00001111
+ masks: ; Color masks
+ .byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00001111, %00000000
+ default_palette:
+ .byte $00, $0F, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E
.code
@@ -55,14 +55,14 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; No palettes
+ ; No palettes
lda #TGI_ERR_INV_FUNC
sta error
rts
diff --git a/libsrc/atari/tgi/atari_tgi_common.inc b/libsrc/atari/tgi/atari_tgi_common.inc
index 9e9f74aa4..9190fe8c8 100644
--- a/libsrc/atari/tgi/atari_tgi_common.inc
+++ b/libsrc/atari/tgi/atari_tgi_common.inc
@@ -6,240 +6,240 @@
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Header. Includes jump table and constants.
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Header. Includes jump table and constants.
+ ;
+ ; ----------------------------------------------------------------------
.segment "JUMPTABLE"
; Header
- .byte $74, $67, $69 ; "tgi"
- .byte TGI_API_VERSION ; TGI API version number
- .word x_res ; X resolution
- .word y_res ; Y resolution
- .byte colors ; Number of drawing colors
- .byte pages ; Number of screens available
- .byte 8 ; System font X size
- .byte 8 ; System font Y size
- .word aspect ; Aspect ratio
+ .byte $74, $67, $69 ; "tgi"
+ .byte TGI_API_VERSION ; TGI API version number
+ .word x_res ; X resolution
+ .word y_res ; Y resolution
+ .byte colors ; Number of drawing colors
+ .byte pages ; Number of screens available
+ .byte 8 ; System font X size
+ .byte 8 ; System font Y size
+ .word aspect ; Aspect ratio
.byte 0 ; TGI driver flags
; Function table
- .addr INSTALL
- .addr UNINSTALL
- .addr INIT
- .addr DONE
- .addr GETERROR
- .addr CONTROL
- .addr CLEAR
- .addr SETVIEWPAGE
- .addr SETDRAWPAGE
- .addr SETCOLOR
- .addr SETPALETTE
- .addr GETPALETTE
- .addr GETDEFPALETTE
- .addr SETPIXEL
- .addr GETPIXEL
- .addr LINE
- .addr BAR
- .addr TEXTSTYLE
- .addr OUTTEXT
- .addr 0 ; IRQ entry is unused
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr INIT
+ .addr DONE
+ .addr GETERROR
+ .addr CONTROL
+ .addr CLEAR
+ .addr SETVIEWPAGE
+ .addr SETDRAWPAGE
+ .addr SETCOLOR
+ .addr SETPALETTE
+ .addr GETPALETTE
+ .addr GETDEFPALETTE
+ .addr SETPIXEL
+ .addr GETPIXEL
+ .addr LINE
+ .addr BAR
+ .addr TEXTSTYLE
+ .addr OUTTEXT
+ .addr 0 ; IRQ entry is unused
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Parameters
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Parameters
+ ;
+ ; ----------------------------------------------------------------------
- x1 := ptr1
- y1 := ptr2
- x2 := ptr3
- y2 := ptr4
- radius := tmp1
+ x1 := ptr1
+ y1 := ptr2
+ x2 := ptr3
+ y2 := ptr4
+ radius := tmp1
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Global variables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Global variables
+ ;
+ ; ----------------------------------------------------------------------
- sptr := regsave + 2
+ sptr := regsave + 2
.bss
- error:
- .res 1 ; Error code
+ error:
+ .res 1 ; Error code
.if ::grmode = 9 || ::grmode = 11
- palette = default_palette
+ palette = default_palette
.else
- palette:
- .res colors ; The current palette
+ palette:
+ .res colors ; The current palette
.endif
- mask:
- .res 1 ; Current pixel mask
- griocb:
- .res 1 ; IOCB channel number for graphics
+ mask:
+ .res 1 ; Current pixel mask
+ griocb:
+ .res 1 ; IOCB channel number for graphics
.if pages = 2
- p0scr:
- .res 1 ; High byte of screen address for screen page 0
- p0dls:
- .res 1 ; High byte of display list address for screen page 0
- ; Page 1's addresses are 8K higher
+ p0scr:
+ .res 1 ; High byte of screen address for screen page 0
+ p0dls:
+ .res 1 ; High byte of display list address for screen page 0
+ ; Page 1's addresses are 8K higher
.endif
.data
- mag_x:
- .byte 1 ; Horizontal text scaling factor
- mag_y:
- .byte 1 ; Vertical text scaling factor
- mag_x8:
- .word 8 ; Horizontal text scaling factor * 8
- mag_y8:
- .word 8 ; Vertical text scaling factor * 8
- text_dir:
- .byte 0 ; Text direction,
+ mag_x:
+ .byte 1 ; Horizontal text scaling factor
+ mag_y:
+ .byte 1 ; Vertical text scaling factor
+ mag_x8:
+ .word 8 ; Horizontal text scaling factor * 8
+ mag_y8:
+ .word 8 ; Vertical text scaling factor * 8
+ text_dir:
+ .byte 0 ; Text direction,
.code
; ******************************************************************************
-.macro put_pixel
+.macro put_pixel
- ; ----------------------------------------------------------------------
- ;
- ; Put a pixel at (sptr),y using x as the bit mask offset
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Put a pixel at (sptr),y using x as the bit mask offset
+ ;
+ ; ----------------------------------------------------------------------
- lda (sptr),y
- eor mask
- and mask_table,x
- eor (sptr),y
- sta (sptr),y
+ lda (sptr),y
+ eor mask
+ and mask_table,x
+ eor (sptr),y
+ sta (sptr),y
.endmacro
; ******************************************************************************
.rodata
screen_device:
- .byte "S:",$9B ; Device code for screen
+ .byte "S:",$9B ; Device code for screen
screen_device_length := * - screen_device
.code
.proc INIT
- ; ----------------------------------------------------------------------
- ;
- ; INIT: Switch to graphics mode
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; INIT: Switch to graphics mode
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Initialize drawing color
+ ; Initialize drawing color
.if ::ppb = 8
- ldx #$FF
+ ldx #$FF
.elseif ::ppb = 4
- ldx #$55
+ ldx #$55
.elseif ::ppb = 2
- ldx #$11
+ ldx #$11
.endif
- stx mask
+ stx mask
- ; Find a free IOCB
- lda #$70
+ ; Find a free IOCB
+ lda #$70
search: tax
- ldy ICHID,x
- cpy #$FF
- beq found
- sub #$10
- bcs search
-
- ; Not enough resources available (free IOCB or memory)
- ; enter with C cleared!
-nores: lda #TGI_ERR_NO_RES
- bcc exit
-
-found: ; Check if enough RAM is available
- lda #0
- sub #mem_needed
- cmp APPMHI + 1
- bcc nores
- bne switch
- cpy APPMHI
- bcc nores ; not enough memory
-
- ; Switch into graphics mode
-switch: lda #OPEN
- sta ICCOM,x
- lda #OPNIN | OPNOT
- sta ICAX1,x
- lda #::grmode
- sta ICAX2,x
- lda #screen_device
- sta ICBAH,x
- lda #screen_device_length
- sta ICBLH,x
- jsr CIOV
+ ldy ICHID,x
+ cpy #$FF
+ beq found
+ sub #$10
+ bcs search
+
+ ; Not enough resources available (free IOCB or memory)
+ ; enter with C cleared!
+nores: lda #TGI_ERR_NO_RES
+ bcc exit
+
+found: ; Check if enough RAM is available
+ lda #0
+ sub #mem_needed
+ cmp APPMHI + 1
+ bcc nores
+ bne switch
+ cpy APPMHI
+ bcc nores ; not enough memory
+
+ ; Switch into graphics mode
+switch: lda #OPEN
+ sta ICCOM,x
+ lda #OPNIN | OPNOT
+ sta ICAX1,x
+ lda #::grmode
+ sta ICAX2,x
+ lda #screen_device
+ sta ICBAH,x
+ lda #screen_device_length
+ sta ICBLH,x
+ jsr CIOV
.if ::pages = 2
- ; Reserve 8K of high memory
- lda RAMTOP
- sub #32
- sta RAMTOP
- ; Close and reopen graphics
- lda #CLOSE
- sta ICCOM,x
- jsr CIOV
- ; Reopen graphics
- lda #OPEN
- sta ICCOM,x
- lda #OPNIN | OPNOT
- sta ICAX1,x
- lda #::grmode
- sta ICAX2,x
- lda #screen_device
- sta ICBAH,x
- lda #screen_device_length
- sta ICBLH,x
- jsr CIOV
- ; Save screen pointers
- lda SAVMSC + 1
- sta p0scr
- lda SDLSTH
- sta p0dls
+ ; Reserve 8K of high memory
+ lda RAMTOP
+ sub #32
+ sta RAMTOP
+ ; Close and reopen graphics
+ lda #CLOSE
+ sta ICCOM,x
+ jsr CIOV
+ ; Reopen graphics
+ lda #OPEN
+ sta ICCOM,x
+ lda #OPNIN | OPNOT
+ sta ICAX1,x
+ lda #::grmode
+ sta ICAX2,x
+ lda #screen_device
+ sta ICBAH,x
+ lda #screen_device_length
+ sta ICBLH,x
+ jsr CIOV
+ ; Save screen pointers
+ lda SAVMSC + 1
+ sta p0scr
+ lda SDLSTH
+ sta p0dls
.endif ; ::pages = 2
- stx griocb
+ stx griocb
- ; Reset the error code and return
+ ; Reset the error code and return
lda #TGI_ERR_OK
-exit: sta error
+exit: sta error
rts
.endproc
@@ -247,109 +247,109 @@ exit: sta error
.proc DONE
- ; ----------------------------------------------------------------------
- ;
- ; DONE: Switch back to text mode
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; DONE: Switch back to text mode
+ ;
+ ; ----------------------------------------------------------------------
.code
.if ::pages = 2
- ; Free 8K of high memory
- lda RAMTOP
- add #32
- sta RAMTOP
+ ; Free 8K of high memory
+ lda RAMTOP
+ add #32
+ sta RAMTOP
.endif
- ; Clear griocb
- lda #$FF
- ldx griocb
- sta griocb
-
- ; Close the S: device
- lda #CLOSE
- sta ICCOM,x
- jsr CIOV
-
- ; Reopen it in Graphics 0
- lda #OPEN
- sta ICCOM,x
- lda #OPNIN | OPNOT
- sta ICAX1,x
- lda #0
- sta ICAX2,x
- lda #screen_device
- sta ICBAH,x
- lda #screen_device_length
- sta ICBLH,x
- jsr CIOV
-
- ; Now close it again; we don't need it anymore :)
- lda #CLOSE
- sta ICCOM,x
- jmp CIOV
+ ; Clear griocb
+ lda #$FF
+ ldx griocb
+ sta griocb
+
+ ; Close the S: device
+ lda #CLOSE
+ sta ICCOM,x
+ jsr CIOV
+
+ ; Reopen it in Graphics 0
+ lda #OPEN
+ sta ICCOM,x
+ lda #OPNIN | OPNOT
+ sta ICAX1,x
+ lda #0
+ sta ICAX2,x
+ lda #screen_device
+ sta ICBAH,x
+ lda #screen_device_length
+ sta ICBLH,x
+ jsr CIOV
+
+ ; Now close it again; we don't need it anymore :)
+ lda #CLOSE
+ sta ICCOM,x
+ jmp CIOV
.endproc
; ******************************************************************************
.proc GETERROR
- ; ----------------------------------------------------------------------
- ;
- ; GETERROR: Return the error code in A and clear it
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; GETERROR: Return the error code in A and clear it
+ ;
+ ; ----------------------------------------------------------------------
.code
- ldx #TGI_ERR_OK
- lda error
- stx error
- rts
+ ldx #TGI_ERR_OK
+ lda error
+ stx error
+ rts
.endproc
; ******************************************************************************
.proc CLEAR
- ; ----------------------------------------------------------------------
- ;
- ; CLEAR: Clear the screen
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; CLEAR: Clear the screen
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Load the screen address in sptr
- lda SAVMSC
- sta sptr
- lda SAVMSC + 1
- sta sptr + 1
+ ; Load the screen address in sptr
+ lda SAVMSC
+ sta sptr
+ lda SAVMSC + 1
+ sta sptr + 1
- ; Fill with zero
- lda #0
- tay
+ ; Fill with zero
+ lda #0
+ tay
.if >::scrsize > 0
- ; Clear full pages if any
- ldx #>::scrsize
-loop1: sta (sptr),y
- iny
- bne loop1
- inc sptr + 1
- dex
- bne loop1
+ ; Clear full pages if any
+ ldx #>::scrsize
+loop1: sta (sptr),y
+ iny
+ bne loop1
+ inc sptr + 1
+ dex
+ bne loop1
.endif
.if <::scrsize > 0
- ; Clear the rest, if any
-loop2: sta (sptr),y
- iny
- cpy #<::scrsize
- bne loop2
+ ; Clear the rest, if any
+loop2: sta (sptr),y
+ iny
+ cpy #<::scrsize
+ bne loop2
.endif
rts
@@ -359,11 +359,11 @@ loop2: sta (sptr),y
.proc GETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; GETPALETTE: Return the current palette in A/X
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; GETPALETTE: Return the current palette in A/X
+ ;
+ ; ----------------------------------------------------------------------
.code
lda # 0, 1 -> 15, 2 -> 1, 3 -> 2 etc.
- beq cont
- cpx #1
- bne map
- ldx #16
-map: dex
+ ; Map colors like this: 0 -> 0, 1 -> 15, 2 -> 1, 3 -> 2 etc.
+ beq cont
+ cpx #1
+ bne map
+ ldx #16
+map: dex
cont:
.endif
- lda masks,x
- sta mask
- rts
+ lda masks,x
+ sta mask
+ rts
.endproc
; ******************************************************************************
.proc CALC
- ; ----------------------------------------------------------------------
- ;
- ; CALC: Calculate the screen address
- ; in
- ; x1 (ptr1) x coordinate
- ; y1 (ptr2) y coordinate
- ; out
- ; sptr + y screen address
- ; x bit mask index
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; CALC: Calculate the screen address
+ ; in
+ ; x1 (ptr1) x coordinate
+ ; y1 (ptr2) y coordinate
+ ; out
+ ; sptr + y screen address
+ ; x bit mask index
+ ;
+ ; ----------------------------------------------------------------------
.bss
- temp: .res 1
+ temp: .res 1
.code
- ; calculate line offset
- lda y1 + 1
- sta temp
- lda y1
+ ; calculate line offset
+ lda y1 + 1
+ sta temp
+ lda y1
.if ::x_res / ::ppb = 40
- yrep = 3
+ yrep = 3
.elseif ::x_res / ::ppb = 20
- yrep = 2
+ yrep = 2
.elseif ::x_res / ::ppb = 10
- yrep = 1
+ yrep = 1
.endif
-.repeat yrep
- asl a
- rol temp
+.repeat yrep
+ asl a
+ rol temp
.endrepeat
- sta sptr
- ldx temp
- stx sptr + 1
+ sta sptr
+ ldx temp
+ stx sptr + 1
-.repeat 2
- asl a
- rol temp
+.repeat 2
+ asl a
+ rol temp
.endrepeat
- add sptr
- sta sptr
- lda temp
- adc sptr + 1
- sta sptr + 1
+ add sptr
+ sta sptr
+ lda temp
+ adc sptr + 1
+ sta sptr + 1
- ; calculate bit mask offset
- lda x1
- and #ppb - 1
- tax
+ ; calculate bit mask offset
+ lda x1
+ and #ppb - 1
+ tax
- ; calculate row offset
- lda x1 + 1
- sta temp
- lda x1
+ ; calculate row offset
+ lda x1 + 1
+ sta temp
+ lda x1
.if ::ppb = 8
- xrep = 3
+ xrep = 3
.elseif ::ppb = 4
- xrep = 2
+ xrep = 2
.elseif ::ppb = 2
- xrep = 1
+ xrep = 1
.endif
-.repeat xrep
- lsr temp
- ror a
+.repeat xrep
+ lsr temp
+ ror a
.endrepeat
- tay
+ tay
- ; sptr += SAVMSC
- lda SAVMSC
- add sptr
- sta sptr
- lda SAVMSC + 1
- adc sptr + 1
- sta sptr + 1
+ ; sptr += SAVMSC
+ lda SAVMSC
+ add sptr
+ sta sptr
+ lda SAVMSC + 1
+ adc sptr + 1
+ sta sptr + 1
- ; We're done!
- rts
+ ; We're done!
+ rts
.endproc
; ******************************************************************************
.proc SETPIXEL
- ; ----------------------------------------------------------------------
- ;
- ; Draw one pixel at x1, y1
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Draw one pixel at x1, y1
+ ;
+ ; ----------------------------------------------------------------------
.code
- jsr CALC
- put_pixel
- rts
+ jsr CALC
+ put_pixel
+ rts
.endproc
; ******************************************************************************
.proc GETPIXEL
- ; ----------------------------------------------------------------------
- ;
- ; GETPIXEL: Read the color value of a pixel and return it in A/X
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; GETPIXEL: Read the color value of a pixel and return it in A/X
+ ;
+ ; ----------------------------------------------------------------------
.code
- jsr CALC
- lda (sptr),y
- and mask_table,x
+ jsr CALC
+ lda (sptr),y
+ and mask_table,x
.if ::ppb = 8
- beq zero
- lda #1
-zero: ldx #0
- rts
+ beq zero
+ lda #1
+zero: ldx #0
+ rts
.elseif ::ppb = 4
-loop: cpx #3
- beq done4
- lsr a
- lsr a
- inx
- bne loop
-done4: and #$03
- ldx #0
- rts
+loop: cpx #3
+ beq done4
+ lsr a
+ lsr a
+ inx
+ bne loop
+done4: and #$03
+ ldx #0
+ rts
.elseif ::ppb = 2
- dex
- bne shift
- and #$0F
- jmp exit
-shift: lsr a
- lsr a
- lsr a
- lsr a
+ dex
+ bne shift
+ and #$0F
+ jmp exit
+shift: lsr a
+ lsr a
+ lsr a
+ lsr a
exit:
.if ::grmode = 9
- ; Mode 9 mapping
- ; Map colors like this: 0 -> 0, 15 -> 1, 2 -> 3, 3 -> 4 etc.
- beq done9
- cmp #15
- bne map9
- lda #0
-map9: add #1
+ ; Mode 9 mapping
+ ; Map colors like this: 0 -> 0, 15 -> 1, 2 -> 3, 3 -> 4 etc.
+ beq done9
+ cmp #15
+ bne map9
+ lda #0
+map9: add #1
done9:
.endif
.if ::grmode = 10
- ; Mode 10 mapping
- ; Map out of range colors like this:
- ; 9 -> 8
- ; 10 -> 8
- ; 11 -> 8
- ; 12 -> 0
- ; 13 -> 1
- ; 14 -> 2
- ; 15 -> 3
- cmp #9
- bcc done10
- sub #12
- bcs done10
- lda #8
+ ; Mode 10 mapping
+ ; Map out of range colors like this:
+ ; 9 -> 8
+ ; 10 -> 8
+ ; 11 -> 8
+ ; 12 -> 0
+ ; 13 -> 1
+ ; 14 -> 2
+ ; 15 -> 3
+ cmp #9
+ bcc done10
+ sub #12
+ bcs done10
+ lda #8
done10:
.endif ; ::grmode = 10
- ; Done!
- ldx #0
- rts
-.endif ; ::ppb = 2
+ ; Done!
+ ldx #0
+ rts
+.endif ; ::ppb = 2
.endproc
@@ -602,422 +602,422 @@ done10:
.proc LINE
- ; ----------------------------------------------------------------------
- ;
- ; LINE: Draw a line from x1,y1 to x2,y2
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; LINE: Draw a line from x1,y1 to x2,y2
+ ;
+ ; ----------------------------------------------------------------------
.ifdef USE_CIO_LINE
- ; position ptr1, ptr2
- lda x1
- sta OLDCOL
- lda x1 + 1
- sta OLDCOL + 1
- lda y1
- sta OLDROW
- ; plot
- jsr SETPIXEL
- ; position ptr3,ptr4
- lda x2
- sta COLCRS
- lda x2 + 1
- sta COLCRS + 1
- lda y2
- sta ROWCRS
- ; drawto
- ldx griocb
- lda #DRAWLN
- sta ICCOM,x
- lda mask
+ ; position ptr1, ptr2
+ lda x1
+ sta OLDCOL
+ lda x1 + 1
+ sta OLDCOL + 1
+ lda y1
+ sta OLDROW
+ ; plot
+ jsr SETPIXEL
+ ; position ptr3,ptr4
+ lda x2
+ sta COLCRS
+ lda x2 + 1
+ sta COLCRS + 1
+ lda y2
+ sta ROWCRS
+ ; drawto
+ ldx griocb
+ lda #DRAWLN
+ sta ICCOM,x
+ lda mask
.if ::grmode = 10
- and #$0f
+ and #$0f
.else
- and #colors - 1
+ and #colors - 1
.endif
- sta ATACHR
- jmp CIOV
+ sta ATACHR
+ jmp CIOV
-.else ; USE_CIO_LINE
+.else ; USE_CIO_LINE
; locals
- dx := sreg
- dy := y1
- dx2 := x2
- dy2 := y2
- iy := tmp1
- err := tmp3
+ dx := sreg
+ dy := y1
+ dx2 := x2
+ dy2 := y2
+ iy := tmp1
+ err := tmp3
.code
- ; dx = x2 - x1
- lda x2
- sub x1
- sta dx
- lda x2 + 1
- sbc x1 + 1
- sta dx + 1
- ; if dx is positive, no problem
- bcs dx_positive
-
- ; if dx is negative, swap x1,y1 with x2,y2
- lda x1 ; x1 <-> x2, low byte
- ldx x2
- sta x2
- stx x1
- lda x1 + 1 ; x1 <-> x2, high byte
- ldx x2 + 1
- sta x2 + 1
- stx x1 + 1
- lda y1 ; y1 <-> y2, low byte
- ldx y2
- sta y2
- stx y1
- lda y1 + 1 ; y1 <-> y2, high byte
- ldx y2 + 1
- sta y2 + 1
- stx y1 + 1
- ; Calculate again
- jmp LINE
+ ; dx = x2 - x1
+ lda x2
+ sub x1
+ sta dx
+ lda x2 + 1
+ sbc x1 + 1
+ sta dx + 1
+ ; if dx is positive, no problem
+ bcs dx_positive
+
+ ; if dx is negative, swap x1,y1 with x2,y2
+ lda x1 ; x1 <-> x2, low byte
+ ldx x2
+ sta x2
+ stx x1
+ lda x1 + 1 ; x1 <-> x2, high byte
+ ldx x2 + 1
+ sta x2 + 1
+ stx x1 + 1
+ lda y1 ; y1 <-> y2, low byte
+ ldx y2
+ sta y2
+ stx y1
+ lda y1 + 1 ; y1 <-> y2, high byte
+ ldx y2 + 1
+ sta y2 + 1
+ stx y1 + 1
+ ; Calculate again
+ jmp LINE
dx_positive:
- ; Calculate coords
- jsr CALC
-
- ; dy = y2 - y1
- lda y2
- sub y1
- sta dy
- lda y2 + 1
- sbc y1 + 1
- sta dy + 1
-
- ; if dy is negative
- bcs dy_positive
- ; dy = -dy
- lda #0
- sub dy
- sta dy
- lda #0
- sbc dy + 1
- sta dy + 1
- ; iy = -row_size
- lda #<(65536 - x_res / ppb)
- sta iy
- lda #>(65536 - x_res / ppb)
- sta iy + 1
- bne skip_iy_1 ; always
+ ; Calculate coords
+ jsr CALC
+
+ ; dy = y2 - y1
+ lda y2
+ sub y1
+ sta dy
+ lda y2 + 1
+ sbc y1 + 1
+ sta dy + 1
+
+ ; if dy is negative
+ bcs dy_positive
+ ; dy = -dy
+ lda #0
+ sub dy
+ sta dy
+ lda #0
+ sbc dy + 1
+ sta dy + 1
+ ; iy = -row_size
+ lda #<(65536 - x_res / ppb)
+ sta iy
+ lda #>(65536 - x_res / ppb)
+ sta iy + 1
+ bne skip_iy_1 ; always
dy_positive:
- ; iy = row_size
- lda #<(x_res / ppb)
- sta iy
- lda #>(x_res / ppb)
- sta iy + 1
+ ; iy = row_size
+ lda #<(x_res / ppb)
+ sta iy
+ lda #>(x_res / ppb)
+ sta iy + 1
skip_iy_1:
- ; dx2 = dx * 2
- lda dx
- asl a
- sta dx2
- lda dx + 1
- rol a
- sta dx2 + 1
-
- ; dy2 = dy * 2
- lda dy
- asl a
- sta dy2
- lda dy + 1
- rol a
- sta dy2 + 1
-
- ; if dx >= dy
- lda dx
- cmp dy
- lda dx + 1
- sbc dy + 1
- bcc dy_major
-
- ; dx is the major axis
-
- ; err = dy2 - dx
- lda dy2
- sub dx
- sta err
- lda dy2 + 1
- sbc dx + 1
- sta err + 1
-
- .scope
-loop: ; main loop
- put_pixel
- ; if err >= 0
- lda err + 1
- bmi err_neg
- ; err -= dx2
- lda err
- sub dx2
- sta err
- lda err + 1
- sbc dx2 + 1
- sta err + 1
- ; move_vertical (iy)
- lda sptr
- add iy
- sta sptr
- lda sptr + 1
- adc iy + 1
- sta sptr + 1
+ ; dx2 = dx * 2
+ lda dx
+ asl a
+ sta dx2
+ lda dx + 1
+ rol a
+ sta dx2 + 1
+
+ ; dy2 = dy * 2
+ lda dy
+ asl a
+ sta dy2
+ lda dy + 1
+ rol a
+ sta dy2 + 1
+
+ ; if dx >= dy
+ lda dx
+ cmp dy
+ lda dx + 1
+ sbc dy + 1
+ bcc dy_major
+
+ ; dx is the major axis
+
+ ; err = dy2 - dx
+ lda dy2
+ sub dx
+ sta err
+ lda dy2 + 1
+ sbc dx + 1
+ sta err + 1
+
+ .scope
+loop: ; main loop
+ put_pixel
+ ; if err >= 0
+ lda err + 1
+ bmi err_neg
+ ; err -= dx2
+ lda err
+ sub dx2
+ sta err
+ lda err + 1
+ sbc dx2 + 1
+ sta err + 1
+ ; move_vertical (iy)
+ lda sptr
+ add iy
+ sta sptr
+ lda sptr + 1
+ adc iy + 1
+ sta sptr + 1
err_neg:
- ; err += dy2
- lda err
- add dy2
- sta err
- lda err + 1
- adc dy2 + 1
- sta err + 1
- ; move_right
- inx
- cpx #ppb
- bne end_move
- ldx #0
- iny
- bne end_move
- inc sptr + 1
+ ; err += dy2
+ lda err
+ add dy2
+ sta err
+ lda err + 1
+ adc dy2 + 1
+ sta err + 1
+ ; move_right
+ inx
+ cpx #ppb
+ bne end_move
+ ldx #0
+ iny
+ bne end_move
+ inc sptr + 1
end_move:
- ; loop while dx-- >= 0
- lda dx
- ora dx + 1
- beq exit
- dec dx
- lda dx
- cmp #$FF
- bne loop
- dec dx + 1
- jmp loop
-exit: rts
- .endscope
+ ; loop while dx-- >= 0
+ lda dx
+ ora dx + 1
+ beq exit
+ dec dx
+ lda dx
+ cmp #$FF
+ bne loop
+ dec dx + 1
+ jmp loop
+exit: rts
+ .endscope
dy_major:
- ; dy is the major axis
-
- ; err = dx2 - dy;
- lda dx2
- sub dy
- sta err
- lda dx2 + 1
- sbc dy + 1
- sta err + 1
-
- .scope
-loop: ; main loop
- put_pixel
- ; if err >= 0
- lda err + 1
- bmi end_move
- ; err -= dy2
- lda err
- sub dy2
- sta err
- lda err + 1
- sbc dy2 + 1
- sta err + 1
- ; move_right
- inx
- cpx #ppb
- bne end_move
- ldx #0
- iny
- bne end_move
- inc sptr + 1
+ ; dy is the major axis
+
+ ; err = dx2 - dy;
+ lda dx2
+ sub dy
+ sta err
+ lda dx2 + 1
+ sbc dy + 1
+ sta err + 1
+
+ .scope
+loop: ; main loop
+ put_pixel
+ ; if err >= 0
+ lda err + 1
+ bmi end_move
+ ; err -= dy2
+ lda err
+ sub dy2
+ sta err
+ lda err + 1
+ sbc dy2 + 1
+ sta err + 1
+ ; move_right
+ inx
+ cpx #ppb
+ bne end_move
+ ldx #0
+ iny
+ bne end_move
+ inc sptr + 1
end_move:
- ; err += dx2
- lda err
- add dx2
- sta err
- lda err + 1
- adc dx2 + 1
- sta err + 1
- ; move_vertical(iy)
- lda sptr
- add iy
- sta sptr
- lda sptr + 1
- adc iy + 1
- sta sptr + 1
- ; loop while dy-- >= 0
- lda dy
- ora dy + 1
- beq exit
- dec dy
- lda dy
- cmp #$FF
- bne loop
- dec dy + 1
- jmp loop
-exit: rts
- .endscope
-.endif ; USE_CIO_LINE
+ ; err += dx2
+ lda err
+ add dx2
+ sta err
+ lda err + 1
+ adc dx2 + 1
+ sta err + 1
+ ; move_vertical(iy)
+ lda sptr
+ add iy
+ sta sptr
+ lda sptr + 1
+ adc iy + 1
+ sta sptr + 1
+ ; loop while dy-- >= 0
+ lda dy
+ ora dy + 1
+ beq exit
+ dec dy
+ lda dy
+ cmp #$FF
+ bne loop
+ dec dy + 1
+ jmp loop
+exit: rts
+ .endscope
+.endif ; USE_CIO_LINE
.endproc
; ******************************************************************************
.proc clipped_bar
- ; ----------------------------------------------------------------------
- ;
- ; Clip and draw bar, this function will disappear when text clipping
- ; will be done int the TGI kernel
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Clip and draw bar, this function will disappear when text clipping
+ ; will be done int the TGI kernel
+ ;
+ ; ----------------------------------------------------------------------
.code
- lda y1 + 1
- bne off
- lda y1
- cmp #y_res
- bcs off
+ lda y1 + 1
+ bne off
+ lda y1
+ cmp #y_res
+ bcs off
- lda x1 + 1
+ lda x1 + 1
.if >(::x_res - 1) > 0
- cmp #>x_res
- bcc check2
+ cmp #>x_res
+ bcc check2
.endif
- bne off
- lda x1
- cmp #(::x_res - 1) > 0
- cmp #>x_res
- bcc BAR
+ cmp #>x_res
+ bcc BAR
.endif
- bne off
- lda x2
- cmp #(::x_res - 1) > 0
- lda x2 + 1
- sta x1 + 1
+ lda x2 + 1
+ sta x1 + 1
.endif
- jsr CALC
- ; Save the values
- tya
- add sptr
- sta sptr
- bcc skips
- inc sptr + 1
-skips: inx
- lda bar_table,x
- eor #$FF
- sta rmask
- ; Calculate memory difference between x1 and x2
- lda sptr
- sub lmem
- sta dx
-loop: ; Main loop
- ldy #0
- ldx dx
- beq same
- ; Left
- lda (lmem),y
- eor mask
- and lmask
- eor (lmem),y
- sta (lmem),y
- iny
- ; Between
- lda mask
- jmp next
-btwn: sta (lmem),y
- iny
-next: dex
- bne btwn
- ; Right
- lda (lmem),y
- eor mask
- and rmask
- eor (lmem),y
- sta (lmem),y
- jmp cont
-same: ; Same byte
- lda lmask
- and rmask
- sta fmask
- lda (lmem),y
- eor mask
- and fmask
- eor (lmem),y
- sta (lmem),y
-cont: ; Go to next row
- lda lmem
- add #<(x_res / ppb)
- sta lmem
- bcc skipm
- inc lmem + 1
-skipm: ; Loop while --dy > 0
- dec dy
- bne loop
-
- rts
+ jsr CALC
+ ; Save the values
+ tya
+ add sptr
+ sta sptr
+ bcc skips
+ inc sptr + 1
+skips: inx
+ lda bar_table,x
+ eor #$FF
+ sta rmask
+ ; Calculate memory difference between x1 and x2
+ lda sptr
+ sub lmem
+ sta dx
+loop: ; Main loop
+ ldy #0
+ ldx dx
+ beq same
+ ; Left
+ lda (lmem),y
+ eor mask
+ and lmask
+ eor (lmem),y
+ sta (lmem),y
+ iny
+ ; Between
+ lda mask
+ jmp next
+btwn: sta (lmem),y
+ iny
+next: dex
+ bne btwn
+ ; Right
+ lda (lmem),y
+ eor mask
+ and rmask
+ eor (lmem),y
+ sta (lmem),y
+ jmp cont
+same: ; Same byte
+ lda lmask
+ and rmask
+ sta fmask
+ lda (lmem),y
+ eor mask
+ and fmask
+ eor (lmem),y
+ sta (lmem),y
+cont: ; Go to next row
+ lda lmem
+ add #<(x_res / ppb)
+ sta lmem
+ bcc skipm
+ inc lmem + 1
+skipm: ; Loop while --dy > 0
+ dec dy
+ bne loop
+
+ rts
.endproc
@@ -1025,378 +1025,378 @@ skipm: ; Loop while --dy > 0
.proc TEXTSTYLE
- ; ----------------------------------------------------------------------
- ;
- ; TEXTSTYLE: Set text style. Scale factors in X and Y and direction in A
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; TEXTSTYLE: Set text style. Scale factors in X and Y and direction in A
+ ;
+ ; ----------------------------------------------------------------------
.code
- stx mag_x
- sty mag_y
- ; Save text direction in bit 8 so that we can use BIT instruction later
- lsr a
- ror a
- sta text_dir
- ; Save 8 * scaling factors
- lda #0
- sta mag_x8 + 1
- sta mag_y8 + 1
- ; Save 8 * mag_x
- txa
-
- .repeat 3
- asl a
- rol mag_x8 + 1
- .endrepeat
-
- sta mag_x8
- ; Save 8 * mag_y
- tya
-
- .repeat 3
- asl a
- rol mag_y8 + 1
- .endrepeat
-
- sta mag_y8
- ; Done!
- rts
+ stx mag_x
+ sty mag_y
+ ; Save text direction in bit 8 so that we can use BIT instruction later
+ lsr a
+ ror a
+ sta text_dir
+ ; Save 8 * scaling factors
+ lda #0
+ sta mag_x8 + 1
+ sta mag_y8 + 1
+ ; Save 8 * mag_x
+ txa
+
+ .repeat 3
+ asl a
+ rol mag_x8 + 1
+ .endrepeat
+
+ sta mag_x8
+ ; Save 8 * mag_y
+ tya
+
+ .repeat 3
+ asl a
+ rol mag_y8 + 1
+ .endrepeat
+
+ sta mag_y8
+ ; Done!
+ rts
.endproc
; ******************************************************************************
.proc OUTTEXT
- ; ----------------------------------------------------------------------
- ;
- ; OUTTEXT: Draw text at x1, y1. String is in ptr3
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; OUTTEXT: Draw text at x1, y1. String is in ptr3
+ ;
+ ; ----------------------------------------------------------------------
; locals
- string := tmp1
- cols := tmp3
- pixels := tmp4
- font := regsave
+ string := tmp1
+ cols := tmp3
+ pixels := tmp4
+ font := regsave
.rodata
- ataint: .byte 64,0,32,96
+ ataint: .byte 64,0,32,96
.bss
- rows: .res 1
+ rows: .res 1
.if >(::x_res - 1) > 0
- oldx1: .res 2
- oldx2: .res 2
+ oldx1: .res 2
+ oldx2: .res 2
.else
- oldx1: .res 1
- oldx2: .res 1
+ oldx1: .res 1
+ oldx2: .res 1
.endif
- oldy1: .res 1
- oldy2: .res 1
- inv: .res 1
+ oldy1: .res 1
+ oldy2: .res 1
+ inv: .res 1
.code
- ; Don't draw zero sized characters
- lda mag_x
- ora mag_y
- bne not0
- rts
-
-not0: ; Save string address, ptr3 is needed by BAR
- lda ptr3
- sta string
- lda ptr3 + 1
- sta string + 1
-
- bit text_dir
- bmi vert
-
- ; Calculate x2
- lda mag_x
- sub #1
- add x1
- sta x2
+ ; Don't draw zero sized characters
+ lda mag_x
+ ora mag_y
+ bne not0
+ rts
+
+not0: ; Save string address, ptr3 is needed by BAR
+ lda ptr3
+ sta string
+ lda ptr3 + 1
+ sta string + 1
+
+ bit text_dir
+ bmi vert
+
+ ; Calculate x2
+ lda mag_x
+ sub #1
+ add x1
+ sta x2
.if >(::x_res - 1) > 0
- lda x1 + 1
- adc #0
- sta x2 + 1
+ lda x1 + 1
+ adc #0
+ sta x2 + 1
.else
- lda #0
- sta x2 + 1
+ lda #0
+ sta x2 + 1
.endif
- ; Calculate y2 and adjust y1
- dec y1
- lda y1
- sta y2
- sub mag_y
- add #1
- sta y1
- lda #0
- sta y2 + 1
-
- jmp while
-
- ; Calculate for vertical text
-vert: lda x1
- sub #1
- sta x2
- lda x1 + 1
- sbc #0
- sta x2 + 1
- lda x1
- sub mag_y
- sta x1
- lda x1 + 1
- sbc #0
- sta x1 + 1
-
- lda mag_x
- sub #1
- add y1
- sta y2
- lda #0
- sta y2 + 1
- jmp while
-
- ; Main loop
-loop: inc string
- bne skiph
- inc string + 1
-skiph: ; Save coords
- bit text_dir
- bmi scvert
-
- ldx y1
- stx oldy1
- ldx y2
- stx oldy2
- jmp draw
-
-scvert: ldx x1
- stx oldx1
- ldx x2
- stx oldx2
+ ; Calculate y2 and adjust y1
+ dec y1
+ lda y1
+ sta y2
+ sub mag_y
+ add #1
+ sta y1
+ lda #0
+ sta y2 + 1
+
+ jmp while
+
+ ; Calculate for vertical text
+vert: lda x1
+ sub #1
+ sta x2
+ lda x1 + 1
+ sbc #0
+ sta x2 + 1
+ lda x1
+ sub mag_y
+ sta x1
+ lda x1 + 1
+ sbc #0
+ sta x1 + 1
+
+ lda mag_x
+ sub #1
+ add y1
+ sta y2
+ lda #0
+ sta y2 + 1
+ jmp while
+
+ ; Main loop
+loop: inc string
+ bne skiph
+ inc string + 1
+skiph: ; Save coords
+ bit text_dir
+ bmi scvert
+
+ ldx y1
+ stx oldy1
+ ldx y2
+ stx oldy2
+ jmp draw
+
+scvert: ldx x1
+ stx oldx1
+ ldx x2
+ stx oldx2
.if >(::x_res - 1) > 0
- ldx x1 + 1
- stx oldx1 + 1
- ldx x2 + 1
- stx oldx2 + 1
+ ldx x1 + 1
+ stx oldx1 + 1
+ ldx x2 + 1
+ stx oldx2 + 1
.endif
- ; Draw one character
- ; Convert to ANTIC code
-draw: tay
- rol a
- rol a
- rol a
- rol a
- and #3
- tax
- tya
- and #$9f
- ora ataint,x
- ; Save and clear inverse video bit
- sta inv
- and #$7F
- ; Calculate font data address
- sta font
- lda #0
- sta font + 1
-
- .repeat 3
- asl font
- rol a
- .endrepeat
-
- adc CHBAS
- sta font + 1
- ; Save old coords
- bit text_dir
- bpl hor
- lda y1
- sta oldy1
- lda y2
- sta oldy2
- jmp cont
-hor: lda x1
- sta oldx1
- lda x2
- sta oldx2
+ ; Draw one character
+ ; Convert to ANTIC code
+draw: tay
+ rol a
+ rol a
+ rol a
+ rol a
+ and #3
+ tax
+ tya
+ and #$9f
+ ora ataint,x
+ ; Save and clear inverse video bit
+ sta inv
+ and #$7F
+ ; Calculate font data address
+ sta font
+ lda #0
+ sta font + 1
+
+ .repeat 3
+ asl font
+ rol a
+ .endrepeat
+
+ adc CHBAS
+ sta font + 1
+ ; Save old coords
+ bit text_dir
+ bpl hor
+ lda y1
+ sta oldy1
+ lda y2
+ sta oldy2
+ jmp cont
+hor: lda x1
+ sta oldx1
+ lda x2
+ sta oldx2
.if >(::x_res - 1) > 0
- lda x1 + 1
- sta oldx1 + 1
- lda x2 + 1
- sta oldx2 + 1
+ lda x1 + 1
+ sta oldx1 + 1
+ lda x2 + 1
+ sta oldx2 + 1
.endif
- ; Get glyph pixels
-cont: ldy #7
- ; Put one row of the glyph
-putrow: sty rows
- lda (font),y
- bit inv
- bpl noinv
- eor #$FF
-noinv: sta pixels
- lda #7
- sta cols
- ; Put one column of the row
-putcol: asl pixels
- bcc next_col
- lda x1
- pha
- lda x1 + 1
- pha
- jsr clipped_bar
- pla
- sta x1 + 1
- pla
- sta x1
+ ; Get glyph pixels
+cont: ldy #7
+ ; Put one row of the glyph
+putrow: sty rows
+ lda (font),y
+ bit inv
+ bpl noinv
+ eor #$FF
+noinv: sta pixels
+ lda #7
+ sta cols
+ ; Put one column of the row
+putcol: asl pixels
+ bcc next_col
+ lda x1
+ pha
+ lda x1 + 1
+ pha
+ jsr clipped_bar
+ pla
+ sta x1 + 1
+ pla
+ sta x1
next_col:
- ; Go to next column
- ; increase x coords
- bit text_dir
- bmi vertinc
-
- lda mag_x
- add x1
- sta x1
- bcc L1
- inc x1 + 1
-L1: lda mag_x
- add x2
- sta x2
- bcc L2
- inc x2 + 1
- jmp L2
+ ; Go to next column
+ ; increase x coords
+ bit text_dir
+ bmi vertinc
+
+ lda mag_x
+ add x1
+ sta x1
+ bcc L1
+ inc x1 + 1
+L1: lda mag_x
+ add x2
+ sta x2
+ bcc L2
+ inc x2 + 1
+ jmp L2
vertinc:
- lda y1
- sub mag_x
- sta y1
- lda y2
- sub mag_x
- sta y2
+ lda y1
+ sub mag_x
+ sta y1
+ lda y2
+ sub mag_x
+ sta y2
L2:
- dec cols
- bpl putcol
+ dec cols
+ bpl putcol
next_row:
- ; Go to next row
- bit text_dir
- bmi verty
-
- lda y1
- sub mag_y
- sta y1
- bcs L3
- dec y1 + 1
-L3: lda y2
- sub mag_y
- sta y2
- bcs L6
- dec y2 + 1
-L4: jmp L6
-
-verty: lda x1
- sub mag_y
- sta x1
- bcs L5
- dec x1 + 1
-L5: lda x2
- sub mag_y
- sta x2
- bcs L6
- dec x2 + 1
+ ; Go to next row
+ bit text_dir
+ bmi verty
+
+ lda y1
+ sub mag_y
+ sta y1
+ bcs L3
+ dec y1 + 1
+L3: lda y2
+ sub mag_y
+ sta y2
+ bcs L6
+ dec y2 + 1
+L4: jmp L6
+
+verty: lda x1
+ sub mag_y
+ sta x1
+ bcs L5
+ dec x1 + 1
+L5: lda x2
+ sub mag_y
+ sta x2
+ bcs L6
+ dec x2 + 1
L6:
- ; Restore old values
- bit text_dir
- bpl reshor
- lda oldy1
- sta y1
- lda oldy2
- sta y2
- jmp nextrow
-reshor: lda oldx1
- sta x1
- lda oldx2
- sta x2
+ ; Restore old values
+ bit text_dir
+ bpl reshor
+ lda oldy1
+ sta y1
+ lda oldy2
+ sta y2
+ jmp nextrow
+reshor: lda oldx1
+ sta x1
+ lda oldx2
+ sta x2
.if >(::x_res - 1) > 0
- lda oldx1 + 1
- sta x1 + 1
- lda oldx2 + 1
- sta x2 + 1
+ lda oldx1 + 1
+ sta x1 + 1
+ lda oldx2 + 1
+ sta x2 + 1
.endif
- ; Next row
+ ; Next row
nextrow:
- ldy rows
- dey
- jpl putrow
-
- ; Restore coords
- bit text_dir
- bmi resvert
-
- ldx oldy1
- stx y1
- ldx oldy2
- stx y2
- ldx #0
- stx y1 + 1
- stx y2 + 1
-
- lda mag_x8
- add x1
- sta x1
- lda mag_x8 + 1
- adc x1 + 1
- sta x1 + 1
- lda mag_x8
- add x2
- sta x2
- lda mag_x8 + 1
- adc x2 + 1
- sta x2 + 1
-
- jmp while
+ ldy rows
+ dey
+ jpl putrow
+
+ ; Restore coords
+ bit text_dir
+ bmi resvert
+
+ ldx oldy1
+ stx y1
+ ldx oldy2
+ stx y2
+ ldx #0
+ stx y1 + 1
+ stx y2 + 1
+
+ lda mag_x8
+ add x1
+ sta x1
+ lda mag_x8 + 1
+ adc x1 + 1
+ sta x1 + 1
+ lda mag_x8
+ add x2
+ sta x2
+ lda mag_x8 + 1
+ adc x2 + 1
+ sta x2 + 1
+
+ jmp while
resvert:
- ldx oldx1
- stx x1
- ldx oldx2
- stx x2
+ ldx oldx1
+ stx x1
+ ldx oldx2
+ stx x2
.if >(::x_res - 1) > 0
- ldx oldx1 + 1
- stx x1 + 1
- ldx oldx2 + 1
- stx x2 + 1
+ ldx oldx1 + 1
+ stx x1 + 1
+ ldx oldx2 + 1
+ stx x2 + 1
.endif
- lda y1
- sub mag_x8
- sta y1
- lda y1 +1
- sbc mag_x8 + 1
- sta y1 + 1
- lda y2
- sub mag_x8
- sta y2
- lda y2 +1
- sbc mag_x8 + 1
- sta y2 + 1
-
- ; End of loop
-while: ldy #0
- lda (string),y
- jne loop ; Check for null character
- rts
+ lda y1
+ sub mag_x8
+ sta y1
+ lda y1 +1
+ sbc mag_x8 + 1
+ sta y1 + 1
+ lda y2
+ sub mag_x8
+ sta y2
+ lda y2 +1
+ sbc mag_x8 + 1
+ sta y2 + 1
+
+ ; End of loop
+while: ldy #0
+ lda (string),y
+ jne loop ; Check for null character
+ rts
.endproc
@@ -1405,72 +1405,72 @@ while: ldy #0
.proc SETVIEWPAGE
- ; ----------------------------------------------------------------------
- ;
- ; SETVIEWPAGE, page in A
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETVIEWPAGE, page in A
+ ;
+ ; ----------------------------------------------------------------------
.code
- tax
- beq cont
- lda #32
+ tax
+ beq cont
+ lda #32
-cont: add p0dls
- cmp SDLSTH
- beq done ; We're already in the desired page
+cont: add p0dls
+ cmp SDLSTH
+ beq done ; We're already in the desired page
- ldx RTCLOK + 2
- sta SDLSTH
+ ldx RTCLOK + 2
+ sta SDLSTH
- ; Wait until next VBLANK
-wait: cpx RTCLOK + 2
- beq wait
+ ; Wait until next VBLANK
+wait: cpx RTCLOK + 2
+ beq wait
- ; Done
-done: rts
+ ; Done
+done: rts
.endproc
; ******************************************************************************
.proc SETDRAWPAGE
- ; ----------------------------------------------------------------------
- ;
- ; SETDRAWPAGE, page in A
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETDRAWPAGE, page in A
+ ;
+ ; ----------------------------------------------------------------------
.code
- tax
- beq cont
- lda #32
-cont: add p0scr
- sta SAVMSC + 1
- rts
+ tax
+ beq cont
+ lda #32
+cont: add p0scr
+ sta SAVMSC + 1
+ rts
.endproc
.endif
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Unimplemented functions that require an error code
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Unimplemented functions that require an error code
+ ;
+ ; ----------------------------------------------------------------------
CONTROL:
- lda #TGI_ERR_INV_FUNC
- sta error
- ; fall through
+ lda #TGI_ERR_INV_FUNC
+ sta error
+ ; fall through
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Unimplemented functions that don't require an error code
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Unimplemented functions that don't require an error code
+ ;
+ ; ----------------------------------------------------------------------
INSTALL:
UNINSTALL:
diff --git a/libsrc/atari/tgi/atr10p2.s b/libsrc/atari/tgi/atr10p2.s
index e29ff601c..aa3a6fcee 100644
--- a/libsrc/atari/tgi/atr10p2.s
+++ b/libsrc/atari/tgi/atr10p2.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 10
+ grmode = 10
; X resolution
- x_res = 80
+ x_res = 80
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 9
+ colors = 9
; Pixels per byte
- ppb = 2
+ ppb = 2
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $0330 ; based on 4/3 display
+ aspect = $0330 ; based on 4/3 display
; Free memory needed
- mem_needed = 15339
+ mem_needed = 15339
; Number of screen pages
- pages = 2
+ pages = 2
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11110000, %00001111
- masks: ; Color masks
- .byte $00, $11, $22, $33, $44, $55, $66, $77, $88
- bar_table: ; Mask table for BAR
- .byte %11111111, %00001111, %00000000
- default_palette:
- .byte $00, $0E, $32, $96, $68, $C4, $74, $EE, $4A
+ mask_table: ; Mask table to set pixels
+ .byte %11110000, %00001111
+ masks: ; Color masks
+ .byte $00, $11, $22, $33, $44, $55, $66, $77, $88
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00001111, %00000000
+ default_palette:
+ .byte $00, $0E, $32, $96, $68, $C4, $74, $EE, $4A
.code
@@ -55,22 +55,22 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- sta PCOLR0,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ sta PCOLR0,y
+ dey
+ bpl loop
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atr15p2.s b/libsrc/atari/tgi/atr15p2.s
index a3cdd7726..7692d0699 100644
--- a/libsrc/atari/tgi/atr15p2.s
+++ b/libsrc/atari/tgi/atr15p2.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 15
+ grmode = 15
; X resolution
- x_res = 160
+ x_res = 160
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 4
+ colors = 4
; Pixels per byte
- ppb = 4
+ ppb = 4
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $0198 ; based on 4/3 display
+ aspect = $0198 ; based on 4/3 display
; Free memory needed
- mem_needed = 15339
+ mem_needed = 15339
; Number of screen pages
- pages = 2
+ pages = 2
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11000000, %00110000, %00001100, %00000011
- masks: ; Color masks
- .byte %00000000, %01010101, %10101010, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %00111111, %00001111, %00000011, %00000000
- default_palette:
- .byte $00, $0E, $32, $96
+ mask_table: ; Mask table to set pixels
+ .byte %11000000, %00110000, %00001100, %00000011
+ masks: ; Color masks
+ .byte %00000000, %01010101, %10101010, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00111111, %00001111, %00000011, %00000000
+ default_palette:
+ .byte $00, $0E, $32, $96
.code
@@ -55,31 +55,31 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR4
- lda palette + 1
- sta COLOR0
- lda palette + 2
- sta COLOR1
- lda palette + 3
- sta COLOR2
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR4
+ lda palette + 1
+ sta COLOR0
+ lda palette + 2
+ sta COLOR1
+ lda palette + 3
+ sta COLOR2
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atr8p2.s b/libsrc/atari/tgi/atr8p2.s
index 162aa4460..f292f3787 100644
--- a/libsrc/atari/tgi/atr8p2.s
+++ b/libsrc/atari/tgi/atr8p2.s
@@ -4,77 +4,77 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 8
+ grmode = 8
; X resolution
- x_res = 320
+ x_res = 320
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 2
+ colors = 2
; Pixels per byte
- ppb = 8
+ ppb = 8
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $00CC ; based on 4/3 display
+ aspect = $00CC ; based on 4/3 display
; Free memory needed
- mem_needed = 15339
+ mem_needed = 15339
; Number of screen pages
- pages = 2
+ pages = 2
.rodata
- mask_table: ; Mask table to set pixels
- .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
- masks: ; Color masks
- .byte %00000000, %11111111
- bar_table: ; Mask table for BAR
- .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
- default_palette:
- .byte $00, $0E
+ mask_table: ; Mask table to set pixels
+ .byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
+ masks: ; Color masks
+ .byte %00000000, %11111111
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %01111111, %00111111, %00011111, %00001111, %00000111, %00000011, %00000001, %00000000
+ default_palette:
+ .byte $00, $0E
.code
; ******************************************************************************
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; Copy the palette
- ldy #colors - 1
-loop: lda (ptr1),y
- sta palette,y
- dey
- bpl loop
+ ; Copy the palette
+ ldy #colors - 1
+loop: lda (ptr1),y
+ sta palette,y
+ dey
+ bpl loop
- ; Get the color entries from the palette
- lda palette
- sta COLOR2
- lda palette + 1
- sta COLOR1
+ ; Get the color entries from the palette
+ lda palette
+ sta COLOR2
+ lda palette + 1
+ sta COLOR1
- ; Done, reset the error code
+ ; Done, reset the error code
lda #TGI_ERR_OK
sta error
rts
diff --git a/libsrc/atari/tgi/atr9p2.s b/libsrc/atari/tgi/atr9p2.s
index f8418f112..750df3ad7 100644
--- a/libsrc/atari/tgi/atr9p2.s
+++ b/libsrc/atari/tgi/atr9p2.s
@@ -4,50 +4,50 @@
; Fatih Aygun (2009)
;
- .include "atari.inc"
- .include "zeropage.inc"
+ .include "atari.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
- .macpack generic
+ .macpack generic
; ******************************************************************************
- ; ----------------------------------------------------------------------
- ;
- ; Constants and tables
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; Constants and tables
+ ;
+ ; ----------------------------------------------------------------------
; Graphics mode
- grmode = 9
+ grmode = 9
; X resolution
- x_res = 80
+ x_res = 80
; Y resolution
- y_res = 192
+ y_res = 192
; Number of colors
- colors = 16
+ colors = 16
; Pixels per byte
- ppb = 2
+ ppb = 2
; Screen memory size in bytes
- scrsize = x_res * y_res / ppb
+ scrsize = x_res * y_res / ppb
; Pixel aspect ratio
- aspect = $0330 ; based on 4/3 display
+ aspect = $0330 ; based on 4/3 display
; Free memory needed
- mem_needed = 15339
+ mem_needed = 15339
; Number of screen pages
- pages = 2
+ pages = 2
.rodata
- mask_table: ; Mask table to set pixels
- .byte %11110000, %00001111
- masks: ; Color masks
- .byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
- bar_table: ; Mask table for BAR
- .byte %11111111, %00001111, %00000000
- default_palette:
- .byte $00, $0F, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E
+ mask_table: ; Mask table to set pixels
+ .byte %11110000, %00001111
+ masks: ; Color masks
+ .byte $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $aa, $bb, $cc, $dd, $ee, $ff
+ bar_table: ; Mask table for BAR
+ .byte %11111111, %00001111, %00000000
+ default_palette:
+ .byte $00, $0F, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E
.code
@@ -55,14 +55,14 @@
.proc SETPALETTE
- ; ----------------------------------------------------------------------
- ;
- ; SETPALETTE: Set the palette (in ptr1)
- ;
- ; ----------------------------------------------------------------------
+ ; ----------------------------------------------------------------------
+ ;
+ ; SETPALETTE: Set the palette (in ptr1)
+ ;
+ ; ----------------------------------------------------------------------
.code
- ; No palettes
+ ; No palettes
lda #TGI_ERR_INV_FUNC
sta error
rts
diff --git a/libsrc/atari/tgi_colors.s b/libsrc/atari/tgi_colors.s
index 4dab483e2..6ef3729b4 100644
--- a/libsrc/atari/tgi_colors.s
+++ b/libsrc/atari/tgi_colors.s
@@ -2,7 +2,7 @@
; Target-specific black & white values for use by the target-shared TGI kernel
;
- .include "tgi-kernel.inc"
+ .include "tgi-kernel.inc"
- .export tgi_color_black:zp = $00
- .export tgi_color_white:zp = $01
+ .export tgi_color_black:zp = $00
+ .export tgi_color_white:zp = $01
diff --git a/libsrc/atari/tgi_stat_stddrv.s b/libsrc/atari/tgi_stat_stddrv.s
index 015eb6318..05c570d7a 100644
--- a/libsrc/atari/tgi_stat_stddrv.s
+++ b/libsrc/atari/tgi_stat_stddrv.s
@@ -6,8 +6,8 @@
; const void tgi_static_stddrv[];
;
- .export _tgi_static_stddrv
- .import _atari8_tgi
+ .export _tgi_static_stddrv
+ .import _atari8_tgi
.rodata
diff --git a/libsrc/atari/tgi_stddrv.s b/libsrc/atari/tgi_stddrv.s
index 219842b08..94ced91d4 100644
--- a/libsrc/atari/tgi_stddrv.s
+++ b/libsrc/atari/tgi_stddrv.s
@@ -6,8 +6,8 @@
; const char tgi_stddrv[];
;
- .export _tgi_stddrv
+ .export _tgi_stddrv
.rodata
-_tgi_stddrv: .asciiz "atari8.tgi"
+_tgi_stddrv: .asciiz "atari8.tgi"
diff --git a/libsrc/atari/toascii.s b/libsrc/atari/toascii.s
index 328f1f486..39de0d746 100644
--- a/libsrc/atari/toascii.s
+++ b/libsrc/atari/toascii.s
@@ -8,12 +8,12 @@
.proc _toascii
; Clear the inverse video bit
- and #$7F
+ and #$7F
; X must be zero on return
- ldx #0
+ ldx #0
; Done!
- rts
+ rts
.endproc
diff --git a/libsrc/atari/tvtype.s b/libsrc/atari/tvtype.s
index 84540b898..76661bf72 100644
--- a/libsrc/atari/tvtype.s
+++ b/libsrc/atari/tvtype.s
@@ -9,18 +9,18 @@
;
- .include "atari.inc"
- .include "get_tv.inc"
+ .include "atari.inc"
+ .include "get_tv.inc"
-.proc _get_tv
+.proc _get_tv
- ldx #TV::NTSC ; Assume NTSC
- lda PAL ; use hw register, PALNTS is only supported on XL/XE ROM
- and #$0e
- bne @NTSC
- inx ; = TV::PAL
-@NTSC: txa
- ldx #0 ; Expand to int
- rts
+ ldx #TV::NTSC ; Assume NTSC
+ lda PAL ; use hw register, PALNTS is only supported on XL/XE ROM
+ and #$0e
+ bne @NTSC
+ inx ; = TV::PAL
+@NTSC: txa
+ ldx #0 ; Expand to int
+ rts
.endproc
diff --git a/libsrc/atari/ucase_fn.s b/libsrc/atari/ucase_fn.s
index 79f16167f..a32ddce23 100644
--- a/libsrc/atari/ucase_fn.s
+++ b/libsrc/atari/ucase_fn.s
@@ -6,97 +6,97 @@
; used by open.s and remove.s
;
; Calling parameters:
-; AX - points to filename
+; AX - points to filename
; Return parameters:
-; C - 0/1 for OK/Error (filename too long)
-; AX - points to uppercased version of the filename on the stack
-; tmp3 - amount of bytes used on the stack (needed for cleanup)
+; C - 0/1 for OK/Error (filename too long)
+; AX - points to uppercased version of the filename on the stack
+; tmp3 - amount of bytes used on the stack (needed for cleanup)
; Uses:
; ptr4 - scratch pointer used to remember original AX pointer
;
;
- .include "atari.inc"
+ .include "atari.inc"
-.ifdef DEFAULT_DEVICE
- .importzp tmp2
- .import __defdev
+.ifdef DEFAULT_DEVICE
+ .importzp tmp2
+ .import __defdev
.endif
- .importzp tmp3,ptr4,sp
- .import subysp,addysp
- .export ucase_fn
+ .importzp tmp3,ptr4,sp
+ .import subysp,addysp
+ .export ucase_fn
.proc ucase_fn
- ; we make sure that the filename doesn't contain lowercase letters
- ; we copy the filename we got onto the stack, uppercase it and use this
- ; one to open the iocb
- ; we're using tmp3, ptr4
+ ; we make sure that the filename doesn't contain lowercase letters
+ ; we copy the filename we got onto the stack, uppercase it and use this
+ ; one to open the iocb
+ ; we're using tmp3, ptr4
- ; save the original pointer
- sta ptr4
- stx ptr4+1
+ ; save the original pointer
+ sta ptr4
+ stx ptr4+1
-.ifdef DEFAULT_DEVICE
- ldy #1
- sty tmp2 ; initialize flag: device present in passed string
- lda #':'
- cmp (ptr4),y
- beq hasdev
- iny
- cmp (ptr4),y
- beq hasdev
- sta tmp2 ; set flag: no device in passed string
+.ifdef DEFAULT_DEVICE
+ ldy #1
+ sty tmp2 ; initialize flag: device present in passed string
+ lda #':'
+ cmp (ptr4),y
+ beq hasdev
+ iny
+ cmp (ptr4),y
+ beq hasdev
+ sta tmp2 ; set flag: no device in passed string
hasdev:
.endif
- ldy #128
- sty tmp3 ; save size
- jsr subysp ; make room on the stack
+ ldy #128
+ sty tmp3 ; save size
+ jsr subysp ; make room on the stack
- ; copy filename to the temp. place on the stack, also uppercasing it
- ldy #0
+ ; copy filename to the temp. place on the stack, also uppercasing it
+ ldy #0
-loop2: lda (ptr4),y
- sta (sp),y
- beq copy_end
- bmi L1 ; Not lowercase (also, invalid, should reject)
- cmp #'a'
- bcc L1 ; Not lowercase
- and #$DF ; make upper case char, assume ASCII chars
- sta (sp),y ; store back
+loop2: lda (ptr4),y
+ sta (sp),y
+ beq copy_end
+ bmi L1 ; Not lowercase (also, invalid, should reject)
+ cmp #'a'
+ bcc L1 ; Not lowercase
+ and #$DF ; make upper case char, assume ASCII chars
+ sta (sp),y ; store back
L1:
- iny
- bpl loop2 ; bpl: this way we only support a max. length of 127
+ iny
+ bpl loop2 ; bpl: this way we only support a max. length of 127
- ; Filename too long
- jsr addysp ; restore the stack
- sec ; indicate error
- rts
+ ; Filename too long
+ jsr addysp ; restore the stack
+ sec ; indicate error
+ rts
copy_end:
-.ifdef DEFAULT_DEVICE
- lda tmp2
- cmp #1 ; was device present in passed string?
- beq hasdev2 ; yes, don't prepend something
+.ifdef DEFAULT_DEVICE
+ lda tmp2
+ cmp #1 ; was device present in passed string?
+ beq hasdev2 ; yes, don't prepend something
- ldy #128+3 ; no, prepend "D:" (or other device)
- sty tmp3 ; adjust stack size used
- ldy #3
- jsr subysp ; adjust stack pointer
- dey
-cpdev: lda __defdev,y
- sta (sp),y ; insert device name, number and ':'
- dey
- bpl cpdev
+ ldy #128+3 ; no, prepend "D:" (or other device)
+ sty tmp3 ; adjust stack size used
+ ldy #3
+ jsr subysp ; adjust stack pointer
+ dey
+cpdev: lda __defdev,y
+ sta (sp),y ; insert device name, number and ':'
+ dey
+ bpl cpdev
hasdev2:
.endif
- ; leave A and X pointing to the modified filename
- lda sp
- ldx sp+1
- clc ; indicate success
- rts
+ ; leave A and X pointing to the modified filename
+ lda sp
+ ldx sp+1
+ clc ; indicate success
+ rts
.endproc
diff --git a/libsrc/atari/wherex.s b/libsrc/atari/wherex.s
index c3e24c50e..1b72199a2 100644
--- a/libsrc/atari/wherex.s
+++ b/libsrc/atari/wherex.s
@@ -4,10 +4,10 @@
; unsigned char wherex (void);
;
- .export _wherex
- .include "atari.inc"
+ .export _wherex
+ .include "atari.inc"
_wherex:
- lda COLCRS
- ldx #0
- rts
+ lda COLCRS
+ ldx #0
+ rts
diff --git a/libsrc/atari/wherey.s b/libsrc/atari/wherey.s
index de672b7af..f391eec17 100644
--- a/libsrc/atari/wherey.s
+++ b/libsrc/atari/wherey.s
@@ -4,10 +4,10 @@
; unsigned char wherey (void);
;
- .export _wherey
- .include "atari.inc"
+ .export _wherey
+ .include "atari.inc"
_wherey:
- lda ROWCRS
- ldx #0
- rts
+ lda ROWCRS
+ ldx #0
+ rts
diff --git a/libsrc/atari/write.s b/libsrc/atari/write.s
index 645f0f934..1452b2eee 100644
--- a/libsrc/atari/write.s
+++ b/libsrc/atari/write.s
@@ -1,29 +1,29 @@
;
; int __fastcall__ write (int fd, const void* buf, unsigned count);
;
- .include "atari.inc"
- .import __rwsetup,__do_oserror,__inviocb,__oserror
- .export _write
+ .include "atari.inc"
+ .import __rwsetup,__do_oserror,__inviocb,__oserror
+ .export _write
_write:
- jsr __rwsetup ; do common setup
- beq write9 ; if size 0, it's a no-op
- cpx #$FF ; invalid iocb?
- beq _inviocb
- lda #PUTCHR
- sta ICCOM,x
- jsr CIOV
- bpl write9
- jmp __do_oserror ; update errno
+ jsr __rwsetup ; do common setup
+ beq write9 ; if size 0, it's a no-op
+ cpx #$FF ; invalid iocb?
+ beq _inviocb
+ lda #PUTCHR
+ sta ICCOM,x
+ jsr CIOV
+ bpl write9
+ jmp __do_oserror ; update errno
write9:
- lda ICBLL,x ; get buf len low
- pha
- lda ICBLH,x ; buf len high
- tax
- lda #0
- sta __oserror ; clear system dependend error code
- pla
- rts
+ lda ICBLL,x ; get buf len low
+ pha
+ lda ICBLH,x ; buf len high
+ tax
+ lda #0
+ sta __oserror ; clear system dependend error code
+ pla
+ rts
_inviocb:
- jmp __inviocb
+ jmp __inviocb
diff --git a/libsrc/atmos/_scrsize.s b/libsrc/atmos/_scrsize.s
index 24eec248f..2dd58399d 100644
--- a/libsrc/atmos/_scrsize.s
+++ b/libsrc/atmos/_scrsize.s
@@ -4,7 +4,7 @@
; Screen size variables
;
- .export screensize
+ .export screensize
.proc screensize
diff --git a/libsrc/atmos/atmos_load.s b/libsrc/atmos/atmos_load.s
index 30d67ab93..9e86373f3 100644
--- a/libsrc/atmos/atmos_load.s
+++ b/libsrc/atmos/atmos_load.s
@@ -2,24 +2,24 @@
; based on code by Twilighte
; void __fastcall__ atmos_load(const char* name);
- .export _atmos_load
- .import store_filename
+ .export _atmos_load
+ .import store_filename
-.proc _atmos_load
+.proc _atmos_load
- sei
- jsr store_filename
- ldx #$00
- stx $02ad
- stx $02ae
- stx $025a
- stx $025b
- jsr cload_bit
- cli
- rts
+ sei
+ jsr store_filename
+ ldx #$00
+ stx $02ad
+ stx $02ae
+ stx $025a
+ stx $025b
+ jsr cload_bit
+ cli
+ rts
cload_bit:
- pha
- jmp $e874
+ pha
+ jmp $e874
.endproc
diff --git a/libsrc/atmos/atmos_save.s b/libsrc/atmos/atmos_save.s
index 7a4e68aae..0bd9e29cc 100644
--- a/libsrc/atmos/atmos_save.s
+++ b/libsrc/atmos/atmos_save.s
@@ -2,27 +2,27 @@
; based on code by Twilighte
; void __fastcall__ atmos_save(const char* name, const void* start, const void* end);
- .export _atmos_save
- .import popax, store_filename
+ .export _atmos_save
+ .import popax, store_filename
-.proc _atmos_save
+.proc _atmos_save
- sei
- sta $02ab ; file end lo
- stx $02ac ; file end hi
- jsr popax
- sta $02a9 ; file start lo
- stx $02aa ; file start hi
- jsr popax
- jsr store_filename
- lda #00
- sta $02ad
- jsr csave_bit
- cli
- rts
+ sei
+ sta $02ab ; file end lo
+ stx $02ac ; file end hi
+ jsr popax
+ sta $02a9 ; file start lo
+ stx $02aa ; file start hi
+ jsr popax
+ jsr store_filename
+ lda #00
+ sta $02ad
+ jsr csave_bit
+ cli
+ rts
csave_bit:
- php
- jmp $e92c
+ php
+ jmp $e92c
.endproc
diff --git a/libsrc/atmos/cclear.s b/libsrc/atmos/cclear.s
index 107696788..9d356a8ab 100644
--- a/libsrc/atmos/cclear.s
+++ b/libsrc/atmos/cclear.s
@@ -5,25 +5,25 @@
; void cclear (unsigned char length);
;
- .export _cclearxy, _cclear
+ .export _cclearxy, _cclear
.import setscrptr
.import rvs
- .import popax
+ .import popax
.importzp ptr2
.include "atmos.inc"
_cclearxy:
- pha ; Save the length
- jsr popax ; Get X and Y
+ pha ; Save the length
+ jsr popax ; Get X and Y
sta CURS_Y ; Store Y
stx CURS_X ; Store X
- pla ; Restore the length and run into _cclear
+ pla ; Restore the length and run into _cclear
_cclear:
- tax ; Is the length zero?
- beq @L9 ; Jump if done
+ tax ; Is the length zero?
+ beq @L9 ; Jump if done
jsr setscrptr ; Set ptr2 to screen, won't use X
lda #' '
ora rvs
@@ -33,6 +33,6 @@ _cclear:
inc ptr2+1 ; Bump high byte of screen pointer
@L2: dex
bne @L1
-@L9: rts
+@L9: rts
diff --git a/libsrc/atmos/cgetc.s b/libsrc/atmos/cgetc.s
index e64734719..38e7aa873 100644
--- a/libsrc/atmos/cgetc.s
+++ b/libsrc/atmos/cgetc.s
@@ -4,11 +4,11 @@
; char cgetc (void);
;
- .export _cgetc
+ .export _cgetc
.constructor initcgetc
- .import cursor
+ .import cursor
- .include "atmos.inc"
+ .include "atmos.inc"
diff --git a/libsrc/atmos/chline.s b/libsrc/atmos/chline.s
index 85c7b58d2..61d0f394c 100644
--- a/libsrc/atmos/chline.s
+++ b/libsrc/atmos/chline.s
@@ -5,25 +5,25 @@
; void chline (unsigned char length);
;
- .export _chlinexy, _chline
+ .export _chlinexy, _chline
.import setscrptr
.import rvs
- .import popax
+ .import popax
.importzp ptr2
.include "atmos.inc"
_chlinexy:
- pha ; Save the length
- jsr popax ; Get X and Y
+ pha ; Save the length
+ jsr popax ; Get X and Y
sta CURS_Y ; Store Y
stx CURS_X ; Store X
- pla ; Restore the length and run into _chline
+ pla ; Restore the length and run into _chline
_chline:
- tax ; Is the length zero?
- beq @L9 ; Jump if done
+ tax ; Is the length zero?
+ beq @L9 ; Jump if done
jsr setscrptr ; Set ptr2 to screen, won't use X
txa ; Length into A
clc
@@ -37,5 +37,5 @@ _chline:
inc ptr2+1 ; Bump high byte of screen pointer
@L2: dex
bne @L1
-@L9: rts
+@L9: rts
diff --git a/libsrc/atmos/clock.s b/libsrc/atmos/clock.s
index 56573a56a..4440f557d 100644
--- a/libsrc/atmos/clock.s
+++ b/libsrc/atmos/clock.s
@@ -4,14 +4,14 @@
; clock_t clock (void);
;
- .export _clock
+ .export _clock
.import negax
- .importzp sreg
+ .importzp sreg
- .include "atmos.inc"
+ .include "atmos.inc"
-.proc _clock
+.proc _clock
; Clear the timer high 16 bits
diff --git a/libsrc/atmos/clrscr.s b/libsrc/atmos/clrscr.s
index 4f9a3486a..9dce665e9 100644
--- a/libsrc/atmos/clrscr.s
+++ b/libsrc/atmos/clrscr.s
@@ -2,15 +2,15 @@
; Ullrich von Bassewitz, 2003-04-13
;
- .export _clrscr
+ .export _clrscr
.importzp ptr2
- .include "atmos.inc"
+ .include "atmos.inc"
; ------------------------------------------------------------------------
; void clrscr (void);
-.proc _clrscr
+.proc _clrscr
; Set the cursor to top left cursor position
diff --git a/libsrc/atmos/color.s b/libsrc/atmos/color.s
index 3a73ee5f2..8c9dfba9e 100644
--- a/libsrc/atmos/color.s
+++ b/libsrc/atmos/color.s
@@ -6,13 +6,13 @@
; unsigned char __fastcall__ bordercolor (unsigned char color);
;
- .export _textcolor, _bgcolor, _bordercolor
+ .export _textcolor, _bgcolor, _bordercolor
.import return0, return1
-_textcolor = return1
+_textcolor = return1
-_bgcolor = return0
+_bgcolor = return0
-_bordercolor = return0
+_bordercolor = return0
diff --git a/libsrc/atmos/cputc.s b/libsrc/atmos/cputc.s
index 6d4f17bdb..9f65be500 100644
--- a/libsrc/atmos/cputc.s
+++ b/libsrc/atmos/cputc.s
@@ -5,34 +5,34 @@
; void cputc (char c);
;
- .export _cputcxy, _cputc
- .export setscrptr, putchar
+ .export _cputcxy, _cputc
+ .export setscrptr, putchar
.import rvs
- .import popax
+ .import popax
.importzp ptr2
- .include "atmos.inc"
+ .include "atmos.inc"
_cputcxy:
- pha ; Save C
- jsr popax ; Get X and Y
+ pha ; Save C
+ jsr popax ; Get X and Y
sta CURS_Y ; Store Y
stx CURS_X ; Store X
- pla ; Restore C
+ pla ; Restore C
; Plot a character - also used as internal function
-_cputc: cmp #$0D ; CR?
- bne L1
- lda #0
- sta CURS_X ; Carriage return
+_cputc: cmp #$0D ; CR?
+ bne L1
+ lda #0
+ sta CURS_X ; Carriage return
rts
-L1: cmp #$0A ; LF?
- bne output
- inc CURS_Y ; Newline
- rts
+L1: cmp #$0A ; LF?
+ bne output
+ inc CURS_Y ; Newline
+ rts
; Output the character, then advance the cursor position
@@ -40,13 +40,13 @@ output:
jsr putchar
advance:
- iny
- cpy #40
- bne L3
- inc CURS_Y ; new line
- ldy #0 ; + cr
-L3: sty CURS_X
- rts
+ iny
+ cpy #40
+ bne L3
+ inc CURS_Y ; new line
+ ldy #0 ; + cr
+L3: sty CURS_X
+ rts
; ------------------------------------------------------------------------
; Set ptr2 to the screen, load the X offset into Y
@@ -59,7 +59,7 @@ L3: sty CURS_X
sta ptr2
lda ScrTabHi,y ; Get high byte of line address
sta ptr2+1
- ldy CURS_X ; Get X offset
+ ldy CURS_X ; Get X offset
rts
.endproc
@@ -71,12 +71,12 @@ L3: sty CURS_X
.code
.proc putchar
- ora rvs ; Set revers bit
+ ora rvs ; Set revers bit
pha ; And save
jsr setscrptr ; Set ptr2 to the screen
pla ; Restore the character
- sta (ptr2),y ; Set char
- rts
+ sta (ptr2),y ; Set char
+ rts
.endproc
diff --git a/libsrc/atmos/crt0.s b/libsrc/atmos/crt0.s
index d88e4c3ff..1588cbec0 100644
--- a/libsrc/atmos/crt0.s
+++ b/libsrc/atmos/crt0.s
@@ -4,110 +4,110 @@
; By Debrune Jérôme and Ullrich von Bassewitz
;
- .export _exit
- .export __STARTUP__ : absolute = 1 ; Mark as startup
- .import initlib, donelib
- .import callmain, zerobss
- .import __RAM_START__, __RAM_SIZE__
- .import __ZPSAVE_LOAD__, __STACKSIZE__
+ .export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
+ .import initlib, donelib
+ .import callmain, zerobss
+ .import __RAM_START__, __RAM_SIZE__
+ .import __ZPSAVE_LOAD__, __STACKSIZE__
- .include "zeropage.inc"
- .include "atmos.inc"
+ .include "zeropage.inc"
+ .include "atmos.inc"
; ------------------------------------------------------------------------
; Oric tape header
-.segment "TAPEHDR"
+.segment "TAPEHDR"
- .byte $16, $16, $16 ; Sync bytes
- .byte $24 ; End of header marker
+ .byte $16, $16, $16 ; Sync bytes
+ .byte $24 ; End of header marker
- .byte $00 ; $2B0
- .byte $00 ; $2AF
- .byte $80 ; $2AE Machine code flag
- .byte $C7 ; $2AD Autoload flag
- .dbyt __ZPSAVE_LOAD__ - 1 ; $2AB
- .dbyt __RAM_START__ ; $2A9
- .byte $00 ; $2A8
- .byte ((.VERSION >> 8) & $0F) + '0'
- .byte ((.VERSION >> 4) & $0F) + '0'
- .byte (.VERSION & $0F) + '0'
- .byte $00 ; Zero terminated compiler version
+ .byte $00 ; $2B0
+ .byte $00 ; $2AF
+ .byte $80 ; $2AE Machine code flag
+ .byte $C7 ; $2AD Autoload flag
+ .dbyt __ZPSAVE_LOAD__ - 1 ; $2AB
+ .dbyt __RAM_START__ ; $2A9
+ .byte $00 ; $2A8
+ .byte ((.VERSION >> 8) & $0F) + '0'
+ .byte ((.VERSION >> 4) & $0F) + '0'
+ .byte (.VERSION & $0F) + '0'
+ .byte $00 ; Zero terminated compiler version
; ------------------------------------------------------------------------
; Place the startup code in a special segment.
-.segment "STARTUP"
+.segment "STARTUP"
; Save the zero page area we're about to use
- ldx #zpspace-1
-L1: lda sp,x
- sta zpsave,x ; Save the zero page locations we need
- dex
- bpl L1
+ ldx #zpspace-1
+L1: lda sp,x
+ sta zpsave,x ; Save the zero page locations we need
+ dex
+ bpl L1
; Clear the BSS data
- jsr zerobss
+ jsr zerobss
; Unprotect columns 0 and 1
- lda STATUS
- sta stsave
- and #%11011111
- sta STATUS
+ lda STATUS
+ sta stsave
+ and #%11011111
+ sta STATUS
; Save system stuff and setup the stack
- tsx
- stx spsave ; Save system stk ptr
+ tsx
+ stx spsave ; Save system stk ptr
- lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
- sta sp
- lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
- sta sp+1 ; Set argument stack ptr
+ lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+ sta sp
+ lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+ sta sp+1 ; Set argument stack ptr
; Call module constructors
- jsr initlib
+ jsr initlib
; Push arguments and call main()
- jsr callmain
+ jsr callmain
; Call module destructors. This is also the _exit entry.
-_exit: jsr donelib ; Run module destructors
+_exit: jsr donelib ; Run module destructors
; Restore system stuff
- ldx spsave
- txs
- lda stsave
- sta STATUS
+ ldx spsave
+ txs
+ lda stsave
+ sta STATUS
; Copy back the zero page stuff
- ldx #zpspace-1
-L2: lda zpsave,x
- sta sp,x
- dex
- bpl L2
+ ldx #zpspace-1
+L2: lda zpsave,x
+ sta sp,x
+ dex
+ bpl L2
; Back to BASIC
- rts
+ rts
; ------------------------------------------------------------------------
-.segment "ZPSAVE"
+.segment "ZPSAVE"
-zpsave: .res zpspace
+zpsave: .res zpspace
; ------------------------------------------------------------------------
.bss
-spsave: .res 1
-stsave: .res 1
+spsave: .res 1
+stsave: .res 1
diff --git a/libsrc/atmos/ctype.s b/libsrc/atmos/ctype.s
index 15b7ea935..79edafbb2 100644
--- a/libsrc/atmos/ctype.s
+++ b/libsrc/atmos/ctype.s
@@ -33,267 +33,267 @@
; 6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v')
; 7 - Space or tab character
- .export __ctype
+ .export __ctype
__ctype:
- .byte $10 ; 0/00 ___ctrl_@___
- .byte $10 ; 1/01 ___ctrl_A___
- .byte $10 ; 2/02 ___ctrl_B___
- .byte $10 ; 3/03 ___ctrl_C___
- .byte $10 ; 4/04 ___ctrl_D___
- .byte $10 ; 5/05 ___ctrl_E___
- .byte $10 ; 6/06 ___ctrl_F___
- .byte $10 ; 7/07 ___ctrl_G___
- .byte $10 ; 8/08 ___ctrl_H___
- .byte $D0 ; 9/09 ___ctrl_I___
- .byte $50 ; 10/0a ___ctrl_J___
- .byte $50 ; 11/0b ___ctrl_K___
- .byte $50 ; 12/0c ___ctrl_L___
- .byte $50 ; 13/0d ___ctrl_M___
- .byte $10 ; 14/0e ___ctrl_N___
- .byte $10 ; 15/0f ___ctrl_O___
- .byte $10 ; 16/10 ___ctrl_P___
- .byte $10 ; 17/11 ___ctrl_Q___
- .byte $10 ; 18/12 ___ctrl_R___
- .byte $10 ; 19/13 ___ctrl_S___
- .byte $10 ; 20/14 ___ctrl_T___
- .byte $10 ; 21/15 ___ctrl_U___
- .byte $10 ; 22/16 ___ctrl_V___
- .byte $10 ; 23/17 ___ctrl_W___
- .byte $10 ; 24/18 ___ctrl_X___
- .byte $10 ; 25/19 ___ctrl_Y___
- .byte $10 ; 26/1a ___ctrl_Z___
- .byte $10 ; 27/1b ___ctrl_[___
- .byte $10 ; 28/1c ___ctrl_\___
- .byte $10 ; 29/1d ___ctrl_]___
- .byte $10 ; 30/1e ___ctrl_^___
- .byte $10 ; 31/1f ___ctrl_____
- .byte $A0 ; 32/20 ___SPACE___
- .byte $00 ; 33/21 _____!_____
- .byte $00 ; 34/22 _____"_____
- .byte $00 ; 35/23 _____#_____
- .byte $00 ; 36/24 _____$_____
- .byte $00 ; 37/25 _____%_____
- .byte $00 ; 38/26 _____&_____
- .byte $00 ; 39/27 _____'_____
- .byte $00 ; 40/28 _____(_____
- .byte $00 ; 41/29 _____)_____
- .byte $00 ; 42/2a _____*_____
- .byte $00 ; 43/2b _____+_____
- .byte $00 ; 44/2c _____,_____
- .byte $00 ; 45/2d _____-_____
- .byte $00 ; 46/2e _____._____
- .byte $00 ; 47/2f _____/_____
- .byte $0C ; 48/30 _____0_____
- .byte $0C ; 49/31 _____1_____
- .byte $0C ; 50/32 _____2_____
- .byte $0C ; 51/33 _____3_____
- .byte $0C ; 52/34 _____4_____
- .byte $0C ; 53/35 _____5_____
- .byte $0C ; 54/36 _____6_____
- .byte $0C ; 55/37 _____7_____
- .byte $0C ; 56/38 _____8_____
- .byte $0C ; 57/39 _____9_____
- .byte $00 ; 58/3a _____:_____
- .byte $00 ; 59/3b _____;_____
- .byte $00 ; 60/3c _____<_____
- .byte $00 ; 61/3d _____=_____
- .byte $00 ; 62/3e _____>_____
- .byte $00 ; 63/3f _____?_____
+ .byte $10 ; 0/00 ___ctrl_@___
+ .byte $10 ; 1/01 ___ctrl_A___
+ .byte $10 ; 2/02 ___ctrl_B___
+ .byte $10 ; 3/03 ___ctrl_C___
+ .byte $10 ; 4/04 ___ctrl_D___
+ .byte $10 ; 5/05 ___ctrl_E___
+ .byte $10 ; 6/06 ___ctrl_F___
+ .byte $10 ; 7/07 ___ctrl_G___
+ .byte $10 ; 8/08 ___ctrl_H___
+ .byte $D0 ; 9/09 ___ctrl_I___
+ .byte $50 ; 10/0a ___ctrl_J___
+ .byte $50 ; 11/0b ___ctrl_K___
+ .byte $50 ; 12/0c ___ctrl_L___
+ .byte $50 ; 13/0d ___ctrl_M___
+ .byte $10 ; 14/0e ___ctrl_N___
+ .byte $10 ; 15/0f ___ctrl_O___
+ .byte $10 ; 16/10 ___ctrl_P___
+ .byte $10 ; 17/11 ___ctrl_Q___
+ .byte $10 ; 18/12 ___ctrl_R___
+ .byte $10 ; 19/13 ___ctrl_S___
+ .byte $10 ; 20/14 ___ctrl_T___
+ .byte $10 ; 21/15 ___ctrl_U___
+ .byte $10 ; 22/16 ___ctrl_V___
+ .byte $10 ; 23/17 ___ctrl_W___
+ .byte $10 ; 24/18 ___ctrl_X___
+ .byte $10 ; 25/19 ___ctrl_Y___
+ .byte $10 ; 26/1a ___ctrl_Z___
+ .byte $10 ; 27/1b ___ctrl_[___
+ .byte $10 ; 28/1c ___ctrl_\___
+ .byte $10 ; 29/1d ___ctrl_]___
+ .byte $10 ; 30/1e ___ctrl_^___
+ .byte $10 ; 31/1f ___ctrl_____
+ .byte $A0 ; 32/20 ___SPACE___
+ .byte $00 ; 33/21 _____!_____
+ .byte $00 ; 34/22 _____"_____
+ .byte $00 ; 35/23 _____#_____
+ .byte $00 ; 36/24 _____$_____
+ .byte $00 ; 37/25 _____%_____
+ .byte $00 ; 38/26 _____&_____
+ .byte $00 ; 39/27 _____'_____
+ .byte $00 ; 40/28 _____(_____
+ .byte $00 ; 41/29 _____)_____
+ .byte $00 ; 42/2a _____*_____
+ .byte $00 ; 43/2b _____+_____
+ .byte $00 ; 44/2c _____,_____
+ .byte $00 ; 45/2d _____-_____
+ .byte $00 ; 46/2e _____._____
+ .byte $00 ; 47/2f _____/_____
+ .byte $0C ; 48/30 _____0_____
+ .byte $0C ; 49/31 _____1_____
+ .byte $0C ; 50/32 _____2_____
+ .byte $0C ; 51/33 _____3_____
+ .byte $0C ; 52/34 _____4_____
+ .byte $0C ; 53/35 _____5_____
+ .byte $0C ; 54/36 _____6_____
+ .byte $0C ; 55/37 _____7_____
+ .byte $0C ; 56/38 _____8_____
+ .byte $0C ; 57/39 _____9_____
+ .byte $00 ; 58/3a _____:_____
+ .byte $00 ; 59/3b _____;_____
+ .byte $00 ; 60/3c _____<_____
+ .byte $00 ; 61/3d _____=_____
+ .byte $00 ; 62/3e _____>_____
+ .byte $00 ; 63/3f _____?_____
- .byte $00 ; 64/40 _____@_____
- .byte $0A ; 65/41 _____A_____
- .byte $0A ; 66/42 _____B_____
- .byte $0A ; 67/43 _____C_____
- .byte $0A ; 68/44 _____D_____
- .byte $0A ; 69/45 _____E_____
- .byte $0A ; 70/46 _____F_____
- .byte $02 ; 71/47 _____G_____
- .byte $02 ; 72/48 _____H_____
- .byte $02 ; 73/49 _____I_____
- .byte $02 ; 74/4a _____J_____
- .byte $02 ; 75/4b _____K_____
- .byte $02 ; 76/4c _____L_____
- .byte $02 ; 77/4d _____M_____
- .byte $02 ; 78/4e _____N_____
- .byte $02 ; 79/4f _____O_____
- .byte $02 ; 80/50 _____P_____
- .byte $02 ; 81/51 _____Q_____
- .byte $02 ; 82/52 _____R_____
- .byte $02 ; 83/53 _____S_____
- .byte $02 ; 84/54 _____T_____
- .byte $02 ; 85/55 _____U_____
- .byte $02 ; 86/56 _____V_____
- .byte $02 ; 87/57 _____W_____
- .byte $02 ; 88/58 _____X_____
- .byte $02 ; 89/59 _____Y_____
- .byte $02 ; 90/5a _____Z_____
- .byte $00 ; 91/5b _____[_____
- .byte $00 ; 92/5c _____\_____
- .byte $00 ; 93/5d _____]_____
- .byte $00 ; 94/5e _____^_____
- .byte $00 ; 95/5f _UNDERLINE_
- .byte $00 ; 96/60 ___grave___
- .byte $09 ; 97/61 _____a_____
- .byte $09 ; 98/62 _____b_____
- .byte $09 ; 99/63 _____c_____
- .byte $09 ; 100/64 _____d_____
- .byte $09 ; 101/65 _____e_____
- .byte $09 ; 102/66 _____f_____
- .byte $01 ; 103/67 _____g_____
- .byte $01 ; 104/68 _____h_____
- .byte $01 ; 105/69 _____i_____
- .byte $01 ; 106/6a _____j_____
- .byte $01 ; 107/6b _____k_____
- .byte $01 ; 108/6c _____l_____
- .byte $01 ; 109/6d _____m_____
- .byte $01 ; 110/6e _____n_____
- .byte $01 ; 111/6f _____o_____
- .byte $01 ; 112/70 _____p_____
- .byte $01 ; 113/71 _____q_____
- .byte $01 ; 114/72 _____r_____
- .byte $01 ; 115/73 _____s_____
- .byte $01 ; 116/74 _____t_____
- .byte $01 ; 117/75 _____u_____
- .byte $01 ; 118/76 _____v_____
- .byte $01 ; 119/77 _____w_____
- .byte $01 ; 120/78 _____x_____
- .byte $01 ; 121/79 _____y_____
- .byte $01 ; 122/7a _____z_____
- .byte $00 ; 123/7b _____{_____
- .byte $00 ; 124/7c _____|_____
- .byte $00 ; 125/7d _____}_____
- .byte $00 ; 126/7e _____~_____
- .byte $40 ; 127/7f ____DEL____
+ .byte $00 ; 64/40 _____@_____
+ .byte $0A ; 65/41 _____A_____
+ .byte $0A ; 66/42 _____B_____
+ .byte $0A ; 67/43 _____C_____
+ .byte $0A ; 68/44 _____D_____
+ .byte $0A ; 69/45 _____E_____
+ .byte $0A ; 70/46 _____F_____
+ .byte $02 ; 71/47 _____G_____
+ .byte $02 ; 72/48 _____H_____
+ .byte $02 ; 73/49 _____I_____
+ .byte $02 ; 74/4a _____J_____
+ .byte $02 ; 75/4b _____K_____
+ .byte $02 ; 76/4c _____L_____
+ .byte $02 ; 77/4d _____M_____
+ .byte $02 ; 78/4e _____N_____
+ .byte $02 ; 79/4f _____O_____
+ .byte $02 ; 80/50 _____P_____
+ .byte $02 ; 81/51 _____Q_____
+ .byte $02 ; 82/52 _____R_____
+ .byte $02 ; 83/53 _____S_____
+ .byte $02 ; 84/54 _____T_____
+ .byte $02 ; 85/55 _____U_____
+ .byte $02 ; 86/56 _____V_____
+ .byte $02 ; 87/57 _____W_____
+ .byte $02 ; 88/58 _____X_____
+ .byte $02 ; 89/59 _____Y_____
+ .byte $02 ; 90/5a _____Z_____
+ .byte $00 ; 91/5b _____[_____
+ .byte $00 ; 92/5c _____\_____
+ .byte $00 ; 93/5d _____]_____
+ .byte $00 ; 94/5e _____^_____
+ .byte $00 ; 95/5f _UNDERLINE_
+ .byte $00 ; 96/60 ___grave___
+ .byte $09 ; 97/61 _____a_____
+ .byte $09 ; 98/62 _____b_____
+ .byte $09 ; 99/63 _____c_____
+ .byte $09 ; 100/64 _____d_____
+ .byte $09 ; 101/65 _____e_____
+ .byte $09 ; 102/66 _____f_____
+ .byte $01 ; 103/67 _____g_____
+ .byte $01 ; 104/68 _____h_____
+ .byte $01 ; 105/69 _____i_____
+ .byte $01 ; 106/6a _____j_____
+ .byte $01 ; 107/6b _____k_____
+ .byte $01 ; 108/6c _____l_____
+ .byte $01 ; 109/6d _____m_____
+ .byte $01 ; 110/6e _____n_____
+ .byte $01 ; 111/6f _____o_____
+ .byte $01 ; 112/70 _____p_____
+ .byte $01 ; 113/71 _____q_____
+ .byte $01 ; 114/72 _____r_____
+ .byte $01 ; 115/73 _____s_____
+ .byte $01 ; 116/74 _____t_____
+ .byte $01 ; 117/75 _____u_____
+ .byte $01 ; 118/76 _____v_____
+ .byte $01 ; 119/77 _____w_____
+ .byte $01 ; 120/78 _____x_____
+ .byte $01 ; 121/79 _____y_____
+ .byte $01 ; 122/7a _____z_____
+ .byte $00 ; 123/7b _____{_____
+ .byte $00 ; 124/7c _____|_____
+ .byte $00 ; 125/7d _____}_____
+ .byte $00 ; 126/7e _____~_____
+ .byte $40 ; 127/7f ____DEL____
- .byte $00 ; 128/80 ___________
- .byte $00 ; 129/81 ___________
- .byte $00 ; 130/82 ___________
- .byte $00 ; 131/83 ___________
- .byte $00 ; 132/84 ___________
- .byte $00 ; 133/85 ___________
- .byte $00 ; 134/86 ___________
- .byte $00 ; 135/87 ___________
- .byte $00 ; 136/88 ___________
- .byte $00 ; 137/89 ___________
- .byte $00 ; 138/8a ___________
- .byte $00 ; 139/8b ___________
- .byte $00 ; 140/8c ___________
- .byte $00 ; 141/8d ___________
- .byte $00 ; 142/8e ___________
- .byte $00 ; 143/8f ___________
- .byte $00 ; 144/90 ___________
- .byte $00 ; 145/91 ___________
- .byte $00 ; 146/92 ___________
- .byte $10 ; 147/93 ___________
- .byte $00 ; 148/94 ___________
- .byte $00 ; 149/95 ___________
- .byte $00 ; 150/96 ___________
- .byte $00 ; 151/97 ___________
- .byte $00 ; 152/98 ___________
- .byte $00 ; 153/99 ___________
- .byte $00 ; 154/9a ___________
- .byte $00 ; 155/9b ___________
- .byte $00 ; 156/9c ___________
- .byte $00 ; 157/9d ___________
- .byte $00 ; 158/9e ___________
- .byte $00 ; 159/9f ___________
+ .byte $00 ; 128/80 ___________
+ .byte $00 ; 129/81 ___________
+ .byte $00 ; 130/82 ___________
+ .byte $00 ; 131/83 ___________
+ .byte $00 ; 132/84 ___________
+ .byte $00 ; 133/85 ___________
+ .byte $00 ; 134/86 ___________
+ .byte $00 ; 135/87 ___________
+ .byte $00 ; 136/88 ___________
+ .byte $00 ; 137/89 ___________
+ .byte $00 ; 138/8a ___________
+ .byte $00 ; 139/8b ___________
+ .byte $00 ; 140/8c ___________
+ .byte $00 ; 141/8d ___________
+ .byte $00 ; 142/8e ___________
+ .byte $00 ; 143/8f ___________
+ .byte $00 ; 144/90 ___________
+ .byte $00 ; 145/91 ___________
+ .byte $00 ; 146/92 ___________
+ .byte $10 ; 147/93 ___________
+ .byte $00 ; 148/94 ___________
+ .byte $00 ; 149/95 ___________
+ .byte $00 ; 150/96 ___________
+ .byte $00 ; 151/97 ___________
+ .byte $00 ; 152/98 ___________
+ .byte $00 ; 153/99 ___________
+ .byte $00 ; 154/9a ___________
+ .byte $00 ; 155/9b ___________
+ .byte $00 ; 156/9c ___________
+ .byte $00 ; 157/9d ___________
+ .byte $00 ; 158/9e ___________
+ .byte $00 ; 159/9f ___________
- .byte $00 ; 160/a0 ___________
- .byte $00 ; 161/a1 ___________
- .byte $00 ; 162/a2 ___________
- .byte $00 ; 163/a3 ___________
- .byte $00 ; 164/a4 ___________
- .byte $00 ; 165/a5 ___________
- .byte $00 ; 166/a6 ___________
- .byte $00 ; 167/a7 ___________
- .byte $00 ; 168/a8 ___________
- .byte $00 ; 169/a9 ___________
- .byte $00 ; 170/aa ___________
- .byte $00 ; 171/ab ___________
- .byte $00 ; 172/ac ___________
- .byte $00 ; 173/ad ___________
- .byte $00 ; 174/ae ___________
- .byte $00 ; 175/af ___________
- .byte $00 ; 176/b0 ___________
- .byte $00 ; 177/b1 ___________
- .byte $00 ; 178/b2 ___________
- .byte $00 ; 179/b3 ___________
- .byte $00 ; 180/b4 ___________
- .byte $00 ; 181/b5 ___________
- .byte $00 ; 182/b6 ___________
- .byte $00 ; 183/b7 ___________
- .byte $00 ; 184/b8 ___________
- .byte $00 ; 185/b9 ___________
- .byte $00 ; 186/ba ___________
- .byte $00 ; 187/bb ___________
- .byte $00 ; 188/bc ___________
- .byte $00 ; 189/bd ___________
- .byte $00 ; 190/be ___________
- .byte $00 ; 191/bf ___________
+ .byte $00 ; 160/a0 ___________
+ .byte $00 ; 161/a1 ___________
+ .byte $00 ; 162/a2 ___________
+ .byte $00 ; 163/a3 ___________
+ .byte $00 ; 164/a4 ___________
+ .byte $00 ; 165/a5 ___________
+ .byte $00 ; 166/a6 ___________
+ .byte $00 ; 167/a7 ___________
+ .byte $00 ; 168/a8 ___________
+ .byte $00 ; 169/a9 ___________
+ .byte $00 ; 170/aa ___________
+ .byte $00 ; 171/ab ___________
+ .byte $00 ; 172/ac ___________
+ .byte $00 ; 173/ad ___________
+ .byte $00 ; 174/ae ___________
+ .byte $00 ; 175/af ___________
+ .byte $00 ; 176/b0 ___________
+ .byte $00 ; 177/b1 ___________
+ .byte $00 ; 178/b2 ___________
+ .byte $00 ; 179/b3 ___________
+ .byte $00 ; 180/b4 ___________
+ .byte $00 ; 181/b5 ___________
+ .byte $00 ; 182/b6 ___________
+ .byte $00 ; 183/b7 ___________
+ .byte $00 ; 184/b8 ___________
+ .byte $00 ; 185/b9 ___________
+ .byte $00 ; 186/ba ___________
+ .byte $00 ; 187/bb ___________
+ .byte $00 ; 188/bc ___________
+ .byte $00 ; 189/bd ___________
+ .byte $00 ; 190/be ___________
+ .byte $00 ; 191/bf ___________
- .byte $02 ; 192/c0 ___________
- .byte $02 ; 193/c1 ___________
- .byte $02 ; 194/c2 ___________
- .byte $02 ; 195/c3 ___________
- .byte $02 ; 196/c4 ___________
- .byte $02 ; 197/c5 ___________
- .byte $02 ; 198/c6 ___________
- .byte $02 ; 199/c7 ___________
- .byte $02 ; 200/c8 ___________
- .byte $02 ; 201/c9 ___________
- .byte $02 ; 202/ca ___________
- .byte $02 ; 203/cb ___________
- .byte $02 ; 204/cc ___________
- .byte $02 ; 205/cd ___________
- .byte $02 ; 206/ce ___________
- .byte $02 ; 207/cf ___________
- .byte $02 ; 208/d0 ___________
- .byte $02 ; 209/d1 ___________
- .byte $02 ; 210/d2 ___________
- .byte $02 ; 211/d3 ___________
- .byte $02 ; 212/d4 ___________
- .byte $02 ; 213/d5 ___________
- .byte $02 ; 214/d6 ___________
- .byte $02 ; 215/d7 ___________
- .byte $02 ; 216/d8 ___________
- .byte $02 ; 217/d9 ___________
- .byte $02 ; 218/da ___________
- .byte $02 ; 219/db ___________
- .byte $02 ; 220/dc ___________
- .byte $02 ; 221/dd ___________
- .byte $02 ; 222/de ___________
- .byte $00 ; 223/df ___________
- .byte $01 ; 224/e0 ___________
- .byte $01 ; 225/e1 ___________
- .byte $01 ; 226/e2 ___________
- .byte $01 ; 227/e3 ___________
- .byte $01 ; 228/e4 ___________
- .byte $01 ; 229/e5 ___________
- .byte $01 ; 230/e6 ___________
- .byte $01 ; 231/e7 ___________
- .byte $01 ; 232/e8 ___________
- .byte $01 ; 233/e9 ___________
- .byte $01 ; 234/ea ___________
- .byte $01 ; 235/eb ___________
- .byte $01 ; 236/ec ___________
- .byte $01 ; 237/ed ___________
- .byte $01 ; 238/ee ___________
- .byte $01 ; 239/ef ___________
- .byte $01 ; 240/f0 ___________
- .byte $01 ; 241/f1 ___________
- .byte $01 ; 242/f2 ___________
- .byte $01 ; 243/f3 ___________
- .byte $01 ; 244/f4 ___________
- .byte $01 ; 245/f5 ___________
- .byte $01 ; 246/f6 ___________
- .byte $01 ; 247/f7 ___________
- .byte $01 ; 248/f8 ___________
- .byte $01 ; 249/f9 ___________
- .byte $01 ; 250/fa ___________
- .byte $01 ; 251/fb ___________
- .byte $01 ; 252/fc ___________
- .byte $01 ; 253/fd ___________
- .byte $01 ; 254/fe ___________
- .byte $00 ; 255/ff ___________
+ .byte $02 ; 192/c0 ___________
+ .byte $02 ; 193/c1 ___________
+ .byte $02 ; 194/c2 ___________
+ .byte $02 ; 195/c3 ___________
+ .byte $02 ; 196/c4 ___________
+ .byte $02 ; 197/c5 ___________
+ .byte $02 ; 198/c6 ___________
+ .byte $02 ; 199/c7 ___________
+ .byte $02 ; 200/c8 ___________
+ .byte $02 ; 201/c9 ___________
+ .byte $02 ; 202/ca ___________
+ .byte $02 ; 203/cb ___________
+ .byte $02 ; 204/cc ___________
+ .byte $02 ; 205/cd ___________
+ .byte $02 ; 206/ce ___________
+ .byte $02 ; 207/cf ___________
+ .byte $02 ; 208/d0 ___________
+ .byte $02 ; 209/d1 ___________
+ .byte $02 ; 210/d2 ___________
+ .byte $02 ; 211/d3 ___________
+ .byte $02 ; 212/d4 ___________
+ .byte $02 ; 213/d5 ___________
+ .byte $02 ; 214/d6 ___________
+ .byte $02 ; 215/d7 ___________
+ .byte $02 ; 216/d8 ___________
+ .byte $02 ; 217/d9 ___________
+ .byte $02 ; 218/da ___________
+ .byte $02 ; 219/db ___________
+ .byte $02 ; 220/dc ___________
+ .byte $02 ; 221/dd ___________
+ .byte $02 ; 222/de ___________
+ .byte $00 ; 223/df ___________
+ .byte $01 ; 224/e0 ___________
+ .byte $01 ; 225/e1 ___________
+ .byte $01 ; 226/e2 ___________
+ .byte $01 ; 227/e3 ___________
+ .byte $01 ; 228/e4 ___________
+ .byte $01 ; 229/e5 ___________
+ .byte $01 ; 230/e6 ___________
+ .byte $01 ; 231/e7 ___________
+ .byte $01 ; 232/e8 ___________
+ .byte $01 ; 233/e9 ___________
+ .byte $01 ; 234/ea ___________
+ .byte $01 ; 235/eb ___________
+ .byte $01 ; 236/ec ___________
+ .byte $01 ; 237/ed ___________
+ .byte $01 ; 238/ee ___________
+ .byte $01 ; 239/ef ___________
+ .byte $01 ; 240/f0 ___________
+ .byte $01 ; 241/f1 ___________
+ .byte $01 ; 242/f2 ___________
+ .byte $01 ; 243/f3 ___________
+ .byte $01 ; 244/f4 ___________
+ .byte $01 ; 245/f5 ___________
+ .byte $01 ; 246/f6 ___________
+ .byte $01 ; 247/f7 ___________
+ .byte $01 ; 248/f8 ___________
+ .byte $01 ; 249/f9 ___________
+ .byte $01 ; 250/fa ___________
+ .byte $01 ; 251/fb ___________
+ .byte $01 ; 252/fc ___________
+ .byte $01 ; 253/fd ___________
+ .byte $01 ; 254/fe ___________
+ .byte $00 ; 255/ff ___________
diff --git a/libsrc/atmos/cvline.s b/libsrc/atmos/cvline.s
index 09eea4caa..ca41502c2 100644
--- a/libsrc/atmos/cvline.s
+++ b/libsrc/atmos/cvline.s
@@ -5,25 +5,25 @@
; void cvline (unsigned char length);
;
- .export _cvlinexy, _cvline
+ .export _cvlinexy, _cvline
.import setscrptr
.import rvs
- .import popax
+ .import popax
.importzp ptr2
.include "atmos.inc"
_cvlinexy:
- pha ; Save the length
- jsr popax ; Get X and Y
+ pha ; Save the length
+ jsr popax ; Get X and Y
sta CURS_Y ; Store Y
stx CURS_X ; Store X
- pla ; Restore the length and run into _cvline
+ pla ; Restore the length and run into _cvline
_cvline:
- tax ; Is the length zero?
- beq @L9 ; Jump if done
+ tax ; Is the length zero?
+ beq @L9 ; Jump if done
@L1: jsr setscrptr ; Set ptr2 to screen, won't use X
lda #'|'
ora rvs
@@ -31,6 +31,6 @@ _cvline:
inc CURS_Y
@L2: dex
bne @L1
-@L9: rts
+@L9: rts
diff --git a/libsrc/atmos/gotox.s b/libsrc/atmos/gotox.s
index 25ed7fbf2..6f8682722 100644
--- a/libsrc/atmos/gotox.s
+++ b/libsrc/atmos/gotox.s
@@ -4,13 +4,13 @@
; void gotox (unsigned char x);
;
- .export _gotox
+ .export _gotox
.include "atmos.inc"
.proc _gotox
- sta CURS_X ; Set X
+ sta CURS_X ; Set X
rts
.endproc
diff --git a/libsrc/atmos/gotoxy.s b/libsrc/atmos/gotoxy.s
index 26a16bb21..80d4d5251 100644
--- a/libsrc/atmos/gotoxy.s
+++ b/libsrc/atmos/gotoxy.s
@@ -4,16 +4,16 @@
; void gotoxy (unsigned char x, unsigned char y);
;
- .export _gotoxy
- .import popa
+ .export _gotoxy
+ .import popa
.include "atmos.inc"
.proc _gotoxy
- sta CURS_Y ; Set Y
- jsr popa ; Get X
- sta CURS_X ; Set X
+ sta CURS_Y ; Set Y
+ jsr popa ; Get X
+ sta CURS_X ; Set X
rts
.endproc
diff --git a/libsrc/atmos/gotoy.s b/libsrc/atmos/gotoy.s
index baa95a773..4db577755 100644
--- a/libsrc/atmos/gotoy.s
+++ b/libsrc/atmos/gotoy.s
@@ -4,13 +4,13 @@
; void gotoy (unsigned char y);
;
- .export _gotoy
+ .export _gotoy
.include "atmos.inc"
.proc _gotoy
- sta CURS_Y ; Set Y
+ sta CURS_Y ; Set Y
rts
.endproc
diff --git a/libsrc/atmos/irq.s b/libsrc/atmos/irq.s
index c022eccd4..ed443caae 100644
--- a/libsrc/atmos/irq.s
+++ b/libsrc/atmos/irq.s
@@ -2,58 +2,58 @@
; IRQ handling (Oric version)
;
- .export initirq, doneirq
- .import callirq
+ .export initirq, doneirq
+ .import callirq
- .include "atmos.inc"
+ .include "atmos.inc"
; ------------------------------------------------------------------------
-.segment "INIT"
+.segment "INIT"
initirq:
- lda IRQVec
- ldx IRQVec+1
- sta IRQInd+1
- stx IRQInd+2
- lda #IRQStub
- jmp setvec
+ lda IRQVec
+ ldx IRQVec+1
+ sta IRQInd+1
+ stx IRQInd+2
+ lda #IRQStub
+ jmp setvec
; ------------------------------------------------------------------------
.code
doneirq:
- lda IRQInd+1
- ldx IRQInd+2
-setvec: sei
- sta IRQVec
- stx IRQVec+1
- cli
- rts
+ lda IRQInd+1
+ ldx IRQInd+2
+setvec: sei
+ sta IRQVec
+ stx IRQVec+1
+ cli
+ rts
; ------------------------------------------------------------------------
-.segment "LOWCODE"
+.segment "LOWCODE"
IRQStub:
- cld ; Just to be sure
- pha
- txa
- pha
- tya
- pha
- jsr callirq ; Call the functions
- pla
- tay
- pla
- tax
- pla
- jmp IRQInd ; Jump to the saved IRQ vector
+ cld ; Just to be sure
+ pha
+ txa
+ pha
+ tya
+ pha
+ jsr callirq ; Call the functions
+ pla
+ tay
+ pla
+ tax
+ pla
+ jmp IRQInd ; Jump to the saved IRQ vector
; ------------------------------------------------------------------------
.data
-IRQInd: jmp $0000
+IRQInd: jmp $0000
diff --git a/libsrc/atmos/joy/atmos-pase.s b/libsrc/atmos/joy/atmos-pase.s
index 18ac7b887..81dba394a 100644
--- a/libsrc/atmos/joy/atmos-pase.s
+++ b/libsrc/atmos/joy/atmos-pase.s
@@ -6,55 +6,55 @@
; Based on Ullrich von Bassewitz, 2002-12-20
;
- .include "joy-kernel.inc"
- .include "joy-error.inc"
-; .include "atmos.inc"
+ .include "joy-kernel.inc"
+ .include "joy-error.inc"
+; .include "atmos.inc"
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "JUMPTABLE"
; Driver signature
- .byte $6A, $6F, $79 ; "joy"
- .byte JOY_API_VERSION ; Driver API version number
+ .byte $6A, $6F, $79 ; "joy"
+ .byte JOY_API_VERSION ; Driver API version number
; Button state masks (8 values)
- .byte $10 ; JOY_UP
- .byte $08 ; JOY_DOWN
- .byte $01 ; JOY_LEFT
- .byte $02 ; JOY_RIGHT
- .byte $20 ; JOY_FIRE
- .byte $00 ; Future expansion
- .byte $00 ; Future expansion
- .byte $00 ; Future expansion
+ .byte $10 ; JOY_UP
+ .byte $08 ; JOY_DOWN
+ .byte $01 ; JOY_LEFT
+ .byte $02 ; JOY_RIGHT
+ .byte $20 ; JOY_FIRE
+ .byte $00 ; Future expansion
+ .byte $00 ; Future expansion
+ .byte $00 ; Future expansion
; Jump table.
- .addr INSTALL
- .addr UNINSTALL
- .addr COUNT
- .addr READ
- .addr 0 ; IRQ entry unused
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr COUNT
+ .addr READ
+ .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
-JOY_COUNT = 2 ; Number of joysticks we support
+JOY_COUNT = 2 ; Number of joysticks we support
-PRA = $0301
-DDRA = $0303
-PRA2 = $030F
+PRA = $0301
+DDRA = $0303
+PRA2 = $030F
; ------------------------------------------------------------------------
; Data.
.bss
-temp1: .byte $00
-temp2: .byte $00
+temp1: .byte $00
+temp2: .byte $00
.code
@@ -66,9 +66,9 @@ temp2: .byte $00
;
INSTALL:
- lda #JOY_ERR_OK
- ldx #0
-; rts ; Run into UNINSTALL instead
+ lda #JOY_ERR_OK
+ ldx #0
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -76,7 +76,7 @@ INSTALL:
;
UNINSTALL:
- rts
+ rts
; ------------------------------------------------------------------------
@@ -84,42 +84,42 @@ UNINSTALL:
;
COUNT:
- lda #JOY_COUNT
- ldx #0
- rts
+ lda #JOY_COUNT
+ ldx #0
+ rts
; ------------------------------------------------------------------------
; READ: Read a particular joystick passed in A.
;
READ:
- tay
-
- lda PRA
- pha
- lda DDRA
- pha
- lda #%11000000
- sta DDRA
- lda #%10000000
- sta PRA2
- lda PRA2
- sta temp1
- lda #%01000000
- sta PRA2
- lda PRA
- sta temp2
- pla
- sta DDRA
- pla
- sta PRA2
-
- ldx #0
- tya
- bne @L1
- lda temp1
- eor #$FF
- rts
-@L1: lda temp2
- eor #$FF
- rts
+ tay
+
+ lda PRA
+ pha
+ lda DDRA
+ pha
+ lda #%11000000
+ sta DDRA
+ lda #%10000000
+ sta PRA2
+ lda PRA2
+ sta temp1
+ lda #%01000000
+ sta PRA2
+ lda PRA
+ sta temp2
+ pla
+ sta DDRA
+ pla
+ sta PRA2
+
+ ldx #0
+ tya
+ bne @L1
+ lda temp1
+ eor #$FF
+ rts
+@L1: lda temp2
+ eor #$FF
+ rts
diff --git a/libsrc/atmos/joy_stat_stddrv.s b/libsrc/atmos/joy_stat_stddrv.s
index c94405c3c..2ac2259d5 100644
--- a/libsrc/atmos/joy_stat_stddrv.s
+++ b/libsrc/atmos/joy_stat_stddrv.s
@@ -6,8 +6,8 @@
; const void joy_static_stddrv[];
;
- .export _joy_static_stddrv
- .import _atmos_pase_joy
+ .export _joy_static_stddrv
+ .import _atmos_pase_joy
.rodata
diff --git a/libsrc/atmos/joy_stddrv.s b/libsrc/atmos/joy_stddrv.s
index 77c9e0ea9..6ed83f445 100644
--- a/libsrc/atmos/joy_stddrv.s
+++ b/libsrc/atmos/joy_stddrv.s
@@ -6,8 +6,8 @@
; const char joy_stddrv[];
;
- .export _joy_stddrv
+ .export _joy_stddrv
.rodata
-_joy_stddrv: .asciiz "atmos-pase.joy"
+_joy_stddrv: .asciiz "atmos-pase.joy"
diff --git a/libsrc/atmos/kbhit.s b/libsrc/atmos/kbhit.s
index df36226f6..1b18b6cb7 100644
--- a/libsrc/atmos/kbhit.s
+++ b/libsrc/atmos/kbhit.s
@@ -4,9 +4,9 @@
; int kbhit (void);
;
- .export _kbhit
+ .export _kbhit
- .include "atmos.inc"
+ .include "atmos.inc"
_kbhit:
ldx #$00 ; Load high byte
diff --git a/libsrc/atmos/mainargs.s b/libsrc/atmos/mainargs.s
index 54fdb61e9..3e1f6467b 100644
--- a/libsrc/atmos/mainargs.s
+++ b/libsrc/atmos/mainargs.s
@@ -5,117 +5,117 @@
; Setup arguments for main
;
- .constructor initmainargs, 24
- .import __argc, __argv
- .macpack generic
+ .constructor initmainargs, 24
+ .import __argc, __argv
+ .macpack generic
-MAXARGS = 10 ; Maximum number of arguments allowed
-REM = $9d ; BASIC token-code
-NAME_LEN = 16 ; maximum length of command-name
+MAXARGS = 10 ; Maximum number of arguments allowed
+REM = $9d ; BASIC token-code
+NAME_LEN = 16 ; maximum length of command-name
BASIC_BUF = $35
-FNAM = $293
+FNAM = $293
;---------------------------------------------------------------------------
; Get possible command-line arguments. Goes into the special INIT segment,
; which may be reused after the startup code is run
-.segment "INIT"
+.segment "INIT"
-.proc initmainargs
+.proc initmainargs
; Assume that the program was loaded, a moment ago, by the traditional LOAD
; statement. Save the "most-recent filename" as argument #0.
; Because the buffer, that we're copying into, was zeroed out,
; we don't need to add a NUL character.
;
- ldy #NAME_LEN - 1 ; limit the length
-L0: lda FNAM,y
- sta name,y
- dey
- bpl L0
- inc __argc ; argc always is equal to, at least, 1
+ ldy #NAME_LEN - 1 ; limit the length
+L0: lda FNAM,y
+ sta name,y
+ dey
+ bpl L0
+ inc __argc ; argc always is equal to, at least, 1
; Find the "rem" token.
;
- ldx #0
-L2: lda BASIC_BUF,x
- beq done ; no "rem," no args.
- inx
- cmp #REM
- bne L2
- ldy #1 * 2
+ ldx #0
+L2: lda BASIC_BUF,x
+ beq done ; no "rem," no args.
+ inx
+ cmp #REM
+ bne L2
+ ldy #1 * 2
; Find the next argument
-next: lda BASIC_BUF,x
- beq done ; End of line reached
- inx
- cmp #' ' ; Skip leading spaces
- beq next ;
+next: lda BASIC_BUF,x
+ beq done ; End of line reached
+ inx
+ cmp #' ' ; Skip leading spaces
+ beq next ;
; Found start of next argument. We've incremented the pointer in X already, so
; it points to the second character of the argument. This is useful since we
; will check now for a quoted argument, in which case we will have to skip this
; first character.
-found: cmp #'"' ; Is the argument quoted?
- beq setterm ; Jump if so
- dex ; Reset pointer to first argument character
- lda #' ' ; A space ends the argument
-setterm:sta term ; Set end of argument marker
+found: cmp #'"' ; Is the argument quoted?
+ beq setterm ; Jump if so
+ dex ; Reset pointer to first argument character
+ lda #' ' ; A space ends the argument
+setterm:sta term ; Set end of argument marker
; Now store a pointer to the argument into the next slot. Since the BASIC
; input buffer is located at the zero page, no calculations are necessary.
- txa ; Get low byte
- add #argv
- sta __argv
- stx __argv + 1
+done: lda #argv
+ sta __argv
+ stx __argv + 1
- rts
+ rts
.endproc
; These arrays are zeroed before initmainargs is called.
-; char name[16+1];
+; char name[16+1];
; char* argv[MAXARGS+1]={name};
;
.bss
-term: .res 1
-name: .res NAME_LEN + 1
+term: .res 1
+name: .res NAME_LEN + 1
.data
-argv: .addr name
- .res MAXARGS * 2
+argv: .addr name
+ .res MAXARGS * 2
diff --git a/libsrc/atmos/oserrlist.s b/libsrc/atmos/oserrlist.s
index ebdb531f8..8ec41de6d 100644
--- a/libsrc/atmos/oserrlist.s
+++ b/libsrc/atmos/oserrlist.s
@@ -41,35 +41,35 @@ End:
.rodata
__sys_oserrlist:
- sys_oserr_entry 1, "File not found"
- sys_oserr_entry 2, "Invalid command end"
- sys_oserr_entry 3, "No drive number"
- sys_oserr_entry 4, "Bad drive number"
- sys_oserr_entry 5, "Invalid filename"
- sys_oserr_entry 6, "fderr=(error number)"
- sys_oserr_entry 7, "Illegal attribute"
- sys_oserr_entry 8, "Wildcard(s) not allowed"
- sys_oserr_entry 9, "File already exists"
- sys_oserr_entry 10, "Insufficient disc space"
- sys_oserr_entry 11, "File open"
- sys_oserr_entry 12, "Illegal quantity"
- sys_oserr_entry 13, "End address missing"
- sys_oserr_entry 14, "Start address > end address"
- sys_oserr_entry 15, "Missing 'to'"
- sys_oserr_entry 16, "Renamed file not on same disc"
- sys_oserr_entry 17, "Unknown array"
- sys_oserr_entry 18, "Target drive not source drive"
- sys_oserr_entry 19, "Destination not specified"
- sys_oserr_entry 20, "Cannot merge and overwrite"
- sys_oserr_entry 21, "Single target file illegal"
- sys_oserr_entry 22, "Syntax"
- sys_oserr_entry 23, "Filename missing"
- sys_oserr_entry 24, "Source file missing"
- sys_oserr_entry 25, "Type mismatch"
- sys_oserr_entry 26, "Disc write-protected"
- sys_oserr_entry 27, "Incompatible drives"
- sys_oserr_entry 28, "File not open"
- sys_oserr_entry 29, "File end"
- sys_oserr_sentinel "Unknown error"
+ sys_oserr_entry 1, "File not found"
+ sys_oserr_entry 2, "Invalid command end"
+ sys_oserr_entry 3, "No drive number"
+ sys_oserr_entry 4, "Bad drive number"
+ sys_oserr_entry 5, "Invalid filename"
+ sys_oserr_entry 6, "fderr=(error number)"
+ sys_oserr_entry 7, "Illegal attribute"
+ sys_oserr_entry 8, "Wildcard(s) not allowed"
+ sys_oserr_entry 9, "File already exists"
+ sys_oserr_entry 10, "Insufficient disc space"
+ sys_oserr_entry 11, "File open"
+ sys_oserr_entry 12, "Illegal quantity"
+ sys_oserr_entry 13, "End address missing"
+ sys_oserr_entry 14, "Start address > end address"
+ sys_oserr_entry 15, "Missing 'to'"
+ sys_oserr_entry 16, "Renamed file not on same disc"
+ sys_oserr_entry 17, "Unknown array"
+ sys_oserr_entry 18, "Target drive not source drive"
+ sys_oserr_entry 19, "Destination not specified"
+ sys_oserr_entry 20, "Cannot merge and overwrite"
+ sys_oserr_entry 21, "Single target file illegal"
+ sys_oserr_entry 22, "Syntax"
+ sys_oserr_entry 23, "Filename missing"
+ sys_oserr_entry 24, "Source file missing"
+ sys_oserr_entry 25, "Type mismatch"
+ sys_oserr_entry 26, "Disc write-protected"
+ sys_oserr_entry 27, "Incompatible drives"
+ sys_oserr_entry 28, "File not open"
+ sys_oserr_entry 29, "File end"
+ sys_oserr_sentinel "Unknown error"
diff --git a/libsrc/atmos/oserror.s b/libsrc/atmos/oserror.s
index aa54ea585..37c9bd7fc 100644
--- a/libsrc/atmos/oserror.s
+++ b/libsrc/atmos/oserror.s
@@ -5,13 +5,13 @@
; /* Map a system specific error into a system independent code */
;
- .include "errno.inc"
- .export __osmaperrno
+ .include "errno.inc"
+ .export __osmaperrno
-.proc __osmaperrno
+.proc __osmaperrno
- lda #EUNKNOWN
- rts
+ lda #EUNKNOWN
+ rts
.endproc
diff --git a/libsrc/atmos/revers.s b/libsrc/atmos/revers.s
index 07334af15..ad3e1f909 100644
--- a/libsrc/atmos/revers.s
+++ b/libsrc/atmos/revers.s
@@ -4,7 +4,7 @@
; unsigned char revers (unsigned char onoff);
;
- .export _revers
+ .export _revers
.export rvs
; ------------------------------------------------------------------------
@@ -13,18 +13,18 @@
.code
.proc _revers
- ldx #$00 ; Assume revers off
- tay ; Test onoff
- beq L1 ; Jump if off
- ldx #$80 ; Load on value
- ldy #$00 ; Assume old value is zero
-L1: lda rvs ; Load old value
- stx rvs ; Set new value
- beq L2 ; Jump if old value zero
- iny ; Make old value = 1
-L2: ldx #$00 ; Load high byte of result
- tya ; Load low byte, set CC
- rts
+ ldx #$00 ; Assume revers off
+ tay ; Test onoff
+ beq L1 ; Jump if off
+ ldx #$80 ; Load on value
+ ldy #$00 ; Assume old value is zero
+L1: lda rvs ; Load old value
+ stx rvs ; Set new value
+ beq L2 ; Jump if old value zero
+ iny ; Make old value = 1
+L2: ldx #$00 ; Load high byte of result
+ tya ; Load low byte, set CC
+ rts
.endproc
diff --git a/libsrc/atmos/ser/atmos-acia.s b/libsrc/atmos/ser/atmos-acia.s
index c2b48c9fc..36071c32a 100644
--- a/libsrc/atmos/ser/atmos-acia.s
+++ b/libsrc/atmos/ser/atmos-acia.s
@@ -22,99 +22,99 @@
; interrupt handling assumes that the 65816 is in 6502-emulation mode.
;
- .include "zeropage.inc"
- .include "ser-kernel.inc"
- .include "ser-error.inc"
+ .include "zeropage.inc"
+ .include "ser-kernel.inc"
+ .include "ser-error.inc"
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "JUMPTABLE"
- ; Driver signature
- .byte $73, $65, $72 ; "ser"
- .byte SER_API_VERSION ; Serial API version number
+ ; Driver signature
+ .byte $73, $65, $72 ; "ser"
+ .byte SER_API_VERSION ; Serial API version number
- ; Jump table.
- .addr INSTALL
- .addr UNINSTALL
- .addr OPEN
- .addr CLOSE
- .addr GET
- .addr PUT
- .addr STATUS
- .addr IOCTL
- .addr IRQ
+ ; Jump table.
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr OPEN
+ .addr CLOSE
+ .addr GET
+ .addr PUT
+ .addr STATUS
+ .addr IOCTL
+ .addr IRQ
;----------------------------------------------------------------------------
; I/O definitions
-ACIA = $031C
-ACIA_DATA = ACIA+0 ; Data register
-ACIA_STATUS = ACIA+1 ; Status register
-ACIA_CMD = ACIA+2 ; Command register
-ACIA_CTRL = ACIA+3 ; Control register
+ACIA = $031C
+ACIA_DATA = ACIA+0 ; Data register
+ACIA_STATUS = ACIA+1 ; Status register
+ACIA_CMD = ACIA+2 ; Command register
+ACIA_CTRL = ACIA+3 ; Control register
;----------------------------------------------------------------------------
; Global variables
- .bss
-
-RecvHead: .res 1 ; Head of receive buffer
-RecvTail: .res 1 ; Tail of receive buffer
-RecvFreeCnt: .res 1 ; Number of bytes in receive buffer
-SendHead: .res 1 ; Head of send buffer
-SendTail: .res 1 ; Tail of send buffer
-SendFreeCnt: .res 1 ; Number of bytes in send buffer
-
-Stopped: .res 1 ; Flow-stopped flag
-RtsOff: .res 1 ;
-
-RecvBuf: .res 256 ; Receive buffers: 256 bytes
-SendBuf: .res 256 ; Send buffers: 256 bytes
-
-Index: .res 1 ; I/O register index
-
- .rodata
-
- ; Tables used to translate RS232 params into register values
-BaudTable: ; bit7 = 1 means setting is invalid
- .byte $FF ; SER_BAUD_45_5
- .byte $01 ; SER_BAUD_50
- .byte $02 ; SER_BAUD_75
- .byte $03 ; SER_BAUD_110
- .byte $04 ; SER_BAUD_134_5
- .byte $05 ; SER_BAUD_150
- .byte $06 ; SER_BAUD_300
- .byte $07 ; SER_BAUD_600
- .byte $08 ; SER_BAUD_1200
- .byte $09 ; SER_BAUD_1800
- .byte $0A ; SER_BAUD_2400
- .byte $0B ; SER_BAUD_3600
- .byte $0C ; SER_BAUD_4800
- .byte $0D ; SER_BAUD_7200
- .byte $0E ; SER_BAUD_9600
- .byte $0F ; SER_BAUD_19200
- .byte $FF ; SER_BAUD_38400
- .byte $FF ; SER_BAUD_57600
- .byte $FF ; SER_BAUD_115200
- .byte $FF ; SER_BAUD_230400
+ .bss
+
+RecvHead: .res 1 ; Head of receive buffer
+RecvTail: .res 1 ; Tail of receive buffer
+RecvFreeCnt: .res 1 ; Number of bytes in receive buffer
+SendHead: .res 1 ; Head of send buffer
+SendTail: .res 1 ; Tail of send buffer
+SendFreeCnt: .res 1 ; Number of bytes in send buffer
+
+Stopped: .res 1 ; Flow-stopped flag
+RtsOff: .res 1 ;
+
+RecvBuf: .res 256 ; Receive buffers: 256 bytes
+SendBuf: .res 256 ; Send buffers: 256 bytes
+
+Index: .res 1 ; I/O register index
+
+ .rodata
+
+ ; Tables used to translate RS232 params into register values
+BaudTable: ; bit7 = 1 means setting is invalid
+ .byte $FF ; SER_BAUD_45_5
+ .byte $01 ; SER_BAUD_50
+ .byte $02 ; SER_BAUD_75
+ .byte $03 ; SER_BAUD_110
+ .byte $04 ; SER_BAUD_134_5
+ .byte $05 ; SER_BAUD_150
+ .byte $06 ; SER_BAUD_300
+ .byte $07 ; SER_BAUD_600
+ .byte $08 ; SER_BAUD_1200
+ .byte $09 ; SER_BAUD_1800
+ .byte $0A ; SER_BAUD_2400
+ .byte $0B ; SER_BAUD_3600
+ .byte $0C ; SER_BAUD_4800
+ .byte $0D ; SER_BAUD_7200
+ .byte $0E ; SER_BAUD_9600
+ .byte $0F ; SER_BAUD_19200
+ .byte $FF ; SER_BAUD_38400
+ .byte $FF ; SER_BAUD_57600
+ .byte $FF ; SER_BAUD_115200
+ .byte $FF ; SER_BAUD_230400
BitTable:
- .byte $60 ; SER_BITS_5
- .byte $40 ; SER_BITS_6
- .byte $20 ; SER_BITS_7
- .byte $00 ; SER_BITS_8
+ .byte $60 ; SER_BITS_5
+ .byte $40 ; SER_BITS_6
+ .byte $20 ; SER_BITS_7
+ .byte $00 ; SER_BITS_8
StopTable:
- .byte $00 ; SER_STOP_1
- .byte $80 ; SER_STOP_2
+ .byte $00 ; SER_STOP_1
+ .byte $80 ; SER_STOP_2
ParityTable:
- .byte $00 ; SER_PAR_NONE
- .byte $20 ; SER_PAR_ODD
- .byte $60 ; SER_PAR_EVEN
- .byte $A0 ; SER_PAR_MARK
- .byte $E0 ; SER_PAR_SPACE
+ .byte $00 ; SER_PAR_NONE
+ .byte $20 ; SER_PAR_ODD
+ .byte $60 ; SER_PAR_EVEN
+ .byte $A0 ; SER_PAR_MARK
+ .byte $E0 ; SER_PAR_SPACE
- .code
+ .code
;----------------------------------------------------------------------------
; INSTALL: Is called after the driver is loaded into memory. If possible,
@@ -134,91 +134,91 @@ ParityTable:
INSTALL:
UNINSTALL:
CLOSE:
- ldx Index ; Check for open port
- beq :+
+ ldx Index ; Check for open port
+ beq :+
- ; Deactivate DTR and disable 6551 interrupts
- lda #%00001010
- sta ACIA_CMD,x
+ ; Deactivate DTR and disable 6551 interrupts
+ lda #%00001010
+ sta ACIA_CMD,x
- ; Done, return an error code
-: lda #SER_ERR_INIT_FAILED
- rts
-
- ; Baud rate not available
-InvBaud:lda #SER_ERR_BAUD_UNAVAIL
- rts
+ ; Check if the handshake setting is valid
+ ldy #SER_PARAMS::HANDSHAKE ; Handshake
+ lda (ptr1),y
+ cmp #SER_HS_HW ; This is all we support
+ bne InvParam
+
+ ; Initialize buffers
+ ldy #$00
+ sty Stopped
+ sty RecvHead
+ sty RecvTail
+ sty SendHead
+ sty SendTail
+ dey ; Y = 255
+ sty RecvFreeCnt
+ sty SendFreeCnt
+
+ ; Set the value for the control register, which contains stop bits,
+ ; word length and the baud rate.
+ ldy #SER_PARAMS::BAUDRATE
+ lda (ptr1),y ; Baudrate index
+ tay
+ lda BaudTable,y ; Get 6551 value
+ bmi InvBaud ; Branch if rate not supported
+ sta tmp1
+
+ ldy #SER_PARAMS::DATABITS ; Databits
+ lda (ptr1),y
+ tay
+ lda BitTable,y
+ ora tmp1
+ sta tmp1
+
+ ldy #SER_PARAMS::STOPBITS ; Stopbits
+ lda (ptr1),y
+ tay
+ lda StopTable,y
+ ora tmp1
+ ora #%00010000 ; Receiver clock source = baudrate
+ sta ACIA_CTRL
+
+ ; Set the value for the command register. We remember the base value
+ ; in RtsOff, since we will have to manipulate ACIA_CMD often.
+ ldy #SER_PARAMS::PARITY ; Parity
+ lda (ptr1),y
+ tay
+ lda ParityTable,y
+ ora #%00000001 ; DTR active
+ sta RtsOff
+ ora #%00001000 ; Enable receive interrupts
+ sta ACIA_CMD
+
+ ; Done
+ stx Index ; Mark port as open
+ lda #SER_ERR_INIT_FAILED
+ rts
+
+ ; Baud rate not available
+InvBaud:lda #SER_ERR_BAUD_UNAVAIL
+ rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
@@ -226,82 +226,82 @@ InvBaud:lda #SER_ERR_NO_DATA
- rts
-
- ; Check for flow stopped & enough free: release flow control
-: ldy Stopped ; (34)
- beq :+
- cmp #63
- bcc :+
- lda #$00
- sta Stopped
- lda RtsOff
- ora #%00001000
- sta ACIA_CMD
-
- ; Get byte from buffer
-: ldy RecvHead ; (41)
- lda RecvBuf,y
- inc RecvHead
- inc RecvFreeCnt
- ldx #$00 ; (59)
- sta (ptr1,x)
- txa ; Return code = 0
- rts
+ ldy SendFreeCnt ; Send data if necessary
+ iny ; Y == $FF?
+ beq :+
+ lda #$00 ; TryHard = false
+ jsr TryToSend
+
+ ; Check for buffer empty
+: lda RecvFreeCnt ; (25)
+ cmp #$FF
+ bne :+
+ lda #SER_ERR_NO_DATA
+ rts
+
+ ; Check for flow stopped & enough free: release flow control
+: ldy Stopped ; (34)
+ beq :+
+ cmp #63
+ bcc :+
+ lda #$00
+ sta Stopped
+ lda RtsOff
+ ora #%00001000
+ sta ACIA_CMD
+
+ ; Get byte from buffer
+: ldy RecvHead ; (41)
+ lda RecvBuf,y
+ inc RecvHead
+ inc RecvFreeCnt
+ ldx #$00 ; (59)
+ sta (ptr1,x)
+ txa ; Return code = 0
+ rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; Must return an SER_ERR_xx code in a/x.
PUT:
- ; Try to send
- ldy SendFreeCnt
- iny ; Y = $FF?
- beq :+
- pha
- lda #$00 ; TryHard = false
- jsr TryToSend
- pla
-
- ; Put byte into send buffer & send
-: ldy SendFreeCnt
- bne :+
- lda #SER_ERR_OVERFLOW
- rts
-
-: ldy SendTail
- sta SendBuf,y
- inc SendTail
- dec SendFreeCnt
- lda #$FF ; TryHard = true
- jsr TryToSend
- lda #SER_ERR_OVERFLOW
+ rts
+
+: ldy SendTail
+ sta SendBuf,y
+ inc SendTail
+ dec SendFreeCnt
+ lda #$FF ; TryHard = true
+ jsr TryToSend
+ lda #SER_ERR_INV_IOCTL
- rts
+ lda #SER_ERR_INV_IOCTL
+ rts
;----------------------------------------------------------------------------
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
@@ -320,55 +320,55 @@ IOCTL:
; was handled, otherwise with carry clear.
IRQ:
- ldx Index ; Check for open port
- beq Done
- lda ACIA_STATUS,x ; Check ACIA status for receive interrupt
- and #$08
- beq Done ; Jump if no ACIA interrupt
- lda ACIA_DATA,x ; Get byte from ACIA
- ldy RecvFreeCnt ; Check if we have free space left
- beq Flow ; Jump if no space in receive buffer
- ldy RecvTail ; Load buffer pointer
- sta RecvBuf,y ; Store received byte in buffer
- inc RecvTail ; Increment buffer pointer
- dec RecvFreeCnt ; Decrement free space counter
- ldy RecvFreeCnt ; Check for buffer space low
- cpy #33
- bcc Flow ; Assert flow control if buffer space low
- rts ; Interrupt handled (carry already set)
-
- ; Assert flow control if buffer space too low
-Flow: lda RtsOff
- sta ACIA_CMD,x
- sta Stopped
- sec ; Interrupt handled
-Done: rts
+ ldx Index ; Check for open port
+ beq Done
+ lda ACIA_STATUS,x ; Check ACIA status for receive interrupt
+ and #$08
+ beq Done ; Jump if no ACIA interrupt
+ lda ACIA_DATA,x ; Get byte from ACIA
+ ldy RecvFreeCnt ; Check if we have free space left
+ beq Flow ; Jump if no space in receive buffer
+ ldy RecvTail ; Load buffer pointer
+ sta RecvBuf,y ; Store received byte in buffer
+ inc RecvTail ; Increment buffer pointer
+ dec RecvFreeCnt ; Decrement free space counter
+ ldy RecvFreeCnt ; Check for buffer space low
+ cpy #33
+ bcc Flow ; Assert flow control if buffer space low
+ rts ; Interrupt handled (carry already set)
+
+ ; Assert flow control if buffer space too low
+Flow: lda RtsOff
+ sta ACIA_CMD,x
+ sta Stopped
+ sec ; Interrupt handled
+Done: rts
;----------------------------------------------------------------------------
; Try to send a byte. Internal routine. A = TryHard
TryToSend:
- sta tmp1 ; Remember tryHard flag
-Again: lda SendFreeCnt
- cmp #$FF
- beq Quit ; Bail out
-
- ; Check for flow stopped
- lda Stopped
- bne Quit ; Bail out
-
- ; Check that ACIA is ready to send
- lda ACIA_STATUS
- and #$10
- bne Send
- bit tmp1 ; Keep trying if must try hard
- bmi Again
-Quit: rts
-
- ; Send byte and try again
-Send: ldy SendHead
- lda SendBuf,y
- sta ACIA_DATA
- inc SendHead
- inc SendFreeCnt
- jmp Again
+ sta tmp1 ; Remember tryHard flag
+Again: lda SendFreeCnt
+ cmp #$FF
+ beq Quit ; Bail out
+
+ ; Check for flow stopped
+ lda Stopped
+ bne Quit ; Bail out
+
+ ; Check that ACIA is ready to send
+ lda ACIA_STATUS
+ and #$10
+ bne Send
+ bit tmp1 ; Keep trying if must try hard
+ bmi Again
+Quit: rts
+
+ ; Send byte and try again
+Send: ldy SendHead
+ lda SendBuf,y
+ sta ACIA_DATA
+ inc SendHead
+ inc SendFreeCnt
+ jmp Again
diff --git a/libsrc/atmos/store_filename.s b/libsrc/atmos/store_filename.s
index a909bcf15..cb6d8b933 100644
--- a/libsrc/atmos/store_filename.s
+++ b/libsrc/atmos/store_filename.s
@@ -1,12 +1,12 @@
- .export store_filename
- .importzp ptr1
+ .export store_filename
+ .importzp ptr1
store_filename:
- sta ptr1
- stx ptr1+1
- ldy #$0f ;store filename
-: lda (ptr1),y
- sta $027f,y
- dey
- bpl :-
- rts
+ sta ptr1
+ stx ptr1+1
+ ldy #$0f ;store filename
+: lda (ptr1),y
+ sta $027f,y
+ dey
+ bpl :-
+ rts
diff --git a/libsrc/atmos/systime.s b/libsrc/atmos/systime.s
index 1d039e80e..d22b8c596 100644
--- a/libsrc/atmos/systime.s
+++ b/libsrc/atmos/systime.s
@@ -9,7 +9,7 @@
; */
;
- .export __systime
+ .export __systime
.importzp sreg
diff --git a/libsrc/atmos/sysuname.s b/libsrc/atmos/sysuname.s
index d86ce5047..546f942ab 100644
--- a/libsrc/atmos/sysuname.s
+++ b/libsrc/atmos/sysuname.s
@@ -4,11 +4,11 @@
; unsigned char __fastcall__ _sysuname (struct utsname* buf);
;
- .export __sysuname, utsdata
+ .export __sysuname, utsdata
- .import utscopy
+ .import utscopy
- __sysuname = utscopy
+ __sysuname = utscopy
;--------------------------------------------------------------------------
; Data. We define a fixed utsname struct here and just copy it.
@@ -16,31 +16,31 @@
.rodata
utsdata:
- ; sysname
- .asciiz "cc65"
-
- ; nodename
- .asciiz ""
-
- ; release
- .byte ((.VERSION >> 8) & $0F) + '0'
- .byte '.'
- .if ((.VERSION >> 4) & $0F) > 9
- .byte ((.VERSION >> 4) & $0F) / 10 + '0'
- .byte ((.VERSION >> 4) & $0F) .MOD 10 + '0'
- .else
- .byte ((.VERSION >> 4) & $0F) + '0'
- .endif
- .byte $00
-
- ; version
- .if (.VERSION & $0F) > 9
- .byte (.VERSION & $0F) / 10 + '0'
- .byte (.VERSION & $0F) .MOD 10 + '0'
- .else
- .byte (.VERSION & $0F) + '0'
- .endif
- .byte $00
-
- ; machine
- .asciiz "Oric Atmos"
+ ; sysname
+ .asciiz "cc65"
+
+ ; nodename
+ .asciiz ""
+
+ ; release
+ .byte ((.VERSION >> 8) & $0F) + '0'
+ .byte '.'
+ .if ((.VERSION >> 4) & $0F) > 9
+ .byte ((.VERSION >> 4) & $0F) / 10 + '0'
+ .byte ((.VERSION >> 4) & $0F) .MOD 10 + '0'
+ .else
+ .byte ((.VERSION >> 4) & $0F) + '0'
+ .endif
+ .byte $00
+
+ ; version
+ .if (.VERSION & $0F) > 9
+ .byte (.VERSION & $0F) / 10 + '0'
+ .byte (.VERSION & $0F) .MOD 10 + '0'
+ .else
+ .byte (.VERSION & $0F) + '0'
+ .endif
+ .byte $00
+
+ ; machine
+ .asciiz "Oric Atmos"
diff --git a/libsrc/atmos/tgi/atmos-228-200-3.s b/libsrc/atmos/tgi/atmos-228-200-3.s
index 03a9ce7df..9417fff0d 100644
--- a/libsrc/atmos/tgi/atmos-228-200-3.s
+++ b/libsrc/atmos/tgi/atmos-228-200-3.s
@@ -5,59 +5,59 @@
; 2012-08-11, Greg King
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
- .include "atmos.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
+ .include "atmos.inc"
- .macpack generic
+ .macpack generic
-XSIZE = 6 ; System font width
-YSIZE = 8 ; System font height
+XSIZE = 6 ; System font width
+YSIZE = 8 ; System font height
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "JUMPTABLE"
; The first part of the header is a structure that has a signature,
; and defines the capabilities of the driver.
- .byte "tgi"
- .byte TGI_API_VERSION ; TGI API version number
- .word 228 ; x resolution
- .word 200 ; y resolution
- .byte 3 ; Number of drawing colors
- .byte 1 ; Number of screens available
- .byte XSIZE ; System font x size
- .byte YSIZE ; System font y size
- .word $011C ; Aspect ratio (based on 4/3 display)
- .byte 0 ; TGI driver flags
+ .byte "tgi"
+ .byte TGI_API_VERSION ; TGI API version number
+ .word 228 ; x resolution
+ .word 200 ; y resolution
+ .byte 3 ; Number of drawing colors
+ .byte 1 ; Number of screens available
+ .byte XSIZE ; System font x size
+ .byte YSIZE ; System font y size
+ .word $011C ; Aspect ratio (based on 4/3 display)
+ .byte 0 ; TGI driver flags
; Next comes the jump table. Currently, all entries must be valid;
; and, may point to an RTS, for test versions (function not implemented).
- .addr INSTALL
- .addr UNINSTALL
- .addr INIT
- .addr DONE
- .addr GETERROR
- .addr CONTROL
- .addr CLEAR
- .addr SETVIEWPAGE
- .addr SETDRAWPAGE
- .addr SETCOLOR
- .addr SETPALETTE
- .addr GETPALETTE
- .addr GETDEFPALETTE
- .addr SETPIXEL
- .addr GETPIXEL
- .addr LINE
- .addr BAR
- .addr TEXTSTYLE
- .addr OUTTEXT
- .addr 0 ; IRQ entry is unused
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr INIT
+ .addr DONE
+ .addr GETERROR
+ .addr CONTROL
+ .addr CLEAR
+ .addr SETVIEWPAGE
+ .addr SETDRAWPAGE
+ .addr SETCOLOR
+ .addr SETPALETTE
+ .addr GETPALETTE
+ .addr GETDEFPALETTE
+ .addr SETPIXEL
+ .addr GETPIXEL
+ .addr LINE
+ .addr BAR
+ .addr TEXTSTYLE
+ .addr OUTTEXT
+ .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
@@ -65,34 +65,34 @@ YSIZE = 8 ; System font height
; Variables mapped to the zero-page segment variables. These are
; used for passing parameters to the driver.
-X1 := ptr1
-Y1 := ptr2
-X2 := ptr3
-Y2 := ptr4
+X1 := ptr1
+Y1 := ptr2
+X2 := ptr3
+Y2 := ptr4
; Absolute variables used in the code
.bss
-ERROR: .res 1 ; Error code
-MODE: .res 1 ; Graphics mode
-PALETTE: .res 2
+ERROR: .res 1 ; Error code
+MODE: .res 1 ; Graphics mode
+PALETTE: .res 2
; Constants and table
; BASIC 1.1 addresses
-PATTERN := $213
-PARAM1 := $2E1 ; & $2E2
-PARAM2 := $2E3 ; & $2E4
-PARAM3 := $2E5 ; & $2E6
-TEXT := $EC21
-HIRES := $EC33
-CURSET := $F0C8
-CURMOV := $F0FD
-DRAW := $F110
-CHAR := $F12D
-POINT := $F1C8
-PAPER := $F204
-INK := $F210
+PATTERN := $213
+PARAM1 := $2E1 ; & $2E2
+PARAM2 := $2E3 ; & $2E4
+PARAM3 := $2E5 ; & $2E6
+TEXT := $EC21
+HIRES := $EC33
+CURSET := $F0C8
+CURMOV := $F0FD
+DRAW := $F110
+CHAR := $F12D
+POINT := $F1C8
+PAPER := $F204
+INK := $F210
.rodata
@@ -100,7 +100,7 @@ INK := $F210
; (The third "color" actually flips a pixel
; between the foreground and background colors.)
;
-DEFPALETTE: .byte 0, 1
+DEFPALETTE: .byte 0, 1
.code
@@ -121,7 +121,7 @@ INIT:
; Switch into graphics mode.
- jsr HIRES
+ jsr HIRES
; Done, reset the error code.
@@ -129,9 +129,9 @@ INIT:
; GETERROR: Return the error code in A, and clear it.
GETERROR:
- ldx #TGI_ERR_OK
- lda ERROR
- stx ERROR
+ ldx #TGI_ERR_OK
+ lda ERROR
+ stx ERROR
; ------------------------------------------------------------------------
; INSTALL routine. Is called after the driver is loaded into memory. May
@@ -151,7 +151,7 @@ INSTALL:
;
UNINSTALL:
- rts
+ rts
; ------------------------------------------------------------------------
; DONE: Will be called to switch the graphics device back into text mode.
@@ -161,7 +161,7 @@ UNINSTALL:
; Must set an error code: NO
;
-DONE := TEXT
+DONE := TEXT
; ------------------------------------------------------------------------
; CONTROL: Platform-/driver-specific entry point.
@@ -170,10 +170,10 @@ DONE := TEXT
;
CONTROL:
- sta PATTERN
- lda #TGI_ERR_OK
- sta ERROR
- rts
+ sta PATTERN
+ lda #TGI_ERR_OK
+ sta ERROR
+ rts
; ------------------------------------------------------------------------
; CLEAR: Clears the screen.
@@ -181,7 +181,7 @@ CONTROL:
; Must set an error code: NO
;
-CLEAR := HIRES
+CLEAR := HIRES
; ------------------------------------------------------------------------
; SETVIEWPAGE: Set the visible page. Called with the new page in A (0..n).
@@ -200,7 +200,7 @@ SETVIEWPAGE:
;
SETDRAWPAGE:
- rts
+ rts
; ------------------------------------------------------------------------
; SETCOLOR: Set the drawing color (in A). The new color already is checked
@@ -210,8 +210,8 @@ SETDRAWPAGE:
;
SETCOLOR:
- sta MODE
- rts
+ sta MODE
+ rts
; ------------------------------------------------------------------------
; SETPALETTE: Set the palette (not available with all drivers/hardware).
@@ -222,27 +222,27 @@ SETCOLOR:
;
SETPALETTE:
- ldy #0
- jsr flipcolor
- sty PARAM1+1
- jsr PAPER
- ldy #1
- jsr flipcolor
- dey ; TGI_ERR_OK
- sty ERROR
- sty PARAM1+1
- jmp INK
+ ldy #0
+ jsr flipcolor
+ sty PARAM1+1
+ jsr PAPER
+ ldy #1
+ jsr flipcolor
+ dey ; TGI_ERR_OK
+ sty ERROR
+ sty PARAM1+1
+ jmp INK
flipcolor:
- lda (ptr1),y
- sta PALETTE,y
- cmp #1
- beq @flip
- cmp #7
- bne @keep
-@flip: eor #1 ^ 7
-@keep: sta PARAM1
- rts
+ lda (ptr1),y
+ sta PALETTE,y
+ cmp #1
+ beq @flip
+ cmp #7
+ bne @keep
+@flip: eor #1 ^ 7
+@keep: sta PARAM1
+ rts
; ------------------------------------------------------------------------
; GETPALETTE: Return the current palette in A/X. Even drivers that cannot
@@ -253,9 +253,9 @@ flipcolor:
;
GETPALETTE:
- lda #PALETTE
- rts
+ lda #PALETTE
+ rts
; ------------------------------------------------------------------------
; GETDEFPALETTE: Return the default palette for the driver in A/X. All
@@ -267,9 +267,9 @@ GETPALETTE:
;
GETDEFPALETTE:
- lda #DEFPALETTE
- rts
+ lda #DEFPALETTE
+ rts
; ------------------------------------------------------------------------
; SETPIXEL: Draw one pixel at X1/Y1 = ptr1/ptr2 with the current drawing
@@ -280,18 +280,18 @@ GETDEFPALETTE:
;
SETPIXEL:
- lda Y1
- sta PARAM2
- lda MODE
-mymode: sta PARAM3
- lda X1
- add #2 * XSIZE ; Skip screen attribute columns
- sta PARAM1
- lda #0
- sta PARAM1+1
- sta PARAM2+1
- sta PARAM3+1
- jmp CURSET
+ lda Y1
+ sta PARAM2
+ lda MODE
+mymode: sta PARAM3
+ lda X1
+ add #2 * XSIZE ; Skip screen attribute columns
+ sta PARAM1
+ lda #0
+ sta PARAM1+1
+ sta PARAM2+1
+ sta PARAM3+1
+ jmp CURSET
; ------------------------------------------------------------------------
; GETPIXEL: Read the color value of a pixel, and return it in A/X. The
@@ -299,18 +299,18 @@ mymode: sta PARAM3
; area, so there is no need for clipping inside this function.
GETPIXEL:
- lda X1
- sta PARAM1
- lda Y1
- sta PARAM2
- lda #0
- sta PARAM1+1
- sta PARAM2+1
- jsr POINT
- lda PARAM1
- and #%00000001
- ldx #0
- rts
+ lda X1
+ sta PARAM1
+ lda Y1
+ sta PARAM2
+ lda #0
+ sta PARAM1+1
+ sta PARAM2+1
+ jsr POINT
+ lda PARAM1
+ and #%00000001
+ ldx #0
+ rts
; ------------------------------------------------------------------------
; LINE: Draw a line from X1/Y1 to X2/Y2, where X1/Y1 = ptr1/ptr2 and
@@ -320,24 +320,24 @@ GETPIXEL:
;
LINE:
- jsr SETPIXEL
- lda X2
- sub X1
- sta PARAM1
- lda X2+1
- sbc X1+1
- sta PARAM1+1
- lda Y2
- sub Y1
- sta PARAM2
- lda Y2+1
- sbc Y1+1
- sta PARAM2+1
- lda MODE
- sta PARAM3
- ldx #>0
- stx PARAM3+1
- jmp DRAW
+ jsr SETPIXEL
+ lda X2
+ sub X1
+ sta PARAM1
+ lda X2+1
+ sbc X1+1
+ sta PARAM1+1
+ lda Y2
+ sub Y1
+ sta PARAM2
+ lda Y2+1
+ sbc Y1+1
+ sta PARAM2+1
+ lda MODE
+ sta PARAM3
+ ldx #>0
+ stx PARAM3+1
+ jmp DRAW
; ------------------------------------------------------------------------
; BAR: Draw a filled rectangle with the corners X1/Y1, X2/Y2, where
@@ -345,29 +345,29 @@ LINE:
; Contrary to most other functions, the graphics kernel will sort and clip
; the co-ordinates before calling the driver; so, on entry, the following
; conditions are valid:
-; X1 <= X2
-; Y1 <= Y2
-; (X1 >= 0) && (X1 < XRES)
-; (X2 >= 0) && (X2 < XRES)
-; (Y1 >= 0) && (Y1 < YRES)
-; (Y2 >= 0) && (Y2 < YRES)
+; X1 <= X2
+; Y1 <= Y2
+; (X1 >= 0) && (X1 < XRES)
+; (X2 >= 0) && (X2 < XRES)
+; (Y1 >= 0) && (Y1 < YRES)
+; (Y2 >= 0) && (Y2 < YRES)
;
; Must set an error code: NO
;
BAR:
- inc Y2
-@L1: lda Y2
- pha
- lda Y1
- sta Y2
- jsr LINE
- pla
- sta Y2
- inc Y1
- cmp Y1
- bne @L1
- rts
+ inc Y2
+@L1: lda Y2
+ pha
+ lda Y1
+ sta Y2
+ jsr LINE
+ pla
+ sta Y2
+ inc Y1
+ cmp Y1
+ bne @L1
+ rts
; ------------------------------------------------------------------------
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in the x
@@ -377,7 +377,7 @@ BAR:
;
TEXTSTYLE:
- rts
+ rts
; ------------------------------------------------------------------------
@@ -389,38 +389,38 @@ TEXTSTYLE:
;
OUTTEXT:
- lda Y1
- sub #(YSIZE - 1)
- sta PARAM2
- lda #3 ; (Move graphics cursor; don't draw)
- jsr mymode
-
- ldy #0
-@next: lda (ptr3),y
- beq @end
- sta PARAM1
- lda #0
- sta PARAM2
- sta PARAM1+1
- sta PARAM2+1
- sta PARAM3+1
- lda MODE
- sta PARAM3
- tya
- pha
- jsr CHAR
- lda #XSIZE
- sta PARAM1
- lda #0
- sta PARAM2
- sta PARAM1+1
- sta PARAM2+1
- sta PARAM3+1
- lda #3
- sta PARAM3
- jsr CURMOV
- pla
- tay
- iny
- bne @next
-@end: rts
+ lda Y1
+ sub #(YSIZE - 1)
+ sta PARAM2
+ lda #3 ; (Move graphics cursor; don't draw)
+ jsr mymode
+
+ ldy #0
+@next: lda (ptr3),y
+ beq @end
+ sta PARAM1
+ lda #0
+ sta PARAM2
+ sta PARAM1+1
+ sta PARAM2+1
+ sta PARAM3+1
+ lda MODE
+ sta PARAM3
+ tya
+ pha
+ jsr CHAR
+ lda #XSIZE
+ sta PARAM1
+ lda #0
+ sta PARAM2
+ sta PARAM1+1
+ sta PARAM2+1
+ sta PARAM3+1
+ lda #3
+ sta PARAM3
+ jsr CURMOV
+ pla
+ tay
+ iny
+ bne @next
+@end: rts
diff --git a/libsrc/atmos/tgi/atmos-240-200-2.s b/libsrc/atmos/tgi/atmos-240-200-2.s
index 9027b3340..735d75f93 100644
--- a/libsrc/atmos/tgi/atmos-240-200-2.s
+++ b/libsrc/atmos/tgi/atmos-240-200-2.s
@@ -5,58 +5,58 @@
; 2012-08-11, Greg King
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
- .include "atmos.inc"
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
+ .include "atmos.inc"
- .macpack generic
+ .macpack generic
-XSIZE = 6 ; System font width
-YSIZE = 8 ; System font height
+XSIZE = 6 ; System font width
+YSIZE = 8 ; System font height
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "JUMPTABLE"
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
- .byte $74, $67, $69 ; "tgi"
- .byte TGI_API_VERSION ; TGI API version number
- .word 240 ; X resolution
- .word 200 ; Y resolution
- .byte 2 ; Number of drawing colors
- .byte 1 ; Number of screens available
- .byte XSIZE ; System font X size
- .byte YSIZE ; System font Y size
+ .byte $74, $67, $69 ; "tgi"
+ .byte TGI_API_VERSION ; TGI API version number
+ .word 240 ; X resolution
+ .word 200 ; Y resolution
+ .byte 2 ; Number of drawing colors
+ .byte 1 ; Number of screens available
+ .byte XSIZE ; System font X size
+ .byte YSIZE ; System font Y size
.word $011C ; Aspect ratio (based on 4/3 display)
.byte 0 ; TGI driver flags
; Next comes the jump table. Currently all entries must be valid and may point
; to an RTS for test versions (function not implemented).
- .addr INSTALL
- .addr UNINSTALL
- .addr INIT
- .addr DONE
- .addr GETERROR
- .addr CONTROL
- .addr CLEAR
- .addr SETVIEWPAGE
- .addr SETDRAWPAGE
- .addr SETCOLOR
- .addr SETPALETTE
- .addr GETPALETTE
- .addr GETDEFPALETTE
- .addr SETPIXEL
- .addr GETPIXEL
- .addr LINE
- .addr BAR
- .addr TEXTSTYLE
- .addr OUTTEXT
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr INIT
+ .addr DONE
+ .addr GETERROR
+ .addr CONTROL
+ .addr CLEAR
+ .addr SETVIEWPAGE
+ .addr SETDRAWPAGE
+ .addr SETCOLOR
+ .addr SETPALETTE
+ .addr GETPALETTE
+ .addr GETDEFPALETTE
+ .addr SETPIXEL
+ .addr GETPIXEL
+ .addr LINE
+ .addr BAR
+ .addr TEXTSTYLE
+ .addr OUTTEXT
.addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
@@ -65,35 +65,35 @@ YSIZE = 8 ; System font height
; Variables mapped to the zero page segment variables. Some of these are
; used for passing parameters to the driver.
-X1 = ptr1
-Y1 = ptr2
-X2 = ptr3
-Y2 = ptr4
+X1 = ptr1
+Y1 = ptr2
+X2 = ptr3
+Y2 = ptr4
; Absolute variables used in the code
.bss
-ERROR: .res 1 ; Error code
-MODE: .res 1 ; Graphics mode
+ERROR: .res 1 ; Error code
+MODE: .res 1 ; Graphics mode
; Constants and tables
-PARAM1 = $2E1
-PARAM2 = $2E3
-PARAM3 = $2E5
-TEXT = $EC21
-HIRES = $EC33
-CURSET = $F0C8
-CURMOV = $F0FD
-DRAW = $F110
-CHAR = $F12D
-POINT = $F1C8
-PAPER = $F204
-INK = $F210
+PARAM1 = $2E1
+PARAM2 = $2E3
+PARAM3 = $2E5
+TEXT = $EC21
+HIRES = $EC33
+CURSET = $F0C8
+CURMOV = $F0FD
+DRAW = $F110
+CHAR = $F12D
+POINT = $F1C8
+PAPER = $F204
+INK = $F210
.rodata
-DEFPALETTE: .byte 0, 1
+DEFPALETTE: .byte 0, 1
.code
@@ -115,7 +115,7 @@ INSTALL:
;
UNINSTALL:
- rts
+ rts
; ------------------------------------------------------------------------
; INIT: Changes an already installed device from text mode to graphics
@@ -135,13 +135,13 @@ INIT:
; Switch into graphics mode
- jsr HIRES
+ jsr HIRES
; Done, reset the error code
- lda #TGI_ERR_OK
- sta ERROR
- rts
+ lda #TGI_ERR_OK
+ sta ERROR
+ rts
; ------------------------------------------------------------------------
; DONE: Will be called to switch the graphics device back into text mode.
@@ -151,16 +151,16 @@ INIT:
; Must set an error code: NO
;
-DONE = TEXT
+DONE = TEXT
; ------------------------------------------------------------------------
; GETERROR: Return the error code in A and clear it.
GETERROR:
- ldx #TGI_ERR_OK
- lda ERROR
- stx ERROR
- rts
+ ldx #TGI_ERR_OK
+ lda ERROR
+ stx ERROR
+ rts
; ------------------------------------------------------------------------
; CONTROL: Platform/driver specific entry point.
@@ -169,10 +169,10 @@ GETERROR:
;
CONTROL:
- sta $213
- lda #TGI_ERR_OK
- sta ERROR
- rts
+ sta $213
+ lda #TGI_ERR_OK
+ sta ERROR
+ rts
; ------------------------------------------------------------------------
; CLEAR: Clears the screen.
@@ -180,7 +180,7 @@ CONTROL:
; Must set an error code: NO
;
-CLEAR = HIRES
+CLEAR = HIRES
; ------------------------------------------------------------------------
; SETVIEWPAGE: Set the visible page. Called with the new page in A (0..n).
@@ -199,7 +199,7 @@ SETVIEWPAGE:
;
SETDRAWPAGE:
- rts
+ rts
; ------------------------------------------------------------------------
; SETCOLOR: Set the drawing color (in A). The new color is already checked
@@ -209,8 +209,8 @@ SETDRAWPAGE:
;
SETCOLOR:
- sta MODE
- rts
+ sta MODE
+ rts
; ------------------------------------------------------------------------
; SETPALETTE: Set the palette (not available with all drivers/hardware).
@@ -221,9 +221,9 @@ SETCOLOR:
;
SETPALETTE:
- lda #TGI_ERR_INV_FUNC ; This resolution has no palette
- sta ERROR
- rts
+ lda #TGI_ERR_INV_FUNC ; This resolution has no palette
+ sta ERROR
+ rts
; ------------------------------------------------------------------------
; GETPALETTE: Return the current palette in A/X. Even drivers that cannot
@@ -245,9 +245,9 @@ GETPALETTE:
;
GETDEFPALETTE:
- lda #DEFPALETTE
- rts
+ lda #DEFPALETTE
+ rts
; ------------------------------------------------------------------------
; SETPIXEL: Draw one pixel at X1/Y1 = ptr1/ptr2 with the current drawing
@@ -258,17 +258,17 @@ GETDEFPALETTE:
;
SETPIXEL:
- lda Y1
- sta PARAM2
- lda MODE
-mymode: sta PARAM3
- lda X1
- sta PARAM1
- lda #0
- sta PARAM1+1
- sta PARAM2+1
- sta PARAM3+1
- jmp CURSET
+ lda Y1
+ sta PARAM2
+ lda MODE
+mymode: sta PARAM3
+ lda X1
+ sta PARAM1
+ lda #0
+ sta PARAM1+1
+ sta PARAM2+1
+ sta PARAM3+1
+ jmp CURSET
; ------------------------------------------------------------------------
; GETPIXEL: Read the color value of a pixel and return it in A/X. The
@@ -276,18 +276,18 @@ mymode: sta PARAM3
; area, so there is no need for clipping inside this function.
GETPIXEL:
- lda X1
- sta PARAM1
- lda Y1
- sta PARAM2
- lda #0
- sta PARAM1+1
- sta PARAM2+1
- jsr POINT
- lda PARAM1
- and #%00000001
- ldx #0
- rts
+ lda X1
+ sta PARAM1
+ lda Y1
+ sta PARAM2
+ lda #0
+ sta PARAM1+1
+ sta PARAM2+1
+ jsr POINT
+ lda PARAM1
+ and #%00000001
+ ldx #0
+ rts
; ------------------------------------------------------------------------
; LINE: Draw a line from X1/Y1 to X2/Y2, where X1/Y1 = ptr1/ptr2 and
@@ -297,24 +297,24 @@ GETPIXEL:
;
LINE:
- jsr SETPIXEL
- lda X2
- sub X1
- sta PARAM1
- lda X2+1
- sbc X1+1
- sta PARAM1+1
- lda Y2
- sub Y1
- sta PARAM2
- lda Y2+1
- sbc Y1+1
- sta PARAM2+1
- lda MODE
- sta PARAM3
- ldx #>0
- stx PARAM3+1
- jmp DRAW
+ jsr SETPIXEL
+ lda X2
+ sub X1
+ sta PARAM1
+ lda X2+1
+ sbc X1+1
+ sta PARAM1+1
+ lda Y2
+ sub Y1
+ sta PARAM2
+ lda Y2+1
+ sbc Y1+1
+ sta PARAM2+1
+ lda MODE
+ sta PARAM3
+ ldx #>0
+ stx PARAM3+1
+ jmp DRAW
; ------------------------------------------------------------------------
; BAR: Draw a filled rectangle with the corners X1/Y1, X2/Y2, where
@@ -322,29 +322,29 @@ LINE:
; Contrary to most other functions, the graphics kernel will sort and clip
; the coordinates before calling the driver, so on entry the following
; conditions are valid:
-; X1 <= X2
-; Y1 <= Y2
-; (X1 >= 0) && (X1 < XRES)
-; (X2 >= 0) && (X2 < XRES)
-; (Y1 >= 0) && (Y1 < YRES)
-; (Y2 >= 0) && (Y2 < YRES)
+; X1 <= X2
+; Y1 <= Y2
+; (X1 >= 0) && (X1 < XRES)
+; (X2 >= 0) && (X2 < XRES)
+; (Y1 >= 0) && (Y1 < YRES)
+; (Y2 >= 0) && (Y2 < YRES)
;
; Must set an error code: NO
;
BAR:
- inc Y2
-@L1: lda Y2
- pha
- lda Y1
- sta Y2
- jsr LINE
- pla
- sta Y2
- inc Y1
- cmp Y1
- bne @L1
- rts
+ inc Y2
+@L1: lda Y2
+ pha
+ lda Y1
+ sta Y2
+ jsr LINE
+ pla
+ sta Y2
+ inc Y1
+ cmp Y1
+ bne @L1
+ rts
; ------------------------------------------------------------------------
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y
@@ -354,7 +354,7 @@ BAR:
;
TEXTSTYLE:
- rts
+ rts
; ------------------------------------------------------------------------
@@ -366,38 +366,38 @@ TEXTSTYLE:
;
OUTTEXT:
- lda Y1
- sub #(YSIZE - 1)
- sta PARAM2
- lda #3 ; (Move graphics cursor; don't draw)
- jsr mymode
-
- ldy #0
-@next: lda (ptr3),y
- beq @end
- sta PARAM1
- lda #0
- sta PARAM2
- sta PARAM1+1
- sta PARAM2+1
- sta PARAM3+1
- lda MODE
- sta PARAM3
- tya
- pha
- jsr CHAR
- lda #XSIZE
- sta PARAM1
- lda #0
- sta PARAM2
- sta PARAM1+1
- sta PARAM2+1
- sta PARAM3+1
- lda #3
- sta PARAM3
- jsr CURMOV
- pla
- tay
- iny
- bne @next
-@end: rts
+ lda Y1
+ sub #(YSIZE - 1)
+ sta PARAM2
+ lda #3 ; (Move graphics cursor; don't draw)
+ jsr mymode
+
+ ldy #0
+@next: lda (ptr3),y
+ beq @end
+ sta PARAM1
+ lda #0
+ sta PARAM2
+ sta PARAM1+1
+ sta PARAM2+1
+ sta PARAM3+1
+ lda MODE
+ sta PARAM3
+ tya
+ pha
+ jsr CHAR
+ lda #XSIZE
+ sta PARAM1
+ lda #0
+ sta PARAM2
+ sta PARAM1+1
+ sta PARAM2+1
+ sta PARAM3+1
+ lda #3
+ sta PARAM3
+ jsr CURMOV
+ pla
+ tay
+ iny
+ bne @next
+@end: rts
diff --git a/libsrc/atmos/tgi_colors.s b/libsrc/atmos/tgi_colors.s
index 4dab483e2..6ef3729b4 100644
--- a/libsrc/atmos/tgi_colors.s
+++ b/libsrc/atmos/tgi_colors.s
@@ -2,7 +2,7 @@
; Target-specific black & white values for use by the target-shared TGI kernel
;
- .include "tgi-kernel.inc"
+ .include "tgi-kernel.inc"
- .export tgi_color_black:zp = $00
- .export tgi_color_white:zp = $01
+ .export tgi_color_black:zp = $00
+ .export tgi_color_white:zp = $01
diff --git a/libsrc/atmos/tgi_stat_stddrv.s b/libsrc/atmos/tgi_stat_stddrv.s
index 89aef440f..7411f6276 100644
--- a/libsrc/atmos/tgi_stat_stddrv.s
+++ b/libsrc/atmos/tgi_stat_stddrv.s
@@ -6,8 +6,8 @@
; const void tgi_static_stddrv[];
;
- .export _tgi_static_stddrv
- .import _atmos_240_200_2_tgi
+ .export _tgi_static_stddrv
+ .import _atmos_240_200_2_tgi
.rodata
diff --git a/libsrc/atmos/tgi_stddrv.s b/libsrc/atmos/tgi_stddrv.s
index 905380bcd..d5c1a8eba 100644
--- a/libsrc/atmos/tgi_stddrv.s
+++ b/libsrc/atmos/tgi_stddrv.s
@@ -6,8 +6,8 @@
; const char tgi_stddrv[];
;
- .export _tgi_stddrv
+ .export _tgi_stddrv
.rodata
-_tgi_stddrv: .asciiz "atmos-240-200-2.tgi"
+_tgi_stddrv: .asciiz "atmos-240-200-2.tgi"
diff --git a/libsrc/atmos/toascii.s b/libsrc/atmos/toascii.s
index 606fb0b6b..69e0cf07a 100644
--- a/libsrc/atmos/toascii.s
+++ b/libsrc/atmos/toascii.s
@@ -3,12 +3,12 @@
; /* Convert a target-specific character to ASCII. */
;
-.export _toascii
+.export _toascii
-.proc _toascii
+.proc _toascii
; .X must be zero, on return.
- ldx #>0
- rts
+ ldx #>0
+ rts
.endproc
diff --git a/libsrc/atmos/wherex.s b/libsrc/atmos/wherex.s
index 649f1adfe..7a2dbadc1 100644
--- a/libsrc/atmos/wherex.s
+++ b/libsrc/atmos/wherex.s
@@ -4,7 +4,7 @@
; unsigned char wherex (void);
;
- .export _wherex
+ .export _wherex
.include "atmos.inc"
@@ -12,7 +12,7 @@
ldx #$00
lda CURS_X
- rts
+ rts
.endproc
diff --git a/libsrc/atmos/wherey.s b/libsrc/atmos/wherey.s
index 3a940c581..8a2b3443f 100644
--- a/libsrc/atmos/wherey.s
+++ b/libsrc/atmos/wherey.s
@@ -4,7 +4,7 @@
; unsigned char wherey (void);
;
- .export _wherey
+ .export _wherey
.include "atmos.inc"
@@ -12,7 +12,7 @@
ldx #$00
lda CURS_Y
- rts
+ rts
.endproc
diff --git a/libsrc/atmos/write.s b/libsrc/atmos/write.s
index b7129dd1a..c6399f2bf 100644
--- a/libsrc/atmos/write.s
+++ b/libsrc/atmos/write.s
@@ -6,16 +6,16 @@
; This function is a hack!
;
- .export _write
- .import popax
- .importzp ptr1, ptr2, ptr3, tmp1
+ .export _write
+ .import popax
+ .importzp ptr1, ptr2, ptr3, tmp1
- .include "atmos.inc"
+ .include "atmos.inc"
.proc _write
- sta ptr3
- stx ptr3+1 ; save count as result
+ sta ptr3
+ stx ptr3+1 ; save count as result
eor #$FF
sta ptr2
@@ -23,32 +23,32 @@
eor #$FF
sta ptr2+1 ; Remember -count-1
- jsr popax ; get buf
- sta ptr1
- stx ptr1+1
- jsr popax ; get fd and discard
-L1: inc ptr2
+ jsr popax ; get buf
+ sta ptr1
+ stx ptr1+1
+ jsr popax ; get fd and discard
+L1: inc ptr2
bne L2
inc ptr2+1
beq L9
L2: ldy #0
- lda (ptr1),y
+ lda (ptr1),y
tax
cpx #$0A ; Check for \n
bne L3
jsr PRINT
ldx #$0D
L3: jsr PRINT
- inc ptr1
- bne L1
- inc ptr1+1
+ inc ptr1
+ bne L1
+ inc ptr1+1
jmp L1
; No error, return count
-L9: lda ptr3
- ldx ptr3+1
- rts
+L9: lda ptr3
+ ldx ptr3+1
+ rts
.endproc
diff --git a/libsrc/c128/_scrsize.s b/libsrc/c128/_scrsize.s
index 1f38ea65c..ad01f402c 100644
--- a/libsrc/c128/_scrsize.s
+++ b/libsrc/c128/_scrsize.s
@@ -4,7 +4,7 @@
; Screen size variables
;
- .export screensize
+ .export screensize
.include "c128.inc"
diff --git a/libsrc/c128/break.s b/libsrc/c128/break.s
index 4cb349444..f2f872be8 100644
--- a/libsrc/c128/break.s
+++ b/libsrc/c128/break.s
@@ -5,69 +5,69 @@
; void reset_brk (void);
;
- .export _set_brk, _reset_brk
- .destructor _reset_brk
- .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
- .importzp ptr1
+ .export _set_brk, _reset_brk
+ .destructor _reset_brk
+ .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
+ .importzp ptr1
- .include "c128.inc"
+ .include "c128.inc"
.bss
-_brk_a: .res 1
-_brk_x: .res 1
-_brk_y: .res 1
-_brk_sr: .res 1
-_brk_pc: .res 2
+_brk_a: .res 1
+_brk_x: .res 1
+_brk_y: .res 1
+_brk_sr: .res 1
+_brk_pc: .res 2
.data
-uservec: jmp $FFFF ; Patched at runtime
+uservec: jmp $FFFF ; Patched at runtime
.code
; Set the break vector
-.proc _set_brk
+.proc _set_brk
- sta uservec+1
- stx uservec+2 ; Set the user vector
+ sta uservec+1
+ stx uservec+2 ; Set the user vector
- lda brk_old+1
- ora brk_old+2 ; Did we save the vector already?
- bne @L1 ; Jump if we installed the handler already
+ lda brk_old+1
+ ora brk_old+2 ; Did we save the vector already?
+ bne @L1 ; Jump if we installed the handler already
- lda BRKVec ; Save the old vector
- sta brk_old+1
- lda BRKVec+1
- sta brk_old+2
+ lda BRKVec ; Save the old vector
+ sta brk_old+1
+ lda BRKVec+1
+ sta brk_old+2
- lda #brk_stub
- sta BRKVec
- stx BRKVec+1
+ lda #brk_stub
+ sta BRKVec
+ stx BRKVec+1
- lda #brk_handler
- sta brk_ind+1
- stx brk_ind+2
+ lda #brk_handler
+ sta brk_ind+1
+ stx brk_ind+2
-@L1: rts
+@L1: rts
.endproc
; Reset the break vector
-.proc _reset_brk
-
- lda brk_old+1
- ldx brk_old+2
- beq @L9 ; Jump if vector not installed
- sta BRKVec
- stx BRKVec+1
- lda #$00
- sta brk_old+1 ; Clear the saved vector
- sta brk_old+2
-@L9: rts
+.proc _reset_brk
+
+ lda brk_old+1
+ ldx brk_old+2
+ beq @L9 ; Jump if vector not installed
+ sta BRKVec
+ stx BRKVec+1
+ lda #$00
+ sta brk_old+1 ; Clear the saved vector
+ sta brk_old+2
+@L9: rts
.endproc
@@ -75,37 +75,37 @@ uservec: jmp $FFFF ; Patched at runtime
; Break handler, called if a break occurs
-.proc brk_handler
-
- pla
- sta _brk_y
- pla
- sta _brk_x
- pla
- sta _brk_a
- pla
- and #$EF ; Clear break bit
- sta _brk_sr
- pla ; PC low
- sec
- sbc #2 ; Point to start of brk
- sta _brk_pc
- pla ; PC high
- sbc #0
- sta _brk_pc+1
-
- jsr uservec ; Call the user's routine
-
- lda _brk_pc+1
- pha
- lda _brk_pc
- pha
- lda _brk_sr
- pha
- ldx _brk_x
- ldy _brk_y
- lda _brk_a
- rti ; Jump back...
+.proc brk_handler
+
+ pla
+ sta _brk_y
+ pla
+ sta _brk_x
+ pla
+ sta _brk_a
+ pla
+ and #$EF ; Clear break bit
+ sta _brk_sr
+ pla ; PC low
+ sec
+ sbc #2 ; Point to start of brk
+ sta _brk_pc
+ pla ; PC high
+ sbc #0
+ sta _brk_pc+1
+
+ jsr uservec ; Call the user's routine
+
+ lda _brk_pc+1
+ pha
+ lda _brk_pc
+ pha
+ lda _brk_sr
+ pha
+ ldx _brk_x
+ ldy _brk_y
+ lda _brk_a
+ rti ; Jump back...
.endproc
@@ -115,9 +115,9 @@ uservec: jmp $FFFF ; Patched at runtime
.segment "LOWCODE"
.proc brk_stub
- pla ; Get original MMU_CR value
- sta MMU_CR ; And set it
- jmp brk_ind ; Jump indirect to break
+ pla ; Get original MMU_CR value
+ sta MMU_CR ; And set it
+ jmp brk_ind ; Jump indirect to break
.endproc
; ------------------------------------------------------------------------
diff --git a/libsrc/c128/c64mode.s b/libsrc/c128/c64mode.s
index bc3f9d36c..053e67dfc 100644
--- a/libsrc/c128/c64mode.s
+++ b/libsrc/c128/c64mode.s
@@ -5,8 +5,8 @@
; /* Switch the C128 into C64 mode. Note: This function will not return! */
;
- .export _c64mode
+ .export _c64mode
.import C64MODE
- _c64mode = C64MODE
+ _c64mode = C64MODE
diff --git a/libsrc/c128/cgetc.s b/libsrc/c128/cgetc.s
index 78e06b1eb..46f13d197 100644
--- a/libsrc/c128/cgetc.s
+++ b/libsrc/c128/cgetc.s
@@ -4,18 +4,18 @@
; char cgetc (void);
;
- .export _cgetc
+ .export _cgetc
.constructor initcgetc
.destructor donecgetc
- .import cursor
+ .import cursor
- .include "c128.inc"
+ .include "c128.inc"
;--------------------------------------------------------------------------
-_cgetc: lda KEY_COUNT ; Get number of characters
- bne L2 ; Jump if there are already chars waiting
+_cgetc: lda KEY_COUNT ; Get number of characters
+ bne L2 ; Jump if there are already chars waiting
; Switch on the cursor if needed. We MUST always switch the cursor on,
; before switching it off, because switching it off will restore the
@@ -23,50 +23,50 @@ _cgetc: lda KEY_COUNT ; Get number of characters
; it off will restore the wrong character attribute.
jsr CURS_SET ; Set cursor to current position
- jsr CURS_ON
- lda cursor
- bne L1
- lda #$01
- jsr CURS_OFF
-L1: lda KEY_COUNT ; Check characters again
- beq L1
- jsr CURS_OFF ; Switch cursor off, if characters available
-
-L2: jsr KBDREAD ; Read char and return in A
+ jsr CURS_ON
+ lda cursor
+ bne L1
+ lda #$01
+ jsr CURS_OFF
+L1: lda KEY_COUNT ; Check characters again
+ beq L1
+ jsr CURS_OFF ; Switch cursor off, if characters available
+
+L2: jsr KBDREAD ; Read char and return in A
ldx #0
- rts
+ rts
;--------------------------------------------------------------------------
; Module constructor/destructor
.bss
-keyvec: .res 2
+keyvec: .res 2
.segment "INIT"
initcgetc:
; Save the old vector
- lda KeyStoreVec
- sta keyvec
- lda KeyStoreVec+1
- sta keyvec+1
+ lda KeyStoreVec
+ sta keyvec
+ lda KeyStoreVec+1
+ sta keyvec+1
; Set the new vector. I can only hope that this works for other C128
; versions...
- lda #<$C6B7
- ldx #>$C6B7
+ lda #<$C6B7
+ ldx #>$C6B7
jmp SetVec
.code
donecgetc:
- lda keyvec
- ldx keyvec+1
-SetVec: sei
- sta KeyStoreVec
- stx KeyStoreVec+1
- cli
- rts
+ lda keyvec
+ ldx keyvec+1
+SetVec: sei
+ sta KeyStoreVec
+ stx KeyStoreVec+1
+ cli
+ rts
diff --git a/libsrc/c128/clrscr.s b/libsrc/c128/clrscr.s
index 54219b007..2213be0cd 100644
--- a/libsrc/c128/clrscr.s
+++ b/libsrc/c128/clrscr.s
@@ -4,11 +4,11 @@
; void clrscr (void);
;
- .export _clrscr
+ .export _clrscr
- .include "c128.inc"
+ .include "c128.inc"
-_clrscr = CLRSCR
+_clrscr = CLRSCR
diff --git a/libsrc/c128/color.s b/libsrc/c128/color.s
index 5ee12431b..9e6b8537f 100644
--- a/libsrc/c128/color.s
+++ b/libsrc/c128/color.s
@@ -6,15 +6,15 @@
; unsigned char __fastcall__ bordercolor (unsigned char color);
;
- .export _textcolor, _bgcolor, _bordercolor
+ .export _textcolor, _bgcolor, _bordercolor
.import return0
- .include "c128.inc"
+ .include "c128.inc"
_textcolor:
- bit MODE ; Check 80/40 column mode
- bmi @L1 ; Jump if 80 columns
+ bit MODE ; Check 80/40 column mode
+ bmi @L1 ; Jump if 80 columns
; 40 column mode
@@ -29,7 +29,7 @@ _textcolor:
@L1: tax ; Move new color to X
lda CHARCOLOR ; Get old color + attributes
and #$F0 ; Keep old attributes
- ora $CE5C,x ; Translate VIC color -> VDC color
+ ora $CE5C,x ; Translate VIC color -> VDC color
ldx CHARCOLOR ; Get the old color
sta CHARCOLOR ; Set the new color + old attributes
txa ; Old color -> A
@@ -39,13 +39,13 @@ _textcolor:
; translate vdc->vic colour
vdctovic:
- ldy #16
-@L2: cmp $CE5C-1,y
- beq @L3
+ ldy #16
+@L2: cmp $CE5C-1,y
+ beq @L3
dey
bne @L2
-@L3: tya
- rts
+@L3: tya
+ rts
_bgcolor:
@@ -54,27 +54,27 @@ _bgcolor:
; 40 column mode
- ldx VIC_BG_COLOR0 ; get old value
- sta VIC_BG_COLOR0 ; set new value
- txa
+ ldx VIC_BG_COLOR0 ; get old value
+ sta VIC_BG_COLOR0 ; set new value
+ txa
ldx #$00
- rts
+ rts
; 80 column mode
@L1: tax ; Move new color to X
- lda $CE5C,x ; Translate VIC color -> VDC color
- pha
- ldx #26
- jsr $CDDA ; Read vdc register 26
- jsr vdctovic
- tay
- pla
- ldx #26
- jsr $CDCC ; Write vdc register 26
- tya
+ lda $CE5C,x ; Translate VIC color -> VDC color
+ pha
+ ldx #26
+ jsr $CDDA ; Read vdc register 26
+ jsr vdctovic
+ tay
+ pla
+ ldx #26
+ jsr $CDCC ; Write vdc register 26
+ tya
ldx #$00
- rts
+ rts
_bordercolor:
@@ -83,11 +83,11 @@ _bordercolor:
; 40 column mode
- ldx VIC_BORDERCOLOR ; get old value
- sta VIC_BORDERCOLOR ; set new value
- txa
+ ldx VIC_BORDERCOLOR ; get old value
+ sta VIC_BORDERCOLOR ; set new value
+ txa
ldx #$00
- rts
+ rts
; 80 column mode
diff --git a/libsrc/c128/conio.s b/libsrc/c128/conio.s
index 42df1437a..5193fb807 100644
--- a/libsrc/c128/conio.s
+++ b/libsrc/c128/conio.s
@@ -4,7 +4,7 @@
; Low level stuff for screen output/console input
;
- .exportzp CURS_X, CURS_Y
+ .exportzp CURS_X, CURS_Y
- .include "c128.inc"
+ .include "c128.inc"
diff --git a/libsrc/c128/cputc.s b/libsrc/c128/cputc.s
index 73abdec52..e906c242a 100644
--- a/libsrc/c128/cputc.s
+++ b/libsrc/c128/cputc.s
@@ -6,12 +6,12 @@
; void cputc (char c);
;
- .export _cputcxy, _cputc, cputdirect, putchar
- .export newline, plot
- .import popa, _gotoxy
+ .export _cputcxy, _cputc, cputdirect, putchar
+ .export newline, plot
+ .import popa, _gotoxy
.import PLOT
- .include "c128.inc"
+ .include "c128.inc"
newline = NEWLINE
@@ -20,31 +20,31 @@ newline = NEWLINE
.code
_cputcxy:
- pha ; Save C
- jsr popa ; Get Y
- jsr _gotoxy ; Set cursor, drop x
- pla ; Restore C
+ pha ; Save C
+ jsr popa ; Get Y
+ jsr _gotoxy ; Set cursor, drop x
+ pla ; Restore C
; Plot a character - also used as internal function
-_cputc: cmp #$0A ; CR?
- beq cr ; Output a cr
+_cputc: cmp #$0A ; CR?
+ beq cr ; Output a cr
- cmp #$0D ; LF?
- bne L2
- jmp NEWLINE ; Update cursor position
+ cmp #$0D ; LF?
+ bne L2
+ jmp NEWLINE ; Update cursor position
; Printable char of some sort
-L2: cmp #' '
- bcc cputdirect ; Other control char
- tay
- bmi L5
- cmp #$60
- bcc L3
- and #$DF
- bne cputdirect ; Branch always
-L3: and #$3F
+L2: cmp #' '
+ bcc cputdirect ; Other control char
+ tay
+ bmi L5
+ cmp #$60
+ bcc L3
+ and #$DF
+ bne cputdirect ; Branch always
+L3: and #$3F
; Output one character to the screen. We will disable scrolling while doing so
@@ -62,28 +62,28 @@ cputdirect:
; Handle character if high bit set
-L5: and #$7F
- cmp #$7E ; PI?
- bne L6
- lda #$5E ; Load screen code for PI
- bne cputdirect
-L6: ora #$40
- bne cputdirect ; Branch always
+L5: and #$7F
+ cmp #$7E ; PI?
+ bne L6
+ lda #$5E ; Load screen code for PI
+ bne cputdirect
+L6: ora #$40
+ bne cputdirect ; Branch always
; Carriage return
-cr: lda #0
- sta CURS_X
+cr: lda #0
+ sta CURS_X
; Set cursor position, calculate RAM pointers
-plot: ldy CURS_X
- ldx CURS_Y
- clc
- jmp PLOT ; Set the new cursor
+plot: ldy CURS_X
+ ldx CURS_Y
+ clc
+ jmp PLOT ; Set the new cursor
; Write one character to the screen without doing anything else, return X
; position in Y
-putchar = $CC2F
+putchar = $CC2F
diff --git a/libsrc/c128/crt0.s b/libsrc/c128/crt0.s
index 4315947e1..cd104decd 100644
--- a/libsrc/c128/crt0.s
+++ b/libsrc/c128/crt0.s
@@ -2,119 +2,119 @@
; Startup code for cc65 (C128 version)
;
- .export _exit
- .export __STARTUP__ : absolute = 1 ; Mark as startup
- .import initlib, donelib
- .import zerobss
- .import push0, callmain
- .import RESTOR, BSOUT, CLRCH
- .import __RAM_START__, __RAM_SIZE__, __STACKSIZE__
- .importzp ST
+ .export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
+ .import initlib, donelib
+ .import zerobss
+ .import push0, callmain
+ .import RESTOR, BSOUT, CLRCH
+ .import __RAM_START__, __RAM_SIZE__, __STACKSIZE__
+ .importzp ST
- .include "zeropage.inc"
- .include "c128.inc"
+ .include "zeropage.inc"
+ .include "c128.inc"
; ------------------------------------------------------------------------
; Startup code
-.segment "STARTUP"
+.segment "STARTUP"
Start:
; Switch to the second charset
- lda #14
- jsr BSOUT
+ lda #14
+ jsr BSOUT
; Before doing anything else, we have to setup our banking configuration.
; Otherwise just the lowest 16K are actually RAM. Writing through the ROM
; to the underlying RAM works, but it is bad style.
- lda MMU_CR ; Get current memory configuration...
- pha ; ...and save it for later
- lda #MMU_CFG_CC65 ; Bank0 with kernal ROM
- sta MMU_CR
+ lda MMU_CR ; Get current memory configuration...
+ pha ; ...and save it for later
+ lda #MMU_CFG_CC65 ; Bank0 with kernal ROM
+ sta MMU_CR
; Save the zero page locations we need
- ldx #zpspace-1
-L1: lda sp,x
- sta zpsave,x
- dex
- bpl L1
+ ldx #zpspace-1
+L1: lda sp,x
+ sta zpsave,x
+ dex
+ bpl L1
; Clear the BSS data
- jsr zerobss
+ jsr zerobss
; Save system stuff and setup the stack
- pla ; Get MMU setting
- sta mmusave
+ pla ; Get MMU setting
+ sta mmusave
- tsx
- stx spsave ; Save the system stack pointer
+ tsx
+ stx spsave ; Save the system stack pointer
- lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
- sta sp
- lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
- sta sp+1 ; Set argument stack ptr
+ lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+ sta sp
+ lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+ sta sp+1 ; Set argument stack ptr
; Call module constructors
- jsr initlib
+ jsr initlib
; Set the bank for the file name to our execution bank. We must do this,
; *after* calling constructors, because some of them may depend on the
; original value of this register.
- lda #0
- sta FNAM_BANK
+ lda #0
+ sta FNAM_BANK
; Push arguments and call main()
- jsr callmain
+ jsr callmain
; Back from main (this is also the _exit entry). Run module destructors
-_exit: pha ; Save the return code on stack
- jsr donelib
+_exit: pha ; Save the return code on stack
+ jsr donelib
; Copy back the zero page stuff
- ldx #zpspace-1
-L2: lda zpsave,x
- sta sp,x
- dex
- bpl L2
+ ldx #zpspace-1
+L2: lda zpsave,x
+ sta sp,x
+ dex
+ bpl L2
; Place the program return code into ST
- pla
- sta ST
+ pla
+ sta ST
; Reset the stack and the memory configuration
- ldx spsave
- txs
- ldx mmusave
- stx MMU_CR
+ ldx spsave
+ txs
+ ldx mmusave
+ stx MMU_CR
; Done, return to BASIC
- rts
+ rts
; ------------------------------------------------------------------------
; Data
-.segment "ZPSAVE"
+.segment "ZPSAVE"
-zpsave: .res zpspace
+zpsave: .res zpspace
; ------------------------------------------------------------------------
.bss
-spsave: .res 1
-mmusave:.res 1
+spsave: .res 1
+mmusave:.res 1
diff --git a/libsrc/c128/dbgbreak.s_ b/libsrc/c128/dbgbreak.s_
index 472d800fe..a99071786 100644
--- a/libsrc/c128/dbgbreak.s_
+++ b/libsrc/c128/dbgbreak.s_
@@ -4,20 +4,20 @@
; unsigned DbgSetBreakVec (unsigned Addr);
;
- .export _DbgSetBreakVec
- .import popax, utstax
-
- .include "../cbm/cbm.inc"
+ .export _DbgSetBreakVec
+ .import popax, utstax
+
+ .include "../cbm/cbm.inc"
_DbgSetBreakVec:
- jsr popax ; Get the new address
- ldy BRKVec
- sta BRKVec
- lda BRKVec+1
- stx BRKVec+1
- tax
- tya
- jmp utstax
+ jsr popax ; Get the new address
+ ldy BRKVec
+ sta BRKVec
+ lda BRKVec+1
+ stx BRKVec+1
+ tax
+ tya
+ jmp utstax
diff --git a/libsrc/c128/devnum.s b/libsrc/c128/devnum.s
index 72007a516..91d0ccc07 100644
--- a/libsrc/c128/devnum.s
+++ b/libsrc/c128/devnum.s
@@ -2,6 +2,6 @@
; Oliver Schmidt, 2010-02-14
;
- .include "c128.inc"
+ .include "c128.inc"
- .exportzp devnum := DEVNUM
+ .exportzp devnum := DEVNUM
diff --git a/libsrc/c128/emd/c128-georam.s b/libsrc/c128/emd/c128-georam.s
index 23c3469c5..0c106f406 100644
--- a/libsrc/c128/emd/c128-georam.s
+++ b/libsrc/c128/emd/c128-georam.s
@@ -8,9 +8,9 @@
; Marco van den Heuvel, 2010-01-21
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "em-kernel.inc"
+ .include "em-kernel.inc"
.include "em-error.inc"
@@ -25,7 +25,7 @@
; Driver signature
.byte $65, $6d, $64 ; "emd"
- .byte EMD_API_VERSION ; EM API version number
+ .byte EMD_API_VERSION ; EM API version number
; Jump table.
@@ -62,83 +62,83 @@ pagecount: .res 2 ; Number of available pages
;
INSTALL:
- ldx GR_WINDOW
+ ldx GR_WINDOW
cpx GR_WINDOW
bne @notpresent
inc GR_WINDOW
- cpx GR_WINDOW
- beq @notpresent
-
- lda #4
- jsr check
- cpy GR_WINDOW
- beq @has64k
- lda #8
- jsr check
- cpy GR_WINDOW
- beq @has128k
- lda #16
- jsr check
- cpy GR_WINDOW
- beq @has256k
- lda #32
- jsr check
- cpy GR_WINDOW
- beq @has512k
- lda #64
- jsr check
- cpy GR_WINDOW
- beq @has1024k
- lda #128
- jsr check
- cpy GR_WINDOW
- beq @has2048k
- ldx #>16384
+ cpx GR_WINDOW
+ beq @notpresent
+
+ lda #4
+ jsr check
+ cpy GR_WINDOW
+ beq @has64k
+ lda #8
+ jsr check
+ cpy GR_WINDOW
+ beq @has128k
+ lda #16
+ jsr check
+ cpy GR_WINDOW
+ beq @has256k
+ lda #32
+ jsr check
+ cpy GR_WINDOW
+ beq @has512k
+ lda #64
+ jsr check
+ cpy GR_WINDOW
+ beq @has1024k
+ lda #128
+ jsr check
+ cpy GR_WINDOW
+ beq @has2048k
+ ldx #>16384
bne @setok
@has64k:
- ldx #>256
- bne @setok
+ ldx #>256
+ bne @setok
@has128k:
- ldx #>512
- bne @setok
+ ldx #>512
+ bne @setok
@has256k:
- ldx #>1024
- bne @setok
+ ldx #>1024
+ bne @setok
@has512k:
- ldx #>2048
- bne @setok
+ ldx #>2048
+ bne @setok
@has1024k:
- ldx #>4096
- bne @setok
+ ldx #>4096
+ bne @setok
@has2048k:
- ldx #>8192
- bne @setok
+ ldx #>8192
+ bne @setok
@notpresent:
- lda #EM_ERR_NO_DEVICE
- rts
+ lda #EM_ERR_NO_DEVICE
+ rts
@setok:
- lda #0
- sta pagecount
- stx pagecount+1
- lda #EM_ERR_OK
- rts
+ lda #0
+ sta pagecount
+ stx pagecount+1
+ lda #EM_ERR_OK
+ rts
check:
- ldx #0
- stx GR_PAGE_LO
- stx GR_PAGE_HI
- ldy GR_WINDOW
- iny
- sta GR_PAGE_HI
- sty GR_WINDOW
- ldx #0
- stx GR_PAGE_HI
-; rts ; Run into UNINSTALL instead
+ ldx #0
+ stx GR_PAGE_LO
+ stx GR_PAGE_HI
+ ldy GR_WINDOW
+ iny
+ sta GR_PAGE_HI
+ sty GR_WINDOW
+ ldx #0
+ stx GR_PAGE_HI
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
diff --git a/libsrc/c128/emd/c128-ram.s b/libsrc/c128/emd/c128-ram.s
index 1211c444d..02979a6dc 100644
--- a/libsrc/c128/emd/c128-ram.s
+++ b/libsrc/c128/emd/c128-ram.s
@@ -5,9 +5,9 @@
; Ullrich von Bassewitz, 2002-12-04
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "em-kernel.inc"
+ .include "em-kernel.inc"
.include "em-error.inc"
.include "c128.inc"
@@ -23,7 +23,7 @@
; Driver signature
.byte $65, $6d, $64 ; "emd"
- .byte EMD_API_VERSION ; EM API version number
+ .byte EMD_API_VERSION ; EM API version number
; Jump table.
@@ -33,15 +33,15 @@
.word MAP
.word USE
.word COMMIT
- .word COPYFROM
+ .word COPYFROM
.word COPYTO
; ------------------------------------------------------------------------
; Constants
-BASE = $400
+BASE = $400
TOPMEM = $FF00
-PAGES = (TOPMEM - BASE) / 256
+PAGES = (TOPMEM - BASE) / 256
; ------------------------------------------------------------------------
; Data.
@@ -96,10 +96,10 @@ MAP: sta curpage
stx curpage+1 ; Remember the new page
clc
- adc #>BASE
- sta ptr1+1
- ldy #$00
- sty ptr1
+ adc #>BASE
+ sta ptr1+1
+ ldy #$00
+ sty ptr1
lda #BASE
- sta ptr1+1
- ldy #$00
- sty ptr1
+ adc #>BASE
+ sta ptr1+1
+ ldy #$00
+ sty ptr1
lda #BASE
- sta ptr1+1
- ldy #$00
+ adc #>BASE
+ sta ptr1+1
+ ldy #$00
sty ptr1
lda #512
- bne @setsize
-@rc64: ldx #>256
+ ldx RAMC_WINDOW
+ cpx RAMC_WINDOW
+ bne @notpresent
+
+ lda #0
+ sta RAMC_PAGE_LO
+ sta RAMC_PAGE_HI
+ ldx RAMC_WINDOW
+ cpx RAMC_WINDOW
+ bne @notpresent
+ lda #2
+ sta RAMC_WINDOW
+ cmp RAMC_WINDOW
+ beq @cont
+ cpx RAMC_WINDOW
+ beq @readonly
+@cont: ldy #1
+ sty RAMC_PAGE_HI
+ sty RAMC_WINDOW
+ dey
+ sty RAMC_PAGE_HI
+ iny
+ cpy RAMC_WINDOW
+ beq @rc64
+ ; we're on rc128
+ ldx #>512
+ bne @setsize
+@rc64: ldx #>256
@setsize:
- lda #0
- sta pagecount
- stx pagecount+1
+ lda #0
+ sta pagecount
+ stx pagecount+1
lda #EM_ERR_OK
rts
@notpresent:
@readonly:
- lda #EM_ERR_NO_DEVICE
-; rts ; Run into UNINSTALL instead
+ lda #EM_ERR_NO_DEVICE
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -134,8 +134,8 @@ USE = MAP
; by the driver.
;
-MAP: sta RAMC_PAGE_LO
- stx RAMC_PAGE_HI
+MAP: sta RAMC_PAGE_LO
+ stx RAMC_PAGE_HI
lda #RAMC_WINDOW
@@ -185,14 +185,14 @@ COPYFROM:
; Bump page register
-@L4: inc tmp1
- bne @L5
- inc tmp2
-@L5: lda tmp1
- sta RAMC_PAGE_LO
- lda tmp2
- sta RAMC_PAGE_HI
- jmp @L3
+@L4: inc tmp1
+ bne @L5
+ inc tmp2
+@L5: lda tmp1
+ sta RAMC_PAGE_LO
+ lda tmp2
+ sta RAMC_PAGE_HI
+ jmp @L3
; ------------------------------------------------------------------------
; COPYTO: Copy from linear into extended memory. A pointer to a structure
@@ -233,14 +233,14 @@ COPYTO:
; Bump page register
-@L4: inc tmp1
- bne @L5
- inc tmp2
-@L5: lda tmp1
- sta RAMC_PAGE_LO
- lda tmp2
- sta RAMC_PAGE_HI
- jmp @L3
+@L4: inc tmp1
+ bne @L5
+ inc tmp2
+@L5: lda tmp1
+ sta RAMC_PAGE_LO
+ lda tmp2
+ sta RAMC_PAGE_HI
+ jmp @L3
; ------------------------------------------------------------------------
; Helper function for COPYFROM and COPYTO: Store the pointer to the request
diff --git a/libsrc/c128/emd/c128-reu.s b/libsrc/c128/emd/c128-reu.s
index 4f86f6aee..b1a979cb5 100644
--- a/libsrc/c128/emd/c128-reu.s
+++ b/libsrc/c128/emd/c128-reu.s
@@ -5,11 +5,11 @@
; Ullrich von Bassewitz, 2002-11-29
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "em-kernel.inc"
+ .include "em-kernel.inc"
.include "em-error.inc"
- .include "c128.inc"
+ .include "c128.inc"
.macpack generic
@@ -23,7 +23,7 @@
; Driver signature
.byte $65, $6d, $64 ; "emd"
- .byte EMD_API_VERSION ; EM API version number
+ .byte EMD_API_VERSION ; EM API version number
; Jump table.
@@ -33,7 +33,7 @@
.word MAP
.word USE
.word COMMIT
- .word COPYFROM
+ .word COPYFROM
.word COPYTO
; ------------------------------------------------------------------------
@@ -61,12 +61,12 @@ curpage: .res 2 ; Current page number
window: .res 256 ; Memory "window"
-reu_params: .word $0000 ; Host address, lo, hi
- .word $0000 ; Exp address, lo, hi
- .byte $00 ; Expansion bank no.
- .word $0000 ; # bytes to move, lo, hi
- .byte $00 ; Interrupt mask reg.
- .byte $00 ; Adress control reg.
+reu_params: .word $0000 ; Host address, lo, hi
+ .word $0000 ; Exp address, lo, hi
+ .byte $00 ; Expansion bank no.
+ .word $0000 ; # bytes to move, lo, hi
+ .byte $00 ; Interrupt mask reg.
+ .byte $00 ; Adress control reg.
.code
@@ -221,14 +221,14 @@ transfer1:
; Transfer subroutine for the REU. Expects command in Y.
transfer:
- sty REU_COMMAND ; Issue command
+ sty REU_COMMAND ; Issue command
- ldy MMU_CR ; Save the current MMU settings
- lda #MMU_CFG_RAM0 ;
- sei ;
- sta MMU_CR ; Enable RAM in bank #0
+ ldy MMU_CR ; Save the current MMU settings
+ lda #MMU_CFG_RAM0 ;
+ sei ;
+ sta MMU_CR ; Enable RAM in bank #0
lda REU_TRIGGER ; Don't change $FF00
- sta REU_TRIGGER ; Start the transfer...
+ sta REU_TRIGGER ; Start the transfer...
sty MMU_CR ; Restore the old configuration
cli
diff --git a/libsrc/c128/emd/c128-vdc.s b/libsrc/c128/emd/c128-vdc.s
index d2b6b9d8b..29dbb4569 100644
--- a/libsrc/c128/emd/c128-vdc.s
+++ b/libsrc/c128/emd/c128-vdc.s
@@ -4,10 +4,10 @@
; Maciej 'YTM/Elysium' Witkowiak
; 06,20.12.2002
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "em-kernel.inc"
- .include "em-error.inc"
+ .include "em-kernel.inc"
+ .include "em-error.inc"
.macpack generic
@@ -21,7 +21,7 @@
; Driver signature
.byte $65, $6d, $64 ; "emd"
- .byte EMD_API_VERSION ; EM API version number
+ .byte EMD_API_VERSION ; EM API version number
; Jump table.
@@ -29,33 +29,33 @@
.word DEINSTALL
.word PAGECOUNT
.word MAP
- .word USE
+ .word USE
.word COMMIT
- .word COPYFROM
+ .word COPYFROM
.word COPYTO
; ------------------------------------------------------------------------
; Constants
-VDC_ADDR_REG = $D600 ; VDC address
-VDC_DATA_REG = $D601 ; VDC data
+VDC_ADDR_REG = $D600 ; VDC address
+VDC_DATA_REG = $D601 ; VDC data
-VDC_DATA_HI = 18 ; used registers
-VDC_DATA_LO = 19
-VDC_CSET = 28
-VDC_DATA = 31
+VDC_DATA_HI = 18 ; used registers
+VDC_DATA_LO = 19
+VDC_CSET = 28
+VDC_DATA = 31
; ------------------------------------------------------------------------
; Data.
.data
-pagecount: .word 64 ; $0000-$3fff as 16k default
-curpage: .word $ffff ; currently mapped-in page (invalid)
+pagecount: .word 64 ; $0000-$3fff as 16k default
+curpage: .word $ffff ; currently mapped-in page (invalid)
.bss
-window: .res 256 ; memory window
+window: .res 256 ; memory window
.code
@@ -67,78 +67,78 @@ window: .res 256 ; memory window
;
INSTALL:
- ; do test for VDC presence here???
-
- ldx #VDC_CSET ; determine size of RAM...
- jsr vdcgetreg
- sta tmp1
- ora #%00010000
- jsr vdcputreg ; turn on 64k
-
- jsr settestadr1 ; save original value of test byte
- jsr vdcgetbyte
- sta tmp2
-
- lda #$55 ; write $55 here
- ldy #ptr1
- jsr test64k ; read it here and there
- lda #$aa ; write $aa here
- ldy #ptr2
- jsr test64k ; read it here and there
-
- jsr settestadr1
- lda tmp2
- jsr vdcputbyte ; restore original value of test byte
-
- lda ptr1 ; do bytes match?
- cmp ptr1+1
- bne @have64k
- lda ptr2
- cmp ptr2+1
- bne @have64k
-
- ldx #VDC_CSET
- lda tmp1
- jsr vdcputreg ; restore 16/64k flag
- jmp @endok ; and leave default values for 16k
+ ; do test for VDC presence here???
+
+ ldx #VDC_CSET ; determine size of RAM...
+ jsr vdcgetreg
+ sta tmp1
+ ora #%00010000
+ jsr vdcputreg ; turn on 64k
+
+ jsr settestadr1 ; save original value of test byte
+ jsr vdcgetbyte
+ sta tmp2
+
+ lda #$55 ; write $55 here
+ ldy #ptr1
+ jsr test64k ; read it here and there
+ lda #$aa ; write $aa here
+ ldy #ptr2
+ jsr test64k ; read it here and there
+
+ jsr settestadr1
+ lda tmp2
+ jsr vdcputbyte ; restore original value of test byte
+
+ lda ptr1 ; do bytes match?
+ cmp ptr1+1
+ bne @have64k
+ lda ptr2
+ cmp ptr2+1
+ bne @have64k
+
+ ldx #VDC_CSET
+ lda tmp1
+ jsr vdcputreg ; restore 16/64k flag
+ jmp @endok ; and leave default values for 16k
@have64k:
- lda #<256
- ldx #>256
- sta pagecount
- stx pagecount+1
+ lda #<256
+ ldx #>256
+ sta pagecount
+ stx pagecount+1
@endok:
- lda #EM_ERR_OK
rts
test64k:
- sta tmp1
- sty ptr3
- lda #0
- sta ptr3+1
- jsr settestadr1
- lda tmp1
- jsr vdcputbyte ; write $55
- jsr settestadr1
- jsr vdcgetbyte ; read here
- pha
- jsr settestadr2
- jsr vdcgetbyte ; and there
- ldy #1
- sta (ptr3),y
- pla
- dey
- sta (ptr3),y
- rts
+ sta tmp1
+ sty ptr3
+ lda #0
+ sta ptr3+1
+ jsr settestadr1
+ lda tmp1
+ jsr vdcputbyte ; write $55
+ jsr settestadr1
+ jsr vdcgetbyte ; read here
+ pha
+ jsr settestadr2
+ jsr vdcgetbyte ; and there
+ ldy #1
+ sta (ptr3),y
+ pla
+ dey
+ sta (ptr3),y
+ rts
settestadr1:
- ldy #$02 ; test page 2 (here)
- .byte $2c
+ ldy #$02 ; test page 2 (here)
+ .byte $2c
settestadr2:
- ldy #$42 ; or page 64+2 (there)
- lda #0
- jmp vdcsetsrcaddr
+ ldy #$42 ; or page 64+2 (there)
+ lda #0
+ jmp vdcsetsrcaddr
; ------------------------------------------------------------------------
; DEINSTALL routine. Is called before the driver is removed from memory.
@@ -146,7 +146,7 @@ settestadr2:
;
DEINSTALL:
- ;on C128 restore font and clear the screen?
+ ;on C128 restore font and clear the screen?
rts
; ------------------------------------------------------------------------
@@ -164,42 +164,42 @@ PAGECOUNT:
; by the driver.
;
-MAP: sta curpage
- stx curpage+1
- sta ptr1+1
- ldy #0
- sty ptr1
+MAP: sta curpage
+ stx curpage+1
+ sta ptr1+1
+ ldy #0
+ sty ptr1
- lda #window
- sta ptr2+1
+ lda #window
+ sta ptr2+1
- jsr transferin
+ jsr transferin
lda #window
- rts
+ rts
; copy a single page from (ptr1):VDCRAM to (ptr2):RAM
transferin:
- lda ptr1
- ldy ptr1+1
- jsr vdcsetsrcaddr ; set source address in VDC
- ldy #0
- ldx #VDC_DATA
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- lda VDC_DATA_REG ; get 2 bytes at a time to speed-up
- sta (ptr2),y ; (in fact up to 8 bytes could be fetched with special VDC config)
- iny
- lda VDC_DATA_REG
- sta (ptr2),y
- iny
- bne @L0
- rts
+ lda ptr1
+ ldy ptr1+1
+ jsr vdcsetsrcaddr ; set source address in VDC
+ ldy #0
+ ldx #VDC_DATA
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ lda VDC_DATA_REG ; get 2 bytes at a time to speed-up
+ sta (ptr2),y ; (in fact up to 8 bytes could be fetched with special VDC config)
+ iny
+ lda VDC_DATA_REG
+ sta (ptr2),y
+ iny
+ bne @L0
+ rts
; ------------------------------------------------------------------------
; USE: Tell the driver that the window is now associated with a given page.
@@ -214,36 +214,36 @@ done: rts
; COMMIT: Commit changes in the memory window to extended storage.
COMMIT:
- lda curpage ; jump if no page mapped
- ldx curpage+1
- bmi done
- sta ptr1+1
- ldy #0
- sty ptr1
-
- lda #window
- sta ptr2+1
+ lda curpage ; jump if no page mapped
+ ldx curpage+1
+ bmi done
+ sta ptr1+1
+ ldy #0
+ sty ptr1
+
+ lda #window
+ sta ptr2+1
; fall through to transferout
; copy a single page from (ptr2):RAM to (ptr1):VDCRAM
transferout:
- lda ptr1
- ldy ptr1+1
- jsr vdcsetsrcaddr ; set source address in VDC
- ldy #0
- ldx #VDC_DATA
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- lda (ptr2),y ; speedup does not work for writing
- sta VDC_DATA_REG
- iny
- bne @L0
- rts
+ lda ptr1
+ ldy ptr1+1
+ jsr vdcsetsrcaddr ; set source address in VDC
+ ldy #0
+ ldx #VDC_DATA
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ lda (ptr2),y ; speedup does not work for writing
+ sta VDC_DATA_REG
+ iny
+ bne @L0
+ rts
; ------------------------------------------------------------------------
; COPYFROM: Copy from extended into linear memory. A pointer to a structure
@@ -252,8 +252,8 @@ transferout:
;
COPYFROM:
- jsr setup
- beq @L2 ; Skip if no full pages
+ jsr setup
+ beq @L2 ; Skip if no full pages
; Copy full pages
@@ -268,18 +268,18 @@ COPYFROM:
@L2: ldy #EM_COPY::COUNT
lda (ptr3),y ; Get bytes in last page
beq @L4
- sta tmp1
+ sta tmp1
; Transfer the bytes in the last page
- ldy #0
-@L3: jsr vdcgetbyte
- sta (ptr2),y
- iny
- dec tmp1
- lda tmp1
- bne @L3
-@L4: rts
+ ldy #0
+@L3: jsr vdcgetbyte
+ sta (ptr2),y
+ iny
+ dec tmp1
+ lda tmp1
+ bne @L3
+@L4: rts
; ------------------------------------------------------------------------
; COPYTO: Copy from linear into extended memory. A pointer to a structure
@@ -288,8 +288,8 @@ COPYFROM:
;
COPYTO:
- jsr setup
- beq @L2 ; Skip if no full pages
+ jsr setup
+ beq @L2 ; Skip if no full pages
; Copy full pages
@@ -304,52 +304,52 @@ COPYTO:
@L2: ldy #EM_COPY::COUNT
lda (ptr3),y ; Get bytes in last page
beq @L4
- sta tmp1
+ sta tmp1
; Transfer the bytes in the last page
- ldy #0
-@L3: lda (ptr2),y
- jsr vdcputbyte
- iny
- dec tmp1
- lda tmp1
- bne @L3
-@L4: rts
+ ldy #0
+@L3: lda (ptr2),y
+ jsr vdcputbyte
+ iny
+ dec tmp1
+ lda tmp1
+ bne @L3
+@L4: rts
;-------------------------------------------------------------------------
; Helper functions to handle VDC ram
;
vdcsetsrcaddr:
- ldx #VDC_DATA_LO
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- sta VDC_DATA_REG
- dex
- tya
- stx VDC_ADDR_REG
- sta VDC_DATA_REG
- rts
+ ldx #VDC_DATA_LO
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ sta VDC_DATA_REG
+ dex
+ tya
+ stx VDC_ADDR_REG
+ sta VDC_DATA_REG
+ rts
vdcgetbyte:
- ldx #VDC_DATA
+ ldx #VDC_DATA
vdcgetreg:
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- lda VDC_DATA_REG
- rts
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ lda VDC_DATA_REG
+ rts
vdcputbyte:
- ldx #VDC_DATA
+ ldx #VDC_DATA
vdcputreg:
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- sta VDC_DATA_REG
- rts
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ sta VDC_DATA_REG
+ rts
; ------------------------------------------------------------------------
; Helper function for COPYFROM and COPYTO: Store the pointer to the request
@@ -357,7 +357,7 @@ vdcputreg:
;
setup:
- sta ptr3
+ sta ptr3
stx ptr3+1 ; Save the passed em_copy pointer
ldy #EM_COPY::OFFS
@@ -374,8 +374,8 @@ setup:
lda (ptr3),y
sta ptr2+1 ; To
- ldy #EM_COPY::COUNT+1
+ ldy #EM_COPY::COUNT+1
lda (ptr3),y ; Get number of pages
sta tmp1
- rts
+ rts
diff --git a/libsrc/c128/fast.s b/libsrc/c128/fast.s
index abb32d2be..9e032f915 100644
--- a/libsrc/c128/fast.s
+++ b/libsrc/c128/fast.s
@@ -7,16 +7,16 @@
; */
;
- .export _fast
+ .export _fast
- .include "c128.inc"
+ .include "c128.inc"
-.proc _fast
+.proc _fast
- lda #$01
- sta VIC_CLK_128
- rts
+ lda #$01
+ sta VIC_CLK_128
+ rts
.endproc
diff --git a/libsrc/c128/get_tv.s b/libsrc/c128/get_tv.s
index 084876d11..d85c9a650 100644
--- a/libsrc/c128/get_tv.s
+++ b/libsrc/c128/get_tv.s
@@ -5,7 +5,7 @@
; /* Return the video mode the machine is using */
;
- .include "get_tv.inc"
+ .include "get_tv.inc"
.include "c128.inc"
@@ -14,7 +14,7 @@
.proc _get_tv
- ldx #TV::PAL ; Assume PAL
+ ldx #TV::PAL ; Assume PAL
lda PALFLAG
bne pal
dex ; NTSC
diff --git a/libsrc/c128/irq.s b/libsrc/c128/irq.s
index d468eeaaa..aed1f3a25 100644
--- a/libsrc/c128/irq.s
+++ b/libsrc/c128/irq.s
@@ -2,38 +2,38 @@
; IRQ handling (C128 version)
;
- .export initirq, doneirq
- .import callirq
+ .export initirq, doneirq
+ .import callirq
- .include "c128.inc"
+ .include "c128.inc"
-IRQInd = $2FD ; JMP $0000 - used as indirect IRQ vector
+IRQInd = $2FD ; JMP $0000 - used as indirect IRQ vector
; ------------------------------------------------------------------------
-.segment "INIT"
+.segment "INIT"
initirq:
- lda IRQVec
- ldx IRQVec+1
- sta IRQInd+1
- stx IRQInd+2
- lda #IRQStub
- jmp setvec
+ lda IRQVec
+ ldx IRQVec+1
+ sta IRQInd+1
+ stx IRQInd+2
+ lda #IRQStub
+ jmp setvec
; ------------------------------------------------------------------------
.code
doneirq:
- lda IRQInd+1
- ldx IRQInd+2
-setvec: sei
- sta IRQVec
- stx IRQVec+1
- cli
- rts
+ lda IRQInd+1
+ ldx IRQInd+2
+setvec: sei
+ sta IRQVec
+ stx IRQVec+1
+ cli
+ rts
; ------------------------------------------------------------------------
; The C128 has ROM parallel to the RAM starting from $4000. The startup code
@@ -45,15 +45,15 @@ setvec: sei
; placed just above the startup code, so it goes into a RAM area that is
; not banked.
-.segment "LOWCODE"
+.segment "LOWCODE"
IRQStub:
- cld ; Just to be sure
- lda MMU_CR ; Get old register value
- pha ; And save on stack
- lda #MMU_CFG_CC65 ; Bank 0 with kernal ROM
- sta MMU_CR
- jsr callirq ; Call the functions
- pla ; Get old register value
- sta MMU_CR
- jmp IRQInd ; Jump to the saved IRQ vector
+ cld ; Just to be sure
+ lda MMU_CR ; Get old register value
+ pha ; And save on stack
+ lda #MMU_CFG_CC65 ; Bank 0 with kernal ROM
+ sta MMU_CR
+ jsr callirq ; Call the functions
+ pla ; Get old register value
+ sta MMU_CR
+ jmp IRQInd ; Jump to the saved IRQ vector
diff --git a/libsrc/c128/joy/c128-ptvjoy.s b/libsrc/c128/joy/c128-ptvjoy.s
index e101997f1..5763fbe2d 100644
--- a/libsrc/c128/joy/c128-ptvjoy.s
+++ b/libsrc/c128/joy/c128-ptvjoy.s
@@ -61,7 +61,7 @@ JOY_COUNT = 4 ; Number of joysticks we support
INSTALL:
lda #JOY_ERR_OK
-; rts ; Run into UNINSTALL instead
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -85,18 +85,18 @@ COUNT:
; READ: Read a particular joystick passed in A.
;
-READ: tax ; Joystick number into X
+READ: tax ; Joystick number into X
bne joy2
; Read joystick 1
-joy1: lda #$7F
+joy1: lda #$7F
sei
- sta CIA1_PRA
- lda CIA1_PRB
+ sta CIA1_PRA
+ lda CIA1_PRB
cli
- and #$1F
- eor #$1F
+ and #$1F
+ eor #$1F
rts
; Read joystick 2
@@ -104,15 +104,15 @@ joy1: lda #$7F
joy2: dex
bne joy3
- lda #$E0
- ldy #$FF
+ lda #$E0
+ ldy #$FF
sei
- sta CIA1_DDRA
- lda CIA1_PRA
- sty CIA1_DDRA
+ sta CIA1_DDRA
+ lda CIA1_PRA
+ sty CIA1_DDRA
cli
- and #$1F
- eor #$1F
+ and #$1F
+ eor #$1F
rts
; Read joystick 3
diff --git a/libsrc/c128/joy/c128-stdjoy.s b/libsrc/c128/joy/c128-stdjoy.s
index 241e223e7..f86853a81 100644
--- a/libsrc/c128/joy/c128-stdjoy.s
+++ b/libsrc/c128/joy/c128-stdjoy.s
@@ -6,9 +6,9 @@
; Ullrich von Bassewitz, 2002-12-21
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "joy-kernel.inc"
+ .include "joy-kernel.inc"
.include "joy-error.inc"
.include "c128.inc"
@@ -22,8 +22,8 @@
; Driver signature
- .byte $6A, $6F, $79 ; "joy"
- .byte JOY_API_VERSION ; Driver API version number
+ .byte $6A, $6F, $79 ; "joy"
+ .byte JOY_API_VERSION ; Driver API version number
; Button state masks (8 values)
@@ -66,7 +66,7 @@ JOY_COUNT = 2 ; Number of joysticks we support
INSTALL:
lda #JOY_ERR_OK
-; rts ; Run into UNINSTALL instead
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -90,32 +90,32 @@ COUNT:
; READ: Read a particular joystick passed in A.
;
-READ: tax ; Joystick number into X
- bne joy2
+READ: tax ; Joystick number into X
+ bne joy2
; Read joystick 1
-joy1: lda #$7F
- sei
- sta CIA1_PRA
- lda CIA1_PRB
- cli
- and #$1F
- eor #$1F
- rts
+joy1: lda #$7F
+ sei
+ sta CIA1_PRA
+ lda CIA1_PRB
+ cli
+ and #$1F
+ eor #$1F
+ rts
; Read joystick 2
-joy2: ldx #0
- lda #$E0
- ldy #$FF
- sei
- sta CIA1_DDRA
- lda CIA1_PRA
- sty CIA1_DDRA
- cli
- and #$1F
- eor #$1F
- rts
+joy2: ldx #0
+ lda #$E0
+ ldy #$FF
+ sei
+ sta CIA1_DDRA
+ lda CIA1_PRA
+ sty CIA1_DDRA
+ cli
+ and #$1F
+ eor #$1F
+ rts
diff --git a/libsrc/c128/joy_stat_stddrv.s b/libsrc/c128/joy_stat_stddrv.s
index 6a70a8fd2..d6d695347 100644
--- a/libsrc/c128/joy_stat_stddrv.s
+++ b/libsrc/c128/joy_stat_stddrv.s
@@ -6,8 +6,8 @@
; const void joy_static_stddrv[];
;
- .export _joy_static_stddrv
- .import _c128_stdjoy_joy
+ .export _joy_static_stddrv
+ .import _c128_stdjoy_joy
.rodata
diff --git a/libsrc/c128/joy_stddrv.s b/libsrc/c128/joy_stddrv.s
index 4cfd4b9a1..acbd0bdfa 100644
--- a/libsrc/c128/joy_stddrv.s
+++ b/libsrc/c128/joy_stddrv.s
@@ -6,9 +6,9 @@
; const char joy_stddrv[];
;
- .export _joy_stddrv
+ .export _joy_stddrv
.rodata
-_joy_stddrv: .asciiz "c128-stdjoy.joy"
+_joy_stddrv: .asciiz "c128-stdjoy.joy"
diff --git a/libsrc/c128/kbhit.s b/libsrc/c128/kbhit.s
index 28ee2d4de..c1bca2416 100644
--- a/libsrc/c128/kbhit.s
+++ b/libsrc/c128/kbhit.s
@@ -4,16 +4,16 @@
; unsigned char kbhit (void);
;
- .export _kbhit
+ .export _kbhit
- .include "c128.inc"
+ .include "c128.inc"
.proc _kbhit
ldx #0 ; High byte of return is always zero
- lda KEY_COUNT ; Get number of characters
-; ora FKEY_COUNT ; Or with number of chars from function keys
+ lda KEY_COUNT ; Get number of characters
+; ora FKEY_COUNT ; Or with number of chars from function keys
beq L9
lda #1
L9: rts
diff --git a/libsrc/c128/kernal.s b/libsrc/c128/kernal.s
index 7a6ff2822..f3b78d00b 100644
--- a/libsrc/c128/kernal.s
+++ b/libsrc/c128/kernal.s
@@ -53,48 +53,48 @@
; All functions are available in the kernal jump table
; Extended jump table
-C64MODE = $FF4D
-SWAPPER = $FF5F
+C64MODE = $FF4D
+SWAPPER = $FF5F
SETBNK = $FF68
;
-CINT = $FF81
-IOINIT = $FF84
-RAMTAS = $FF87
-RESTOR = $FF8A
-VECTOR = $FF8D
-SETMSG = $FF90
-SECOND = $FF93
-TKSA = $FF96
-MEMTOP = $FF99
-MEMBOT = $FF9C
-SCNKEY = $FF9F
-SETTMO = $FFA2
-ACPTR = $FFA5
-CIOUT = $FFA8
-UNTLK = $FFAB
-UNLSN = $FFAE
-LISTEN = $FFB1
-TALK = $FFB4
-READST = $FFB7
-SETLFS = $FFBA
-SETNAM = $FFBD
-OPEN = $FFC0
-CLOSE = $FFC3
-CHKIN = $FFC6
-CKOUT = $FFC9
-CLRCH = $FFCC
-BASIN = $FFCF
-BSOUT = $FFD2
-LOAD = $FFD5
-SAVE = $FFD8
-SETTIM = $FFDB
-RDTIM = $FFDE
-STOP = $FFE1
-GETIN = $FFE4
-CLALL = $FFE7
-UDTIM = $FFEA
-SCREEN = $FFED
-PLOT = $FFF0
-IOBASE = $FFF3
+CINT = $FF81
+IOINIT = $FF84
+RAMTAS = $FF87
+RESTOR = $FF8A
+VECTOR = $FF8D
+SETMSG = $FF90
+SECOND = $FF93
+TKSA = $FF96
+MEMTOP = $FF99
+MEMBOT = $FF9C
+SCNKEY = $FF9F
+SETTMO = $FFA2
+ACPTR = $FFA5
+CIOUT = $FFA8
+UNTLK = $FFAB
+UNLSN = $FFAE
+LISTEN = $FFB1
+TALK = $FFB4
+READST = $FFB7
+SETLFS = $FFBA
+SETNAM = $FFBD
+OPEN = $FFC0
+CLOSE = $FFC3
+CHKIN = $FFC6
+CKOUT = $FFC9
+CLRCH = $FFCC
+BASIN = $FFCF
+BSOUT = $FFD2
+LOAD = $FFD5
+SAVE = $FFD8
+SETTIM = $FFDB
+RDTIM = $FFDE
+STOP = $FFE1
+GETIN = $FFE4
+CLALL = $FFE7
+UDTIM = $FFEA
+SCREEN = $FFED
+PLOT = $FFF0
+IOBASE = $FFF3
diff --git a/libsrc/c128/mainargs.s b/libsrc/c128/mainargs.s
index 3bacd2934..fb5fd1554 100644
--- a/libsrc/c128/mainargs.s
+++ b/libsrc/c128/mainargs.s
@@ -22,15 +22,15 @@
; - The "file-name" might be a path-name; don't copy the directory-components.
; - Add a control-character quoting mechanism.
- .constructor initmainargs, 24
- .import __argc, __argv
+ .constructor initmainargs, 24
+ .import __argc, __argv
- .include "c128.inc"
+ .include "c128.inc"
-MAXARGS = 10 ; Maximum number of arguments allowed
-REM = $8f ; BASIC token-code
-NAME_LEN = 16 ; maximum length of command-name
+MAXARGS = 10 ; Maximum number of arguments allowed
+REM = $8f ; BASIC token-code
+NAME_LEN = 16 ; maximum length of command-name
; Get possible command-line arguments. Goes into the special INIT segment,
@@ -45,27 +45,27 @@ initmainargs:
; Because the buffer, that we're copying into, was zeroed out,
; we don't need to add a NUL character.
;
- ldy FNAM_LEN
- cpy #NAME_LEN + 1
- bcc L1
- ldy #NAME_LEN - 1 ; limit the length
+ ldy FNAM_LEN
+ cpy #NAME_LEN + 1
+ bcc L1
+ ldy #NAME_LEN - 1 ; limit the length
L0: lda #FNAM ; Load vector address for FETCH routine
ldx FNAM_BANK ; Load bank for FETCH routine
jsr INDFET ; Load byte from (FETVEC),y
- sta name,y ; Save byte from filename
-L1: dey
- bpl L0
- inc __argc ; argc always is equal to, at least, 1
+ sta name,y ; Save byte from filename
+L1: dey
+ bpl L0
+ inc __argc ; argc always is equal to, at least, 1
; Find the "rem" token.
;
- ldx #0
-L2: lda BASIC_BUF,x
- beq done ; no "rem," no args.
- inx
- cmp #REM
- bne L2
- ldy #1 * 2
+ ldx #0
+L2: lda BASIC_BUF,x
+ beq done ; no "rem," no args.
+ inx
+ cmp #REM
+ bne L2
+ ldy #1 * 2
; Find the next argument
@@ -91,11 +91,11 @@ setterm:sta term ; Set end of argument marker
; necessary.
txa ; Get low byte
- sta argv,y ; argv[y]= &arg
- iny
- lda #>BASIC_BUF
- sta argv,y
- iny
+ sta argv,y ; argv[y]= &arg
+ iny
+ lda #>BASIC_BUF
+ sta argv,y
+ iny
inc __argc ; Found another arg
; Search for the end of the argument
@@ -122,21 +122,21 @@ argloop:lda BASIC_BUF,x
; (The last vector in argv[] already is NULL.)
-done: lda #argv
- sta __argv
- stx __argv + 1
- rts
+done: lda #argv
+ sta __argv
+ stx __argv + 1
+ rts
; These arrays are zeroed before initmainargs is called.
-; char name[16+1];
+; char name[16+1];
; char* argv[MAXARGS+1]={name};
;
.bss
-term: .res 1
-name: .res NAME_LEN + 1
+term: .res 1
+name: .res NAME_LEN + 1
.data
argv: .addr name
- .res MAXARGS * 2
+ .res MAXARGS * 2
diff --git a/libsrc/c128/mcbdefault.s b/libsrc/c128/mcbdefault.s
index d5a91f923..cdedf4904 100644
--- a/libsrc/c128/mcbdefault.s
+++ b/libsrc/c128/mcbdefault.s
@@ -64,13 +64,13 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
txa
adc #0
bne @L1 ; Branch if high byte not zero
- lda VIC_SPR_HI_X ; Get high X bits of all sprites
- and #MOUSE_SPR_NMASK ; Clear high bit for sprite
+ lda VIC_SPR_HI_X ; Get high X bits of all sprites
+ and #MOUSE_SPR_NMASK ; Clear high bit for sprite
sta VIC_SPR_HI_X
rts
-@L1: lda VIC_SPR_HI_X ; Get high X bits of all sprites
- ora #MOUSE_SPR_MASK ; Set high bit for sprite
+@L1: lda VIC_SPR_HI_X ; Get high X bits of all sprites
+ ora #MOUSE_SPR_MASK ; Set high bit for sprite
sta VIC_SPR_HI_X
rts
@@ -86,11 +86,11 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
ldx PALFLAG
bne @L1
adc #50 ; FIXME: Should be NTSC, is PAL value
- sta VIC_SPR_Y ; Set Y position
+ sta VIC_SPR_Y ; Set Y position
rts
@L1: adc #50 ; Add PAL correction
- sta VIC_SPR_Y ; Set Y position
+ sta VIC_SPR_Y ; Set Y position
rts
.endproc
diff --git a/libsrc/c128/mou/c128-1351.s b/libsrc/c128/mou/c128-1351.s
index 999c57090..f7c74d3cb 100644
--- a/libsrc/c128/mou/c128-1351.s
+++ b/libsrc/c128/mou/c128-1351.s
@@ -7,7 +7,7 @@
.include "zeropage.inc"
.include "mouse-kernel.inc"
- .include "c128.inc"
+ .include "c128.inc"
.macpack generic
@@ -64,18 +64,18 @@ SCREEN_WIDTH = 320
.bss
Vars:
-OldPotX: .res 1 ; Old hw counter values
-OldPotY: .res 1
+OldPotX: .res 1 ; Old hw counter values
+OldPotY: .res 1
YPos: .res 2 ; Current mouse position, Y
XPos: .res 2 ; Current mouse position, X
-XMin: .res 2 ; X1 value of bounding box
-YMin: .res 2 ; Y1 value of bounding box
-XMax: .res 2 ; X2 value of bounding box
-YMax: .res 2 ; Y2 value of bounding box
+XMin: .res 2 ; X1 value of bounding box
+YMin: .res 2 ; Y1 value of bounding box
+XMax: .res 2 ; X2 value of bounding box
+YMax: .res 2 ; Y2 value of bounding box
-OldValue: .res 1 ; Temp for MoveCheck routine
-NewValue: .res 1 ; Temp for MoveCheck routine
+OldValue: .res 1 ; Temp for MoveCheck routine
+NewValue: .res 1 ; Temp for MoveCheck routine
; Default values for above variables
@@ -177,7 +177,7 @@ SETBOX: sta ptr1
bpl @L1
cli
- rts
+ rts
;----------------------------------------------------------------------------
; GETBOX: Return the mouse bounding box. The parameters are passed as they
@@ -195,7 +195,7 @@ GETBOX: sta ptr1
bpl @L1
cli
- rts
+ rts
;----------------------------------------------------------------------------
; MOVE: Move the mouse to a new position. The position is passed as it comes
@@ -219,47 +219,47 @@ MOVE: sei ; No interrupts
lda (sp),y
sta XPos ; New X position
- jsr CMOVEX ; Move the cursor
+ jsr CMOVEX ; Move the cursor
- cli ; Allow interrupts
- rts
+ cli ; Allow interrupts
+ rts
;----------------------------------------------------------------------------
; BUTTONS: Return the button mask in a/x.
BUTTONS:
- lda #$7F
- sei
- sta CIA1_PRA
- lda CIA1_PRB ; Read joystick #0
- cli
+ lda #$7F
+ sei
+ sta CIA1_PRA
+ lda CIA1_PRB ; Read joystick #0
+ cli
ldx #0
- and #$1F
- eor #$1F
+ and #$1F
+ eor #$1F
rts
;----------------------------------------------------------------------------
; POS: Return the mouse position in the MOUSE_POS struct pointed to by ptr1.
; No return code required.
-POS: ldy #MOUSE_POS::XCOORD ; Structure offset
+POS: ldy #MOUSE_POS::XCOORD ; Structure offset
- sei ; Disable interrupts
- lda XPos ; Transfer the position
- sta (ptr1),y
- lda XPos+1
- iny
- sta (ptr1),y
- lda YPos
+ sei ; Disable interrupts
+ lda XPos ; Transfer the position
+ sta (ptr1),y
+ lda XPos+1
iny
sta (ptr1),y
- lda YPos+1
- cli ; Enable interrupts
+ lda YPos
+ iny
+ sta (ptr1),y
+ lda YPos+1
+ cli ; Enable interrupts
iny
sta (ptr1),y ; Store last byte
- rts ; Done
+ rts ; Done
;----------------------------------------------------------------------------
; INFO: Returns mouse position and current button mask in the MOUSE_INFO
@@ -270,15 +270,15 @@ POS: ldy #MOUSE_POS::XCOORD ; Structure offset
; call _mouse_pos to initialize the struct pointer and fill the position
; fields.
-INFO: jsr POS
+INFO: jsr POS
; Fill in the button state
- jsr BUTTONS ; Will not touch ptr1
- ldy #MOUSE_INFO::BUTTONS
- sta (ptr1),y
+ jsr BUTTONS ; Will not touch ptr1
+ ldy #MOUSE_INFO::BUTTONS
+ sta (ptr1),y
- rts
+ rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
@@ -297,10 +297,10 @@ IOCTL: lda # a/y)
- add XPos
- tay ; Remember low byte
- txa
- adc XPos+1
- tax
+ add XPos
+ tay ; Remember low byte
+ txa
+ adc XPos+1
+ tax
; Limit the X coordinate to the bounding box
- cpy XMin
- sbc XMin+1
- bpl @L1
- ldy XMin
- ldx XMin+1
- jmp @L2
-@L1: txa
-
- cpy XMax
- sbc XMax+1
- bmi @L2
- ldy XMax
- ldx XMax+1
-@L2: sty XPos
- stx XPos+1
+ cpy XMin
+ sbc XMin+1
+ bpl @L1
+ ldy XMin
+ ldx XMin+1
+ jmp @L2
+@L1: txa
+
+ cpy XMax
+ sbc XMax+1
+ bmi @L2
+ ldy XMax
+ ldx XMax+1
+@L2: sty XPos
+ stx XPos+1
; Move the mouse pointer to the new X pos
@@ -339,10 +339,10 @@ IRQ: lda SID_ADConv1 ; Get mouse X movement
; Calculate the Y movement vector
-@SkipX: lda SID_ADConv2 ; Get mouse Y movement
- ldy OldPotY
- jsr MoveCheck ; Calculate movement
- sty OldPotY
+@SkipX: lda SID_ADConv2 ; Get mouse Y movement
+ ldy OldPotY
+ jsr MoveCheck ; Calculate movement
+ sty OldPotY
; Skip processing if nothing has changed
@@ -350,32 +350,32 @@ IRQ: lda SID_ADConv1 ; Get mouse X movement
; Calculate the new Y coordinate (--> a/y)
- sta OldValue
- lda YPos
- sub OldValue
- tay
- stx OldValue
- lda YPos+1
- sbc OldValue
- tax
+ sta OldValue
+ lda YPos
+ sub OldValue
+ tay
+ stx OldValue
+ lda YPos+1
+ sbc OldValue
+ tax
; Limit the Y coordinate to the bounding box
- cpy YMin
- sbc YMin+1
- bpl @L3
- ldy YMin
- ldx YMin+1
- jmp @L4
-@L3: txa
-
- cpy YMax
- sbc YMax+1
- bmi @L4
- ldy YMax
- ldx YMax+1
-@L4: sty YPos
- stx YPos+1
+ cpy YMin
+ sbc YMin+1
+ bpl @L3
+ ldy YMin
+ ldx YMin+1
+ jmp @L4
+@L3: txa
+
+ cpy YMax
+ sbc YMax+1
+ bmi @L4
+ ldy YMax
+ ldx YMax+1
+@L4: sty YPos
+ stx YPos+1
; Move the mouse pointer to the new X pos
@@ -391,38 +391,38 @@ IRQ: lda SID_ADConv1 ; Get mouse X movement
;
; Move check routine, called for both coordinates.
;
-; Entry: y = old value of pot register
-; a = current value of pot register
-; Exit: y = value to use for old value
-; x/a = delta value for position
+; Entry: y = old value of pot register
+; a = current value of pot register
+; Exit: y = value to use for old value
+; x/a = delta value for position
;
MoveCheck:
- sty OldValue
- sta NewValue
- ldx #$00
-
- sub OldValue ; a = mod64 (new - old)
- and #%01111111
- cmp #%01000000 ; if (a > 0)
- bcs @L1 ;
- lsr a ; a /= 2;
- beq @L2 ; if (a != 0)
- ldy NewValue ; y = NewValue
+ sty OldValue
+ sta NewValue
+ ldx #$00
+
+ sub OldValue ; a = mod64 (new - old)
+ and #%01111111
+ cmp #%01000000 ; if (a > 0)
+ bcs @L1 ;
+ lsr a ; a /= 2;
+ beq @L2 ; if (a != 0)
+ ldy NewValue ; y = NewValue
+ sec
+ rts ; return
+
+@L1: ora #%11000000 ; else or in high order bits
+ cmp #$FF ; if (a != -1)
+ beq @L2
sec
- rts ; return
-
-@L1: ora #%11000000 ; else or in high order bits
- cmp #$FF ; if (a != -1)
- beq @L2
- sec
- ror a ; a /= 2
- dex ; high byte = -1 (X = $FF)
- ldy NewValue
+ ror a ; a /= 2
+ dex ; high byte = -1 (X = $FF)
+ ldy NewValue
sec
- rts
+ rts
-@L2: txa ; A = $00
+@L2: txa ; A = $00
clc
- rts
+ rts
diff --git a/libsrc/c128/mou/c128-joy.s b/libsrc/c128/mou/c128-joy.s
index 0cceaa7f1..3ac7b5ee3 100644
--- a/libsrc/c128/mou/c128-joy.s
+++ b/libsrc/c128/mou/c128-joy.s
@@ -6,7 +6,7 @@
.include "zeropage.inc"
.include "mouse-kernel.inc"
- .include "c128.inc"
+ .include "c128.inc"
.macpack generic
@@ -73,11 +73,11 @@ SCREEN_WIDTH = 320
Vars:
YPos: .res 2 ; Current mouse position, Y
XPos: .res 2 ; Current mouse position, X
-XMin: .res 2 ; X1 value of bounding box
-YMin: .res 2 ; Y1 value of bounding box
-XMax: .res 2 ; X2 value of bounding box
-YMax: .res 2 ; Y2 value of bounding box
-Buttons: .res 1 ; Button mask
+XMin: .res 2 ; X1 value of bounding box
+YMin: .res 2 ; Y1 value of bounding box
+XMax: .res 2 ; X2 value of bounding box
+YMax: .res 2 ; Y2 value of bounding box
+Buttons: .res 1 ; Button mask
; Temporary value used in the int handler
@@ -94,7 +94,7 @@ Temp: .res 1
.word 0 ; YMin
.word SCREEN_WIDTH ; XMax
.word SCREEN_HEIGHT ; YMax
- .byte 0 ; Buttons
+ .byte 0 ; Buttons
.endproc
.code
@@ -183,7 +183,7 @@ SETBOX: sta ptr1
bpl @L1
cli
- rts
+ rts
;----------------------------------------------------------------------------
; GETBOX: Return the mouse bounding box. The parameters are passed as they
@@ -201,7 +201,7 @@ GETBOX: sta ptr1
bpl @L1
cli
- rts
+ rts
;----------------------------------------------------------------------------
; MOVE: Move the mouse to a new position. The position is passed as it comes
@@ -225,41 +225,41 @@ MOVE: sei ; No interrupts
lda (sp),y
sta XPos ; New X position
- jsr CMOVEX ; Move the cursor
+ jsr CMOVEX ; Move the cursor
- cli ; Allow interrupts
- rts
+ cli ; Allow interrupts
+ rts
;----------------------------------------------------------------------------
; BUTTONS: Return the button mask in a/x.
BUTTONS:
- lda Buttons
- ldx #$00
- rts
+ lda Buttons
+ ldx #$00
+ rts
;----------------------------------------------------------------------------
; POS: Return the mouse position in the MOUSE_POS struct pointed to by ptr1.
; No return code required.
-POS: ldy #MOUSE_POS::XCOORD ; Structure offset
+POS: ldy #MOUSE_POS::XCOORD ; Structure offset
- sei ; Disable interrupts
- lda XPos ; Transfer the position
- sta (ptr1),y
- lda XPos+1
- iny
- sta (ptr1),y
- lda YPos
+ sei ; Disable interrupts
+ lda XPos ; Transfer the position
+ sta (ptr1),y
+ lda XPos+1
iny
sta (ptr1),y
- lda YPos+1
- cli ; Enable interrupts
+ lda YPos
+ iny
+ sta (ptr1),y
+ lda YPos+1
+ cli ; Enable interrupts
iny
sta (ptr1),y ; Store last byte
- rts ; Done
+ rts ; Done
;----------------------------------------------------------------------------
; INFO: Returns mouse position and current button mask in the MOUSE_INFO
@@ -270,15 +270,15 @@ POS: ldy #MOUSE_POS::XCOORD ; Structure offset
; call _mouse_pos to initialize the struct pointer and fill the position
; fields.
-INFO: jsr POS
+INFO: jsr POS
; Fill in the button state
- lda Buttons
- ldy #MOUSE_INFO::BUTTONS
- sta (ptr1),y
+ lda Buttons
+ ldy #MOUSE_INFO::BUTTONS
+ sta (ptr1),y
- rts
+ rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
@@ -297,11 +297,11 @@ IOCTL: lda # a/y)
@AddX: add XPos
- tay ; Remember low byte
- txa
- adc XPos+1
- tax
+ tay ; Remember low byte
+ txa
+ adc XPos+1
+ tax
; Limit the X coordinate to the bounding box
- cpy XMin
- sbc XMin+1
- bpl @L1
- ldy XMin
- ldx XMin+1
- jmp @L2
-@L1: txa
-
- cpy XMax
- sbc XMax+1
- bmi @L2
- ldy XMax
- ldx XMax+1
-@L2: sty XPos
- stx XPos+1
+ cpy XMin
+ sbc XMin+1
+ bpl @L1
+ ldy XMin
+ ldx XMin+1
+ jmp @L2
+@L1: txa
+
+ cpy XMax
+ sbc XMax+1
+ bmi @L2
+ ldy XMax
+ ldx XMax+1
+@L2: sty XPos
+ stx XPos+1
; Move the mouse pointer to the new X pos
@@ -363,45 +363,45 @@ IRQ: lda #$7F
; Calculate the Y movement vector
@SkipX: lda Temp ; Read joystick #0
- and #(JOY::UP | JOY::DOWN) ; Check up/down
- beq @SkipY ;
+ and #(JOY::UP | JOY::DOWN) ; Check up/down
+ beq @SkipY ;
; We will cheat here and rely on the fact that either the up, OR the down
; bit can be active
- lsr a ; Check UP bit
- bcc @Down
- lda #$FF
- tax
- bne @AddY
-@Down: lda #$01
- ldx #$00
+ lsr a ; Check UP bit
+ bcc @Down
+ lda #$FF
+ tax
+ bne @AddY
+@Down: lda #$01
+ ldx #$00
; Calculate the new Y coordinate (--> a/y)
-@AddY: add YPos
- tay ; Remember low byte
- txa
- adc YPos+1
- tax
+@AddY: add YPos
+ tay ; Remember low byte
+ txa
+ adc YPos+1
+ tax
; Limit the Y coordinate to the bounding box
- cpy YMin
- sbc YMin+1
- bpl @L3
- ldy YMin
- ldx YMin+1
- jmp @L4
-@L3: txa
-
- cpy YMax
- sbc YMax+1
- bmi @L4
- ldy YMax
- ldx YMax+1
-@L4: sty YPos
- stx YPos+1
+ cpy YMin
+ sbc YMin+1
+ bpl @L3
+ ldy YMin
+ ldx YMin+1
+ jmp @L4
+@L3: txa
+
+ cpy YMax
+ sbc YMax+1
+ bmi @L4
+ ldy YMax
+ ldx YMax+1
+@L4: sty YPos
+ stx YPos+1
; Move the mouse pointer to the new X pos
diff --git a/libsrc/c128/mou/c128-pot.s b/libsrc/c128/mou/c128-pot.s
index c6f7a1f86..2713e3f4f 100644
--- a/libsrc/c128/mou/c128-pot.s
+++ b/libsrc/c128/mou/c128-pot.s
@@ -5,59 +5,59 @@
; Stefan Haubenthal, 2006-08-20
;
- .include "zeropage.inc"
- .include "mouse-kernel.inc"
- .include "c128.inc"
+ .include "zeropage.inc"
+ .include "mouse-kernel.inc"
+ .include "c128.inc"
- .macpack generic
+ .macpack generic
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "JUMPTABLE"
HEADER:
; Driver signature
- .byte $6d, $6f, $75 ; "mou"
- .byte MOUSE_API_VERSION ; Mouse driver API version number
+ .byte $6d, $6f, $75 ; "mou"
+ .byte MOUSE_API_VERSION ; Mouse driver API version number
; Jump table.
- .addr INSTALL
- .addr UNINSTALL
- .addr HIDE
- .addr SHOW
- .addr SETBOX
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr HIDE
+ .addr SHOW
+ .addr SETBOX
.addr GETBOX
- .addr MOVE
- .addr BUTTONS
- .addr POS
- .addr INFO
- .addr IOCTL
- .addr IRQ
+ .addr MOVE
+ .addr BUTTONS
+ .addr POS
+ .addr INFO
+ .addr IOCTL
+ .addr IRQ
; Callback table, set by the kernel before INSTALL is called
-CHIDE: jmp $0000 ; Hide the cursor
-CSHOW: jmp $0000 ; Show the cursor
-CMOVEX: jmp $0000 ; Move the cursor to X coord
-CMOVEY: jmp $0000 ; Move the cursor to Y coord
+CHIDE: jmp $0000 ; Hide the cursor
+CSHOW: jmp $0000 ; Show the cursor
+CMOVEX: jmp $0000 ; Move the cursor to X coord
+CMOVEY: jmp $0000 ; Move the cursor to Y coord
;----------------------------------------------------------------------------
; Constants
-SCREEN_HEIGHT = 200
-SCREEN_WIDTH = 320
+SCREEN_HEIGHT = 200
+SCREEN_WIDTH = 320
-.enum JOY
- UP = $01
- DOWN = $02
- LEFT = $04
- RIGHT = $08
- FIRE = $10
+.enum JOY
+ UP = $01
+ DOWN = $02
+ LEFT = $04
+ RIGHT = $08
+ FIRE = $10
.endenum
;----------------------------------------------------------------------------
@@ -68,30 +68,30 @@ SCREEN_WIDTH = 320
.bss
Vars:
-YPos: .res 2 ; Current mouse position, Y
-XPos: .res 2 ; Current mouse position, X
-XMin: .res 2 ; X1 value of bounding box
-YMin: .res 2 ; Y1 value of bounding box
-XMax: .res 2 ; X2 value of bounding box
-YMax: .res 2 ; Y2 value of bounding box
-Buttons: .res 1 ; Button mask
+YPos: .res 2 ; Current mouse position, Y
+XPos: .res 2 ; Current mouse position, X
+XMin: .res 2 ; X1 value of bounding box
+YMin: .res 2 ; Y1 value of bounding box
+XMax: .res 2 ; X2 value of bounding box
+YMax: .res 2 ; Y2 value of bounding box
+Buttons: .res 1 ; Button mask
; Temporary value used in the int handler
-Temp: .res 1
+Temp: .res 1
; Default values for above variables
.rodata
-.proc DefVars
- .word SCREEN_HEIGHT/2 ; YPos
- .word SCREEN_WIDTH/2 ; XPos
- .word 0 ; XMin
- .word 0 ; YMin
- .word SCREEN_WIDTH ; XMax
- .word SCREEN_HEIGHT ; YMax
- .byte 0 ; Buttons
+.proc DefVars
+ .word SCREEN_HEIGHT/2 ; YPos
+ .word SCREEN_WIDTH/2 ; XPos
+ .word 0 ; XMin
+ .word 0 ; YMin
+ .word SCREEN_WIDTH ; XMax
+ .word SCREEN_HEIGHT ; YMax
+ .byte 0 ; Buttons
.endproc
.code
@@ -105,37 +105,37 @@ INSTALL:
; Initialize variables. Just copy the default stuff over
- ldx #.sizeof(DefVars)-1
-@L1: lda DefVars,x
- sta Vars,x
- dex
- bpl @L1
+ ldx #.sizeof(DefVars)-1
+@L1: lda DefVars,x
+ sta Vars,x
+ dex
+ bpl @L1
; Be sure the mouse cursor is invisible and at the default location. We
; need to do that here, because our mouse interrupt handler doesn't set the
; mouse position if it hasn't changed.
- sei
- jsr CHIDE
- lda XPos
- ldx XPos+1
- jsr CMOVEX
- lda YPos
- ldx YPos+1
- jsr CMOVEY
- cli
+ sei
+ jsr CHIDE
+ lda XPos
+ ldx XPos+1
+ jsr CMOVEX
+ lda YPos
+ ldx YPos+1
+ jsr CMOVEY
+ cli
; Done, return zero (= MOUSE_ERR_OK)
- ldx #$00
- txa
- rts
+ ldx #$00
+ txa
+ rts
;----------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
; No return code required (the driver is removed from memory on return).
-UNINSTALL = HIDE ; Hide cursor on exit
+UNINSTALL = HIDE ; Hide cursor on exit
;----------------------------------------------------------------------------
; HIDE routine. Is called to hide the mouse pointer. The mouse kernel manages
@@ -144,10 +144,10 @@ UNINSTALL = HIDE ; Hide cursor on exit
; no special action is required besides hiding the mouse cursor.
; No return code required.
-HIDE: sei
- jsr CHIDE
- cli
- rts
+HIDE: sei
+ jsr CHIDE
+ cli
+ rts
;----------------------------------------------------------------------------
; SHOW routine. Is called to show the mouse pointer. The mouse kernel manages
@@ -156,10 +156,10 @@ HIDE: sei
; no special action is required besides enabling the mouse cursor.
; No return code required.
-SHOW: sei
- jsr CSHOW
- cli
- rts
+SHOW: sei
+ jsr CSHOW
+ cli
+ rts
;----------------------------------------------------------------------------
; SETBOX: Set the mouse bounding box. The parameters are passed as they come
@@ -180,7 +180,7 @@ SETBOX: sta ptr1
bpl @L1
cli
- rts
+ rts
;----------------------------------------------------------------------------
; GETBOX: Return the mouse bounding box. The parameters are passed as they
@@ -198,7 +198,7 @@ GETBOX: sta ptr1
bpl @L1
cli
- rts
+ rts
;----------------------------------------------------------------------------
; MOVE: Move the mouse to a new position. The position is passed as it comes
@@ -208,55 +208,55 @@ GETBOX: sta ptr1
; the screen). No return code required.
;
-MOVE: sei ; No interrupts
+MOVE: sei ; No interrupts
- sta YPos
- stx YPos+1 ; New Y position
- jsr CMOVEY ; Set it
+ sta YPos
+ stx YPos+1 ; New Y position
+ jsr CMOVEY ; Set it
- ldy #$01
- lda (sp),y
- sta XPos+1
- tax
- dey
- lda (sp),y
- sta XPos ; New X position
+ ldy #$01
+ lda (sp),y
+ sta XPos+1
+ tax
+ dey
+ lda (sp),y
+ sta XPos ; New X position
- jsr CMOVEX ; Move the cursor
+ jsr CMOVEX ; Move the cursor
- cli ; Allow interrupts
- rts
+ cli ; Allow interrupts
+ rts
;----------------------------------------------------------------------------
; BUTTONS: Return the button mask in a/x.
BUTTONS:
- lda Buttons
- ldx #$00
- rts
+ lda Buttons
+ ldx #$00
+ rts
;----------------------------------------------------------------------------
; POS: Return the mouse position in the MOUSE_POS struct pointed to by ptr1.
; No return code required.
-POS: ldy #MOUSE_POS::XCOORD ; Structure offset
+POS: ldy #MOUSE_POS::XCOORD ; Structure offset
- sei ; Disable interrupts
- lda XPos ; Transfer the position
- sta (ptr1),y
- lda XPos+1
- iny
- sta (ptr1),y
- lda YPos
- iny
- sta (ptr1),y
- lda YPos+1
- cli ; Enable interrupts
+ sei ; Disable interrupts
+ lda XPos ; Transfer the position
+ sta (ptr1),y
+ lda XPos+1
+ iny
+ sta (ptr1),y
+ lda YPos
+ iny
+ sta (ptr1),y
+ lda YPos+1
+ cli ; Enable interrupts
- iny
- sta (ptr1),y ; Store last byte
+ iny
+ sta (ptr1),y ; Store last byte
- rts ; Done
+ rts ; Done
;----------------------------------------------------------------------------
; INFO: Returns mouse position and current button mask in the MOUSE_INFO
@@ -267,15 +267,15 @@ POS: ldy #MOUSE_POS::XCOORD ; Structure offset
; call _mouse_pos to initialize the struct pointer and fill the position
; fields.
-INFO: jsr POS
+INFO: jsr POS
; Fill in the button state
- lda Buttons
- ldy #MOUSE_INFO::BUTTONS
- sta (ptr1),y
+ lda Buttons
+ ldy #MOUSE_INFO::BUTTONS
+ sta (ptr1),y
- rts
+ rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
@@ -283,108 +283,108 @@ INFO: jsr POS
; Must return an error code in a/x.
;
-IOCTL: lda #MOUSE_ERR_INV_IOCTL
- rts
+IOCTL: lda #MOUSE_ERR_INV_IOCTL
+ rts
;----------------------------------------------------------------------------
; IRQ: Irq handler entry point. Called as a subroutine but in IRQ context
; (so be careful).
;
-IRQ: lda #$7F
- sta CIA1_PRA
- lda CIA1_PRB ; Read port #1
- and #%00001100
- eor #%00001100 ; Make all bits active high
- asl
- sta Buttons
- lsr
- lsr
- lsr
- and #%00000001
- ora Buttons
- sta Buttons
- ldx #%01000000
- stx CIA1_PRA
- ldy #0
-: dey
- bne :-
- ldx SID_ADConv1
- stx XPos
- ldx SID_ADConv2
- stx YPos
-
- lda #$FF
- tax
- bne @AddX ; Branch always
- lda #$01
- ldx #$00
+IRQ: lda #$7F
+ sta CIA1_PRA
+ lda CIA1_PRB ; Read port #1
+ and #%00001100
+ eor #%00001100 ; Make all bits active high
+ asl
+ sta Buttons
+ lsr
+ lsr
+ lsr
+ and #%00000001
+ ora Buttons
+ sta Buttons
+ ldx #%01000000
+ stx CIA1_PRA
+ ldy #0
+: dey
+ bne :-
+ ldx SID_ADConv1
+ stx XPos
+ ldx SID_ADConv2
+ stx YPos
+
+ lda #$FF
+ tax
+ bne @AddX ; Branch always
+ lda #$01
+ ldx #$00
; Calculate the new X coordinate (--> a/y)
-@AddX: add XPos
- tay ; Remember low byte
- txa
- adc XPos+1
- tax
+@AddX: add XPos
+ tay ; Remember low byte
+ txa
+ adc XPos+1
+ tax
; Limit the X coordinate to the bounding box
- cpy XMin
- sbc XMin+1
- bpl @L1
- ldy XMin
- ldx XMin+1
- jmp @L2
-@L1: txa
-
- cpy XMax
- sbc XMax+1
- bmi @L2
- ldy XMax
- ldx XMax+1
-@L2: sty XPos
- stx XPos+1
+ cpy XMin
+ sbc XMin+1
+ bpl @L1
+ ldy XMin
+ ldx XMin+1
+ jmp @L2
+@L1: txa
+
+ cpy XMax
+ sbc XMax+1
+ bmi @L2
+ ldy XMax
+ ldx XMax+1
+@L2: sty XPos
+ stx XPos+1
; Move the mouse pointer to the new X pos
- tya
- jsr CMOVEX
+ tya
+ jsr CMOVEX
- lda #$FF
- tax
- bne @AddY
-@Down: lda #$01
- ldx #$00
+ lda #$FF
+ tax
+ bne @AddY
+@Down: lda #$01
+ ldx #$00
; Calculate the new Y coordinate (--> a/y)
-@AddY: add YPos
- tay ; Remember low byte
- txa
- adc YPos+1
- tax
+@AddY: add YPos
+ tay ; Remember low byte
+ txa
+ adc YPos+1
+ tax
; Limit the Y coordinate to the bounding box
- cpy YMin
- sbc YMin+1
- bpl @L3
- ldy YMin
- ldx YMin+1
- jmp @L4
-@L3: txa
-
- cpy YMax
- sbc YMax+1
- bmi @L4
- ldy YMax
- ldx YMax+1
-@L4: sty YPos
- stx YPos+1
+ cpy YMin
+ sbc YMin+1
+ bpl @L3
+ ldy YMin
+ ldx YMin+1
+ jmp @L4
+@L3: txa
+
+ cpy YMax
+ sbc YMax+1
+ bmi @L4
+ ldy YMax
+ ldx YMax+1
+@L4: sty YPos
+ stx YPos+1
; Move the mouse pointer to the new X pos
- tya
- jmp CMOVEY
+ tya
+ jmp CMOVEY
diff --git a/libsrc/c128/mouse_stat_stddrv.s b/libsrc/c128/mouse_stat_stddrv.s
index 24f40a54f..29f2c6392 100644
--- a/libsrc/c128/mouse_stat_stddrv.s
+++ b/libsrc/c128/mouse_stat_stddrv.s
@@ -6,8 +6,8 @@
; const void mouse_static_stddrv[];
;
- .export _mouse_static_stddrv
- .import _c128_1351_mou
+ .export _mouse_static_stddrv
+ .import _c128_1351_mou
.rodata
diff --git a/libsrc/c128/mouse_stddrv.s b/libsrc/c128/mouse_stddrv.s
index 09c607ea3..a9777a057 100644
--- a/libsrc/c128/mouse_stddrv.s
+++ b/libsrc/c128/mouse_stddrv.s
@@ -6,10 +6,10 @@
; const char mouse_stddrv[];
;
- .export _mouse_stddrv
+ .export _mouse_stddrv
.rodata
-_mouse_stddrv: .asciiz "c128-1351.mou"
+_mouse_stddrv: .asciiz "c128-1351.mou"
diff --git a/libsrc/c128/randomize.s b/libsrc/c128/randomize.s
index a4599e97b..5c57e04be 100644
--- a/libsrc/c128/randomize.s
+++ b/libsrc/c128/randomize.s
@@ -5,10 +5,10 @@
; /* Initialize the random number generator */
;
- .export __randomize
- .import _srand
+ .export __randomize
+ .import _srand
- .include "c128.inc"
+ .include "c128.inc"
__randomize:
ldx VIC_HLINE ; Use VIC rasterline as high byte
diff --git a/libsrc/c128/revers.s b/libsrc/c128/revers.s
index f722c84a8..f19400b9a 100644
--- a/libsrc/c128/revers.s
+++ b/libsrc/c128/revers.s
@@ -4,24 +4,24 @@
; unsigned char revers (unsigned char onoff);
;
- .export _revers
+ .export _revers
.include "c128.inc"
.proc _revers
- ldx #$00 ; Assume revers off
- tay ; Test onoff
- beq L1 ; Jump if off
- ldx #$80 ; Load on value
- ldy #$00 ; Assume old value is zero
-L1: lda RVS ; Load old value
- stx RVS ; Set new value
- beq L2 ; Jump if old value zero
- iny ; Make old value = 1
-L2: ldx #$00 ; Load high byte of result
- tya ; Load low byte, set CC
- rts
+ ldx #$00 ; Assume revers off
+ tay ; Test onoff
+ beq L1 ; Jump if off
+ ldx #$80 ; Load on value
+ ldy #$00 ; Assume old value is zero
+L1: lda RVS ; Load old value
+ stx RVS ; Set new value
+ beq L2 ; Jump if old value zero
+ iny ; Make old value = 1
+L2: ldx #$00 ; Load high byte of result
+ tya ; Load low byte, set CC
+ rts
.endproc
diff --git a/libsrc/c128/ser/c128-swlink.s b/libsrc/c128/ser/c128-swlink.s
index 558d80db8..347452e85 100644
--- a/libsrc/c128/ser/c128-swlink.s
+++ b/libsrc/c128/ser/c128-swlink.s
@@ -24,7 +24,7 @@
.include "zeropage.inc"
.include "ser-kernel.inc"
.include "ser-error.inc"
- .include "c128.inc"
+ .include "c128.inc"
; ------------------------------------------------------------------------
@@ -47,12 +47,12 @@
.word PUT
.word STATUS
.word IOCTL
- .word IRQ
+ .word IRQ
;----------------------------------------------------------------------------
; I/O definitions
-ACIA = $DE00
+ACIA = $DE00
ACIA_DATA = ACIA+0 ; Data register
ACIA_STATUS = ACIA+1 ; Status register
ACIA_CMD = ACIA+2 ; Command register
@@ -137,11 +137,11 @@ NmiStubOrig := *
.org $1150 ; BASIC graphics area
.proc NmiStub
- lda #MMU_CFG_CC65 ; Bank 0 with kernal ROM...
- sta MMU_CR ; ...enable
+ lda #MMU_CFG_CC65 ; Bank 0 with kernal ROM...
+ sta MMU_CR ; ...enable
jsr NmiHandler ; Call the actual NMI handler
- lda #$00 ; Get ROM config...
- sta MMU_CR ; ...and enable it
+ lda #$00 ; Get ROM config...
+ sta MMU_CR ; ...and enable it
Vector := *+1
.byte $4C ; Jump to the saved IRQ vector
@@ -157,8 +157,8 @@ INSTALL:
; Deactivate DTR and disable 6551 interrupts
- lda #%00001010
- sta ACIA_CMD
+ lda #%00001010
+ sta ACIA_CMD
; Copy the NMI stub into low memory
@@ -170,20 +170,20 @@ INSTALL:
; Set up the nmi vector
- lda NMIVec
- ldy NMIVec+1
- sta NmiStub::Vector+0
- sty NmiStub::Vector+1
- lda #NmiStub
-SetNMI: sta NMIVec
- sty NMIVec+1
+ lda NMIVec
+ ldy NMIVec+1
+ sta NmiStub::Vector+0
+ sty NmiStub::Vector+1
+ lda #NmiStub
+SetNMI: sta NMIVec
+ sty NMIVec+1
; Done, return an error code
lda #SER_ERR_INIT_FAILED
- rts
+ lda #SER_ERR_INIT_FAILED
+ rts
; Baud rate not available
@@ -285,8 +285,8 @@ CLOSE:
; Stop interrupts, drop DTR
- lda #%00001010
- sta ACIA_CMD
+ lda #%00001010
+ sta ACIA_CMD
; Initalize buffers. Returns zero in a
@@ -296,7 +296,7 @@ CLOSE:
lda #SER_ERR_NO_DATA
- rts
+@L1: lda RecvFreeCnt ; (25)
+ cmp #$ff
+ bne @L2
+ lda #SER_ERR_NO_DATA
+ rts
; Check for flow stopped & enough free: release flow control
-@L2: ldx Stopped ; (34)
- beq @L3
- cmp #63
- bcc @L3
- lda #$00
- sta Stopped
- lda RtsOff
- ora #%00001000
- sta ACIA_CMD
+@L2: ldx Stopped ; (34)
+ beq @L3
+ cmp #63
+ bcc @L3
+ lda #$00
+ sta Stopped
+ lda RtsOff
+ ora #%00001000
+ sta ACIA_CMD
; Get byte from buffer
-@L3: ldx RecvHead ; (41)
- lda RecvBuf,x
- inc RecvHead
- inc RecvFreeCnt
- ldx #$00 ; (59)
- sta (ptr1,x)
- txa ; Return code = 0
- rts
+@L3: ldx RecvHead ; (41)
+ lda RecvBuf,x
+ inc RecvHead
+ inc RecvFreeCnt
+ ldx #$00 ; (59)
+ sta (ptr1,x)
+ txa ; Return code = 0
+ rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
@@ -351,40 +351,40 @@ PUT:
; Try to send
- ldx SendFreeCnt
- inx ; X = $ff?
- beq @L2
- pha
- lda #$00
- jsr TryToSend
- pla
+ ldx SendFreeCnt
+ inx ; X = $ff?
+ beq @L2
+ pha
+ lda #$00
+ jsr TryToSend
+ pla
; Put byte into send buffer & send
-@L2: ldx SendFreeCnt
- bne @L3
- lda #TM
- jmp _mktime
+.proc __systime
+
+ lda CIA1_TODHR
+ bpl AM
+ and #%01111111
+ sed
+ clc
+ adc #$12
+ cld
+AM: jsr BCD2dec
+ sta TM + tm::tm_hour
+ lda CIA1_TODMIN
+ jsr BCD2dec
+ sta TM + tm::tm_min
+ lda CIA1_TODSEC
+ jsr BCD2dec
+ sta TM + tm::tm_sec
+ lda CIA1_TOD10 ; Dummy read to unfreeze
+ lda #TM
+ jmp _mktime
; dec = (((BCD>>4)*10) + (BCD&0xf))
BCD2dec:tax
- and #%00001111
- sta tmp1
- txa
+ and #%00001111
+ sta tmp1
+ txa
and #%11110000 ; *16
lsr ; *8
sta tmp2
@@ -68,13 +68,13 @@ BCD2dec:tax
lda CIA1_TOD10
sta CIA1_TOD10
- jsr _get_tv
- cmp #TV::PAL
- bne @60Hz
- lda CIA1_CRA
- ora #$80
- sta CIA1_CRA
-@60Hz: rts
+ jsr _get_tv
+ cmp #TV::PAL
+ bne @60Hz
+ lda CIA1_CRA
+ ora #$80
+ sta CIA1_CRA
+@60Hz: rts
.endproc
@@ -83,7 +83,7 @@ BCD2dec:tax
; TM struct with date set to 1970-01-01
.data
-TM: .word 0 ; tm_sec
+TM: .word 0 ; tm_sec
.word 0 ; tm_min
.word 0 ; tm_hour
.word 1 ; tm_mday
diff --git a/libsrc/c128/tgi/c128-vdc.s b/libsrc/c128/tgi/c128-vdc.s
index e497a5942..226d2aea2 100644
--- a/libsrc/c128/tgi/c128-vdc.s
+++ b/libsrc/c128/tgi/c128-vdc.s
@@ -20,9 +20,9 @@
; Register 25 ($19) is said to require different value for VDC v1, but I
; couldn't find what it should be.
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
+ .include "tgi-kernel.inc"
.include "tgi-error.inc"
@@ -31,19 +31,19 @@
; ------------------------------------------------------------------------
; Constants
-VDC_ADDR_REG = $D600 ; VDC address
-VDC_DATA_REG = $D601 ; VDC data
+VDC_ADDR_REG = $D600 ; VDC address
+VDC_DATA_REG = $D601 ; VDC data
-VDC_DSP_HI = 12 ; registers used
-VDC_DSP_LO = 13
-VDC_DATA_HI = 18
-VDC_DATA_LO = 19
-VDC_VSCROLL = 24
-VDC_HSCROLL = 25
-VDC_COLORS = 26
-VDC_CSET = 28
-VDC_COUNT = 30
-VDC_DATA = 31
+VDC_DSP_HI = 12 ; registers used
+VDC_DSP_LO = 13
+VDC_DATA_HI = 18
+VDC_DATA_LO = 19
+VDC_VSCROLL = 24
+VDC_HSCROLL = 25
+VDC_COLORS = 26
+VDC_CSET = 28
+VDC_COUNT = 30
+VDC_DATA = 31
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
@@ -58,7 +58,7 @@ VDC_DATA = 31
xres: .word 640 ; X resolution
yres: .word 200 ; Y resolution
.byte 2 ; Number of drawing colors
-pages: .byte 1 ; Number of screens available
+pages: .byte 1 ; Number of screens available
.byte 8 ; System font X size
.byte 8 ; System font Y size
.word $006A ; Aspect ratio (based on 4/3 display)
@@ -71,7 +71,7 @@ pages: .byte 1 ; Number of screens available
.addr UNINSTALL
.addr INIT
.addr DONE
- .addr GETERROR
+ .addr GETERROR
.addr CONTROL
.addr CLEAR
.addr SETVIEWPAGE
@@ -99,23 +99,23 @@ Y1 = ptr2
X2 = ptr3
Y2 = ptr4
-ADDR = tmp1
-TEMP = tmp3
-TEMP2 = tmp4 ; HORLINE
-TEMP3 = sreg ; HORLINE
+ADDR = tmp1
+TEMP = tmp3
+TEMP2 = tmp4 ; HORLINE
+TEMP3 = sreg ; HORLINE
; Absolute variables used in the code
.bss
-SCRBASE: .res 1 ; High byte of screen base
+SCRBASE: .res 1 ; High byte of screen base
-ERROR: .res 1 ; Error code
+ERROR: .res 1 ; Error code
PALETTE: .res 2 ; The current palette
BITMASK: .res 1 ; $00 = clear, $FF = set pixels
-OLDCOLOR: .res 1 ; colors before entering gfx mode
+OLDCOLOR: .res 1 ; colors before entering gfx mode
; Text output stuff
TEXTMAGX: .res 1
@@ -131,25 +131,25 @@ PALETTESIZE = * - DEFPALETTE
BITTAB: .byte $80,$40,$20,$10,$08,$04,$02,$01
-BITMASKL: .byte %11111111, %01111111, %00111111, %00011111
- .byte %00001111, %00000111, %00000011, %00000001
+BITMASKL: .byte %11111111, %01111111, %00111111, %00011111
+ .byte %00001111, %00000111, %00000011, %00000001
-BITMASKR: .byte %10000000, %11000000, %11100000, %11110000
- .byte %11111000, %11111100, %11111110, %11111111
+BITMASKR: .byte %10000000, %11000000, %11100000, %11110000
+ .byte %11111000, %11111100, %11111110, %11111111
; color translation table (indexed by VIC color)
-COLTRANS: .byte $00, $0f, $08, $06, $0a, $04, $02, $0c
- .byte $0d, $0b, $09, $01, $0e, $05, $03, $07
- ; colors BROWN and GRAY3 are wrong
+COLTRANS: .byte $00, $0f, $08, $06, $0a, $04, $02, $0c
+ .byte $0d, $0b, $09, $01, $0e, $05, $03, $07
+ ; colors BROWN and GRAY3 are wrong
; VDC initialization table (reg),(val),...,$ff
InitVDCTab:
- .byte VDC_DSP_HI, 0 ; viewpage 0 as default
- .byte VDC_DSP_LO, 0
- .byte VDC_HSCROLL, $87
- .byte $ff
+ .byte VDC_DSP_HI, 0 ; viewpage 0 as default
+ .byte VDC_DSP_LO, 0
+ .byte VDC_HSCROLL, $87
+ .byte $ff
-SCN80CLR: .byte 27,88,147,27,88,0
+SCN80CLR: .byte 27,88,147,27,88,0
.code
@@ -162,78 +162,78 @@ SCN80CLR: .byte 27,88,147,27,88,0
;
INSTALL:
- ; check for VDC version and update register $19 value
-
- ; check for VDC ram size and update number of available screens
-
- ldx #VDC_CSET ; determine size of RAM...
- jsr VDCReadReg
- sta tmp1
- ora #%00010000
- jsr VDCWriteReg ; turn on 64k
-
- jsr settestadr1 ; save original value of test byte
- jsr VDCReadByte
- sta tmp2
-
- lda #$55 ; write $55 here
- ldy #ptr1
- jsr test64k ; read it here and there
- lda #$aa ; write $aa here
- ldy #ptr2
- jsr test64k ; read it here and there
-
- jsr settestadr1
- lda tmp2
- jsr VDCWriteByte ; restore original value of test byte
-
- lda ptr1 ; do bytes match?
- cmp ptr1+1
- bne @have64k
- lda ptr2
- cmp ptr2+1
- bne @have64k
-
- ldx #VDC_CSET
- lda tmp1
- jsr VDCWriteReg ; restore 16/64k flag
- jmp @endok ; and leave default values for 16k
+ ; check for VDC version and update register $19 value
+
+ ; check for VDC ram size and update number of available screens
+
+ ldx #VDC_CSET ; determine size of RAM...
+ jsr VDCReadReg
+ sta tmp1
+ ora #%00010000
+ jsr VDCWriteReg ; turn on 64k
+
+ jsr settestadr1 ; save original value of test byte
+ jsr VDCReadByte
+ sta tmp2
+
+ lda #$55 ; write $55 here
+ ldy #ptr1
+ jsr test64k ; read it here and there
+ lda #$aa ; write $aa here
+ ldy #ptr2
+ jsr test64k ; read it here and there
+
+ jsr settestadr1
+ lda tmp2
+ jsr VDCWriteByte ; restore original value of test byte
+
+ lda ptr1 ; do bytes match?
+ cmp ptr1+1
+ bne @have64k
+ lda ptr2
+ cmp ptr2+1
+ bne @have64k
+
+ ldx #VDC_CSET
+ lda tmp1
+ jsr VDCWriteReg ; restore 16/64k flag
+ jmp @endok ; and leave default values for 16k
@have64k:
- lda #4
- sta pages
+ lda #4
+ sta pages
@endok:
- lda #0
- sta SCRBASE ; draw page 0 as default
+ lda #0
+ sta SCRBASE ; draw page 0 as default
rts
test64k:
- sta tmp1
- sty ptr3
- lda #0
- sta ptr3+1
- jsr settestadr1
- lda tmp1
- jsr VDCWriteByte ; write $55
- jsr settestadr1
- jsr VDCReadByte ; read here
- pha
- jsr settestadr2
- jsr VDCReadByte ; and there
- ldy #1
- sta (ptr3),y
- pla
- dey
- sta (ptr3),y
- rts
+ sta tmp1
+ sty ptr3
+ lda #0
+ sta ptr3+1
+ jsr settestadr1
+ lda tmp1
+ jsr VDCWriteByte ; write $55
+ jsr settestadr1
+ jsr VDCReadByte ; read here
+ pha
+ jsr settestadr2
+ jsr VDCReadByte ; and there
+ ldy #1
+ sta (ptr3),y
+ pla
+ dey
+ sta (ptr3),y
+ rts
settestadr1:
- ldy #$02 ; test page 2 (here)
- .byte $2c
+ ldy #$02 ; test page 2 (here)
+ .byte $2c
settestadr2:
- ldy #$42 ; or page 64+2 (there)
- lda #0
- jmp VDCSetSourceAddr
+ ldy #$42 ; or page 64+2 (there)
+ lda #0
+ jmp VDCSetSourceAddr
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory. May
@@ -268,20 +268,20 @@ INIT:
stx BITMASK
; Remeber current color value
- ldx #VDC_COLORS
- jsr VDCReadReg
- sta OLDCOLOR
+ ldx #VDC_COLORS
+ jsr VDCReadReg
+ sta OLDCOLOR
; Switch into graphics mode (set view page 0)
- ldy #0
-@L2: ldx InitVDCTab,y
- bmi @L3
- iny
- lda InitVDCTab,y
- jsr VDCWriteReg
- iny
- bne @L2
+ ldy #0
+@L2: ldx InitVDCTab,y
+ bmi @L3
+ iny
+ lda InitVDCTab,y
+ jsr VDCWriteReg
+ iny
+ bne @L2
@L3:
; Done, reset the error code
@@ -299,35 +299,35 @@ INIT:
;
DONE:
- ; This part is C128-mode specific
- jsr $e179 ; reload character set and setup VDC
- jsr $ff62
- lda $d7 ; in 80-columns?
- bne @L01
-@L0: lda SCN80CLR,y
- beq @L1
- jsr $ffd2 ; print \xe,clr,\xe
- iny
- bne @L0
-@L01: lda #147
- jsr $ffd2 ; print clr
-@L1: lda #0 ; restore view page
- ldx #VDC_DSP_HI
- jsr VDCWriteReg
- lda OLDCOLOR
- ldx #VDC_COLORS
- jsr VDCWriteReg ; restore color (background)
- lda #$47
- ldx #VDC_HSCROLL
- jmp VDCWriteReg ; switch to text screen
+ ; This part is C128-mode specific
+ jsr $e179 ; reload character set and setup VDC
+ jsr $ff62
+ lda $d7 ; in 80-columns?
+ bne @L01
+@L0: lda SCN80CLR,y
+ beq @L1
+ jsr $ffd2 ; print \xe,clr,\xe
+ iny
+ bne @L0
+@L01: lda #147
+ jsr $ffd2 ; print clr
+@L1: lda #0 ; restore view page
+ ldx #VDC_DSP_HI
+ jsr VDCWriteReg
+ lda OLDCOLOR
+ ldx #VDC_COLORS
+ jsr VDCWriteReg ; restore color (background)
+ lda #$47
+ ldx #VDC_HSCROLL
+ jmp VDCWriteReg ; switch to text screen
; ------------------------------------------------------------------------
; GETERROR: Return the error code in A and clear it.
GETERROR:
- ldx #TGI_ERR_OK
- lda ERROR
- stx ERROR
+ ldx #TGI_ERR_OK
+ lda ERROR
+ stx ERROR
rts
; ------------------------------------------------------------------------
@@ -337,8 +337,8 @@ GETERROR:
;
CONTROL:
- lda #TGI_ERR_INV_FUNC
- sta ERROR
+ lda #TGI_ERR_INV_FUNC
+ sta ERROR
rts
; ------------------------------------------------------------------------
@@ -348,22 +348,22 @@ CONTROL:
;
CLEAR:
- lda #0
- ldy SCRBASE
- jsr VDCSetSourceAddr
- lda #0
- ldx #VDC_VSCROLL
- jsr VDCWriteReg ; set fill mode
- lda #0
- jsr VDCWriteByte ; put 1rst byte (fill value)
- ldy #62 ; 62 times
- lda #0 ; 256 bytes
- ldx #VDC_COUNT
-@L1: jsr VDCWriteReg
- dey
- bne @L1
- lda #127
- jmp VDCWriteReg ; 1+62*256+127=16000=(640*256)/8
+ lda #0
+ ldy SCRBASE
+ jsr VDCSetSourceAddr
+ lda #0
+ ldx #VDC_VSCROLL
+ jsr VDCWriteReg ; set fill mode
+ lda #0
+ jsr VDCWriteByte ; put 1rst byte (fill value)
+ ldy #62 ; 62 times
+ lda #0 ; 256 bytes
+ ldx #VDC_COUNT
+@L1: jsr VDCWriteReg
+ dey
+ bne @L1
+ lda #127
+ jmp VDCWriteReg ; 1+62*256+127=16000=(640*256)/8
; ------------------------------------------------------------------------
; SETVIEWPAGE: Set the visible page. Called with the new page in A (0..n).
@@ -373,12 +373,12 @@ CLEAR:
;
SETVIEWPAGE:
- clc
- ror
- ror
- ror
- ldx #VDC_DSP_HI
- jmp VDCWriteReg
+ clc
+ ror
+ ror
+ ror
+ ldx #VDC_DSP_HI
+ jmp VDCWriteReg
; ------------------------------------------------------------------------
; SETDRAWPAGE: Set the drawable page. Called with the new page in A (0..n).
@@ -388,12 +388,12 @@ SETVIEWPAGE:
;
SETDRAWPAGE:
- clc
- ror
- ror
- ror
- sta SCRBASE
- rts
+ clc
+ ror
+ ror
+ ror
+ sta SCRBASE
+ rts
; ------------------------------------------------------------------------
; SETCOLOR: Set the drawing color (in A). The new color is already checked
@@ -428,16 +428,16 @@ SETPALETTE:
; Get the color entries from the palette
ldy PALETTE+1 ; Foreground color
- lda COLTRANS,y
+ lda COLTRANS,y
asl a
asl a
asl a
asl a
ldy PALETTE ; Background color
- ora COLTRANS,y
+ ora COLTRANS,y
- ldx #VDC_COLORS
- jsr VDCWriteReg
+ ldx #VDC_COLORS
+ jsr VDCWriteReg
lda #TGI_ERR_OK ; Clear error code
sta ERROR
rts
@@ -480,23 +480,23 @@ GETDEFPALETTE:
SETPIXEL:
jsr CALC ; Calculate coordinates
- stx TEMP
- lda ADDR
- ldy ADDR+1
- jsr VDCSetSourceAddr
- jsr VDCReadByte
- ldx TEMP
+ stx TEMP
+ lda ADDR
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ jsr VDCReadByte
+ ldx TEMP
- sta TEMP
+ sta TEMP
eor BITMASK
and BITTAB,X
- eor TEMP
- pha
- lda ADDR
- ldy ADDR+1
- jsr VDCSetSourceAddr
- pla
- jsr VDCWriteByte
+ eor TEMP
+ pha
+ lda ADDR
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ pla
+ jsr VDCWriteByte
@L9: rts
@@ -509,12 +509,12 @@ SETPIXEL:
GETPIXEL:
jsr CALC ; Calculate coordinates
- stx TEMP ; preserve X
- lda ADDR
- ldy ADDR+1
- jsr VDCSetSourceAddr
- jsr VDCReadByte
- ldx TEMP
+ stx TEMP ; preserve X
+ lda ADDR
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ jsr VDCReadByte
+ ldx TEMP
ldy #$00
and BITTAB,X
@@ -542,127 +542,127 @@ GETPIXEL:
;
BAR:
- inc Y2
- bne HORLINE
- inc Y2+1
+ inc Y2
+ bne HORLINE
+ inc Y2+1
; Original code for a horizontal line
HORLINE:
- lda X1
- pha
- lda X1+1
- pha
- jsr CALC ; get data for LEFT
- lda BITMASKL,x ; remember left address and bitmask
- pha
- lda ADDR
- pha
- lda ADDR+1
- pha
-
- lda X2
- sta X1
- lda X2+1
- sta X1+1
- jsr CALC ; get data for RIGHT
- lda BITMASKR,x
- sta TEMP3
-
- pla ; recall data for LEFT
- sta X1+1
- pla
- sta X1 ; put left address into X1
- pla
-
- cmp #%11111111 ; if left bit <> 0
- beq @L1
- sta TEMP2 ; do left byte only...
- lda X1
- ldy X1+1
- jsr VDCSetSourceAddr
- jsr VDCReadByte
- sta TEMP
- eor BITMASK
- and TEMP2
- eor TEMP
- pha
- lda X1
- ldy X1+1
- jsr VDCSetSourceAddr
- pla
- jsr VDCWriteByte
- inc X1 ; ... and proceed
- bne @L1
- inc X1+1
-
- ; do right byte (if Y2=0 ++ADDR and skip)
-@L1: lda TEMP3
- cmp #%11111111 ; if right bit <> 7
- bne @L11
- inc ADDR ; right bit = 7 - the next one is the last
- bne @L10
- inc ADDR+1
-@L10: bne @L2
-
-@L11: lda ADDR ; do right byte only...
- ldy ADDR+1
- jsr VDCSetSourceAddr
- jsr VDCReadByte
- sta TEMP
- eor BITMASK
- and TEMP3
- eor TEMP
- pha
- lda ADDR
- ldy ADDR+1
- jsr VDCSetSourceAddr
- pla
- jsr VDCWriteByte
-
-@L2: ; do the fill in the middle
- lda ADDR ; calculate offset in full bytes
- sec
- sbc X1
- beq @L3 ; if equal - there are no more bytes
- sta ADDR
-
- lda X1 ; setup for the left side
- ldy X1+1
- jsr VDCSetSourceAddr
- lda BITMASK ; get color
- jsr VDCWriteByte ; put 1st value
- ldx ADDR
- dex
- beq @L3 ; 1 byte already written
-
- stx ADDR ; if there are more bytes - fill them...
- ldx #VDC_VSCROLL
- lda #0
- jsr VDCWriteReg ; setup for fill
- ldx #VDC_COUNT
- lda ADDR
- jsr VDCWriteReg ; ... fill them NOW!
-
-@L3: pla
- sta X1+1
- pla
- sta X1
+ lda X1
+ pha
+ lda X1+1
+ pha
+ jsr CALC ; get data for LEFT
+ lda BITMASKL,x ; remember left address and bitmask
+ pha
+ lda ADDR
+ pha
+ lda ADDR+1
+ pha
+
+ lda X2
+ sta X1
+ lda X2+1
+ sta X1+1
+ jsr CALC ; get data for RIGHT
+ lda BITMASKR,x
+ sta TEMP3
+
+ pla ; recall data for LEFT
+ sta X1+1
+ pla
+ sta X1 ; put left address into X1
+ pla
+
+ cmp #%11111111 ; if left bit <> 0
+ beq @L1
+ sta TEMP2 ; do left byte only...
+ lda X1
+ ldy X1+1
+ jsr VDCSetSourceAddr
+ jsr VDCReadByte
+ sta TEMP
+ eor BITMASK
+ and TEMP2
+ eor TEMP
+ pha
+ lda X1
+ ldy X1+1
+ jsr VDCSetSourceAddr
+ pla
+ jsr VDCWriteByte
+ inc X1 ; ... and proceed
+ bne @L1
+ inc X1+1
+
+ ; do right byte (if Y2=0 ++ADDR and skip)
+@L1: lda TEMP3
+ cmp #%11111111 ; if right bit <> 7
+ bne @L11
+ inc ADDR ; right bit = 7 - the next one is the last
+ bne @L10
+ inc ADDR+1
+@L10: bne @L2
+
+@L11: lda ADDR ; do right byte only...
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ jsr VDCReadByte
+ sta TEMP
+ eor BITMASK
+ and TEMP3
+ eor TEMP
+ pha
+ lda ADDR
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ pla
+ jsr VDCWriteByte
+
+@L2: ; do the fill in the middle
+ lda ADDR ; calculate offset in full bytes
+ sec
+ sbc X1
+ beq @L3 ; if equal - there are no more bytes
+ sta ADDR
+
+ lda X1 ; setup for the left side
+ ldy X1+1
+ jsr VDCSetSourceAddr
+ lda BITMASK ; get color
+ jsr VDCWriteByte ; put 1st value
+ ldx ADDR
+ dex
+ beq @L3 ; 1 byte already written
+
+ stx ADDR ; if there are more bytes - fill them...
+ ldx #VDC_VSCROLL
+ lda #0
+ jsr VDCWriteReg ; setup for fill
+ ldx #VDC_COUNT
+ lda ADDR
+ jsr VDCWriteReg ; ... fill them NOW!
+
+@L3: pla
+ sta X1+1
+ pla
+ sta X1
; End of horizontal line code
- inc Y1
- bne @L4
- inc Y1+1
-@L4: lda Y1
- cmp Y2
- bne @L5
- lda Y1+1
- cmp Y2+1
- bne @L5
- rts
+ inc Y1
+ bne @L4
+ inc Y1+1
+@L4: lda Y1
+ cmp Y2
+ bne @L5
+ lda Y1+1
+ cmp Y2+1
+ bne @L5
+ rts
-@L5: jmp HORLINE
+@L5: jmp HORLINE
; ------------------------------------------------------------------------
@@ -697,82 +697,82 @@ OUTTEXT:
;> ADDR - address of card
;> X - bit number (X1 & 7)
CALC:
- lda Y1+1
- sta ADDR+1
- lda Y1
- asl
- rol ADDR+1
- asl
- rol ADDR+1 ; Y*4
- clc
- adc Y1
- sta ADDR
- lda Y1+1
- adc ADDR+1
- sta ADDR+1 ; Y*4+Y=Y*5
- lda ADDR
- asl
- rol ADDR+1
- asl
- rol ADDR+1
- asl
- rol ADDR+1
- asl
- rol ADDR+1
- sta ADDR ; Y*5*16=Y*80
- lda X1+1
- sta TEMP
- lda X1
- lsr TEMP
- ror
- lsr TEMP
- ror
- lsr TEMP
- ror
- clc
- adc ADDR
- sta ADDR
- lda ADDR+1 ; ADDR = Y*80+x/8
- adc TEMP
- sta ADDR+1
- lda ADDR+1
- adc SCRBASE
- sta ADDR+1
- lda X1
- and #7
- tax
- rts
+ lda Y1+1
+ sta ADDR+1
+ lda Y1
+ asl
+ rol ADDR+1
+ asl
+ rol ADDR+1 ; Y*4
+ clc
+ adc Y1
+ sta ADDR
+ lda Y1+1
+ adc ADDR+1
+ sta ADDR+1 ; Y*4+Y=Y*5
+ lda ADDR
+ asl
+ rol ADDR+1
+ asl
+ rol ADDR+1
+ asl
+ rol ADDR+1
+ asl
+ rol ADDR+1
+ sta ADDR ; Y*5*16=Y*80
+ lda X1+1
+ sta TEMP
+ lda X1
+ lsr TEMP
+ ror
+ lsr TEMP
+ ror
+ lsr TEMP
+ ror
+ clc
+ adc ADDR
+ sta ADDR
+ lda ADDR+1 ; ADDR = Y*80+x/8
+ adc TEMP
+ sta ADDR+1
+ lda ADDR+1
+ adc SCRBASE
+ sta ADDR+1
+ lda X1
+ and #7
+ tax
+ rts
;-------------
; VDC helpers
VDCSetSourceAddr:
- pha
- tya
- ldx #VDC_DATA_HI
- jsr VDCWriteReg
- pla
- ldx #VDC_DATA_LO
- bne VDCWriteReg
+ pha
+ tya
+ ldx #VDC_DATA_HI
+ jsr VDCWriteReg
+ pla
+ ldx #VDC_DATA_LO
+ bne VDCWriteReg
VDCReadByte:
- ldx #VDC_DATA
+ ldx #VDC_DATA
VDCReadReg:
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- lda VDC_DATA_REG
- rts
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ lda VDC_DATA_REG
+ rts
VDCWriteByte:
- ldx #VDC_DATA
+ ldx #VDC_DATA
VDCWriteReg:
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- sta VDC_DATA_REG
- rts
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ sta VDC_DATA_REG
+ rts
; ------------------------------------------------------------------------
- .include "../../tgi/tgidrv_line.inc"
+ .include "../../tgi/tgidrv_line.inc"
diff --git a/libsrc/c128/tgi/c128-vdc2.s b/libsrc/c128/tgi/c128-vdc2.s
index 7f2dbdf5c..e3c08037f 100644
--- a/libsrc/c128/tgi/c128-vdc2.s
+++ b/libsrc/c128/tgi/c128-vdc2.s
@@ -21,9 +21,9 @@
; Register 25 ($19) is said to require different value for VDC v1, but I
; couldn't find what it should be.
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "tgi-kernel.inc"
+ .include "tgi-kernel.inc"
.include "tgi-error.inc"
@@ -32,19 +32,19 @@
; ------------------------------------------------------------------------
; Constants
-VDC_ADDR_REG = $D600 ; VDC address
-VDC_DATA_REG = $D601 ; VDC data
+VDC_ADDR_REG = $D600 ; VDC address
+VDC_DATA_REG = $D601 ; VDC data
-VDC_DSP_HI = 12 ; registers used
-VDC_DSP_LO = 13
-VDC_DATA_HI = 18
-VDC_DATA_LO = 19
-VDC_VSCROLL = 24
-VDC_HSCROLL = 25
-VDC_COLORS = 26
-VDC_CSET = 28
-VDC_COUNT = 30
-VDC_DATA = 31
+VDC_DSP_HI = 12 ; registers used
+VDC_DSP_LO = 13
+VDC_DATA_HI = 18
+VDC_DATA_LO = 19
+VDC_VSCROLL = 24
+VDC_HSCROLL = 25
+VDC_COLORS = 26
+VDC_CSET = 28
+VDC_COUNT = 30
+VDC_DATA = 31
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
@@ -59,7 +59,7 @@ VDC_DATA = 31
xres: .word 640 ; X resolution
yres: .word 480 ; Y resolution
.byte 2 ; Number of drawing colors
-pages: .byte 0 ; Number of screens available
+pages: .byte 0 ; Number of screens available
.byte 8 ; System font X size
.byte 8 ; System font Y size
.word $0100 ; Aspect ratio (based on 4/3 display)
@@ -72,7 +72,7 @@ pages: .byte 0 ; Number of screens available
.addr UNINSTALL
.addr INIT
.addr DONE
- .addr GETERROR
+ .addr GETERROR
.addr CONTROL
.addr CLEAR
.addr SETVIEWPAGE
@@ -100,21 +100,21 @@ Y1 = ptr2
X2 = ptr3
Y2 = ptr4
-ADDR = tmp1
-TEMP = tmp3
-TEMP2 = tmp4 ; HORLINE
-TEMP3 = sreg ; HORLINE
+ADDR = tmp1
+TEMP = tmp3
+TEMP2 = tmp4 ; HORLINE
+TEMP3 = sreg ; HORLINE
; Absolute variables used in the code
.bss
-ERROR: .res 1 ; Error code
+ERROR: .res 1 ; Error code
PALETTE: .res 2 ; The current palette
BITMASK: .res 1 ; $00 = clear, $FF = set pixels
-OLDCOLOR: .res 1 ; colors before entering gfx mode
+OLDCOLOR: .res 1 ; colors before entering gfx mode
; Text output stuff
TEXTMAGX: .res 1
@@ -130,33 +130,33 @@ PALETTESIZE = * - DEFPALETTE
BITTAB: .byte $80,$40,$20,$10,$08,$04,$02,$01
-BITMASKL: .byte %11111111, %01111111, %00111111, %00011111
- .byte %00001111, %00000111, %00000011, %00000001
+BITMASKL: .byte %11111111, %01111111, %00111111, %00011111
+ .byte %00001111, %00000111, %00000011, %00000001
-BITMASKR: .byte %10000000, %11000000, %11100000, %11110000
- .byte %11111000, %11111100, %11111110, %11111111
+BITMASKR: .byte %10000000, %11000000, %11100000, %11110000
+ .byte %11111000, %11111100, %11111110, %11111111
; color translation table (indexed by VIC color)
-COLTRANS: .byte $00, $0f, $08, $06, $0a, $04, $02, $0c
- .byte $0d, $0b, $09, $01, $0e, $05, $03, $07
- ; colors BROWN and GRAY3 are wrong
+COLTRANS: .byte $00, $0f, $08, $06, $0a, $04, $02, $0c
+ .byte $0d, $0b, $09, $01, $0e, $05, $03, $07
+ ; colors BROWN and GRAY3 are wrong
; VDC initialization table (reg),(val),...,$ff
InitVDCTab:
- .byte VDC_DSP_HI, 0 ; viewpage 0 as default
- .byte VDC_DSP_LO, 0
- .byte VDC_HSCROLL, $87
- .byte 2, $66
- .byte 4, $4c
- .byte 5, $06
- .byte 6, $4c
- .byte 7, $47
- .byte 8, $03
- .byte 9, $06
- .byte 27, $00
- .byte $ff
-
-SCN80CLR: .byte 27,88,147,27,88,0
+ .byte VDC_DSP_HI, 0 ; viewpage 0 as default
+ .byte VDC_DSP_LO, 0
+ .byte VDC_HSCROLL, $87
+ .byte 2, $66
+ .byte 4, $4c
+ .byte 5, $06
+ .byte 6, $4c
+ .byte 7, $47
+ .byte 8, $03
+ .byte 9, $06
+ .byte 27, $00
+ .byte $ff
+
+SCN80CLR: .byte 27,88,147,27,88,0
.code
@@ -169,76 +169,76 @@ SCN80CLR: .byte 27,88,147,27,88,0
;
INSTALL:
- ; check for VDC version and update register $19 value
-
- ; check for VDC ram size and update number of available screens
-
- ldx #VDC_CSET ; determine size of RAM...
- jsr VDCReadReg
- sta tmp1
- ora #%00010000
- jsr VDCWriteReg ; turn on 64k
-
- jsr settestadr1 ; save original value of test byte
- jsr VDCReadByte
- sta tmp2
-
- lda #$55 ; write $55 here
- ldy #ptr1
- jsr test64k ; read it here and there
- lda #$aa ; write $aa here
- ldy #ptr2
- jsr test64k ; read it here and there
-
- jsr settestadr1
- lda tmp2
- jsr VDCWriteByte ; restore original value of test byte
-
- lda ptr1 ; do bytes match?
- cmp ptr1+1
- bne @have64k
- lda ptr2
- cmp ptr2+1
- bne @have64k
-
- ldx #VDC_CSET
- lda tmp1
- jsr VDCWriteReg ; restore 16/64k flag
- jmp @endok ; and leave default values for 16k
+ ; check for VDC version and update register $19 value
+
+ ; check for VDC ram size and update number of available screens
+
+ ldx #VDC_CSET ; determine size of RAM...
+ jsr VDCReadReg
+ sta tmp1
+ ora #%00010000
+ jsr VDCWriteReg ; turn on 64k
+
+ jsr settestadr1 ; save original value of test byte
+ jsr VDCReadByte
+ sta tmp2
+
+ lda #$55 ; write $55 here
+ ldy #ptr1
+ jsr test64k ; read it here and there
+ lda #$aa ; write $aa here
+ ldy #ptr2
+ jsr test64k ; read it here and there
+
+ jsr settestadr1
+ lda tmp2
+ jsr VDCWriteByte ; restore original value of test byte
+
+ lda ptr1 ; do bytes match?
+ cmp ptr1+1
+ bne @have64k
+ lda ptr2
+ cmp ptr2+1
+ bne @have64k
+
+ ldx #VDC_CSET
+ lda tmp1
+ jsr VDCWriteReg ; restore 16/64k flag
+ jmp @endok ; and leave default values for 16k
@have64k:
- lda #1
- sta pages
+ lda #1
+ sta pages
@endok:
rts
test64k:
- sta tmp1
- sty ptr3
- lda #0
- sta ptr3+1
- jsr settestadr1
- lda tmp1
- jsr VDCWriteByte ; write $55
- jsr settestadr1
- jsr VDCReadByte ; read here
- pha
- jsr settestadr2
- jsr VDCReadByte ; and there
- ldy #1
- sta (ptr3),y
- pla
- dey
- sta (ptr3),y
- rts
+ sta tmp1
+ sty ptr3
+ lda #0
+ sta ptr3+1
+ jsr settestadr1
+ lda tmp1
+ jsr VDCWriteByte ; write $55
+ jsr settestadr1
+ jsr VDCReadByte ; read here
+ pha
+ jsr settestadr2
+ jsr VDCReadByte ; and there
+ ldy #1
+ sta (ptr3),y
+ pla
+ dey
+ sta (ptr3),y
+ rts
settestadr1:
- ldy #$02 ; test page 2 (here)
- .byte $2c
+ ldy #$02 ; test page 2 (here)
+ .byte $2c
settestadr2:
- ldy #$42 ; or page 64+2 (there)
- lda #0
- jmp VDCSetSourceAddr
+ ldy #$42 ; or page 64+2 (there)
+ lda #0
+ jmp VDCSetSourceAddr
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory. May
@@ -266,10 +266,10 @@ UNINSTALL:
;
INIT:
- lda pages ; is there enough memory?
- bne @L1 ; Jump if there is one screen
- lda #TGI_ERR_INV_MODE ; Error
- bne @L9
+ lda pages ; is there enough memory?
+ bne @L1 ; Jump if there is one screen
+ lda #TGI_ERR_INV_MODE ; Error
+ bne @L9
; Initialize variables
@@ -277,20 +277,20 @@ INIT:
stx BITMASK
; Remeber current color value
- ldx #VDC_COLORS
- jsr VDCReadReg
- sta OLDCOLOR
+ ldx #VDC_COLORS
+ jsr VDCReadReg
+ sta OLDCOLOR
; Switch into graphics mode (set view page 0)
- ldy #0
-@L2: ldx InitVDCTab,y
- bmi @L3
- iny
- lda InitVDCTab,y
- jsr VDCWriteReg
- iny
- bne @L2
+ ldy #0
+@L2: ldx InitVDCTab,y
+ bmi @L3
+ iny
+ lda InitVDCTab,y
+ jsr VDCWriteReg
+ iny
+ bne @L2
@L3:
; Done, reset the error code
@@ -308,35 +308,35 @@ INIT:
;
DONE:
- ; This part is C128-mode specific
- jsr $e179 ; reload character set and setup VDC
- jsr $ff62
- lda $d7 ; in 80-columns?
- bne @L01
-@L0: lda SCN80CLR,y
- beq @L1
- jsr $ffd2 ; print \xe,clr,\xe
- iny
- bne @L0
-@L01: lda #147
- jsr $ffd2 ; print clr
-@L1: lda #0 ; restore view page
- ldx #VDC_DSP_HI
- jsr VDCWriteReg
- lda OLDCOLOR
- ldx #VDC_COLORS
- jsr VDCWriteReg ; restore color (background)
- lda #$47
- ldx #VDC_HSCROLL
- jmp VDCWriteReg ; switch to text screen
+ ; This part is C128-mode specific
+ jsr $e179 ; reload character set and setup VDC
+ jsr $ff62
+ lda $d7 ; in 80-columns?
+ bne @L01
+@L0: lda SCN80CLR,y
+ beq @L1
+ jsr $ffd2 ; print \xe,clr,\xe
+ iny
+ bne @L0
+@L01: lda #147
+ jsr $ffd2 ; print clr
+@L1: lda #0 ; restore view page
+ ldx #VDC_DSP_HI
+ jsr VDCWriteReg
+ lda OLDCOLOR
+ ldx #VDC_COLORS
+ jsr VDCWriteReg ; restore color (background)
+ lda #$47
+ ldx #VDC_HSCROLL
+ jmp VDCWriteReg ; switch to text screen
; ------------------------------------------------------------------------
; GETERROR: Return the error code in A and clear it.
GETERROR:
- ldx #TGI_ERR_OK
- lda ERROR
- stx ERROR
+ ldx #TGI_ERR_OK
+ lda ERROR
+ stx ERROR
rts
; ------------------------------------------------------------------------
@@ -346,8 +346,8 @@ GETERROR:
;
CONTROL:
- lda #TGI_ERR_INV_FUNC
- sta ERROR
+ lda #TGI_ERR_INV_FUNC
+ sta ERROR
rts
; ------------------------------------------------------------------------
@@ -357,21 +357,21 @@ CONTROL:
;
CLEAR:
- lda #0
- tay
- jsr VDCSetSourceAddr
- lda #0
- ldx #VDC_VSCROLL
- jsr VDCWriteReg ; set fill mode
- lda #0
- jsr VDCWriteByte ; put 1rst byte (fill value)
- ldy #159 ; 159 times
- lda #0 ; 256 bytes
- ldx #VDC_COUNT
-@L1: jsr VDCWriteReg
- dey
- bne @L1
- rts
+ lda #0
+ tay
+ jsr VDCSetSourceAddr
+ lda #0
+ ldx #VDC_VSCROLL
+ jsr VDCWriteReg ; set fill mode
+ lda #0
+ jsr VDCWriteByte ; put 1rst byte (fill value)
+ ldy #159 ; 159 times
+ lda #0 ; 256 bytes
+ ldx #VDC_COUNT
+@L1: jsr VDCWriteReg
+ dey
+ bne @L1
+ rts
; ------------------------------------------------------------------------
; SETVIEWPAGE: Set the visible page. Called with the new page in A (0..n).
@@ -381,7 +381,7 @@ CLEAR:
;
SETVIEWPAGE:
- rts
+ rts
; ------------------------------------------------------------------------
; SETDRAWPAGE: Set the drawable page. Called with the new page in A (0..n).
@@ -391,7 +391,7 @@ SETVIEWPAGE:
;
SETDRAWPAGE:
- rts
+ rts
; ------------------------------------------------------------------------
; SETCOLOR: Set the drawing color (in A). The new color is already checked
@@ -426,16 +426,16 @@ SETPALETTE:
; Get the color entries from the palette
ldy PALETTE+1 ; Foreground color
- lda COLTRANS,y
+ lda COLTRANS,y
asl a
asl a
asl a
asl a
ldy PALETTE ; Background color
- ora COLTRANS,y
+ ora COLTRANS,y
- ldx #VDC_COLORS
- jsr VDCWriteReg
+ ldx #VDC_COLORS
+ jsr VDCWriteReg
lda #TGI_ERR_OK ; Clear error code
sta ERROR
rts
@@ -478,23 +478,23 @@ GETDEFPALETTE:
SETPIXEL:
jsr CALC ; Calculate coordinates
- stx TEMP
- lda ADDR
- ldy ADDR+1
- jsr VDCSetSourceAddr
- jsr VDCReadByte
- ldx TEMP
+ stx TEMP
+ lda ADDR
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ jsr VDCReadByte
+ ldx TEMP
- sta TEMP
+ sta TEMP
eor BITMASK
and BITTAB,X
- eor TEMP
- pha
- lda ADDR
- ldy ADDR+1
- jsr VDCSetSourceAddr
- pla
- jsr VDCWriteByte
+ eor TEMP
+ pha
+ lda ADDR
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ pla
+ jsr VDCWriteByte
@L9: rts
@@ -507,12 +507,12 @@ SETPIXEL:
GETPIXEL:
jsr CALC ; Calculate coordinates
- stx TEMP ; preserve X
- lda ADDR
- ldy ADDR+1
- jsr VDCSetSourceAddr
- jsr VDCReadByte
- ldx TEMP
+ stx TEMP ; preserve X
+ lda ADDR
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ jsr VDCReadByte
+ ldx TEMP
ldy #$00
and BITTAB,X
@@ -540,127 +540,127 @@ GETPIXEL:
;
BAR:
- inc Y2
- bne HORLINE
- inc Y2+1
+ inc Y2
+ bne HORLINE
+ inc Y2+1
; Original code for a horizontal line
HORLINE:
- lda X1
- pha
- lda X1+1
- pha
- jsr CALC ; get data for LEFT
- lda BITMASKL,x ; remember left address and bitmask
- pha
- lda ADDR
- pha
- lda ADDR+1
- pha
-
- lda X2
- sta X1
- lda X2+1
- sta X1+1
- jsr CALC ; get data for RIGHT
- lda BITMASKR,x
- sta TEMP3
-
- pla ; recall data for LEFT
- sta X1+1
- pla
- sta X1 ; put left address into X1
- pla
-
- cmp #%11111111 ; if left bit <> 0
- beq @L1
- sta TEMP2 ; do left byte only...
- lda X1
- ldy X1+1
- jsr VDCSetSourceAddr
- jsr VDCReadByte
- sta TEMP
- eor BITMASK
- and TEMP2
- eor TEMP
- pha
- lda X1
- ldy X1+1
- jsr VDCSetSourceAddr
- pla
- jsr VDCWriteByte
- inc X1 ; ... and proceed
- bne @L1
- inc X1+1
-
- ; do right byte (if Y2=0 ++ADDR and skip)
-@L1: lda TEMP3
- cmp #%11111111 ; if right bit <> 7
- bne @L11
- inc ADDR ; right bit = 7 - the next one is the last
- bne @L10
- inc ADDR+1
-@L10: bne @L2
-
-@L11: lda ADDR ; do right byte only...
- ldy ADDR+1
- jsr VDCSetSourceAddr
- jsr VDCReadByte
- sta TEMP
- eor BITMASK
- and TEMP3
- eor TEMP
- pha
- lda ADDR
- ldy ADDR+1
- jsr VDCSetSourceAddr
- pla
- jsr VDCWriteByte
-
-@L2: ; do the fill in the middle
- lda ADDR ; calculate offset in full bytes
- sec
- sbc X1
- beq @L3 ; if equal - there are no more bytes
- sta ADDR
-
- lda X1 ; setup for the left side
- ldy X1+1
- jsr VDCSetSourceAddr
- lda BITMASK ; get color
- jsr VDCWriteByte ; put 1st value
- ldx ADDR
- dex
- beq @L3 ; 1 byte already written
-
- stx ADDR ; if there are more bytes - fill them...
- ldx #VDC_VSCROLL
- lda #0
- jsr VDCWriteReg ; setup for fill
- ldx #VDC_COUNT
- lda ADDR
- jsr VDCWriteReg ; ... fill them NOW!
-
-@L3: pla
- sta X1+1
- pla
- sta X1
+ lda X1
+ pha
+ lda X1+1
+ pha
+ jsr CALC ; get data for LEFT
+ lda BITMASKL,x ; remember left address and bitmask
+ pha
+ lda ADDR
+ pha
+ lda ADDR+1
+ pha
+
+ lda X2
+ sta X1
+ lda X2+1
+ sta X1+1
+ jsr CALC ; get data for RIGHT
+ lda BITMASKR,x
+ sta TEMP3
+
+ pla ; recall data for LEFT
+ sta X1+1
+ pla
+ sta X1 ; put left address into X1
+ pla
+
+ cmp #%11111111 ; if left bit <> 0
+ beq @L1
+ sta TEMP2 ; do left byte only...
+ lda X1
+ ldy X1+1
+ jsr VDCSetSourceAddr
+ jsr VDCReadByte
+ sta TEMP
+ eor BITMASK
+ and TEMP2
+ eor TEMP
+ pha
+ lda X1
+ ldy X1+1
+ jsr VDCSetSourceAddr
+ pla
+ jsr VDCWriteByte
+ inc X1 ; ... and proceed
+ bne @L1
+ inc X1+1
+
+ ; do right byte (if Y2=0 ++ADDR and skip)
+@L1: lda TEMP3
+ cmp #%11111111 ; if right bit <> 7
+ bne @L11
+ inc ADDR ; right bit = 7 - the next one is the last
+ bne @L10
+ inc ADDR+1
+@L10: bne @L2
+
+@L11: lda ADDR ; do right byte only...
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ jsr VDCReadByte
+ sta TEMP
+ eor BITMASK
+ and TEMP3
+ eor TEMP
+ pha
+ lda ADDR
+ ldy ADDR+1
+ jsr VDCSetSourceAddr
+ pla
+ jsr VDCWriteByte
+
+@L2: ; do the fill in the middle
+ lda ADDR ; calculate offset in full bytes
+ sec
+ sbc X1
+ beq @L3 ; if equal - there are no more bytes
+ sta ADDR
+
+ lda X1 ; setup for the left side
+ ldy X1+1
+ jsr VDCSetSourceAddr
+ lda BITMASK ; get color
+ jsr VDCWriteByte ; put 1st value
+ ldx ADDR
+ dex
+ beq @L3 ; 1 byte already written
+
+ stx ADDR ; if there are more bytes - fill them...
+ ldx #VDC_VSCROLL
+ lda #0
+ jsr VDCWriteReg ; setup for fill
+ ldx #VDC_COUNT
+ lda ADDR
+ jsr VDCWriteReg ; ... fill them NOW!
+
+@L3: pla
+ sta X1+1
+ pla
+ sta X1
; End of horizontal line code
- inc Y1
- bne @L4
- inc Y1+1
-@L4: lda Y1
- cmp Y2
- bne @L5
- lda Y1+1
- cmp Y2+1
- bne @L5
- rts
+ inc Y1
+ bne @L4
+ inc Y1+1
+@L4: lda Y1
+ cmp Y2
+ bne @L5
+ lda Y1+1
+ cmp Y2+1
+ bne @L5
+ rts
-@L5: jmp HORLINE
+@L5: jmp HORLINE
; ------------------------------------------------------------------------
@@ -695,98 +695,98 @@ OUTTEXT:
;> ADDR - address of card
;> X - bit number (X1 & 7)
CALC:
- lda Y1
- pha
- lda Y1+1
- pha
- lsr
- ror Y1 ; Y=Y/2
- sta Y1+1
- sta ADDR+1
- lda Y1
- asl
- rol ADDR+1
- asl
- rol ADDR+1 ; Y*4
- clc
- adc Y1
- sta ADDR
- lda Y1+1
- adc ADDR+1
- sta ADDR+1 ; Y*4+Y=Y*5
- lda ADDR
- asl
- rol ADDR+1
- asl
- rol ADDR+1
- asl
- rol ADDR+1
- asl
- rol ADDR+1
- sta ADDR ; Y*5*16=Y*80
- lda X1+1
- sta TEMP
- lda X1
- lsr TEMP
- ror
- lsr TEMP
- ror
- lsr TEMP
- ror
- clc
- adc ADDR
- sta ADDR
- lda ADDR+1 ; ADDR = Y*80+x/8
- adc TEMP
- sta ADDR+1
- pla
- sta Y1+1
- pla
- sta Y1
- and #1
- beq @even ; even line - no offset
- lda ADDR
- clc
- adc #<21360
- sta ADDR
- lda ADDR+1
- adc #>21360
- sta ADDR+1 ; odd lines are 21360 bytes farther
-@even: lda X1
- and #7
- tax
- rts
+ lda Y1
+ pha
+ lda Y1+1
+ pha
+ lsr
+ ror Y1 ; Y=Y/2
+ sta Y1+1
+ sta ADDR+1
+ lda Y1
+ asl
+ rol ADDR+1
+ asl
+ rol ADDR+1 ; Y*4
+ clc
+ adc Y1
+ sta ADDR
+ lda Y1+1
+ adc ADDR+1
+ sta ADDR+1 ; Y*4+Y=Y*5
+ lda ADDR
+ asl
+ rol ADDR+1
+ asl
+ rol ADDR+1
+ asl
+ rol ADDR+1
+ asl
+ rol ADDR+1
+ sta ADDR ; Y*5*16=Y*80
+ lda X1+1
+ sta TEMP
+ lda X1
+ lsr TEMP
+ ror
+ lsr TEMP
+ ror
+ lsr TEMP
+ ror
+ clc
+ adc ADDR
+ sta ADDR
+ lda ADDR+1 ; ADDR = Y*80+x/8
+ adc TEMP
+ sta ADDR+1
+ pla
+ sta Y1+1
+ pla
+ sta Y1
+ and #1
+ beq @even ; even line - no offset
+ lda ADDR
+ clc
+ adc #<21360
+ sta ADDR
+ lda ADDR+1
+ adc #>21360
+ sta ADDR+1 ; odd lines are 21360 bytes farther
+@even: lda X1
+ and #7
+ tax
+ rts
;-------------
; VDC helpers
VDCSetSourceAddr:
- pha
- tya
- ldx #VDC_DATA_HI
- jsr VDCWriteReg
- pla
- ldx #VDC_DATA_LO
- bne VDCWriteReg
+ pha
+ tya
+ ldx #VDC_DATA_HI
+ jsr VDCWriteReg
+ pla
+ ldx #VDC_DATA_LO
+ bne VDCWriteReg
VDCReadByte:
- ldx #VDC_DATA
+ ldx #VDC_DATA
VDCReadReg:
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- lda VDC_DATA_REG
- rts
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ lda VDC_DATA_REG
+ rts
VDCWriteByte:
- ldx #VDC_DATA
+ ldx #VDC_DATA
VDCWriteReg:
- stx VDC_ADDR_REG
-@L0: bit VDC_ADDR_REG
- bpl @L0
- sta VDC_DATA_REG
- rts
+ stx VDC_ADDR_REG
+@L0: bit VDC_ADDR_REG
+ bpl @L0
+ sta VDC_DATA_REG
+ rts
; ------------------------------------------------------------------------
- .include "../../tgi/tgidrv_line.inc"
+ .include "../../tgi/tgidrv_line.inc"
diff --git a/libsrc/c128/tgi_colors.s b/libsrc/c128/tgi_colors.s
index 4dab483e2..6ef3729b4 100644
--- a/libsrc/c128/tgi_colors.s
+++ b/libsrc/c128/tgi_colors.s
@@ -2,7 +2,7 @@
; Target-specific black & white values for use by the target-shared TGI kernel
;
- .include "tgi-kernel.inc"
+ .include "tgi-kernel.inc"
- .export tgi_color_black:zp = $00
- .export tgi_color_white:zp = $01
+ .export tgi_color_black:zp = $00
+ .export tgi_color_white:zp = $01
diff --git a/libsrc/c128/tgi_stat_stddrv.s b/libsrc/c128/tgi_stat_stddrv.s
index e6c2874d3..62f515d4e 100644
--- a/libsrc/c128/tgi_stat_stddrv.s
+++ b/libsrc/c128/tgi_stat_stddrv.s
@@ -6,8 +6,8 @@
; const void tgi_static_stddrv[];
;
- .export _tgi_static_stddrv
- .import _c128_vdc_tgi
+ .export _tgi_static_stddrv
+ .import _c128_vdc_tgi
.rodata
diff --git a/libsrc/c128/tgi_stddrv.s b/libsrc/c128/tgi_stddrv.s
index 70dadde67..6efd0854f 100644
--- a/libsrc/c128/tgi_stddrv.s
+++ b/libsrc/c128/tgi_stddrv.s
@@ -6,8 +6,8 @@
; const char tgi_stddrv[];
;
- .export _tgi_stddrv
+ .export _tgi_stddrv
.rodata
-_tgi_stddrv: .asciiz "c128-vdc.tgi"
+_tgi_stddrv: .asciiz "c128-vdc.tgi"
diff --git a/libsrc/c128/toggle_videomode.s b/libsrc/c128/toggle_videomode.s
index a94e416ee..e09a16cab 100644
--- a/libsrc/c128/toggle_videomode.s
+++ b/libsrc/c128/toggle_videomode.s
@@ -5,7 +5,7 @@
; /* Toggle the video mode between 40 and 80 chars (calls SWAPPER) */
;
- .export _toggle_videomode
+ .export _toggle_videomode
.import SWAPPER, BSOUT
; This function is deprecated
@@ -16,8 +16,8 @@
.proc _toggle_videomode
jsr SWAPPER ; Toggle the mode
- lda #14
- jmp BSOUT ; Switch to lower case chars
+ lda #14
+ jmp BSOUT ; Switch to lower case chars
.endproc
diff --git a/libsrc/c128/videomode.s b/libsrc/c128/videomode.s
index d07df5160..dc7df0fc2 100644
--- a/libsrc/c128/videomode.s
+++ b/libsrc/c128/videomode.s
@@ -5,7 +5,7 @@
; /* Set the video mode, return the old mode */
;
- .export _videomode
+ .export _videomode
.import SWAPPER, BSOUT
.include "c128.inc"
@@ -20,8 +20,8 @@
pha ; ... and save it
jsr SWAPPER ; Toggle the mode
- lda #14
- jsr BSOUT ; Switch to lower case chars
+ lda #14
+ jsr BSOUT ; Switch to lower case chars
pla ; Get old mode into A
diff --git a/libsrc/c16/_scrsize.s b/libsrc/c16/_scrsize.s
index c0a746198..57ad4f30f 100644
--- a/libsrc/c16/_scrsize.s
+++ b/libsrc/c16/_scrsize.s
@@ -4,7 +4,7 @@
; Screen size variables
;
- .export screensize
+ .export screensize
.import SCREEN
screensize = SCREEN
diff --git a/libsrc/c16/break.s b/libsrc/c16/break.s
index c51cc4b07..e143ac6d5 100644
--- a/libsrc/c16/break.s
+++ b/libsrc/c16/break.s
@@ -5,65 +5,65 @@
; void reset_brk (void);
;
- .export _set_brk, _reset_brk
- .destructor _reset_brk
- .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
+ .export _set_brk, _reset_brk
+ .destructor _reset_brk
+ .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
- .include "plus4.inc"
+ .include "plus4.inc"
.bss
-_brk_a: .res 1
-_brk_x: .res 1
-_brk_y: .res 1
-_brk_sr: .res 1
-_brk_pc: .res 2
+_brk_a: .res 1
+_brk_x: .res 1
+_brk_y: .res 1
+_brk_sr: .res 1
+_brk_pc: .res 2
-oldvec: .res 2 ; Old vector
+oldvec: .res 2 ; Old vector
.data
-uservec: jmp $FFFF ; Patched at runtime
+uservec: jmp $FFFF ; Patched at runtime
.code
; Set the break vector
-.proc _set_brk
+.proc _set_brk
- sta uservec+1
- stx uservec+2 ; Set the user vector
+ sta uservec+1
+ stx uservec+2 ; Set the user vector
- lda oldvec
- ora oldvec+1 ; Did we save the vector already?
- bne L1 ; Jump if we installed the handler already
+ lda oldvec
+ ora oldvec+1 ; Did we save the vector already?
+ bne L1 ; Jump if we installed the handler already
- lda BRKVec
- sta oldvec
- lda BRKVec+1
- sta oldvec+1 ; Save the old vector
+ lda BRKVec
+ sta oldvec
+ lda BRKVec+1
+ sta oldvec+1 ; Save the old vector
-L1: lda #brk_handler
- sta BRKVec
- stx BRKVec+1
- rts
+L1: lda #brk_handler
+ sta BRKVec
+ stx BRKVec+1
+ rts
.endproc
; Reset the break vector
-.proc _reset_brk
-
- lda oldvec
- ldx oldvec+1
- beq @L9 ; Jump if vector not installed
- sta BRKVec
- stx BRKVec+1
- lda #$00
- sta oldvec ; Clear the old vector
- stx oldvec+1
-@L9: rts
+.proc _reset_brk
+
+ lda oldvec
+ ldx oldvec+1
+ beq @L9 ; Jump if vector not installed
+ sta BRKVec
+ stx BRKVec+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
+@L9: rts
.endproc
@@ -71,37 +71,37 @@ L1: lda #BASE ; Low 32 K are used
bcc nomem
@@ -104,17 +104,17 @@ PAGECOUNT:
; by the driver.
;
-MAP: sta curpage ; Remember the new page
+MAP: sta curpage ; Remember the new page
add #>BASE
- sta ptr1+1
- ldy #$00
- sty ptr1
+ sta ptr1+1
+ ldy #$00
+ sty ptr1
- lda #window
- sta ptr2+1
+ lda #window
+ sta ptr2+1
; Transfer one page
@@ -137,18 +137,18 @@ USE: sta curpage ; Remember the page
; ------------------------------------------------------------------------
; COMMIT: Commit changes in the memory window to extended storage.
-COMMIT: lda curpage ; Get the current page
+COMMIT: lda curpage ; Get the current page
bmi done ; Jump if no page mapped
add #>BASE
- sta ptr2+1
- ldy #$00
- sty ptr2
+ sta ptr2+1
+ ldy #$00
+ sty ptr2
- lda #window
- sta ptr1+1
+ lda #window
+ sta ptr1+1
; Transfer one page. Y must be zero on entry. Because we bank out the
; kernal, we will run the routine with interrupts disabled but leave
@@ -158,11 +158,11 @@ transfer:
sei
sta ENABLE_RAM
- .repeat 8
- lda (ptr1),y
- sta (ptr2),y
+ .repeat 8
+ lda (ptr1),y
+ sta (ptr2),y
iny
- .endrepeat
+ .endrepeat
sta ENABLE_ROM
cli
@@ -225,8 +225,8 @@ common: ldy #EM_COPY::COUNT+1
; Transfer the bytes in the last page
ldy #$00
-@L3: lda (ptr1),y
- sta (ptr2),y
+@L3: lda (ptr1),y
+ sta (ptr2),y
iny
dex
bne @L3
diff --git a/libsrc/c16/get_tv.s b/libsrc/c16/get_tv.s
index 84f09b12c..f6d82a351 100644
--- a/libsrc/c16/get_tv.s
+++ b/libsrc/c16/get_tv.s
@@ -6,7 +6,7 @@
;
.include "plus4.inc"
- .include "get_tv.inc"
+ .include "get_tv.inc"
;--------------------------------------------------------------------------
@@ -14,7 +14,7 @@
.proc _get_tv
- ldx #TV::PAL ; Assume PAL
+ ldx #TV::PAL ; Assume PAL
bit TED_MULTI1 ; Test bit 6
bvc pal
dex ; NTSC
diff --git a/libsrc/c16/irq.s b/libsrc/c16/irq.s
index 224f5745d..46dd75fe8 100644
--- a/libsrc/c16/irq.s
+++ b/libsrc/c16/irq.s
@@ -2,48 +2,48 @@
; IRQ handling (C16 version)
;
- .export initirq, doneirq
- .import callirq
+ .export initirq, doneirq
+ .import callirq
- .include "plus4.inc"
+ .include "plus4.inc"
; ------------------------------------------------------------------------
-.segment "INIT"
+.segment "INIT"
initirq:
- lda IRQVec
- ldx IRQVec+1
- sta IRQInd+1
- stx IRQInd+2
- lda #IRQStub
- jmp setvec
+ lda IRQVec
+ ldx IRQVec+1
+ sta IRQInd+1
+ stx IRQInd+2
+ lda #IRQStub
+ jmp setvec
; ------------------------------------------------------------------------
.code
doneirq:
- lda IRQInd+1
- ldx IRQInd+2
-setvec: sei
- sta IRQVec
- stx IRQVec+1
- cli
- rts
+ lda IRQInd+1
+ ldx IRQInd+2
+setvec: sei
+ sta IRQVec
+ stx IRQVec+1
+ cli
+ rts
; ------------------------------------------------------------------------
-.segment "LOWCODE"
+.segment "LOWCODE"
IRQStub:
- cld ; Just to be sure
- jsr callirq ; Call the functions
- jmp IRQInd ; Jump to the saved IRQ vector
+ cld ; Just to be sure
+ jsr callirq ; Call the functions
+ jmp IRQInd ; Jump to the saved IRQ vector
; ------------------------------------------------------------------------
.data
-IRQInd: jmp $0000
+IRQInd: jmp $0000
diff --git a/libsrc/c16/joy/c16-stdjoy.s b/libsrc/c16/joy/c16-stdjoy.s
index a448f30e8..54ba47e19 100644
--- a/libsrc/c16/joy/c16-stdjoy.s
+++ b/libsrc/c16/joy/c16-stdjoy.s
@@ -5,5 +5,5 @@
; Ullrich von Bassewitz, 2002-12-21
;
- .include "../../plus4/joy/plus4-stdjoy.s"
+ .include "../../plus4/joy/plus4-stdjoy.s"
diff --git a/libsrc/c16/joy_stat_stddrv.s b/libsrc/c16/joy_stat_stddrv.s
index 68d67403d..2dea36be6 100644
--- a/libsrc/c16/joy_stat_stddrv.s
+++ b/libsrc/c16/joy_stat_stddrv.s
@@ -6,8 +6,8 @@
; const void joy_static_stddrv[];
;
- .export _joy_static_stddrv
- .import _c16_stdjoy_joy
+ .export _joy_static_stddrv
+ .import _c16_stdjoy_joy
.rodata
diff --git a/libsrc/c16/joy_stddrv.s b/libsrc/c16/joy_stddrv.s
index a55eefeb0..10aa8c63d 100644
--- a/libsrc/c16/joy_stddrv.s
+++ b/libsrc/c16/joy_stddrv.s
@@ -6,9 +6,9 @@
; const char joy_stddrv[];
;
- .export _joy_stddrv
+ .export _joy_stddrv
.rodata
-_joy_stddrv: .asciiz "c16-stdjoy.joy"
+_joy_stddrv: .asciiz "c16-stdjoy.joy"
diff --git a/libsrc/c16/kbhit.s b/libsrc/c16/kbhit.s
index f408c4e51..bb88beea8 100644
--- a/libsrc/c16/kbhit.s
+++ b/libsrc/c16/kbhit.s
@@ -4,16 +4,16 @@
; unsigned char kbhit (void);
;
- .export _kbhit
+ .export _kbhit
- .include "plus4.inc"
+ .include "plus4.inc"
.proc _kbhit
ldx #0 ; High byte of return is always zero
- lda KEY_COUNT ; Get number of characters
- ora FKEY_COUNT ; Or with number of chars from function keys
+ lda KEY_COUNT ; Get number of characters
+ ora FKEY_COUNT ; Or with number of chars from function keys
beq L9
lda #1
L9: rts
diff --git a/libsrc/c16/kclose.s b/libsrc/c16/kclose.s
index e957117c5..ef7004732 100644
--- a/libsrc/c16/kclose.s
+++ b/libsrc/c16/kclose.s
@@ -7,8 +7,8 @@
.export CLOSE
.proc CLOSE
- clc ; Force C64 compatible behaviour
- jmp $FFC3 ; Call the ROM routine
+ clc ; Force C64 compatible behaviour
+ jmp $FFC3 ; Call the ROM routine
.endproc
diff --git a/libsrc/c16/kernal.s b/libsrc/c16/kernal.s
index 376f82506..7ba27b62c 100644
--- a/libsrc/c16/kernal.s
+++ b/libsrc/c16/kernal.s
@@ -47,43 +47,43 @@
;-----------------------------------------------------------------------------
; All functions are available in the kernal jump table
-CINT = $FF81
-IOINIT = $FF84
-RAMTAS = $FF87
-RESTOR = $FF8A
-VECTOR = $FF8D
-SETMSG = $FF90
-SECOND = $FF93
-TKSA = $FF96
-MEMTOP = $FF99
-MEMBOT = $FF9C
-SCNKEY = $FF9F
-SETTMO = $FFA2
-ACPTR = $FFA5
-CIOUT = $FFA8
-UNTLK = $FFAB
-UNLSN = $FFAE
-LISTEN = $FFB1
-TALK = $FFB4
-READST = $FFB7
-SETLFS = $FFBA
-SETNAM = $FFBD
-OPEN = $FFC0
-;CLOSE = $FFC3
-CHKIN = $FFC6
-CKOUT = $FFC9
-CLRCH = $FFCC
-BASIN = $FFCF
-BSOUT = $FFD2
-LOAD = $FFD5
-SAVE = $FFD8
-SETTIM = $FFDB
-RDTIM = $FFDE
-STOP = $FFE1
-GETIN = $FFE4
-CLALL = $FFE7
-UDTIM = $FFEA
-SCREEN = $FFED
-PLOT = $FFF0
-IOBASE = $FFF3
+CINT = $FF81
+IOINIT = $FF84
+RAMTAS = $FF87
+RESTOR = $FF8A
+VECTOR = $FF8D
+SETMSG = $FF90
+SECOND = $FF93
+TKSA = $FF96
+MEMTOP = $FF99
+MEMBOT = $FF9C
+SCNKEY = $FF9F
+SETTMO = $FFA2
+ACPTR = $FFA5
+CIOUT = $FFA8
+UNTLK = $FFAB
+UNLSN = $FFAE
+LISTEN = $FFB1
+TALK = $FFB4
+READST = $FFB7
+SETLFS = $FFBA
+SETNAM = $FFBD
+OPEN = $FFC0
+;CLOSE = $FFC3
+CHKIN = $FFC6
+CKOUT = $FFC9
+CLRCH = $FFCC
+BASIN = $FFCF
+BSOUT = $FFD2
+LOAD = $FFD5
+SAVE = $FFD8
+SETTIM = $FFDB
+RDTIM = $FFDE
+STOP = $FFE1
+GETIN = $FFE4
+CLALL = $FFE7
+UDTIM = $FFEA
+SCREEN = $FFED
+PLOT = $FFF0
+IOBASE = $FFF3
diff --git a/libsrc/c16/mainargs.s b/libsrc/c16/mainargs.s
index 418bfe90f..0a402d27d 100644
--- a/libsrc/c16/mainargs.s
+++ b/libsrc/c16/mainargs.s
@@ -22,16 +22,16 @@
; - The "file-name" might be a path-name; don't copy the directory-components.
; - Add a control-character quoting mechanism.
- .constructor initmainargs, 24
- .import __argc, __argv
+ .constructor initmainargs, 24
+ .import __argc, __argv
- .include "plus4.inc"
+ .include "plus4.inc"
-MAXARGS = 10 ; Maximum number of arguments allowed
-REM = $8f ; BASIC token-code
-NAME_LEN = 16 ; maximum length of command-name
+MAXARGS = 10 ; Maximum number of arguments allowed
+REM = $8f ; BASIC token-code
+NAME_LEN = 16 ; maximum length of command-name
; Get possible command-line arguments. Goes into the special INIT segment,
; which may be reused after the startup code is run
@@ -45,26 +45,26 @@ initmainargs:
; Because the buffer, that we're copying into, was zeroed out,
; we don't need to add a NUL character.
;
- ldy FNAM_LEN
- cpy #NAME_LEN + 1
- bcc L1
- ldy #NAME_LEN - 1 ; limit the length
-L0: lda #FNAM ; Vector address
+ ldy FNAM_LEN
+ cpy #NAME_LEN + 1
+ bcc L1
+ ldy #NAME_LEN - 1 ; limit the length
+L0: lda #FNAM ; Vector address
jsr FETCH ; Load byte from RAM
- sta name,y
-L1: dey
- bpl L0
- inc __argc ; argc always is equal to, at least, 1
+ sta name,y
+L1: dey
+ bpl L0
+ inc __argc ; argc always is equal to, at least, 1
; Find the "rem" token.
;
- ldx #0
-L2: lda BASIC_BUF,x
- beq done ; no "rem," no args.
- inx
- cmp #REM
- bne L2
- ldy #1 * 2
+ ldx #0
+L2: lda BASIC_BUF,x
+ beq done ; no "rem," no args.
+ inx
+ cmp #REM
+ bne L2
+ ldy #1 * 2
; Find the next argument
@@ -90,11 +90,11 @@ setterm:sta term ; Set end of argument marker
; necessary.
txa ; Get low byte
- sta argv,y ; argv[y]= &arg
- iny
- lda #>BASIC_BUF
- sta argv,y
- iny
+ sta argv,y ; argv[y]= &arg
+ iny
+ lda #>BASIC_BUF
+ sta argv,y
+ iny
inc __argc ; Found another arg
; Search for the end of the argument
@@ -121,21 +121,21 @@ argloop:lda BASIC_BUF,x
; (The last vector in argv[] already is NULL.)
-done: lda #argv
- sta __argv
- stx __argv + 1
- rts
+done: lda #argv
+ sta __argv
+ stx __argv + 1
+ rts
; These arrays are zeroed before initmainargs is called.
-; char name[16+1];
+; char name[16+1];
; char* argv[MAXARGS+1]={name};
;
.bss
-term: .res 1
-name: .res NAME_LEN + 1
+term: .res 1
+name: .res NAME_LEN + 1
.data
argv: .addr name
- .res MAXARGS * 2
+ .res MAXARGS * 2
diff --git a/libsrc/c16/randomize.s b/libsrc/c16/randomize.s
index e65fd4dab..903a0809a 100644
--- a/libsrc/c16/randomize.s
+++ b/libsrc/c16/randomize.s
@@ -5,10 +5,10 @@
; /* Initialize the random number generator */
;
- .export __randomize
- .import _srand
+ .export __randomize
+ .import _srand
- .include "plus4.inc"
+ .include "plus4.inc"
__randomize:
ldx TED_VLINELO ; Use TED rasterline as high byte
diff --git a/libsrc/c16/revers.s b/libsrc/c16/revers.s
index c48ff9862..f1c0b4d64 100644
--- a/libsrc/c16/revers.s
+++ b/libsrc/c16/revers.s
@@ -4,24 +4,24 @@
; unsigned char revers (unsigned char onoff);
;
- .export _revers
+ .export _revers
.include "plus4.inc"
.proc _revers
- ldx #$00 ; Assume revers off
- tay ; Test onoff
- beq L1 ; Jump if off
- ldx #$80 ; Load on value
- ldy #$00 ; Assume old value is zero
-L1: lda RVS ; Load old value
- stx RVS ; Set new value
- beq L2 ; Jump if old value zero
- iny ; Make old value = 1
-L2: ldx #$00 ; Load high byte of result
- tya ; Load low byte, set CC
- rts
+ ldx #$00 ; Assume revers off
+ tay ; Test onoff
+ beq L1 ; Jump if off
+ ldx #$80 ; Load on value
+ ldy #$00 ; Assume old value is zero
+L1: lda RVS ; Load old value
+ stx RVS ; Set new value
+ beq L2 ; Jump if old value zero
+ iny ; Make old value = 1
+L2: ldx #$00 ; Load high byte of result
+ tya ; Load low byte, set CC
+ rts
.endproc
diff --git a/libsrc/c16/status.s b/libsrc/c16/status.s
index 3620c9107..c6f279230 100644
--- a/libsrc/c16/status.s
+++ b/libsrc/c16/status.s
@@ -2,4 +2,4 @@
; Oliver Schmidt, 2012-09-30
;
- .exportzp ST := $90 ; IEC status byte
+ .exportzp ST := $90 ; IEC status byte
diff --git a/libsrc/c16/systime.s b/libsrc/c16/systime.s
index 1d039e80e..d22b8c596 100644
--- a/libsrc/c16/systime.s
+++ b/libsrc/c16/systime.s
@@ -9,7 +9,7 @@
; */
;
- .export __systime
+ .export __systime
.importzp sreg
diff --git a/libsrc/c64/_scrsize.s b/libsrc/c64/_scrsize.s
index c0a746198..57ad4f30f 100644
--- a/libsrc/c64/_scrsize.s
+++ b/libsrc/c64/_scrsize.s
@@ -4,7 +4,7 @@
; Screen size variables
;
- .export screensize
+ .export screensize
.import SCREEN
screensize = SCREEN
diff --git a/libsrc/c64/break.s b/libsrc/c64/break.s
index 76315b7b9..1c44c59a0 100644
--- a/libsrc/c64/break.s
+++ b/libsrc/c64/break.s
@@ -5,65 +5,65 @@
; void reset_brk (void);
;
- .export _set_brk, _reset_brk
- .destructor _reset_brk
- .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
+ .export _set_brk, _reset_brk
+ .destructor _reset_brk
+ .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
- .include "c64.inc"
+ .include "c64.inc"
.bss
-_brk_a: .res 1
-_brk_x: .res 1
-_brk_y: .res 1
-_brk_sr: .res 1
-_brk_pc: .res 2
+_brk_a: .res 1
+_brk_x: .res 1
+_brk_y: .res 1
+_brk_sr: .res 1
+_brk_pc: .res 2
-oldvec: .res 2 ; Old vector
+oldvec: .res 2 ; Old vector
.data
-uservec: jmp $FFFF ; Patched at runtime
+uservec: jmp $FFFF ; Patched at runtime
.code
; Set the break vector
-.proc _set_brk
+.proc _set_brk
- sta uservec+1
- stx uservec+2 ; Set the user vector
+ sta uservec+1
+ stx uservec+2 ; Set the user vector
- lda oldvec
- ora oldvec+1 ; Did we save the vector already?
- bne L1 ; Jump if we installed the handler already
+ lda oldvec
+ ora oldvec+1 ; Did we save the vector already?
+ bne L1 ; Jump if we installed the handler already
- lda BRKVec
- sta oldvec
- lda BRKVec+1
- sta oldvec+1 ; Save the old vector
+ lda BRKVec
+ sta oldvec
+ lda BRKVec+1
+ sta oldvec+1 ; Save the old vector
-L1: lda #brk_handler
- sta BRKVec
- stx BRKVec+1
- rts
+L1: lda #brk_handler
+ sta BRKVec
+ stx BRKVec+1
+ rts
.endproc
; Reset the break vector
-.proc _reset_brk
-
- lda oldvec
- ldx oldvec+1
- beq @L9 ; Jump if vector not installed
- sta BRKVec
- stx BRKVec+1
- lda #$00
- sta oldvec ; Clear the old vector
- stx oldvec+1
-@L9: rts
+.proc _reset_brk
+
+ lda oldvec
+ ldx oldvec+1
+ beq @L9 ; Jump if vector not installed
+ sta BRKVec
+ stx BRKVec+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
+@L9: rts
.endproc
@@ -71,37 +71,37 @@ L1: lda #(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
- sta sp+1 ; Set argument stack ptr
+ lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+ sta sp
+ lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+ sta sp+1 ; Set argument stack ptr
; Call module constructors
- jsr initlib
+ jsr initlib
; Push arguments and call main
- jsr callmain
+ jsr callmain
; Back from main (This is also the _exit entry). Run module destructors
-_exit: pha ; Save the return code on stack
- jsr donelib
+_exit: pha ; Save the return code on stack
+ jsr donelib
; Copy back the zero page stuff
- ldx #zpspace-1
-L2: lda zpsave,x
- sta sp,x
- dex
- bpl L2
+ ldx #zpspace-1
+L2: lda zpsave,x
+ sta sp,x
+ dex
+ bpl L2
; Place the program return code into ST
- pla
- sta ST
+ pla
+ sta ST
; Restore system stuff
- ldx spsave
- txs ; Restore stack pointer
- ldx mmusave
- stx $01 ; Restore memory configuration
+ ldx spsave
+ txs ; Restore stack pointer
+ ldx mmusave
+ stx $01 ; Restore memory configuration
; Back to basic
- rts
+ rts
; ------------------------------------------------------------------------
; Data
-.segment "ZPSAVE"
+.segment "ZPSAVE"
-zpsave: .res zpspace
+zpsave: .res zpspace
.bss
-spsave: .res 1
-mmusave:.res 1
+spsave: .res 1
+mmusave:.res 1
diff --git a/libsrc/c64/devnum.s b/libsrc/c64/devnum.s
index e7b5f94b2..33c0461bc 100644
--- a/libsrc/c64/devnum.s
+++ b/libsrc/c64/devnum.s
@@ -2,6 +2,6 @@
; Oliver Schmidt, 2010-02-14
;
- .include "c64.inc"
+ .include "c64.inc"
- .exportzp devnum := DEVNUM
+ .exportzp devnum := DEVNUM
diff --git a/libsrc/c64/emd/c64-c256k.s b/libsrc/c64/emd/c64-c256k.s
index ed8bf7732..f559bf7f3 100644
--- a/libsrc/c64/emd/c64-c256k.s
+++ b/libsrc/c64/emd/c64-c256k.s
@@ -3,13 +3,13 @@
; Marco van den Heuvel, 2010-01-27
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "em-kernel.inc"
- .include "em-error.inc"
+ .include "em-kernel.inc"
+ .include "em-error.inc"
- .macpack generic
+ .macpack generic
; ------------------------------------------------------------------------
@@ -19,19 +19,19 @@
; Driver signature
- .byte $65, $6d, $64 ; "emd"
- .byte EMD_API_VERSION ; EM API version number
+ .byte $65, $6d, $64 ; "emd"
+ .byte EMD_API_VERSION ; EM API version number
; Jump table.
- .word INSTALL
- .word UNINSTALL
- .word PAGECOUNT
- .word MAP
- .word USE
- .word COMMIT
- .word COPYFROM
- .word COPYTO
+ .word INSTALL
+ .word UNINSTALL
+ .word PAGECOUNT
+ .word MAP
+ .word USE
+ .word COMMIT
+ .word COPYFROM
+ .word COPYTO
; ------------------------------------------------------------------------
; Constants
@@ -96,13 +96,13 @@ done: stx $01
.bss
-curpage: .res 2 ; Current page number
-curbank: .res 1 ; Current bank
-window: .res 256 ; Memory "window"
+curpage: .res 2 ; Current page number
+curbank: .res 1 ; Current bank
+window: .res 256 ; Memory "window"
; Since the functions above are copied to $200, the current contents of this
; memory area must be saved into backup storage. Allocate enough space.
-backup: .res .max (.sizeof (copy), .sizeof (check))
+backup: .res .max (.sizeof (copy), .sizeof (check))
@@ -115,52 +115,52 @@ backup: .res .max (.sizeof (copy), .sizeof (check))
;
INSTALL:
- lda PIA+1 ; Select Peripheral Registers
- ora #4
- sta PIA+1
+ lda PIA+1 ; Select Peripheral Registers
+ ora #4
+ sta PIA+1
tax
- lda PIA+3
- ora #4
- sta PIA+3
+ lda PIA+3
+ ora #4
+ sta PIA+3
tay
- lda #$DC ; Set the default memory bank data
- sta PIA
- lda #$FE
- sta PIA+2
+ lda #$DC ; Set the default memory bank data
+ sta PIA
+ lda #$FE
+ sta PIA+2
- txa ; Select Data Direction Registers
- and #$FB
- sta PIA+1
+ txa ; Select Data Direction Registers
+ and #$FB
+ sta PIA+1
tya
- and #$FB
- sta PIA+3
+ and #$FB
+ sta PIA+3
- lda #$FF ; Set the ports to output
- sta PIA
- sta PIA+2
+ lda #$FF ; Set the ports to output
+ sta PIA
+ sta PIA+2
txa
- and #$C7
- ora #$30 ; Set CA1 and
- sta PIA+1 ; select Peripheral Registers
- sty PIA+3
+ and #$C7
+ ora #$30 ; Set CA1 and
+ sta PIA+1 ; select Peripheral Registers
+ sty PIA+3
- jsr backup_and_setup_check_routine
- jsr check::entry
+ jsr backup_and_setup_check_routine
+ jsr check::entry
cli
- ldx #.sizeof (check) - 1
- jsr restore_data
- cpy #$01
- beq @present
- lda #EM_ERR_NO_DEVICE
+ ldx #.sizeof (check) - 1
+ jsr restore_data
+ cpy #$01
+ beq @present
+ lda #EM_ERR_NO_DEVICE
rts
@present:
- lda #EM_ERR_OK
-; rts ; Run into UNINSTALL instead
+ lda #EM_ERR_OK
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -176,8 +176,8 @@ UNINSTALL:
;
PAGECOUNT:
- lda #PAGES
+ lda #PAGES
rts
; ------------------------------------------------------------------------
@@ -188,41 +188,41 @@ PAGECOUNT:
MAP:
sei
- sta curpage ; Remember the new page
- stx curpage+1
- jsr adjust_page_and_bank
- stx curbank
+ sta curpage ; Remember the new page
+ stx curpage+1
+ jsr adjust_page_and_bank
+ stx curbank
clc
- adc #>BASE
- sta ptr1+1
- ldy #0
- sty ptr1
- jsr backup_and_setup_copy_routine
- ldx #BASE
+ sta ptr1+1
+ ldy #0
+ sty ptr1
+ jsr backup_and_setup_copy_routine
+ ldx #window ; Return the window address
+ jsr restore_copy_routine
+ lda #window ; Return the window address
cli
rts
; ------------------------------------------------------------------------
; USE: Tell the driver that the window is now associated with a given page.
-USE: sta curpage ; Remember the page
- stx curpage+1
- lda #window ; Return the window
+USE: sta curpage ; Remember the page
+ stx curpage+1
+ lda #window ; Return the window
rts
; ------------------------------------------------------------------------
@@ -230,32 +230,32 @@ USE: sta curpage ; Remember the page
COMMIT:
sei
- lda curpage ; Get the current page
- ldx curpage+1
+ lda curpage ; Get the current page
+ ldx curpage+1
- jsr adjust_page_and_bank
- stx curbank
+ jsr adjust_page_and_bank
+ stx curbank
clc
- adc #>BASE
- sta ptr1+1
- ldy #0
- sty ptr1
- jsr backup_and_setup_copy_routine
- ldx #BASE
+ sta ptr1+1
+ ldy #0
+ sty ptr1
+ jsr backup_and_setup_copy_routine
+ ldx #BASE
- sta ptr4+1
- lda tmp2
+ inc ptr4+1
+ lda ptr4+1
+ cmp #$80
+ bne @L3
+ lda #>BASE
+ sta ptr4+1
+ lda tmp2
clc
- adc #$10
- sta tmp2
- jmp @L3
+ adc #$10
+ sta tmp2
+ jmp @L3
; ------------------------------------------------------------------------
; COPYTO: Copy from linear into extended memory. A pointer to a structure
@@ -332,8 +332,8 @@ COPYFROM:
COPYTO:
sei
- jsr setup
- jsr backup_and_setup_copy_routine
+ jsr setup
+ jsr backup_and_setup_copy_routine
; Setup is:
;
@@ -344,101 +344,101 @@ COPYTO:
; - tmp1 contains zero (to be used for linear memory buffer offset)
; - tmp2 contains the bank value
- lda #BASE
- sta ptr4+1
- lda tmp2
+ bne @L3
+ lda #>BASE
+ sta ptr4+1
+ lda tmp2
clc
- adc #$10
- sta tmp2
- jmp @L3
+ adc #$10
+ sta tmp2
+ jmp @L3
; ------------------------------------------------------------------------
; Helper function for COPYFROM and COPYTO: Store the pointer to the request
; structure and prepare data for the copy
setup:
- sta ptr1
- stx ptr1+1 ; Save passed pointer
+ sta ptr1
+ stx ptr1+1 ; Save passed pointer
; Get the page number from the struct and adjust it so that it may be used
; with the hardware. That is: ptr4 has the page address and page offset
; tmp2 will hold the bank value
- ldy #EM_COPY::PAGE+1
- lda (ptr1),y
+ ldy #EM_COPY::PAGE+1
+ lda (ptr1),y
tax
- ldy #EM_COPY::PAGE
- lda (ptr1),y
- jsr adjust_page_and_bank
+ ldy #EM_COPY::PAGE
+ lda (ptr1),y
+ jsr adjust_page_and_bank
clc
- adc #>BASE
- sta ptr4+1
- stx tmp2
+ adc #>BASE
+ sta ptr4+1
+ stx tmp2
; Get the buffer pointer into ptr2
- ldy #EM_COPY::BUF
- lda (ptr1),y
- sta ptr2
+ ldy #EM_COPY::BUF
+ lda (ptr1),y
+ sta ptr2
iny
- lda (ptr1),y
- sta ptr2+1
+ lda (ptr1),y
+ sta ptr2+1
; Get the count, calculate -(count-1) and store it into ptr3
- ldy #EM_COPY::COUNT
- lda (ptr1),y
- eor #$FF
- sta ptr3
+ ldy #EM_COPY::COUNT
+ lda (ptr1),y
+ eor #$FF
+ sta ptr3
iny
- lda (ptr1),y
- eor #$FF
- sta ptr3+1
+ lda (ptr1),y
+ eor #$FF
+ sta ptr3+1
; Get the page offset into ptr4 and clear tmp1
- ldy #EM_COPY::OFFS
- lda (ptr1),y
- sta ptr4
- lda #0
- sta tmp1
+ ldy #EM_COPY::OFFS
+ lda (ptr1),y
+ sta ptr4
+ lda #0
+ sta tmp1
; Done
@@ -447,47 +447,47 @@ setup:
; Helper routines for copying to and from the +256k ram
backup_and_setup_copy_routine:
- ldx #.sizeof (copy) - 1
+ ldx #.sizeof (copy) - 1
@L1:
- lda copy::entry,x
- sta backup,x
- lda copy::template,x
- sta copy::entry,x
+ lda copy::entry,x
+ sta backup,x
+ lda copy::template,x
+ sta copy::entry,x
dex
- bpl @L1
+ bpl @L1
rts
backup_and_setup_check_routine:
- ldx #.sizeof (check) - 1
+ ldx #.sizeof (check) - 1
@L1:
- lda check::entry,x
- sta backup,x
- lda check::template,x
- sta check::entry,x
+ lda check::entry,x
+ sta backup,x
+ lda check::template,x
+ sta check::entry,x
dex
- bpl @L1
+ bpl @L1
rts
restore_copy_routine:
- ldx #.sizeof (copy) - 1
+ ldx #.sizeof (copy) - 1
restore_data:
- lda backup,x
- sta TARGETLOC,x
+ lda backup,x
+ sta TARGETLOC,x
dex
- bpl restore_data
+ bpl restore_data
rts
; Helper routine to correct for the bank and page
adjust_page_and_bank:
- sta tmp4
- lda #$0C
+ sta tmp4
+ lda #$0C
sta tmp3
- lda tmp4
- and #$c0
+ lda tmp4
+ and #$c0
lsr
lsr
- ora tmp3
- sta tmp3
+ ora tmp3
+ sta tmp3
txa
asl
asl
@@ -495,8 +495,8 @@ adjust_page_and_bank:
asl
asl
asl
- ora tmp3
+ ora tmp3
tax
- lda tmp4
- and #$3f
+ lda tmp4
+ and #$3f
rts
diff --git a/libsrc/c64/emd/c64-dqbb.s b/libsrc/c64/emd/c64-dqbb.s
index 3f581e11a..fcfeaeb9b 100644
--- a/libsrc/c64/emd/c64-dqbb.s
+++ b/libsrc/c64/emd/c64-dqbb.s
@@ -3,13 +3,13 @@
; Marco van den Heuvel, 2010-01-27
;
- .include "zeropage.inc"
+ .include "zeropage.inc"
- .include "em-kernel.inc"
- .include "em-error.inc"
+ .include "em-kernel.inc"
+ .include "em-error.inc"
- .macpack generic
+ .macpack generic
; ------------------------------------------------------------------------
@@ -19,19 +19,19 @@
; Driver signature
- .byte $65, $6d, $64 ; "emd"
- .byte EMD_API_VERSION ; EM API version number
+ .byte $65, $6d, $64 ; "emd"
+ .byte EMD_API_VERSION ; EM API version number
; Jump table.
- .word INSTALL
- .word UNINSTALL
- .word PAGECOUNT
- .word MAP
- .word USE
- .word COMMIT
- .word COPYFROM
- .word COPYTO
+ .word INSTALL
+ .word UNINSTALL
+ .word PAGECOUNT
+ .word MAP
+ .word USE
+ .word COMMIT
+ .word COPYFROM
+ .word COPYTO
; ------------------------------------------------------------------------
; Constants
@@ -115,12 +115,12 @@ address := *+1 ; Patched at runtime
.bss
-curpage: .res 1 ; Current page number
-window: .res 256 ; Memory "window"
+curpage: .res 1 ; Current page number
+window: .res 256 ; Memory "window"
; Since the functions above are copied to $200, the current contents of this
; memory area must be saved into backup storage. Allocate enough space.
-backup: .res .max (.sizeof (copy), .sizeof (check))
+backup: .res .max (.sizeof (copy), .sizeof (check))
@@ -135,21 +135,21 @@ backup: .res .max (.sizeof (copy), .sizeof (check))
INSTALL:
sei
- jsr backup_and_setup_check_routine
- jsr check::entry
+ jsr backup_and_setup_check_routine
+ jsr check::entry
cli
- ldx #.sizeof (check) - 1
- jsr restore_data
- cpy #$01
- beq @present
- lda #EM_ERR_NO_DEVICE
+ ldx #.sizeof (check) - 1
+ jsr restore_data
+ cpy #$01
+ beq @present
+ lda #EM_ERR_NO_DEVICE
rts
@present:
- lda #EM_ERR_OK
-; rts ; Run into UNINSTALL instead
+ lda #EM_ERR_OK
+; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -165,8 +165,8 @@ UNINSTALL:
;
PAGECOUNT:
- lda #PAGES
+ lda #PAGES
rts
; ------------------------------------------------------------------------
@@ -177,37 +177,37 @@ PAGECOUNT:
MAP:
sei
- sta curpage ; Remember the new page
+ sta curpage ; Remember the new page
clc
- adc #>BASE
- sta ptr1+1
- ldy #0
- sty ptr1
- jsr backup_and_setup_copy_routine
- ldx #BASE
+ sta ptr1+1
+ ldy #0
+ sty ptr1
+ jsr backup_and_setup_copy_routine
+ ldx #window ; Return the window address
+ jsr restore_copy_routine
+ lda #window ; Return the window address
cli
rts
; ------------------------------------------------------------------------
; USE: Tell the driver that the window is now associated with a given page.
-USE: sta curpage ; Remember the page
- lda #window ; Return the window
+USE: sta curpage ; Remember the page
+ lda #window ; Return the window
rts
; ------------------------------------------------------------------------
@@ -215,26 +215,26 @@ USE: sta curpage ; Remember the page
COMMIT:
sei
- lda curpage ; Get the current page
+ lda curpage ; Get the current page
clc
- adc #>BASE
- sta ptr1+1
- ldy #0
- sty ptr1
- jsr backup_and_setup_copy_routine
- ldx #