Skip to content

Commit f2f391f

Browse files
authored
Merge pull request #6 from wildbitscomputing/feat/fat32-dir-flags
feat: chdir/getcwd + FAT32 directory flags
2 parents b29b971 + 7f1b08d commit f2f391f

7 files changed

Lines changed: 486 additions & 15 deletions

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,6 @@ fat32.bin: fat32
9393

9494
run: jr.bin
9595
foenixmgr binary jr.bin --address 0x10000
96+
97+
flash: jr.bin
98+
foenixmgr flash-bulk update.csv

f256/fat32.asm

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -868,14 +868,13 @@ _done tya
868868

869869
copy_details
870870

871-
; Mount the source
871+
; Mount the source at dirent.attributes (name + $100)
872872
lda fat.dirent+0
873-
clc
874-
adc #5 ; attrs(1) + start(4)
875873
sta kernel.src+0
876874
lda fat.dirent+1
877-
adc #1 ; skip the name
878-
adc #$60 ; $2k there, $8k here.
875+
inc a ; skip the 256-byte name
876+
clc
877+
adc #$60 ; $2k there, $8k here.
879878
sta kernel.src+1
880879

881880
; Mount the dest
@@ -888,7 +887,22 @@ copy_details
888887
; the event queue needs access to user RAM.
889888
lda #7 ; fat32 ram block
890889
sta mmu+4
891-
890+
891+
; Read FAT32 attributes byte and store in event flags
892+
phy
893+
ldy #0
894+
lda (kernel.src),y ; dirent.attributes
895+
ply
896+
sta kernel.event.entry.directory.file.flags,y
897+
898+
; Advance source to size field: skip attrs(1) + start(4)
899+
lda kernel.src+0
900+
clc
901+
adc #5
902+
sta kernel.src+0
903+
bcc +
904+
inc kernel.src+1
905+
+
892906
; Round up the size
893907
phy
894908
ldy #0

fat32/fat32.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,6 +2107,8 @@ fat32_read_dirent_filtered:
21072107
clc
21082108
rts
21092109

2110+
2111+
21102112
;-----------------------------------------------------------------------------
21112113
; fat32_chdir
21122114
;

kernel/api.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Yield .fill 4 ; Give unused time to the kernel.
2121
Putch .fill 4 ; deprecated
2222
RunBlock .fill 4 ; Chain to resident program by block ID.
2323
RunNamed .fill 4 ; Chain to resident program by name.
24-
.fill 4 ; reserved
24+
Chdir .fill 4 ; Change/get current working directory.
2525

2626
BlockDevice .namespace
2727
List .fill 4 ; Returns a bit-set of available block-accessible devices.

0 commit comments

Comments
 (0)