SD card directory display starts working

This commit is contained in:
FeralChild64 committed 2021-02-15 22:18:37 +01:00
1 parent 992829c60a
commit 0b5f2dcf2a
2 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ dev_sd_init:
sta HTRAP00 sta HTRAP00
+nop +nop
lda #$36 ; dos_cdrootdir lda #$3C ; dos_cdrootdir
sta HTRAP00 sta HTRAP00
+nop +nop
+6 -6
View File
@@ -53,7 +53,7 @@ fs_hvsr_read_dir:
ldx SD_DIR_DESC ; directory descriptor ldx SD_DIR_DESC ; directory descriptor
ldy #$10 ; target page number ldy #$10 ; target page number
lda #$13 ; dos_readdir lda #$14 ; dos_readdir
sta HTRAP00 sta HTRAP00
+nop +nop
@@ -72,6 +72,7 @@ fs_hvsr_read_dir:
; Validate/fix characters in file name ; Validate/fix characters in file name
ldx SD_DIRENT+$40 ldx SD_DIRENT+$40
dex
@lp1: @lp1:
@@ -97,8 +98,6 @@ fs_hvsr_read_dir:
dex dex
bpl @lp1 bpl @lp1
inc $D020
; Validate file name length ; Validate file name length
; XXX check for directory! ; XXX check for directory!
@@ -131,6 +130,9 @@ fs_hvsr_read_dir:
sta SD_DIRENT+$82 sta SD_DIRENT+$82
sta SD_DIRENT+$83 sta SD_DIRENT+$83
ldx SD_DIRENT+$40 ; make sure file name is terminated by 0
sta SD_DIRENT, x
ldx #$04 ; XXX put correct amount of spaces instead ldx #$04 ; XXX put correct amount of spaces instead
lda #' ' lda #' '
sta SD_DIRENT+$80, x sta SD_DIRENT+$80, x
@@ -148,9 +150,7 @@ fs_hvsr_read_dir:
iny iny
lda SD_DIRENT, y lda SD_DIRENT, y
sta SD_DIRENT+$80,x sta SD_DIRENT+$80,x
bne @lp2 bne @lp2
inx
lda #$22 ; closing quote lda #$22 ; closing quote
sta SD_DIRENT+$80, x sta SD_DIRENT+$80, x
@@ -214,7 +214,7 @@ fs_hvsr_read_dir_blocksfree:
; Close the directory within the hypervisor XXX maybe move it to close routine ; Close the directory within the hypervisor XXX maybe move it to close routine
ldx SD_DIR_DESC ldx SD_DIR_DESC
lda #$14 ; dos_closedir lda #$16 ; dos_closedir
sta HTRAP00 sta HTRAP00
+nop +nop