prorwts2/readme.md
2018-08-27 21:10:10 -07:00

1.3 KiB

open/seek/read/write any binary file in ProDOS filesystem.
runs from any directory on floppy or hard disk.
searches the file system for the requested file, can even look inside subdirectories.
can simulate DOS 3.3 RWTS (including format) to allow disk images on the hard disk, and multiple sides in the same file.
can read sparse files, and read and write tree files

usage:

jsr init ;one-time call to unhook ProDOS, detect drive type, and relocate code if needed

;open and read bytes from a file without address override or writing enabled
lda #<file_to_read
sta namlo
lda #>file_to_read
sta namhi
lda #6 ;bytes
sta sizelo
lda #0
sta sizehi
jsr opendir ;open and read file into memory at its load address

;write to an open file with address override
lda #<file_to_write
sta namlo
lda #>file_to_write
sta namhi
lda #0
sta sizelo
lda #>bytes_to_write
sta sizehi
lda #<place_to_write
sta adrlo
lda #>place_to_write
sta adrhi
lda #cmdwrite
sta reqcmd
jsr rdwrpart ;write bytes from memory to specified load address


format of request name is Pascal-style (length, text):
e.g. !raw 5, "MYDIR" or !raw 6, "MYFILE" or !raw 14, "QKUMBAROXURSOX"