mirror of
https://github.com/cc65/cc65.git
synced 2024-06-15 02:29:32 +00:00
Updated to use cbm_kernal.inc. Whitespace cleanups
This commit is contained in:
parent
e69bc65cf1
commit
aeff90ca90
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
.import cursor
|
.import cursor
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "c128.inc"
|
.include "c128.inc"
|
||||||
|
|
||||||
;--------------------------------------------------------------------------
|
;--------------------------------------------------------------------------
|
||||||
|
@ -17,8 +18,8 @@
|
||||||
_cgetc: lda KEY_COUNT ; Get number of characters
|
_cgetc: lda KEY_COUNT ; Get number of characters
|
||||||
bne L2 ; Jump if there are already chars waiting
|
bne L2 ; Jump if there are already chars waiting
|
||||||
|
|
||||||
; Switch on the cursor if needed. We MUST always switch the cursor on,
|
; Switch on the cursor if needed. We MUST always switch the cursor on,
|
||||||
; before switching it off, because switching it off will restore the
|
; before switching it off, because switching it off will restore the
|
||||||
; character attribute remembered when it was switched on. So just switching
|
; character attribute remembered when it was switched on. So just switching
|
||||||
; it off will restore the wrong character attribute.
|
; it off will restore the wrong character attribute.
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
|
|
||||||
.export _clrscr
|
.export _clrscr
|
||||||
|
|
||||||
.include "c128.inc"
|
.include "cbm_kernal.inc"
|
||||||
|
|
||||||
_clrscr = CLRSCR
|
_clrscr = CLRSCR
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
.export _cputcxy, _cputc, cputdirect, putchar
|
.export _cputcxy, _cputc, cputdirect, putchar
|
||||||
.export newline, plot
|
.export newline, plot
|
||||||
.import gotoxy
|
.import gotoxy
|
||||||
.import PLOT
|
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "c128.inc"
|
.include "c128.inc"
|
||||||
|
|
||||||
newline = NEWLINE
|
newline = NEWLINE
|
||||||
|
@ -85,4 +85,3 @@ plot: ldy CURS_X
|
||||||
; position in Y
|
; position in Y
|
||||||
|
|
||||||
putchar = $CC2F
|
putchar = $CC2F
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
.constructor initmainargs, 24
|
.constructor initmainargs, 24
|
||||||
.import __argc, __argv
|
.import __argc, __argv
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "c128.inc"
|
.include "c128.inc"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
.export _cgetc
|
.export _cgetc
|
||||||
.import cursor
|
.import cursor
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "plus4.inc"
|
.include "plus4.inc"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,6 @@
|
||||||
|
|
||||||
.export _clrscr
|
.export _clrscr
|
||||||
|
|
||||||
.include "plus4.inc"
|
.include "cbm_kernal.inc"
|
||||||
|
|
||||||
_clrscr = CLRSCR
|
_clrscr = CLRSCR
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
.export _cgetc
|
.export _cgetc
|
||||||
.import cursor
|
.import cursor
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
|
|
||||||
_cgetc: lda KEY_COUNT ; Get number of characters
|
_cgetc: lda KEY_COUNT ; Get number of characters
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
|
|
||||||
.export _clrscr
|
.export _clrscr
|
||||||
|
|
||||||
.include "c64.inc"
|
.include "cbm_kernal.inc"
|
||||||
|
|
||||||
_clrscr = CLRSCR
|
_clrscr = CLRSCR
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "ser-kernel.inc"
|
.include "ser-kernel.inc"
|
||||||
.include "ser-error.inc"
|
.include "ser-error.inc"
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
|
|
||||||
.macpack module
|
.macpack module
|
||||||
|
@ -45,15 +46,15 @@
|
||||||
|
|
||||||
; Jump table
|
; Jump table
|
||||||
|
|
||||||
.word INSTALL
|
.word SWL_INSTALL
|
||||||
.word UNINSTALL
|
.word SWL_UNINSTALL
|
||||||
.word OPEN
|
.word SWL_OPEN
|
||||||
.word CLOSE
|
.word SWL_CLOSE
|
||||||
.word GET
|
.word SWL_GET
|
||||||
.word PUT
|
.word SWL_PUT
|
||||||
.word STATUS
|
.word SWL_STATUS
|
||||||
.word IOCTL
|
.word SWL_IOCTL
|
||||||
.word IRQ
|
.word SWL_IRQ
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; I/O definitions
|
; I/O definitions
|
||||||
|
@ -136,11 +137,11 @@ ParityTable:
|
||||||
.code
|
.code
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; INSTALL routine. Is called after the driver is loaded into memory. If
|
; SWL_INSTALL routine. Is called after the driver is loaded into memory. If
|
||||||
; possible, check if the hardware is present.
|
; possible, check if the hardware is present.
|
||||||
; Must return an SER_ERR_xx code in a/x.
|
; Must return an SER_ERR_xx code in a/x.
|
||||||
|
|
||||||
INSTALL:
|
SWL_INSTALL:
|
||||||
|
|
||||||
; Deactivate DTR and disable 6551 interrupts
|
; Deactivate DTR and disable 6551 interrupts
|
||||||
|
|
||||||
|
@ -165,10 +166,10 @@ SetNMI: sta NMIVec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; UNINSTALL routine. Is called before the driver is removed from memory.
|
; SWL_UNINSTALL routine. Is called before the driver is removed from memory.
|
||||||
; Must return an SER_ERR_xx code in a/x.
|
; Must return an SER_ERR_xx code in a/x.
|
||||||
|
|
||||||
UNINSTALL:
|
SWL_UNINSTALL:
|
||||||
|
|
||||||
; Stop interrupts, drop DTR
|
; Stop interrupts, drop DTR
|
||||||
|
|
||||||
|
@ -185,7 +186,7 @@ UNINSTALL:
|
||||||
; PARAMS routine. A pointer to a ser_params structure is passed in ptr1.
|
; PARAMS routine. A pointer to a ser_params structure is passed in ptr1.
|
||||||
; Must return an SER_ERR_xx code in a/x.
|
; Must return an SER_ERR_xx code in a/x.
|
||||||
|
|
||||||
OPEN:
|
SWL_OPEN:
|
||||||
|
|
||||||
; Check if the handshake setting is valid
|
; Check if the handshake setting is valid
|
||||||
|
|
||||||
|
@ -256,11 +257,11 @@ InvBaud:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; CLOSE: Close the port, disable interrupts and flush the buffer. Called
|
; SWL_CLOSE: Close the port, disable interrupts and flush the buffer. Called
|
||||||
; without parameters. Must return an error code in a/x.
|
; without parameters. Must return an error code in a/x.
|
||||||
;
|
;
|
||||||
|
|
||||||
CLOSE:
|
SWL_CLOSE:
|
||||||
|
|
||||||
; Stop interrupts, drop DTR
|
; Stop interrupts, drop DTR
|
||||||
|
|
||||||
|
@ -278,12 +279,13 @@ CLOSE:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; GET: Will fetch a character from the receive buffer and store it into the
|
; SWL_GET: Will fetch a character from the receive buffer and store it into the
|
||||||
; variable pointer to by ptr1. If no data is available, SER_ERR_NO_DATA is
|
; variable pointer to by ptr1. If no data is available, SER_ERR_NO_DATA is
|
||||||
; return.
|
; return.
|
||||||
;
|
;
|
||||||
|
|
||||||
GET: ldx SendFreeCnt ; Send data if necessary
|
SWL_GET:
|
||||||
|
ldx SendFreeCnt ; Send data if necessary
|
||||||
inx ; X == $FF?
|
inx ; X == $FF?
|
||||||
beq @L1
|
beq @L1
|
||||||
lda #$00
|
lda #$00
|
||||||
|
@ -322,11 +324,11 @@ GET: ldx SendFreeCnt ; Send data if necessary
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; PUT: Output character in A.
|
; SWL_PUT: Output character in A.
|
||||||
; Must return an error code in a/x.
|
; Must return an error code in a/x.
|
||||||
;
|
;
|
||||||
|
|
||||||
PUT:
|
SWL_PUT:
|
||||||
|
|
||||||
; Try to send
|
; Try to send
|
||||||
|
|
||||||
|
@ -356,31 +358,33 @@ PUT:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; STATUS: Return the status in the variable pointed to by ptr1.
|
; SWL_STATUS: Return the status in the variable pointed to by ptr1.
|
||||||
; Must return an error code in a/x.
|
; Must return an error code in a/x.
|
||||||
;
|
;
|
||||||
|
|
||||||
STATUS: lda ACIA_STATUS
|
SWL_STATUS:
|
||||||
|
lda ACIA_STATUS
|
||||||
ldx #0
|
ldx #0
|
||||||
sta (ptr1,x)
|
sta (ptr1,x)
|
||||||
txa ; SER_ERR_OK
|
txa ; SER_ERR_OK
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
|
; SWL_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
|
||||||
; specific data in ptr1, and the ioctl code in A.
|
; specific data in ptr1, and the ioctl code in A.
|
||||||
; Must return an error code in a/x.
|
; Must return an error code in a/x.
|
||||||
;
|
;
|
||||||
|
|
||||||
IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
|
SWL_IOCTL:
|
||||||
|
lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||||
ldx #>SER_ERR_INV_IOCTL
|
ldx #>SER_ERR_INV_IOCTL
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; IRQ: Not used on the C64
|
; SWL_IRQ: Not used on the C64
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ = $0000
|
SWL_IRQ = $0000
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
;
|
;
|
||||||
|
@ -476,4 +480,3 @@ InitBuffers:
|
||||||
stx RecvFreeCnt
|
stx RecvFreeCnt
|
||||||
stx SendFreeCnt
|
stx SendFreeCnt
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
.import cursor
|
.import cursor
|
||||||
.importzp tmp1
|
.importzp tmp1
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
.include "soft80.inc"
|
.include "soft80.inc"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
.import cursor
|
.import cursor
|
||||||
.importzp tmp1
|
.importzp tmp1
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
.include "soft80.inc"
|
.include "soft80.inc"
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
.export _cgetc
|
.export _cgetc
|
||||||
.import cursor
|
.import cursor
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "plus4.inc"
|
.include "plus4.inc"
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
.export _clrscr
|
.export _clrscr
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "plus4.inc"
|
.include "plus4.inc"
|
||||||
|
|
||||||
.segment "LOWCODE" ; Must go into low memory
|
.segment "LOWCODE" ; Must go into low memory
|
||||||
|
@ -16,9 +17,3 @@
|
||||||
sta ENABLE_RAM ; Switch back to RAM
|
sta ENABLE_RAM ; Switch back to RAM
|
||||||
rts ; Return to caller
|
rts ; Return to caller
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
.export _cgetc
|
.export _cgetc
|
||||||
.import cursor
|
.import cursor
|
||||||
|
|
||||||
|
.include "cbm_kernal.inc"
|
||||||
.include "vic20.inc"
|
.include "vic20.inc"
|
||||||
|
|
||||||
_cgetc: lda KEY_COUNT ; Get number of characters
|
_cgetc: lda KEY_COUNT ; Get number of characters
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
|
|
||||||
.export _clrscr
|
.export _clrscr
|
||||||
|
|
||||||
.include "vic20.inc"
|
.include "cbm_kernal.inc"
|
||||||
|
|
||||||
_clrscr = CLRSCR
|
_clrscr = CLRSCR
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user