clean-up of driver return codes
This commit is contained in:
@@ -87,16 +87,17 @@ INSTALL:
|
||||
cli
|
||||
cmp tmp1
|
||||
beq @ram_present
|
||||
lda #<EM_ERR_NO_DEVICE
|
||||
ldx #>EM_ERR_NO_DEVICE
|
||||
lda #EM_ERR_NO_DEVICE
|
||||
ldx #0 ; return value is char
|
||||
rts
|
||||
|
||||
@ram_present:
|
||||
ldx #$FF
|
||||
stx curpage
|
||||
stx curpage+1 ; Invalidate the current page
|
||||
.assert EM_ERR_OK = 0, error
|
||||
inx
|
||||
txa ; A = X = EM_ERR_OK
|
||||
txa
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
@@ -120,16 +120,16 @@ INSTALL:
|
||||
bne @setok
|
||||
|
||||
@notpresent:
|
||||
lda #<EM_ERR_NO_DEVICE
|
||||
ldx #>EM_ERR_NO_DEVICE
|
||||
lda #EM_ERR_NO_DEVICE
|
||||
ldx #0 ; return value is char
|
||||
rts
|
||||
|
||||
@setok:
|
||||
lda #0
|
||||
sta pagecount
|
||||
stx pagecount+1
|
||||
lda #<EM_ERR_OK
|
||||
ldx #>EM_ERR_OK
|
||||
.assert EM_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
|
||||
check:
|
||||
|
||||
@@ -87,16 +87,17 @@ INSTALL:
|
||||
cli
|
||||
cmp tmp1
|
||||
beq @ram_present
|
||||
lda #<EM_ERR_NO_DEVICE
|
||||
ldx #>EM_ERR_NO_DEVICE
|
||||
lda #EM_ERR_NO_DEVICE
|
||||
ldx #0 ; return value is char
|
||||
rts
|
||||
|
||||
@ram_present:
|
||||
ldx #$FF
|
||||
stx curpage
|
||||
stx curpage+1 ; Invalidate the current page
|
||||
.assert EM_ERR_OK = 0, error
|
||||
inx
|
||||
txa ; A = X = EM_ERR_OK
|
||||
txa
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
@@ -68,8 +68,9 @@ INSTALL:
|
||||
ldx #$FF
|
||||
stx curpage
|
||||
stx curpage+1 ; Invalidate the current page
|
||||
.assert EM_ERR_OK = 0, error
|
||||
inx
|
||||
txa ; A = X = EM_ERR_OK
|
||||
txa
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
@@ -107,8 +107,9 @@ INSTALL:
|
||||
ldx #$FF
|
||||
stx curpage
|
||||
stx curpage+1 ; Invalidate the current page
|
||||
.assert EM_ERR_OK = 0, error
|
||||
inx
|
||||
txa ; A = X = EM_ERR_OK
|
||||
txa
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
@@ -97,13 +97,14 @@ INSTALL:
|
||||
lda #0
|
||||
sta pagecount
|
||||
stx pagecount+1
|
||||
lda #<EM_ERR_OK
|
||||
ldx #>EM_ERR_OK
|
||||
lda #EM_ERR_OK
|
||||
.assert EM_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
@notpresent:
|
||||
@readonly:
|
||||
lda #<EM_ERR_NO_DEVICE
|
||||
ldx #>EM_ERR_NO_DEVICE
|
||||
lda #EM_ERR_NO_DEVICE
|
||||
ldx #0 ; return value is char
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
@@ -126,8 +126,9 @@ size_found:
|
||||
pagecount_ok:
|
||||
stx pagecount
|
||||
sty pagecount+1
|
||||
lda #<EM_ERR_OK
|
||||
ldx #>EM_ERR_OK
|
||||
lda #EM_ERR_OK
|
||||
.assert EM_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
|
||||
; common REU setup for size check
|
||||
|
||||
@@ -121,8 +121,9 @@ INSTALL:
|
||||
lda vdc_cset_save
|
||||
jsr vdcputreg
|
||||
@keep64kBit:
|
||||
lda #<EM_ERR_OK
|
||||
ldx #>EM_ERR_OK
|
||||
lda #EM_ERR_OK
|
||||
.assert EM_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
|
||||
test64k:
|
||||
|
||||
@@ -53,8 +53,9 @@ JOY_COUNT = 4 ; Number of joysticks we support
|
||||
;
|
||||
|
||||
INSTALL:
|
||||
lda #<JOY_ERR_OK
|
||||
ldx #>JOY_ERR_OK
|
||||
lda #JOY_ERR_OK
|
||||
.assert JOY_ERR_OK = 0, error
|
||||
tax
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
@@ -57,8 +57,9 @@ JOY_COUNT = 2 ; Number of joysticks we support
|
||||
;
|
||||
|
||||
INSTALL:
|
||||
lda #<JOY_ERR_OK
|
||||
ldx #>JOY_ERR_OK
|
||||
lda #JOY_ERR_OK
|
||||
.assert JOY_ERR_OK = 0, error
|
||||
tax
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
@@ -194,9 +194,10 @@ INSTALL:
|
||||
sta (ptr3),y
|
||||
cli
|
||||
|
||||
; Done, return zero (= MOUSE_ERR_OK)
|
||||
; Done
|
||||
|
||||
ldx #$00
|
||||
ldx #MOUSE_ERR_OK
|
||||
.assert MOUSE_ERR_OK = 0, error
|
||||
txa
|
||||
rts
|
||||
|
||||
|
||||
@@ -228,9 +228,10 @@ INSTALL:
|
||||
jsr MoveX
|
||||
cli
|
||||
|
||||
; Done, return zero.
|
||||
; Done
|
||||
|
||||
lda #MOUSE_ERR_OK
|
||||
.assert MOUSE_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
|
||||
|
||||
@@ -195,9 +195,10 @@ INSTALL:
|
||||
sta (ptr3),y
|
||||
cli
|
||||
|
||||
; Done, return zero (= MOUSE_ERR_OK)
|
||||
; Done
|
||||
|
||||
ldx #$00
|
||||
ldx #MOUSE_ERR_OK
|
||||
.assert MOUSE_ERR_OK = 0, error
|
||||
txa
|
||||
rts
|
||||
|
||||
|
||||
@@ -195,9 +195,10 @@ INSTALL:
|
||||
sta (ptr3),y
|
||||
cli
|
||||
|
||||
; Done, return zero (= MOUSE_ERR_OK)
|
||||
; Done
|
||||
|
||||
ldx #$00
|
||||
ldx #MOUSE_ERR_OK
|
||||
.assert MOUSE_ERR_OK = 0, error
|
||||
txa
|
||||
rts
|
||||
|
||||
|
||||
@@ -187,8 +187,9 @@ SetNMI: sta NMIVec
|
||||
|
||||
; Done, return an error code
|
||||
|
||||
lda #<SER_ERR_OK
|
||||
tax ; A is zero
|
||||
lda #SER_ERR_OK
|
||||
.assert SER_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
@@ -264,22 +265,23 @@ SER_OPEN:
|
||||
|
||||
; Done
|
||||
|
||||
lda #<SER_ERR_OK
|
||||
tax ; A is zero
|
||||
lda #SER_ERR_OK
|
||||
.assert SER_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
|
||||
; Invalid parameter
|
||||
|
||||
InvParam:
|
||||
lda #<SER_ERR_INIT_FAILED
|
||||
ldx #>SER_ERR_INIT_FAILED
|
||||
lda #SER_ERR_INIT_FAILED
|
||||
ldx #0 ; return value is char
|
||||
rts
|
||||
|
||||
; Baud rate not available
|
||||
|
||||
InvBaud:
|
||||
lda #<SER_ERR_BAUD_UNAVAIL
|
||||
ldx #>SER_ERR_BAUD_UNAVAIL
|
||||
lda #SER_ERR_BAUD_UNAVAIL
|
||||
ldx #0 ; return value is char
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
@@ -300,8 +302,9 @@ SER_CLOSE:
|
||||
|
||||
; Return OK
|
||||
|
||||
lda #<SER_ERR_OK
|
||||
tax ; A is zero
|
||||
lda #SER_ERR_OK
|
||||
.assert SER_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
@@ -322,8 +325,8 @@ SER_GET:
|
||||
@L1: lda RecvFreeCnt ; (25)
|
||||
cmp #$ff
|
||||
bne @L2
|
||||
lda #<SER_ERR_NO_DATA
|
||||
ldx #>SER_ERR_NO_DATA
|
||||
lda #SER_ERR_NO_DATA
|
||||
ldx #0 ; return value is char
|
||||
rts
|
||||
|
||||
; Check for flow stopped & enough free: release flow control
|
||||
@@ -370,7 +373,7 @@ SER_PUT:
|
||||
|
||||
@L2: ldx SendFreeCnt
|
||||
bne @L3
|
||||
lda #<SER_ERR_OVERFLOW ; X is already zero
|
||||
lda #SER_ERR_OVERFLOW ; X is already zero
|
||||
rts
|
||||
|
||||
@L3: ldx SendTail
|
||||
@@ -379,7 +382,8 @@ SER_PUT:
|
||||
dec SendFreeCnt
|
||||
lda #$ff
|
||||
jsr TryToSend
|
||||
lda #<SER_ERR_OK
|
||||
lda #SER_ERR_OK
|
||||
.assert SER_ERR_OK = 0, error
|
||||
tax
|
||||
rts
|
||||
|
||||
@@ -392,7 +396,8 @@ SER_STATUS:
|
||||
lda ACIA_STATUS
|
||||
ldx #0
|
||||
sta (ptr1,x)
|
||||
txa ; SER_ERR_OK
|
||||
.assert SER_ERR_OK = 0, error
|
||||
txa
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
@@ -402,8 +407,8 @@ SER_STATUS:
|
||||
;
|
||||
|
||||
SER_IOCTL:
|
||||
lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||
ldx #>SER_ERR_INV_IOCTL
|
||||
lda #SER_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||
ldx #0 ; return value is char
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user