Looking for info on AV/SEGA (F-Zero GX) TPL, GMA file format

All your homebrew software needs & discussion
Post Reply
User avatar
StarkNebula
Posts: 69
Joined: Fri Feb 21, 2014 5:58 am
Location: Toronto, Canada
Contact:

Looking for info on AV/SEGA (F-Zero GX) TPL, GMA file format

Post by StarkNebula » Wed Mar 12, 2014 4:38 pm

I was wondering if anyone had more info on TPLs (that's not included in YAGCD.) Specifically, I'm looking for information on the TPL file type Amusement Vision used (SEGA 2nd Party; F-Zero GX/AX, Super Monkey Ball 1&2, Virtua Striker...) I know that GameZelda made GXPAND and GXGMA which handle these files. Unfortunately I'm still in the process of learning Python, so C++ is still a fair bit away from simply reading off the source code. However, using HxD, I've found some things:

The examples I use are taken from bg_big.tpl from F-Zero GX. https://i.cloudup.com/rG8j02TAqH-3000x3000.png

* 0x02 on the first line defines the "header" size. So if the first 8 bytes are 0000 01E8, the header's final texture is on line 0x00001E80.
* The next 2 lines (0x00000010 - 0x00000020) probably hold something like the format (RGBA8, read off the tpl.cpp source code).
* For the length of the header after line 1, 0x02 is always 1234. This is referenced in GXGMA's tpl.cpp, so I assume it looks for those and then pulls out the sizing info.
* For the length of the header after line 3, 0x04 is always 0000, until 0x00001E80, where it is 0001 (terminating the TPL header.)
* For the length of the header after line 3, when 0x06 is 000E, it indicates a texture is held thereafter.
* For the length of the header after line 3, 0x0C and 0x0E hold the width/height values (respectively?) Many slots are nulled out.
For the header, I don't know what 0x00 is as it's seemingly random (to me), but uses mostly 0000, if not 000* (where * is 4-A, even on nulled textures.)

If anyone's got info on it, I'd really appreciate it. I'd like to document the file structure so I can (eventually) make some tools to import media into AV games (F-Zero GX and Super Monkey Ball in particular.) Doesn't hurt to have GC tools as well. Also, while I have yet to even touched it, if anyone has info on GMA files, that's be great as well. Game Zelda made export tools but didn't really document it (in a way that I can understand, at least) in a way that others can make import tools.
User avatar
StarkNebula
Posts: 69
Joined: Fri Feb 21, 2014 5:58 am
Location: Toronto, Canada
Contact:

Re: Looking for info on AV/SEGA (F-Zero GX) TPL, GMA file fo

Post by StarkNebula » Tue Mar 18, 2014 4:32 pm

Well I've manage to scavenge up the remains of what I was missing for TPLs, though I'm still looking into >0x04 on line 0x00. Here's how an Amusement Vision TPL is formatted:
Image

http://hitmen.c02.at/files/yagcd/yagcd/chap15.html - 15.35 is where the TPL specs are.

However, I'm still looking for information on GMA files. I've got the source code of GXGMA to go look at, but any other resources on GMAs or on 3D model files would be helpful.

*Edit: I realized that in some other TPLs textures appear after other 0x06+0x07 values that aren't 000E. 0000, 0004, 0005, 000B were among them, so I believe one can simply state that if 0x06 = 00, texture present, if 0x06 = 01, no texture present. Not sure why there are other 0x07 values other than 0E; they don't appear to modify the texture in any way, though they are a little odd (alpha image (0005), alpha layer? (0000)), but it's not consistent.
*Edit Edit: the 0x0E offsets are the YAGCD-specified file types. 0E is CMPR - quite common in GX. I cross referenced a few things using GX's debug menu.

Also, I redefined the header as 2 bytes on 0x02, since 0x00 and 0x01 can be used for define a texture on line 0x00000000, though I've only seen 0000s there. Even the exuberantly long TPLs don't top 500 texture entries, so it's safe to assume it will always be under 65536 (2 bytes) or 4096 (1.5 bytes? Since the offset bump?) lines long. The bulk of the file will always be the textures anyways.
User avatar
StarkNebula
Posts: 69
Joined: Fri Feb 21, 2014 5:58 am
Location: Toronto, Canada
Contact:

Re: Looking for info on AV/SEGA (F-Zero GX) TPL, GMA file fo

Post by StarkNebula » Tue Apr 15, 2014 5:29 am

Sorry bump it, but I've found everything but the 0x00 and 0x01 offsets which I believe would have something to do with how the GMA file calls the textures.
Edit: Actually, I just noticed that values appear on 0x01 immediately after a texture is defined. i.e. Texture on line #5 = 0x01 on line #6 to have a value.

Speaking of GMAs, does anyone have experience decoding vertices and the like from hex data? I'm having issues with regards to that.
Post Reply