User Tools

Site Tools


banjo_kazooie:model_data

This is an old revision of the document!


Model Data

Banjo-Kazooie uses a file-system in which most resources are packed into file blocks throughout the ROM, and are unpacked into RAM when needed. Among these are the model files, each with their own syntax and load-lines. This page's purpose is to cover the syntax and properties of said model files.

Address Value/Syntax Description
0x00000000 [00 00 00 0B] START
0x00000004 [aa aa aa aa] Geometry Layout Offset
0x00000008 [bb bb cc cc] bb=Texture Setup Offset (Usually 00 38), cc=Geo Type*
0x0000000C [dd dd dd dd] Display List Setup Offset
0x00000010 [ee ee ee ee] Vertex Store Setup Offset
0x00000014 [00 00 00 00] ?
0x00000018 [ff ff ff ff] Animation Setup
0x0000001C [gg gg gg gg] Collision Setup
0x00000020 [hh hh hh hh] Effects Setup End Address
0x00000024 [hh hh hh hh] Effects Setup
0x00000028 [00 00 00 00] ?
0x0000002C [jj jj jj jj] Animated Textures Offset
0x00000030 [kk kk ll ll] kk= Tri count, ll= vert count
0x00000034 [00 00 00 00] ?

*Geo Types: 0000=normal, 0002= Trilinear MipMapping (RGBA16), 0004=Env mapping, 0006=?


Texture Setup

Offset from TexSetup Start Value/Syntax Description
0x00000000 [aa aa aa aa] Amount of data in bytes to load (including command)
0x00000004 [00 cc 00 00] cc=Texture Count
0x00000008 [dd dd dd dd] Texture[i] segment address from texture data start
0x0000000C [00 ee 00 00 xx yy 00 00] Texture[i] ee =type*, xx yy=Pixel Grid
0x00000014 [00 00 00 00] Wasted data?

*Types: 01=CI4, 02=CI8, 04=RGBA16, 08=RGBA32, 0x10=IA8,

*External texture indices start at FileID 0x1EF6, 0 indexed.

Example: 00 00 06 00 00 01 00 00 40 40 00 00 00 00 00 00

This will load a CI4 64x64 texture from segmented address 0x600.

Display List Setup

Offset from DLSetup Start Value/Syntax Description
0x00000000 [aa aa aa aa 00 00 00 00] F3DEX Command Count
0x00000008 F3DEX F3DEX Display List

Vertex Store Setup

Offset from VTXSetup Start Value/Syntax Description
0x00000000 [aa aa bb bb cc cc] Draw distance: Negative Coords
0x00000006 [dd dd ee ee ff ff] Draw distance: Positive Coords
0x0000000C [gg gg hh hh] Object Coordinate Range
0x00000010 [jj jj] Collision range? (Enemies, Objects)
0x00000014 [kk kk] Collision range? (Banjo)
0x00000016 [ll ll] Vertex Count*2

Each 16 byte line of the Vertex Setup following the Start denotes where a vertex is stored in 3D space, from where in 2D space its UVs begin being mapped, and which color and opacity alpha values will be applied to these vertices.

Vertex Structure After Start Value/Syntax Description
0x00000000 [xx xx] *s32 Vertex Position on X Axis
0x00000002 [yy yy] s32 Vertex Position on Y Axis
0x00000004 [zz zz] s32 Vertex Position on Z Axis
0x00000006 00 00 Padding(?)
0x00000008 [uu uu] s32 UV Coordinates: U Axis
0x0000000A [vv vv] s32 UV Coordinates: V Axis
0x0000000C [rr] u16 Vertex Color Red Values
0x0000000D [gg] u16 Vertex Color Green Values
0x0000000E [bb] u16 Vertex Color Blue Values
0x0000000F [aa] u16 Vertex Color Alpha Values

*Please note that s32 refers to a value that is 'signed', or a value which may be positive or negative. Positive signed values range from 0000 to 7FFF, negative signed values range from FFFF to 8000. Whereas u16 refers to a value that is unsigned and thus may only be a positive integer from, in this example, 00 to FF.

Example: 0014 0062 FFE7 0000 FFE0 0014 9292 92FF

A vertex will be drawn at position (20, 98, -25). UV mapping will begin at -20 coordinates in the U axis and 20 coordinates in the V axis. This vertex will feature a color of #929292 with full opacity alpha of FF.


Animated Texture List

If the model's animated_textures_offset is non-zero, the animated texture list is an array of 4 of the following struct:

Offset Value/Syntax Type Description
0x00 [aa aa] i16 Frame size (bytes) : 0 if unused
0x02 [bb bb] i16 Frame count
0x04 [cc cc cc cc] f32 Framerate (fps)

Note only the 1st texture in the model can be animated, however it can be animated with 4 different framecounts/framerates. —

banjo_kazooie/model_data.1705109123.txt.gz · Last modified: 2024/01/13 01:25 by BanjoFreak64