*** P00/S00/U00/R00 (PC64-native files) *** Document revision 1.1 These files were created for use in the PC64 emulator, written by Wolfgang Lorenz. Each one has the same layout with the filetype being stored in the DOS extension (i.e. Pxx is a PRG, Sxx is a SEQ, Uxx is a USR and Rxx is a relative file), and the header is only 26 bytes long. This is a dump of a Pxx file (PRG)... 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ASCII ----------------------------------------------- ---------------- 0000: 43 36 34 46 69 6C 65 00 43 52 49 53 49 53 20 4D C64File.CRISIS.M 0010: 4F 55 4E 54 41 49 4E 00 00 00 .. .. .. .. .. .. OUNTAIN......... Bytes: $00-06: ASCII string "C64File" 07: Always $00 08-17: Filename in PETASCII, padded with $00 (not $A0, like a D64) 18: Always $00 19: REL file record size ($00 if not a REL file) 1A-??: Program data The 'xx' in the extension of the file is usually 00, except when we have two DOS filenames which would be the same, but the C64 filenames are different! If we have two C64 filenames which are the same, they *cannot* co-exist in the same directory. If we have two files which do convert down to be the same DOS filename, the extension is incremented until an unused one is found (P01, P02, P03, etc). We can have up to 99 different C64 files with the same corresponding DOS names as that's all the extension will hold (from P00 to P99). Each PC64 file only has one entry, there are no multi-file archives allowed. This could result in a large number of these files in a directory, even for only a few programs, as each C64 file will result in a PC64 file entry. The best use for a PC64 file is a single-file program, one which does not load anything else. The DOS filename is generated by an algorithm used inside PC64 when a file needs to be created. It compresses the 16-byte name down to one that fits the DOS 8 character size limitation. One thing which most people might not know is you *musn't* rename the P/S/R/U DOS files. If you do, PC64 won't be able to load them. When PC64 goes searching for files, it takes the 16-byte C64 filename, does its magic to reduce it to 8.3, then looks to see which DOS files match. Remember, there could be several files with the same 8 character name, but the extensions will be P00, P01, P02 etc. If it can't find the 16-byte C64 filename in amongst those that match, it will report a "File not found". I've tried this with the DOS version (PC64 1.20) and it does report an error locating the file, both in the File Manager and the 64 emulator window. --------------------------------------------------------------------------- What it takes to support PC64 files: The biggest benefit to this format is that the layout and usage is fairly simple to implement. With a consistent 26-byte header and a signature, there's very little difficulty in working with them. Also, PC64 files perform best when used on single-file games as they have *no* wasted space. One good design aspect of PC64 files is how REL files are supported. LNX, D64 and ARK all require storage of the side sectors, either preceeding or following the file. R00 does not need to store these, making it more efficient. The biggest drawback to this format is when converting small C64 files (those of only a few sectors), you could waste hard disk space due to a large DOS "slack" area. When DOS stores files of any size, each one takes up a minimum of one cluster, which on small drives may only be 2 kb/cluster, but on vary large disks could be as high as 32 or 64 kb per cluster. An emulator file which is only a few Kb would, on the large disks, only use a small portion of the total cluster, and thus a lot of wasted DOS storage space results. Note, this also applies to normal DOS files as well! Another drawback (not obvious right away) is since some games are made up of a large number of files or varying sizes, it would be best to store each game in a different sub-directory. If you don't, then you might not be sure what files belong to what programs, and if you ever want to give a program to someone else, there would be difficulties re-assembling the program. This makes file management much more user intensive. The D64 format seems to be the best one for multi-file games. The last negative is that GEOS files cannot be put into the P00 format. They must reside on a native D64 disk in order to work. --------------------------------------------------------------------------- Overall Good/Bad of PC64 Files: Good ---- * Has a 16 character filename * Filetype is available in the DOS file extension * Can easily calculate the file size of the C64 file from the DOS file size (DOS size - 26) * Supports 1541 REL files (R00) * Does not need the side sector info for REL support, like LNX and ARK do. * A very simple, easy to support file header * Can have multiple C64 files with the same name in a DOS directory since the file extension will simply change slightly * Due to each P00 being a separate DOS file, the emulators can easily rewrite any P00 file they need to. This can be useful for debugging/cracking etc. This is only an emulator side effect, but its useful Bad --- * Filenames are padded with $00, not the standard $A0 character * No directory customization, as each PC64 file only holds one C64 file * Since the filetype is the DOS extension, no special attribute bits or non-standard file types (DEL) are kept * Depending on the PC64 filesize and the DOS hard disk cluster size, there could be significant cluster slack-space loss, especially noticible with many P00 files * Unless the user keeps the P00 files organized, you can end up with a mass of confusing files in one directory. File management is crucial to keeping a good archive. It is best to keep each multi-file program in separate directories. Each directory entry also takes up space. * Not as widely supported as D64 or T64 * No GEOS file structure support * No labels/description field in the file header * No multi-file support (as it wasn't designed to do this) * Each file contains a separate C64 name, and in order to get a list of all the real C64 names, *each* file must be read individually to get this * Can't rename the DOS P00 file since PC64 depends on the filename being an algorithmic reduction of the C64 filename. Changing it likely will likely render the file useless to PC64 * No 00's allowed in filenames(?) * I don't think PC64/WIN supports the original PC64/DOS files