RES Format (Boppin)
Format type | Archive |
---|---|
Max files | Unlimited |
File Allocation Table (FAT) | Beginning |
Filenames? | No |
Metadata? | None |
Supports compression? | Yes |
Supports encryption? | No |
Supports subdirectories? | No |
Hidden data? | Yes |
Games |
The Boppin RES Format is used by Boppin for storing game data. No filenames are saved, and files can be stored compressed or uncompressed.
File format
The offsets and sizes of each file are stored in the file header. If a file is compressed, the size stored in the header is of the compressed size, so this can be used to accurately extract data from the RES file itself.
Data type | Name | Description |
---|---|---|
UINT32LE | iOffset | Offset to the file at this index |
UINT32LE | iSize | Size of data stored in RES file |
If iOffset is 0xFFFFFFFF or iSize is zero, this "slot" is unused and doesn't point to a file, so it should be ignored.
This structure is repeated until a file offset plus its size points at or past the end of the RES file. (You could also keep reading until you reach the offset of the first file.)
To access a file, you must seek to its offset as given in the header. At this offset, read in a UINT32LE. This value is the compressed file size. If it matches the value given in the header, then the file is compressed. If the value doesn't match then the file is uncompressed (and these four bytes are actually the start of the file itself.)
If the file is compressed, read in another UINT32LE. This is the decompressed file size. The compressed data then follows.
Compression
The data is compressed using the LZSS algorithm. This still needs to be posted here, however the original Boppin programmer has released code for manipulating RES files and this code includes the LZSS algorithm - until the details are posted here, the code can be obtained easily enough (try asking on the PCKF)
The compression code also contains this header:
/************************************************************** LZSS.C -- A Data Compression Program (tab = 4 spaces) *************************************************************** 4/6/1989 Haruhiko Okumura Use, distribute, and modify this program freely. Please send me your improved versions. PC-VAN SCIENCE NIFTY-Serve PAF01022 CompuServe 74050,1022 **************************************************************/
Filenames
Since the RES format doesn't store any filenames, these would normally have to be automatically generated (e.g. file0001.bin, file0002.bin, etc.) Since the Boppin programmer has released some source code however, the original filenames can be obtained from there:
char *boppin_res[] = { "boppin.cfg", "candy.img", "candy.txb", "boppin.snd", "boppin.mus", "score.cfg", "walls.res", "floors.res", "elevator.til", "source.til", "bopping.til", "bckgnd.til", "prize.til", "monster.til", "misc.til", "char.til", "boppin.lvl", // doesn't seem to be boppin.lvl "<unknown>", "<unknown>", "<unknown>", // boppin.lvl seems to be here instead "<unknown>", "<unknown>", "<unknown>", "<unknown>", "endscrn.bin", "", "" }; char *boppin_mus[] = { "bopbop2.mid", "magnetic.mid", "frustrat.mid", "sapphire.mid", "opus43.mid", "foundat.mid", "feltibun.mid", "stumbum.mid", "starbop.mid", "bumble.mid", "skeptica.mid", "stabhapp.mid", "streets.mid", "dixie.mid", "lobero.mid", "apogee.mid" }; char *boppin_snd[] = { "addcred.voc", "addlife.voc", "blkbnc1.voc", "blkbnc2.voc", "blkdrp.voc", "blockpsh.voc", "blockrez.voc", "bodythud.voc", "boikrez1.voc", "boikrez2.voc", "boikrez3.voc", "boiksui1.voc", "boiksui2.voc", "yeetrez1.voc", "yeetrez3.voc", "yeetsui1.voc", "yeetsu1a.voc", "yeetsui2.voc", "bonustim.voc", "bonustly.voc", "bophit.voc", "crying.voc", "ducking.voc", "elevator.voc", "explosn.voc", "foottap.voc", "jumpjoy.voc", "logo.voc", "logo2.voc", "logo3.voc", "ping.voc", "prizdrop.voc", "prize.voc", "prizelos.voc", "ptrnflsh.voc", "ptrnhit.voc", "refractr.voc", "walking.voc", "noteman.voc", "echotink.voc", "beefbras.voc", "cleanbas.voc", "deepbass.voc", "flickbas.voc", "jahrmark.voc", "licks.voc", "marimba.voc", "nightmar.voc", "piano.voc", "shaker.voc", "softtp12.voc", "strings1.voc", "synbuz.voc", "unknown.voc", "unknown2.voc" };
Tools
The following tools are able to work with files in this format.
Name | Platform | Extract files? | Decompress on extract? | Create new? | Modify? | Compress on insert? | Access hidden data? | Edit metadata? | Notes |
---|---|---|---|---|---|---|---|---|---|
Camoto | Linux/Windows | No | N/A | No | No | N/A | No | N/A | |
Wombat | Windows | Yes | N/A | No | No | N/A | No | N/A |
Credits
This file format was discovered thanks to Stephen P. Lepisto, the original Boppin' programmer, supplying source code for the programs used in development to create the official .RES files. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)