Added SER_ prefix. Whitespace cleanup
This commit is contained in:
parent
ad0b0982d0
commit
5901ea80a4
1 changed files with 30 additions and 30 deletions
|
@ -44,15 +44,15 @@
|
||||||
.addr $0000
|
.addr $0000
|
||||||
|
|
||||||
; Jump table
|
; Jump table
|
||||||
.addr INSTALL
|
.addr SER_INSTALL
|
||||||
.addr UNINSTALL
|
.addr SER_UNINSTALL
|
||||||
.addr OPEN
|
.addr SER_OPEN
|
||||||
.addr CLOSE
|
.addr SER_CLOSE
|
||||||
.addr GET
|
.addr SER_GET
|
||||||
.addr PUT
|
.addr SER_PUT
|
||||||
.addr STATUS
|
.addr SER_STATUS
|
||||||
.addr IOCTL
|
.addr SER_IOCTL
|
||||||
.addr IRQ
|
.addr SER_IRQ
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; I/O definitions
|
; I/O definitions
|
||||||
|
@ -141,23 +141,23 @@ IdTableLen = * - IdValTable
|
||||||
.code
|
.code
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; INSTALL: Is called after the driver is loaded into memory. If possible,
|
; SER_INSTALL: Is called after the driver is loaded into memory. If possible,
|
||||||
; check if the hardware is present. Must return an SER_ERR_xx code in a/x.
|
; check if the hardware is present. Must return an SER_ERR_xx code in a/x.
|
||||||
;
|
;
|
||||||
; Since we don't have to manage the IRQ vector on the Apple II, this is
|
; Since we don't have to manage the IRQ vector on the Apple II, this is
|
||||||
; actually the same as:
|
; actually the same as:
|
||||||
;
|
;
|
||||||
; UNINSTALL: Is called before the driver is removed from memory.
|
; SER_UNINSTALL: Is called before the driver is removed from memory.
|
||||||
; No return code required (the driver is removed from memory on return).
|
; No return code required (the driver is removed from memory on return).
|
||||||
;
|
;
|
||||||
; and:
|
; and:
|
||||||
;
|
;
|
||||||
; CLOSE: Close the port and disable interrupts. Called without parameters.
|
; SER_CLOSE: Close the port and disable interrupts. Called without parameters.
|
||||||
; Must return an SER_ERR_xx code in a/x.
|
; Must return an SER_ERR_xx code in a/x.
|
||||||
|
|
||||||
INSTALL:
|
SER_INSTALL:
|
||||||
UNINSTALL:
|
SER_UNINSTALL:
|
||||||
CLOSE:
|
SER_CLOSE:
|
||||||
ldx Index ; Check for open port
|
ldx Index ; Check for open port
|
||||||
beq :+
|
beq :+
|
||||||
|
|
||||||
|
@ -172,16 +172,16 @@ CLOSE:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; OPEN: A pointer to a ser_params structure is passed in ptr1.
|
; SER_OPEN: 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:
|
SER_OPEN:
|
||||||
ldx #<$C000
|
ldx #<$C000
|
||||||
stx ptr2
|
stx ptr2
|
||||||
lda #>$C000
|
lda #>$C000
|
||||||
ora Slot
|
ora Slot
|
||||||
sta ptr2+1
|
sta ptr2+1
|
||||||
|
|
||||||
; Check Pascal 1.1 Firmware Protocol ID bytes
|
; Check Pascal 1.1 Firmware Protocol ID bytes
|
||||||
: ldy IdOfsTable,x
|
: ldy IdOfsTable,x
|
||||||
lda IdValTable,x
|
lda IdValTable,x
|
||||||
|
@ -190,7 +190,7 @@ OPEN:
|
||||||
inx
|
inx
|
||||||
cpx #IdTableLen
|
cpx #IdTableLen
|
||||||
bcc :-
|
bcc :-
|
||||||
|
|
||||||
; Convert slot to I/O register index
|
; Convert slot to I/O register index
|
||||||
lda Slot
|
lda Slot
|
||||||
asl
|
asl
|
||||||
|
@ -273,11 +273,11 @@ InvBaud:lda #<SER_ERR_BAUD_UNAVAIL
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; GET: Will fetch a character from the receive buffer and store it into the
|
; SER_GET: Will fetch a character from the receive buffer and store it into the
|
||||||
; variable pointed to by ptr1. If no data is available, SER_ERR_NO_DATA is
|
; variable pointed to by ptr1. If no data is available, SER_ERR_NO_DATA is
|
||||||
; returned.
|
; returned.
|
||||||
|
|
||||||
GET:
|
SER_GET:
|
||||||
ldx Index
|
ldx Index
|
||||||
ldy SendFreeCnt ; Send data if necessary
|
ldy SendFreeCnt ; Send data if necessary
|
||||||
iny ; Y == $FF?
|
iny ; Y == $FF?
|
||||||
|
@ -315,10 +315,10 @@ GET:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; PUT: Output character in A.
|
; SER_PUT: Output character in A.
|
||||||
; Must return an SER_ERR_xx code in a/x.
|
; Must return an SER_ERR_xx code in a/x.
|
||||||
|
|
||||||
PUT:
|
SER_PUT:
|
||||||
ldx Index
|
ldx Index
|
||||||
|
|
||||||
; Try to send
|
; Try to send
|
||||||
|
@ -348,10 +348,10 @@ PUT:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; STATUS: Return the status in the variable pointed to by ptr1.
|
; SER_STATUS: Return the status in the variable pointed to by ptr1.
|
||||||
; Must return an SER_ERR_xx code in a/x.
|
; Must return an SER_ERR_xx code in a/x.
|
||||||
|
|
||||||
STATUS:
|
SER_STATUS:
|
||||||
ldx Index
|
ldx Index
|
||||||
lda ACIA_STATUS,x
|
lda ACIA_STATUS,x
|
||||||
ldx #$00
|
ldx #$00
|
||||||
|
@ -360,11 +360,11 @@ STATUS:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
|
; SER_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 SER_ERR_xx code in a/x.
|
; Must return an SER_ERR_xx code in a/x.
|
||||||
|
|
||||||
IOCTL:
|
SER_IOCTL:
|
||||||
; Check data msb and code to be 0
|
; Check data msb and code to be 0
|
||||||
ora ptr1+1
|
ora ptr1+1
|
||||||
bne :+
|
bne :+
|
||||||
|
@ -384,12 +384,12 @@ IOCTL:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
|
; SER_IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
|
||||||
; registers are already saved, no parameters are passed, but the carry flag
|
; 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
|
; is clear on entry. The routine must return with carry set if the interrupt
|
||||||
; was handled, otherwise with carry clear.
|
; was handled, otherwise with carry clear.
|
||||||
|
|
||||||
IRQ:
|
SER_IRQ:
|
||||||
ldx Index ; Check for open port
|
ldx Index ; Check for open port
|
||||||
beq Done
|
beq Done
|
||||||
lda ACIA_STATUS,x ; Check ACIA status for receive interrupt
|
lda ACIA_STATUS,x ; Check ACIA status for receive interrupt
|
||||||
|
@ -431,7 +431,7 @@ Again: lda SendFreeCnt
|
||||||
lda ACIA_STATUS,x
|
lda ACIA_STATUS,x
|
||||||
and #$10
|
and #$10
|
||||||
bne Send
|
bne Send
|
||||||
bit tmp1 ; Keep trying if must try hard
|
bit tmp1 ; Keep trying if must try hard
|
||||||
bmi Again
|
bmi Again
|
||||||
Quit: rts
|
Quit: rts
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue