diff --git a/src/dos_m65/,aliases_dos.s b/src/dos_m65/,aliases_dos.s index 61f61fa3..3b6ec8de 100644 --- a/src/dos_m65/,aliases_dos.s +++ b/src/dos_m65/,aliases_dos.s @@ -11,7 +11,7 @@ ; Temporary storage locations ; - !addr FS_HVSR_DIRENT = $1000 + !addr MEM_BUF = $1000 ; buffer for hypervisor calls; starting at $1000 VIC sees chargen, so this should be a safe place ; diff --git a/src/dos_m65/filesystem_vfs/fs_vfs_nextdirentry.s b/src/dos_m65/filesystem_vfs/fs_vfs_nextdirentry.s index 9a855961..f459b304 100644 --- a/src/dos_m65/filesystem_vfs/fs_vfs_nextdirentry.s +++ b/src/dos_m65/filesystem_vfs/fs_vfs_nextdirentry.s @@ -6,7 +6,7 @@ ; Fills-in: PAR_FNAME, PAR_FTYPE, PAR_FSIZE_BYTES -; NOTE: overrides page pointed by FS_HVSR_DIRENT! +; NOTE: overrides page pointed by MEM_BUF! fs_vfs_nextdirentry: @@ -18,14 +18,14 @@ fs_vfs_nextdirentry: @lpclear: - sta FS_HVSR_DIRENT, x + sta MEM_BUF, x inx bne @lpclear ; Ask the hypervisor to read the next dirent structure ldx SD_DESC ; directory descriptor XXX rename to FS_HVSR_DESC - ldy #>FS_HVSR_DIRENT ; target page number + ldy #>MEM_BUF ; target page number lda #$14 ; dos_readdir sta HTRAP00 @@ -44,7 +44,7 @@ fs_vfs_nextdirentry: ; Preprocess/validate the filename ; - ldx FS_HVSR_DIRENT+$40 ; file name length + ldx MEM_BUF+$40 ; file name length beq fs_vfs_nextdirentry ; do not even try for empty file name cpx #20 bcs fs_vfs_nextdirentry ; if longer than 16 characters + dot + extension - also skip this one @@ -52,7 +52,7 @@ fs_vfs_nextdirentry: @lpname: - lda FS_HVSR_DIRENT,x + lda MEM_BUF,x cmp #$22 beq fs_vfs_nextdirentry ; quotation mark is illegal cmp #$2A @@ -79,7 +79,7 @@ fs_vfs_nextdirentry: @lpname_store_next: - sta FS_HVSR_DIRENT,x ; use this when file name has to be adapted + sta MEM_BUF,x ; use this when file name has to be adapted @lpname_next: @@ -90,7 +90,7 @@ fs_vfs_nextdirentry: ; Determine type (file/directory) ; - lda FS_HVSR_DIRENT+$56 + lda MEM_BUF+$56 tax and #$FE beq @entity_file ; workaround for older hypervisors @@ -106,7 +106,7 @@ fs_vfs_nextdirentry: ; Once again validate the name length, with more precise information - lda FS_HVSR_DIRENT+$40 + lda MEM_BUF+$40 cmp #$11 bcs fs_vfs_nextdirentry ; skip entry if file name longer than 16 characters @@ -119,17 +119,17 @@ fs_vfs_nextdirentry: ; Once again validate the name length, with more precise information - lda FS_HVSR_DIRENT+$40 + lda MEM_BUF+$40 sec sbc #$04 ; strip 4 bytes - for dot and extension bmi fs_vfs_nextdirentry ; if name too short, try next entry beq fs_vfs_nextdirentry ; if name too short, try next entry - sta FS_HVSR_DIRENT+$40 ; store corrected file name length + sta MEM_BUF+$40 ; store corrected file name length tax ; Make sure there is a dot marking the start of a 3-byte extension - lda FS_HVSR_DIRENT, x + lda MEM_BUF, x cmp #$2E +bne fs_vfs_nextdirentry @@ -142,15 +142,15 @@ fs_vfs_nextdirentry: @lpext: - lda FS_HVSR_DIRENT+0, x + lda MEM_BUF+0, x cmp dir_types+0, y bne @lpext_next - lda FS_HVSR_DIRENT+1, x + lda MEM_BUF+1, x cmp dir_types+1, y bne @lpext_next - lda FS_HVSR_DIRENT+2, x + lda MEM_BUF+2, x cmp dir_types+2, y beq @lpext_found @@ -185,7 +185,7 @@ fs_vfs_nextdirentry: ora #$80 ; mark the file as closed, FAT32 does not have a 'not closed' attribute sta PAR_FTYPE - lda FS_HVSR_DIRENT+$56 ; also apply read-only attribute from FAT32 + lda MEM_BUF+$56 ; also apply read-only attribute from FAT32 and #$01 beq @copy_size @@ -201,7 +201,7 @@ fs_vfs_nextdirentry: @lpsize: - lda FS_HVSR_DIRENT+$52,x ; copy file size in byytes + lda MEM_BUF+$52,x ; copy file size in byytes sta PAR_FSIZE_BYTES,x dex bpl @lpsize @@ -215,9 +215,9 @@ fs_vfs_nextdirentry: @lpname_cpy: - cpx FS_HVSR_DIRENT+$40 + cpx MEM_BUF+$40 bcs @lpname_fill - lda FS_HVSR_DIRENT, x + lda MEM_BUF, x @lpname_fill: diff --git a/src/dos_m65/filesystem_vfs/fs_vfs_nextfileblock.s b/src/dos_m65/filesystem_vfs/fs_vfs_nextfileblock.s index d804f8e3..e700a6c7 100644 --- a/src/dos_m65/filesystem_vfs/fs_vfs_nextfileblock.s +++ b/src/dos_m65/filesystem_vfs/fs_vfs_nextfileblock.s @@ -66,7 +66,7 @@ fs_vfs_nextfileblock: fs_vfs_file_not_found: - jsr util_shadow_restore ; restore $1000 memory content + jsr util_shadow_restore ; restore MEM_BUF memory content ldx SD_DESC lda #$16 ; dos_closedir diff --git a/src/dos_m65/filesystem_vfs/fs_vfs_read_dir.s b/src/dos_m65/filesystem_vfs/fs_vfs_read_dir.s index ad99c314..7cba036f 100644 --- a/src/dos_m65/filesystem_vfs/fs_vfs_read_dir.s +++ b/src/dos_m65/filesystem_vfs/fs_vfs_read_dir.s @@ -46,8 +46,7 @@ fs_vfs_read_dir_open: fs_vfs_read_dir: - ; Read dirent structure into $1000, process it, restore the memory content. - ; Starting at $1000 VIC sees chargen, so this should be a safe place + ; Read dirent structure into MEM_BUF, process it, restore the memory content. jsr util_shadow jsr fs_vfs_nextdirentry diff --git a/src/dos_m65/filesystem_vfs/fs_vfs_read_file.s b/src/dos_m65/filesystem_vfs/fs_vfs_read_file.s index 8e7a07c8..7c019a68 100644 --- a/src/dos_m65/filesystem_vfs/fs_vfs_read_file.s +++ b/src/dos_m65/filesystem_vfs/fs_vfs_read_file.s @@ -25,8 +25,7 @@ fs_vfs_read_file_open: ; XXX deduplicate part above with opening directory - ; Read dirent structures into $1000, find the first matching file - ; Starting at $1000 VIC sees chargen, so this should be a safe place + ; Read dirent structures into MEM_BUF, find the first matching file jsr util_shadow @@ -49,7 +48,7 @@ fs_vfs_read_file_open: ; Found the file - load it - jsr util_shadow_restore ; restore $1000 memory content + jsr util_shadow_restore ; restore MEM_BUF memory content lda #$18 ; dos_openfile sta HTRAP00 diff --git a/src/dos_m65/unit_ramdisk/unit_rd_preload.s b/src/dos_m65/unit_ramdisk/unit_rd_preload.s index b62a57e3..f1699990 100644 --- a/src/dos_m65/unit_ramdisk/unit_rd_preload.s +++ b/src/dos_m65/unit_ramdisk/unit_rd_preload.s @@ -26,11 +26,11 @@ unit_rd_preload: @lp1: inx lda ramdisk_filename, x - sta $1000, x + sta MEM_BUF, x bne @lp1 - ldy #>$1000 - ldx #<$1000 + ldy #>MEM_BUF + ldx #