diff --git a/src/,,config_mega65.s b/src/,,config_mega65.s index d9fadbe2..ce67ea29 100644 --- a/src/,,config_mega65.s +++ b/src/,,config_mega65.s @@ -69,7 +69,7 @@ ;; #CONFIG# KEYCMD_F10 "\5FL" ;; #CONFIG# KEYCMD_F11 "@29$" ;; #CONFIG# KEYCMD_F12 "\5FHF" -;; #CONFIG# KEYCMD_F13 "JOYCRSR 2" +;; #CONFIG# KEYCMD_F13 "@30$" ;; #CONFIG# KEYCMD_F14 "BOOTCPM" @@ -92,7 +92,7 @@ ;; #CONFIG# UNIT_SDCARD 28 ;; #CONFIG# UNIT_FLOPPY 29 -;; #CONFIG# UNIT_RAMDISK 0 ; do not change, ram disk is not implemented yet +;; #CONFIG# UNIT_RAMDISK 30 ; --- Debug options diff --git a/src/dos_m65/assets/dos_ramdisk_filename.s b/src/dos_m65/assets/dos_ramdisk_filename.s new file mode 100644 index 00000000..92a82aa7 --- /dev/null +++ b/src/dos_m65/assets/dos_ramdisk_filename.s @@ -0,0 +1,9 @@ + +; +; File name for the initial RAM disk +; + +ramdisk_filename: + + !pet "ramdisk.dnp" + !byte $00 diff --git a/src/dos_m65/unit_ramdisk/unit_rd_init.s b/src/dos_m65/unit_ramdisk/unit_rd_init.s index f12dd15c..0f798b3f 100644 --- a/src/dos_m65/unit_ramdisk/unit_rd_init.s +++ b/src/dos_m65/unit_ramdisk/unit_rd_init.s @@ -23,6 +23,46 @@ unit_rd_init: sta RD_STATUS_BUF,x bne @1 + ; End of initialization, now try to load the initial RAM disk; first set file name + + ldx #ramdisk_filename + + lda #$2E ; dos_setname + sta HTRAP00 + +nop + + ; Try to find the file + + jsr fs_vfs_direntmem_prepare + + ldy #>FS_HVSR_DIRENT ; XXX is it needed? + + lda #$30 ; dos_findfirst + sta HTRAP00 + +nop + + bcc @error_not_found ; branch if file not found XXX why it can't find the file? + + ; XXX load the file + + + + + lda #$20 ; dos_closefile + sta HTRAP00 + +nop + + jsr fs_vfs_direntmem_restore + ; End of initialization rts + + +@error_not_found: + + + ; XXX set information about file not found + + jmp fs_vfs_direntmem_restore