old code removal in CBDOS, bugfixes
This commit is contained in:
1 parent
45ad2ebe6d
commit
d0ead5d970
4 files changed
+22
-90
No files matched your search
@@ -22,7 +22,9 @@ fs_hvsr_read_dir_open:
|
||||
; Reset status to OK
|
||||
|
||||
lda #$00
|
||||
jsr dos_status_00
|
||||
sta PAR_TRACK
|
||||
sta PAR_SECTOR
|
||||
jsr util_status_SD
|
||||
|
||||
; Provide pointer to the header
|
||||
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
|
||||
;
|
||||
; 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
|
||||
|
||||
; 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_sts_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
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
|
||||
dos_status_offset:
|
||||
|
||||
!byte $00,$20,$40
|
||||
+11
-2
@@ -123,8 +123,11 @@ msg_ACPTR_fail_no_talker:
|
||||
|
||||
msg_ACPTR_reset_status:
|
||||
|
||||
lda IDX1_TALKER
|
||||
jsr dos_status_00
|
||||
ldx IDX2_TALKER
|
||||
lda #$00
|
||||
sta PAR_TRACK
|
||||
sta PAR_SECTOR
|
||||
jsr (msg_ACPTR_set_status_vectab, x)
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
@@ -147,3 +150,9 @@ msg_ACPTR_read_vectab:
|
||||
!word msg_ACPTR_read_SD
|
||||
!word msg_ACPTR_read_FD
|
||||
!word msg_ACPTR_read_RD
|
||||
|
||||
msg_ACPTR_set_status_vectab:
|
||||
|
||||
!word util_status_SD
|
||||
!word util_status_FD
|
||||
!word util_status_RD
|
||||
@@ -11,21 +11,21 @@ util_status_SD:
|
||||
|
||||
ldx #$00
|
||||
stx SD_STATUS_IDX ; set first byte of status to read
|
||||
ldx $00 ; offset to status buffer
|
||||
ldx #$00 ; offset to status buffer
|
||||
bra util_status_common
|
||||
|
||||
util_status_FD:
|
||||
|
||||
ldx #$00
|
||||
stx FD_STATUS_IDX ; set first byte of status to read
|
||||
ldx $20 ; offset to status buffer
|
||||
ldx #$20 ; offset to status buffer
|
||||
bra util_status_common
|
||||
|
||||
util_status_RD:
|
||||
|
||||
ldx #$00
|
||||
stx RD_STATUS_IDX ; set first byte of status to read
|
||||
ldx $40 ; offset to status buffer
|
||||
ldx #$40 ; offset to status buffer
|
||||
|
||||
; FALLLTROUGH
|
||||
|
||||
@@ -49,7 +49,7 @@ util_status_common:
|
||||
ldy #$00 ; copy the string
|
||||
@lp:
|
||||
jsr code_LDA_nnnn_Y
|
||||
bne @lp_end
|
||||
beq @lp_end
|
||||
sta XX_STATUS_STR, x
|
||||
iny
|
||||
inx
|
||||
@@ -59,6 +59,7 @@ util_status_common:
|
||||
|
||||
; Store track and sector
|
||||
|
||||
jsr util_status_store_comma
|
||||
lda PAR_TRACK
|
||||
jsr util_status_store_number
|
||||
jsr util_status_store_comma
|
||||
@@ -112,10 +113,12 @@ util_status_store_number:
|
||||
sbc #10
|
||||
bra @lp
|
||||
|
||||
@store_finalize: ; first digit to store in .Y, second in .A
|
||||
@store_finalize: ; first digit to store in .Y, second in .A (need no add '0')
|
||||
|
||||
sty XX_STATUS_STR, x
|
||||
inx
|
||||
clc
|
||||
adc #'0'
|
||||
sta XX_STATUS_STR, x
|
||||
inx
|
||||
|
||||
|
||||
Reference in new issue
Block a user