Dolphin, the GameCube and Wii emulator - Forums

Full Version: [SOLVED] Weird BMP format used in files inside Gamecube game.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Dashman

Hi people.

We're still working on hacking Super Robot Wars GC and the time has come for doing the graphics. So far we've succeeded in extracting the contents of SP and SPR files, which contain character portraits and backgrounds. The next in line are some files that contain "BMP" at the beginning of their header, but are not any of the classic .bmp files. We're naming them BM files for now. Here's what we've guessed so far about their format:

Header (32 bytes), big endian values:

bytes 0 - 2: "BMP".
byte 3: unknown (type?). either 06 or 09.
bytes 4 - 7: number of colours (?)
bytes 8 - 11: height.
bytes 12 - 15: width.
bytes 16 - 31: all zeroes.

The rest of the file would be the image data, but looking at it using crystaltile reveals garbage no matter the mode used.

Here are some examples of these files:

https://www.dropbox.com/sh/ieiibbxvef61v...VftPM414va

* Some files (0018.BM in the folder) have byte 3 set to 07 and both height and width set to 0. These could be palette files.

* There's other files (0007.BM in the folder) whose byte 3 is set to 0a. The size in the bitmap data of these files is not height * width unless we assume 6bpp, which is a pretty unusual colour format (at least for me).


Now, the reason I'm posting all this here is because it's been suggested that this is one of the texture formats that Dolphin supports. We've been pointed towards this part of the code:

https://github.com/dolphin-emu/dolphin/b...c.cpp#L631

However, looking at the code is not helping that much. For starters, I'm not sure how the texture format is determined. I tried googling about "Dolphin Gamecube BMP" and the most I got was a small mention inside YAGCD and an old and slightly confusing bitmap.cpp file ( https://code.google.com/p/dolphin-emu/so...?name=4960 ).

So, I was wondering if somebody who's familiar with Dolphin's texture processing could tell me if the format we've run into is a known format or a custom one.

Cheers.


EDIT:

Never mind, made a couple of extra tests and figured out the format:

[Image: 0024.BM.png]

(wrong palette, obviously)

Sorry if I made someone look up stuff for nothing.