TXR File Format

Technical questions, etc..
Post Reply
joe_7
Petty Officer Third Class
Posts: 17
Joined: 03 Nov 2021, 05:19
Type the number ten into the box: 10

TXR File Format

Post by joe_7 »

I thought it might be interesting to add TXR support (along with some other older/obscure formats) to my graphics program:

https://github.com/JoeDavisson/rendera

I can't find a specification anywhere, but figured out a few things:

1. Files start with 6 bytes containing 0xE8 and 0x80, but not always in that order or in the same place.
2. CHECKER.TXR is the only one with a text label ("test") which starts after that.
3. Starting at location 0xA0 there are two 16-bit values for height/width.
4. Image data starts at 0x484, (1156 bytes from the start).
5. Then there are a series of mipmaps? The first is normal resolution, RGBA (same as Targa), but that's all I know.
6. Not sure what to make of the bump map (.TAB) files, except that the header is the similar. The image data looks more like 8-bit though which makes sense for a bump map, however there is around 10x more than a single 128x128 image would require.

This is more of a curiosity than anything, but if anyone has any insight as to the origin of this format I'd love to learn more about it.
joe_7
Petty Officer Third Class
Posts: 17
Joined: 03 Nov 2021, 05:19
Type the number ten into the box: 10

Re: TXR File Format

Post by joe_7 »

Did a little more investigating, it goes something like this:

Code: Select all

0x0000: 32-bit "magic number" 0x80E8 (33000 in decimal)
0x0004: either "1" or "2"
0x0006: text field
0x00A0: height
0x00A2: width
0x00A8: "0x16"
...
0x0400: number of mips
0x0408: total data size in bytes

mipmap data:
width
height
offset (0x484 + w * h * 4)
(repeat for each mip level)
The files included with TS3 have big-endian byte order, while ones it generates are little-endian. I believe the magic number is used to determine the order. It started to make a lot more sense after I realized some were different (the Amiga was big-endian).

I may have enough information to read/write these now, not sure about the bump maps yet.
Post Reply