First post, by superfury
I just wonder how my sdfimg dynamic disk image format compares to other used formats used by other emulators(sparse disk image formats).
It uses a disk header with basic information on the disk image, one or more lookup tables (three level lookup tables to address up to 2TB, each lookup table representing 1024, 1024 and 4096 sector locations (The primary index of the primary table(1024 items) gives the location of the secondary table(1024 items), the secondary index gives the location of the tertiary table(4096 items), the tertiary index giving the location of the sector. A location of 0 means the sector or table isn't allocated yet. The location of the primary table is set in the image header when it's allocated. The final position of the last valid data allocated (512 bytes for a sector, 8KB for a table contains 1024 locations and 32KB for a table containing 4096 locations). A disk image without anything added yet only contains a header, with the end position(effective filesize to use in case of erroneous file size because of a failed fwrite) set to the size of the header and primary table location set to 0 to indicate no primary table exists yet (in the same fashion primary, secondary and tertiary table items work). Allocated data is allocated in whole blocks (512 bytes, 8KB and 32KB which by default is zeroed out until indexes are updated). Indexes are updated by locating the start of the table (calculated or taken from another lookup table or header(primary table) for the start location, adding 8 times the index to read(64-bit file index) and reading(when retrieving) or writing(when updating) the 64-bit value from/to the file.
Disk image header:
typedef struct
{
byte SIG[7]; //SFDIMG\0
uint_32 headersize; //The size of this header!
int_64 filesize; //The size of the dynamic image, in sectors.
word sectorsize; //The size of a sector (512)
int_64 firstlevellocation; //The location of the first level, in bytes!
int_64 currentsize; //The current file size, in bytes!
} DYNAMICIMAGE_HEADER; //Dynamic image .DAT header.
Anyone knows the other formats used by the other emulators and knows if the format used by my sfdimg disk structure is efficient?
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io