started work on file size handling in CBDOS
This commit is contained in:
1 parent
18d7434668
commit
9d082366ab
3 files changed
+29
-11
No files matched your search
@@ -65,8 +65,8 @@ SRCDIR_DOS_M65 = $(SRCDIR_COMMON) \
|
||||
src/dos_m65/assets \
|
||||
src/dos_m65/dev_floppy \
|
||||
src/dos_m65/dev_ramdisk \
|
||||
src/dos_m65/dev_sdcard
|
||||
|
||||
src/dos_m65/dev_sdcard \
|
||||
src/dos_m65/utils
|
||||
|
||||
SRCDIR_MON_M65 = $(SRCDIR_COMMON) \
|
||||
src/mon_m65
|
||||
|
||||
@@ -69,13 +69,8 @@ fs_hvsr_read_dir:
|
||||
; Dirent structure - important fields:
|
||||
; - $00-$3F - file name
|
||||
; - $40 - file name length
|
||||
; - $51-$54 - file length
|
||||
; - $55-$56 - file type ($10 = dir, $20 = regular) and attributes ($01 for read-only)
|
||||
|
||||
; Drop some strange (unknown) file types
|
||||
|
||||
lda SD_DIRENT+$55
|
||||
bne fs_hvsr_read_dir
|
||||
; - $52-$55 - file length
|
||||
; - $56-$57 - file type ($10 = dir, $20 = regular) and attributes ($01 for read-only)
|
||||
|
||||
; Retrieve read-only status, store mark in SD_DIRENT+$FE
|
||||
|
||||
@@ -216,14 +211,28 @@ fs_hvsr_read_dir:
|
||||
lda #$01 ; link to the next line - dummy, will be regenerated by BASIC
|
||||
sta SD_DIRENT+$80
|
||||
sta SD_DIRENT+$81
|
||||
lda #$00 ; XXX calculate length in blocks instead
|
||||
|
||||
lda SD_DIRENT+$53 ; XXX calculate length in blocks instead
|
||||
sta SD_DIRENT+$82
|
||||
lda SD_DIRENT+$54
|
||||
sta SD_DIRENT+$83
|
||||
|
||||
bra @len_done ; XXX if size above 9999, force maximum possible length
|
||||
|
||||
@len_max:
|
||||
|
||||
lda #<9999
|
||||
sta SD_DIRENT+$82
|
||||
lda #>9999
|
||||
sta SD_DIRENT+$83
|
||||
|
||||
@len_done:
|
||||
|
||||
ldx SD_DIRENT+$40 ; make sure file name is terminated by 0
|
||||
lda #$00
|
||||
sta SD_DIRENT, x
|
||||
|
||||
ldx #$04 ; XXX put correct amount of spaces instead
|
||||
ldx #$04 ; XXX put correct amount of spaces depending on number size
|
||||
lda #' '
|
||||
sta SD_DIRENT+$80, x
|
||||
inx
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
; Adapt the file size for displaying in a directory list
|
||||
|
||||
|
||||
util_dir_filesize:
|
||||
|
||||
; XXX provide implementation
|
||||
|
||||
rts
|
||||
Reference in new issue
Block a user