Skip to content

MFT Files

jjppof edited this page Jul 22, 2023 · 1 revision

So, quick summary with more detail (and I remembered that a hex editor is actually needed to deal with palettes): Load ROM up in a hex editor of your choice. Locate your file(s) in the MFT, which for a recap begins at $08680000, and find the pointer(s) for the files you want to extract. The pointer is MFT ID converted to hex makes it 0x146, multiplied by 4 = 0x518 + 0x08680000. If your file has a palette, you will want to extract the palette separately. The easy way of doing this is to just copy+paste the raw HEX into a new binary file, since palettes are uncompressed and TiledGGD can make use of it pretty easily for viewing purposes (and I imagine you'll want the palette for yourself as well). The palette's length varied depending on the bit-format of the graphic file, but will either be 0x80 (128) or 0x20 (32) bytes in length. Once you have extracted your palette, go back to your pointer in the MFT and add + 0x80 to the pointer (e.g. $08700000 would become $08700080) for 8-bit graphics, or else 0x20 for 4-bit graphics. Save your changes.

If you are not tweaking gs2mapcodecompressor's source code to make things easier: Change whatever map code file pointers you want to match the pointers of the graphic files you wish to extract. Save your changes.

Using the tool: Once saved, click+drag your ROM onto the compression tool. If a folder does not exist, it will automatically extract all MFT files within range, decompressed for your convenience. If the folder does exist, then it will compress everything in the folder back to the ROM; note that it only compresses to one format, so you may not get 1:1 byte size parity).

Using TiledGGD to view (i.e. to confirm you ripped it successfully, and also to fully determine graphic widths used): You will want to load your newly extracted graphic file + the palette as a separate file. Once you have done so, you can use the arrow keys on your keyboard to change width and height of whatever is displayed. You can also go to Image > Go to offset... (shortcut Ctrl+G) to start from later in the graphic file, since it is very common for one graphic file to contain multiple graphics). Keep experimenting until you figure out everything you want!

Clone this wiki locally