Skip to content

Commit

Permalink
fix dirent field lengths and setting of LFN name length.
Browse files Browse the repository at this point in the history
  • Loading branch information
gardners committed Dec 27, 2015
1 parent db6b6f4 commit 481656c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kickstart.a65
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,7 @@ dos_opendir_entry:
; Current long filename (max 64 bytes)
dos_dirent_longfilename:
.byte "Venezualen casaba melon productio"
.byte "n statistics (2012-2015).txt "
.byte "n statistics (2012-2015).txt "
.byte 0
dos_dirent_longfilename_length:
.byte 0
Expand Down
9 changes: 8 additions & 1 deletion kickstart_dos.a65
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,7 @@ drce_next_piece:
drce2: lda (<dos_scratch_vector),y
beq drce_eot_in_filename
sta dos_dirent_longfilename,x
stx dos_dirent_longfilename_length
inx
; protect against over-long LFNs
cpx #$40
Expand All @@ -1278,6 +1279,7 @@ drce2: lda (<dos_scratch_vector),y
drce3: lda (<dos_scratch_vector),y
beq drce_eot_in_filename
sta dos_dirent_longfilename,x
stx dos_dirent_longfilename_length
inx
; protect against over-long LFNs
cpx #$40
Expand All @@ -1293,6 +1295,7 @@ drce3: lda (<dos_scratch_vector),y
drce4: lda (<dos_scratch_vector),y
beq drce_eot_in_filename
sta dos_dirent_longfilename,x
stx dos_dirent_longfilename_length
inx
; protect against over-long LFNs
cpx #$40
Expand All @@ -1312,6 +1315,7 @@ drce_eot_in_filename:
; null terminate if there is space, for convenience
lda #$00
sta dos_dirent_longfilename,x
stx dos_dirent_longfilename_length
drce_eot_in_filename2:

drce_piece_didnt_grow_name_length:
Expand Down Expand Up @@ -1359,6 +1363,7 @@ drce5: lda (<dos_scratch_vector),y
ldx #$00
drce7: lda (<dos_scratch_vector),y
sta dos_dirent_longfilename,x
stx dos_dirent_longfilename_length
inx
iny
cmp #$20 ; space indicates end of short name before extension
Expand All @@ -1370,12 +1375,14 @@ drce_insert_dot:
dex
lda #'.
sta dos_dirent_longfilename,x
stx dos_dirent_longfilename_length
inx
; copy extension part
ldy #fs_fat32_dirent_offset_shortname+8
ldz #0
drce6: lda (<dos_scratch_vector),y
sta dos_dirent_longfilename,x
stx dos_dirent_longfilename_length
inx
iny
inz
Expand All @@ -1389,7 +1396,7 @@ drce6: lda (<dos_scratch_vector),y
drce_copied_extension:
; null terminate short name for convenience in our debugging
lda #$00
sta dos_dirent_longfilename,x
sta dos_dirent_longfilename,x
; record length of short name
stx dos_dirent_longfilename_length

Expand Down

0 comments on commit 481656c

Please sign in to comment.