initial work towards reading SD card directory
This commit is contained in:
1 parent
67e9be4372
commit
906ec22834
3 files changed
+41
-2
No files matched your search
@@ -28,6 +28,15 @@ dev_sd_cmd_OPEN_EOI:
|
|||||||
|
|
||||||
dev_sd_cmd_OPEN_dir:
|
dev_sd_cmd_OPEN_dir:
|
||||||
|
|
||||||
|
; XXX
|
||||||
|
|
||||||
|
; .X = file descriptor
|
||||||
|
; .Y = page of memory for output
|
||||||
|
|
||||||
|
; lda #$11 ; dos_opendir
|
||||||
|
; sta HTRAP00
|
||||||
|
; +nop
|
||||||
|
|
||||||
; Reset status to OK
|
; Reset status to OK
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
|
|||||||
@@ -15,6 +15,20 @@ dev_sd_cmd_READ:
|
|||||||
sec ; mark EOI
|
sec ; mark EOI
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
dev_sd_cmd_READ_dir:
|
||||||
|
|
||||||
|
; Dirent structure:
|
||||||
|
; - 4 bytes - inode
|
||||||
|
; - 2 bytes - ('off' - not sure what's this)
|
||||||
|
; - 4 bytes - ('reclen' - is it file size?)
|
||||||
|
; - 2 bytes - type
|
||||||
|
|
||||||
|
; .X = file descriptor
|
||||||
|
; .Y = page of memory for output
|
||||||
|
|
||||||
|
; lda #$12 ; dos_readdir
|
||||||
|
; sta HTRAP00
|
||||||
|
; +nop
|
||||||
|
|
||||||
dev_sd_cmd_READ_dir_blocksfree:
|
dev_sd_cmd_READ_dir_blocksfree:
|
||||||
|
|
||||||
@@ -32,8 +46,14 @@ dev_sd_cmd_READ_dir_blocksfree:
|
|||||||
|
|
||||||
; Mark end of directory
|
; Mark end of directory
|
||||||
|
|
||||||
lda #$FF
|
lda #$00
|
||||||
sta SD_DIR_PHASE
|
sta SD_DIR_PHASE
|
||||||
|
|
||||||
|
; .X = file descriptor
|
||||||
|
|
||||||
|
; lda #$13 ; dos_closedir
|
||||||
|
; sta HTRAP00
|
||||||
|
; +nop
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
dev_sd_init:
|
dev_sd_init:
|
||||||
|
|
||||||
; Copy status string
|
; Copy initial status string
|
||||||
|
|
||||||
ldx #$00
|
ldx #$00
|
||||||
stx SD_STATUS_IDX
|
stx SD_STATUS_IDX
|
||||||
@@ -23,6 +23,16 @@ dev_sd_init:
|
|||||||
sta SD_STATUS_STR,x
|
sta SD_STATUS_STR,x
|
||||||
bne @1
|
bne @1
|
||||||
|
|
||||||
|
; Close all the files in the hypervisor, go to root directory
|
||||||
|
|
||||||
|
lda #$22 ; dos_closeall
|
||||||
|
sta HTRAP00
|
||||||
|
+nop
|
||||||
|
|
||||||
|
lda #$36 ; dos_cdrootdir
|
||||||
|
sta HTRAP00
|
||||||
|
+nop
|
||||||
|
|
||||||
; End of initialization
|
; End of initialization
|
||||||
|
|
||||||
rts
|
rts
|
||||||
Reference in new issue
Block a user