Here a few commands which will help you get the most out of your USB drive for programming on the C64mini. (You may not yet have THEC64).
USB access (firmware as at April 2018).
The USB must be in FAT32 format.
The .d64 image on the USB needs the name: THEC64-drive8.d64
If you have an existing .d64 image from elsewhere, make a copy on your USB and then rename it to THEC64-drive8.d64 before inserting the USB into the C64 mini.
Load and Save
This is just like on the old C64. See C64mini load. See also C64mini BASIC tips.
Note that if you type LOAD”$”,8 to find out what is on your USB drive, you will lose the current BASIC program contents. So always save first!
Customising your .d64 image (e.g. your programming work)
It is possible to alter the contents of this disk image through the C64 mini, and save your own programs back to the USB. This can be done using the normal LOAD “FILENAME”,8 and SAVE “FILENAME”,8 commands. See C64minihelp.
However, if you wish to delete or re-save files on your D64 image, then you will find the instructions below.
You will need to open an I/O file stream for the disk drive then pass the “S:” command (scratch) to delete a file on the .d64 image.
For the reference for file I/O commands on the C64, you can refer to the original Programmers Reference Manual. The information needed is in the Input Output Chapter. You can also find information about C64 commands at the C64 Wiki Page.
The basic syntax is OPEN #file, #device, protocol.
File: 1 will work(*). Device: disk drive is 8. Protocol: channel 15 will work for sending commands.
Putting that altogether, this is how you delete a file from the current D64 disk image on the USB:
If you wish to initialise the drive as well, you can send the initialise command:
(*) For those interested in what is under the hood, the Open command is parsed by BASIC and then implements the kernal OPEN routine, but not before it calls the SETLFS kernal routine to store the data temporarily, using the 3 parameters for LDA,LDX,LDY respectively (see kernel info).
Saving a file that already exists on the drive will not produce a visible error, but it will not do anything.
It is possible to delete it, as described above, then save it with your filename.