fatfs: show '..' directory entry always, even with hidden/system attributes

This commit is contained in:
Eugene Lozovoy
2025-05-23 19:43:48 +03:00
parent 9783178887
commit 1512e5860b

View File

@ -645,17 +645,30 @@ fatfs_directory_parse:
push ix ;
cp #e5 ; deleted entry?
jr z, .next ; ...
.handle_dot_dir:
cp '.' ; skip directory with name '.'
jr nz, 1f ; ...
jr nz, .handle_hidden_entries ; ...
ld a, (ix+DIR_Attr) ; ...
and #10 ; ... is directory?
jr z, .handle_hidden_entries ; ...
ld a, (ix+DIR_Name+1) ; ...
cp ' ' ; ...
jr nz, 1f ; ...
ld a, (ix+DIR_Attr) ; ...
and #10 ; ...
jr z, .next ; ...
.handle_dot_dot_dir:
cp '.' ; show '..' event if it have system or hidden attribute
jr nz, .handle_hidden_entries ; ...
ld a, (ix+DIR_Name+2) ; ...
cp ' ' ; ...
jr nz, .handle_hidden_entries ; ...
ld a, (ix+DIR_Attr) ; skip volume files
and #08 ; ...
jr nz, .next ; ...
1: ld a, (ix+DIR_Attr) ; skip hidden, system and volume files
jr .save_entry ;
.handle_hidden_entries:
ld a, (ix+DIR_Attr) ; skip hidden, system and volume files
and #0e ; ...
jr nz, .next ; ...
.save_entry:
pop hl ;
push hl ;
ld bc, 32 ; save this entry