Table of Contents

TKMK00 Compression Format

TKMK00 is a format for some compressed textures used in the Mario Kart 64 title screen and menus.

TKMK00 Decoder

The TKMK00 decoder function is located at 800405D0/0411D0 in the Mario Kart 64 (U) ROM. It takes 4 parameters:

Param Type Description
A0 u8* pointer to input TKMK00 compressed data
A1 u8* pointer to output buffer (1 byte per pixel)
A2 u16* pointer to RGBA16 texture output buffer (2 bytes per pixel)
A3 u16 RGBA mask to clear alpha bit for in output (usually 0x0001 or 0x00BE)

TKMK00 Header

Offset Length Description
0x00 0x6 File signature “TKMK00”
0x06 0x1 Bit mask used for offsets at 0xC
0x07 0x1 Unused? (always 0x0F)
0x08 0x2 Output texture width in pixels
0x0A 0x2 Output texture height in pixels
0x0C 0x20 Array of 8 offsets, used with bitmask at 0x06

List of TKMK00 Blocks

Offset A3 Texture
7FA3C0 01
7FAFC0 01
7FB8C0 01
7FBAC0 01
7FBCC0 01
7FBEC0 01
7FC0C0 01
7FC2C0 01
7FC4C0 01
7FC6C0 01
7FC8C0 BE
7FCDC0 BE
7FD2C0 BE
7FD7C0 BE
7FDDC0 BE
7FE1C0 BE
7FE6C0 BE
7FEBC0 BE
7FEFC0 BE
7FF3C0 BE
7FF7C0 BE
7FFCC0 BE
8000C0 BE
8004C0 BE
8008C0 BE
800DC0 BE
8010C0 BE
8014C0 BE
8018C0 BE
801EC0 BE
8021C0 01
802DC0 BE
8031C0 BE
8035C0 BE
8039C0 BE
803DC0 BE
8049C0 BE
804EC0 BE
8055C0 BE
805FC0 BE
806AC0 BE
806DC0 BE
8071C0 BE
8075C0 BE
8078C0 BE
807BC0 BE
807EC0 BE
8080C0 BE
8082C0 BE
8084C0 BE
8086C0 BE
8089C0 BE
808CC0 BE
808EC0 BE
8090C0 BE
8092C0 BE
8094C0 01
8162C0 01
81F6C0 01
8202C0 01
8209C0 01
820AC0 01
820FC0 01

Software Libraries

C: tkmk00: https://github.com/queueRAM/tkmk00

C#: TKMK00Encoder:https://github.com/mib-f8sm9c/MiscellaneousHacks/blob/master/BetaTools/MarioKartTestingTool/TKMK00Encoder.cs

References