erase status after reading error code

This commit is contained in:
FeralChild64 committed 2021-02-12 18:12:13 +01:00
1 parent 2ea3ebe4b0
commit 59d8f215d7
6 files changed
+95 -7

No files matched your search

+91
View File
@@ -0,0 +1,91 @@
;
; Set current error or status
;
; XXX add methods for remaining codes
; XXX size-optimize this, move some parts into subroutines
; .A = 0 for SD card, 1 for FDD, 2 for RAM disk
dos_status_00: ; OK
pha
phx
phy
; Set status byte pointer to the beginning
tax
lda #$00
sta XX_STATUS_IDX, x
; Set .X to offset from XX_STATUS_STR
lda dos_status_offset, x
tax
; Store '00,'
lda #'0'
sta XX_STATUS_STR, x
inx
sta XX_STATUS_STR, x
inx
lda #','
sta XX_STATUS_STR, x
inx
; Store 'OK'
dex
ldy #$FF
@1:
inx
iny
lda dos_err_00, y
beq @2
sta XX_STATUS_STR, x
bra @1
@2:
; Store ',00,00'
lda #','
sta XX_STATUS_STR, x
inx
lda #'0'
sta XX_STATUS_STR, x
inx
sta XX_STATUS_STR, x
inx
lda #','
sta XX_STATUS_STR, x
inx
lda #'0'
sta XX_STATUS_STR, x
inx
sta XX_STATUS_STR, x
inx
; Store 0 (mark end of the status)
lda #$00
sta XX_STATUS_STR, x
; End
ply
plx
pla
clc ; mark status as OK
rts
dos_status_offset:
!byte $00,$20,$40