Home ] Up ] 

FS3 Files, What Are They?

 

FS3 is a format I've come up with which blends the FBJ into a FS2 file, essentially protecting the file from "loosing" it's properties when being transferred from user to user. Or from when you just want a spare copy of the patch. Because the idea was to actually give a UnDo action to resetting the entire patch back to a state it was in before you started editing it. At least back to the last time you created an FS3 from it. This document will attempt to show how the FS3 file looks on the hard drive, and the different ways it can look on the hard drive.

Type fishfilehead
    fType       As String * 4   ' always should be "FS3 "
    fCount      As Word         ' total number of shapes in file
    fMultiPart  As Word         ' number of sections in file
    fCheckSum   As Dword        ' checksum of file - checksum bytes
    fFileSize   As Dword        ' size of file on disk
End Type
For those who are C/C++ purists, and you know who you are, this is being shown in Basic Language conventions because the program is being written in PowerBASIC, which, to me, is like C++ on steroids. I've seen enough VB samples to understand VB, however, a reading of the features which PB, (that link above), shows me that VB offers more raw horsepower for the programmer.

fType is the "filetype", which should be something I think that should exist in every binary mode file because it's an additional check on what the file is. Filetype is a nightmare of a system, so many files which SHOULD have a filetype ignore it completely, and many times, those are the mystery files we're really interested in. (enough ranting)

fCount is the count of the number patches, or sections, in the file. This would include every instance of ITEM or ITEM2 and so on. Seeing as each section gets date stamped, you can pick out which "ITEM" (bad pun) you want to check out based on the date, or you can view the whole thing in one swoop. Well, sortof, more about that as the program develops, we may be talking about taking a serious resource hit trying that, we'll see.

fMultiPart is the number of sections in the archive, this is still undeveloped.

fCheckSum is a checksum of the file which is generated from offset 16 to the end of the file. The reason for starting from offset 16 is that you shouldn't try to include the disk space of the checksum in the checksum. Oh there's a way to do it, but I didn't think it necessary to complicate the code. The checksum is a 4 byte addition of every 4 bytes in the file. There is no accounting for what is called "rollover" in the checksum, if the addition exceeds the size of the 4 bytes used to hold the checksum, it is ignored. Might have to reconsider having the checksum if this operation bogs the program too much when the files get bigger.

fFileSize is the actual size of the file image on the disk, that's all.

Type fishfishname
    vFileName   As String * 14  ' Should work for most
    vCount      As Word         ' Number of shapes in section
    vSaveDate   As Quad         ' Date/Time section was stored
    vOffSet     As Dword        ' absolute location of next section
    vLocation   As Dword        ' absolute location of headers in file
End Type