fix for ram disk file name
This commit is contained in:
1 parent
f7ff71f6cd
commit
394aa80b49
6 files changed
+49
-39
No files matched your search
@@ -177,7 +177,7 @@
|
||||
|
||||
; Memory shadow, needed for SD card support
|
||||
|
||||
!addr SD_MEMSHADOW_BUF = $A800 ; 256 byte buffer for preserving original memory content
|
||||
!addr MEMSHADOW_BUF = $A800 ; 256 byte buffer for preserving original memory content
|
||||
|
||||
; Command/filename buffers, 256 bytes each
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ fs_vfs_nextfileblock:
|
||||
|
||||
fs_vfs_file_not_found:
|
||||
|
||||
jsr fs_vfs_direntmem_restore ; restore $1000 memory content
|
||||
jsr util_shadow_restore ; restore $1000 memory content
|
||||
|
||||
ldx SD_DESC
|
||||
lda #$16 ; dos_closedir
|
||||
|
||||
@@ -49,9 +49,9 @@ 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
|
||||
|
||||
jsr fs_vfs_direntmem_prepare
|
||||
jsr util_shadow
|
||||
jsr fs_vfs_nextdirentry
|
||||
jsr fs_vfs_direntmem_restore ; processor status is preserved
|
||||
jsr util_shadow_restore ; processor status is preserved
|
||||
|
||||
; If nothing to read, output 'blocks free'
|
||||
|
||||
@@ -112,34 +112,3 @@ fs_vfs_read_dir_blocksfree:
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
;
|
||||
; Helper routines
|
||||
;
|
||||
|
||||
fs_vfs_direntmem_prepare:
|
||||
|
||||
ldx #$00
|
||||
@1:
|
||||
ldy $1000, x
|
||||
sty SD_MEMSHADOW_BUF, x
|
||||
inx
|
||||
bne @1
|
||||
|
||||
rts
|
||||
|
||||
fs_vfs_direntmem_restore:
|
||||
|
||||
php
|
||||
|
||||
ldx #$00
|
||||
@1:
|
||||
ldy SD_MEMSHADOW_BUF, x
|
||||
sty $1000, x
|
||||
inx
|
||||
bne @1
|
||||
|
||||
bne @1
|
||||
|
||||
plp
|
||||
rts
|
||||
@@ -28,7 +28,7 @@ fs_vfs_read_file_open:
|
||||
; Read dirent structures into $1000, find the first matching file
|
||||
; Starting at $1000 VIC sees chargen, so this should be a safe place
|
||||
|
||||
jsr fs_vfs_direntmem_prepare
|
||||
jsr util_shadow
|
||||
|
||||
@lp_find:
|
||||
|
||||
@@ -49,7 +49,7 @@ fs_vfs_read_file_open:
|
||||
|
||||
; Found the file - load it
|
||||
|
||||
jsr fs_vfs_direntmem_restore ; restore $1000 memory content
|
||||
jsr util_shadow_restore ; restore $1000 memory content
|
||||
|
||||
lda #$18 ; dos_openfile
|
||||
sta HTRAP00
|
||||
|
||||
@@ -21,11 +21,21 @@ unit_rd_preload:
|
||||
|
||||
; Set file name
|
||||
|
||||
ldy #>ramdisk_filename
|
||||
ldx #<ramdisk_filename
|
||||
jsr util_shadow
|
||||
ldx #$FF
|
||||
@lp1:
|
||||
inx
|
||||
lda ramdisk_filename, x
|
||||
sta $1000, x
|
||||
bne @lp1
|
||||
|
||||
ldy #>$1000
|
||||
ldx #<$1000
|
||||
lda #$2E ; dos_setname
|
||||
sta HTRAP00
|
||||
+nop
|
||||
jsr util_shadow_restore
|
||||
|
||||
+bcc @error_not_found ; branch if error
|
||||
|
||||
; Try to find the file
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
; Handling shadow memory, preserves .P
|
||||
|
||||
|
||||
|
||||
util_shadow:
|
||||
|
||||
ldx #$00
|
||||
@1:
|
||||
ldy $1000, x
|
||||
sty MEMSHADOW_BUF, x
|
||||
inx
|
||||
bne @1
|
||||
|
||||
rts
|
||||
|
||||
util_shadow_restore:
|
||||
|
||||
php
|
||||
|
||||
ldx #$00
|
||||
@1:
|
||||
ldy MEMSHADOW_BUF, x
|
||||
sty $1000, x
|
||||
inx
|
||||
bne @1
|
||||
|
||||
bne @1
|
||||
|
||||
plp
|
||||
rts
|
||||
Reference in new issue
Block a user