clean-up of driver return codes

This commit is contained in:
mrdudz
2023-02-26 20:03:41 +01:00
parent a299ef4210
commit ffa83c32a4
82 changed files with 438 additions and 322 deletions

View File

@@ -120,13 +120,14 @@ INSTALL:
dex
@noextradex:
stx bankcount
lda #<EM_ERR_OK
ldx #>EM_ERR_OK
lda #EM_ERR_OK
.assert EM_ERR_OK = 0, error
tax
rts
@not_present:
cli
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

View File

@@ -158,13 +158,14 @@ INSTALL:
jsr restore_data
cpy #$01
beq @present
lda #<EM_ERR_NO_DEVICE
ldx #>EM_ERR_NO_DEVICE
lda #EM_ERR_NO_DEVICE
ldx #0 ; return value is char
rts
@present:
lda #<EM_ERR_OK
ldx #>EM_ERR_OK
lda #EM_ERR_OK
.assert EM_ERR_OK = 0, error
tax
; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------

View File

@@ -147,13 +147,14 @@ INSTALL:
jsr restore_data
cpy #$01
beq @present
lda #<EM_ERR_NO_DEVICE
ldx #>EM_ERR_NO_DEVICE
lda #EM_ERR_NO_DEVICE
ldx #0 ; return value is char
rts
@present:
lda #<EM_ERR_OK
ldx #>EM_ERR_OK
lda #EM_ERR_OK
.assert EM_ERR_OK = 0, error
tax
; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------

View File

@@ -121,16 +121,17 @@ INSTALL:
bne @setok
@notpresent:
lda #<EM_ERR_NO_DEVICE
ldx #>EM_ERR_NO_DEVICE
lda #EM_ERR_NO_DEVICE
.assert EM_ERR_OK = 0, error
tax
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:

View File

@@ -76,13 +76,14 @@ INSTALL:
beq @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 #<EM_ERR_OK
ldx #>EM_ERR_OK
lda #EM_ERR_OK
.assert EM_ERR_OK = 0, error
tax
; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------

View File

@@ -82,13 +82,14 @@ INSTALL:
cmp #$AA
bne @notpresent
lda #<EM_ERR_OK
ldx #>EM_ERR_OK
lda #EM_ERR_OK
.assert EM_ERR_OK = 0, error
tax
rts
@notpresent:
lda #<EM_ERR_NO_DEVICE
ldx #>EM_ERR_NO_DEVICE
lda #EM_ERR_NO_DEVICE
ldx #0 ; return value is char
; use rts from UNINSTALL below
; ------------------------------------------------------------------------

View File

@@ -65,8 +65,9 @@ window: .res 256 ; Memory "window"
INSTALL:
ldx #$FF
stx curpage ; Invalidate the current page
inx ; X = 0
txa ; A = X = EM_ERR_OK
.assert EM_ERR_OK = 0, error
inx
txa
; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------

View File

@@ -98,13 +98,13 @@ INSTALL:
lda #0
sta pagecount
stx pagecount+1
lda #<EM_ERR_OK
ldx #>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
; ------------------------------------------------------------------------

View File

@@ -127,8 +127,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
@@ -152,6 +153,7 @@ reu_size_check_common:
nodevice:
lda #EM_ERR_NO_DEVICE
.assert EM_ERR_OK = 0, error
; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------

View File

@@ -87,8 +87,8 @@ INSTALL:
bne @L0
iny
bne @L0
lda #<EM_ERR_NO_DEVICE
ldx #>EM_ERR_NO_DEVICE
lda #EM_ERR_NO_DEVICE
; ldx #0 ; return value is char
rts
@present:
@@ -131,8 +131,9 @@ INSTALL:
sta pagecount
stx pagecount+1
@endok:
lda #<EM_ERR_OK
ldx #>EM_ERR_OK
lda #EM_ERR_OK
.assert EM_ERR_OK = 0, error
tax
rts
test64k:

View File

@@ -93,15 +93,16 @@ INSTALL:
; DTV not found
lda #<EM_ERR_NO_DEVICE
ldx #>EM_ERR_NO_DEVICE
lda #EM_ERR_NO_DEVICE
ldx #0 ; return value is char
rts
@present:
ldx #$FF
stx curpage+1 ; Invalidate curpage
inx ; X = 0
txa ; A/X = EM_ERR_OK
.assert EM_ERR_OK = 0, error
inx
txa
; rts ; Run into UNINSTALL instead