erase status after reading error code
This commit is contained in:
1 parent
2ea3ebe4b0
commit
59d8f215d7
6 files changed
+95
-7
No files matched your search
@@ -62,6 +62,7 @@ SRCDIR_KERNAL = $(SRCDIR_COMMON) \
|
||||
|
||||
SRCDIR_DOS_M65 = $(SRCDIR_COMMON) \
|
||||
src/dos_m65 \
|
||||
src/dos_m65/assets \
|
||||
src/dos_m65/dev_floppy \
|
||||
src/dos_m65/dev_ramdisk \
|
||||
src/dos_m65/dev_sdcard
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
!addr FD_STATUS_IDX = $806E ; - floppy
|
||||
!addr RD_STATUS_IDX = $806F ; - ram disk
|
||||
|
||||
!addr XX_STATUS_STR = $8070
|
||||
!addr SD_STATUS_STR = $8070 ; status string for SD card, terminated by 0
|
||||
!addr FD_STATUS_STR = $80A0 ; status string for floppy drive, terminated by 0
|
||||
!addr RD_STATUS_STR = $80D0 ; status string for ram disk, terminated by 0
|
||||
File renamed without changes.
File renamed without changes.
@@ -24,8 +24,6 @@ dos_ACPTR_status:
|
||||
sta TBTCNT ; byte return
|
||||
beq dos_ACPTR_reset_status
|
||||
|
||||
; XXX
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
@@ -38,11 +36,8 @@ dos_ACPTR_fail:
|
||||
|
||||
dos_ACPTR_reset_status:
|
||||
|
||||
; XXX replace status with OK instead
|
||||
|
||||
ldx IDX1_TALKER
|
||||
lda #$00
|
||||
sta XX_STATUS_IDX,x
|
||||
lda IDX1_TALKER
|
||||
jsr dos_status_00
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in new issue
Block a user