====== 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 | {{http://queueram.com/n64/mk64/tkmk00/01/7FA3C0.png}} | | 7FAFC0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FAFC0.png}} | | 7FB8C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FB8C0.png}} | | 7FBAC0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FBAC0.png}} | | 7FBCC0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FBCC0.png}} | | 7FBEC0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FBEC0.png}} | | 7FC0C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FC0C0.png}} | | 7FC2C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FC2C0.png}} | | 7FC4C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FC4C0.png}} | | 7FC6C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/7FC6C0.png}} | | 7FC8C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FC8C0.png}} | | 7FCDC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FCDC0.png}} | | 7FD2C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FD2C0.png}} | | 7FD7C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FD7C0.png}} | | 7FDDC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FDDC0.png}} | | 7FE1C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FE1C0.png}} | | 7FE6C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FE6C0.png}} | | 7FEBC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FEBC0.png}} | | 7FEFC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FEFC0.png}} | | 7FF3C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FF3C0.png}} | | 7FF7C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FF7C0.png}} | | 7FFCC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/7FFCC0.png}} | | 8000C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8000C0.png}} | | 8004C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8004C0.png}} | | 8008C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8008C0.png}} | | 800DC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/800DC0.png}} | | 8010C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8010C0.png}} | | 8014C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8014C0.png}} | | 8018C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8018C0.png}} | | 801EC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/801EC0.png}} | | 8021C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/8021C0.png}} | | 802DC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/802DC0.png}} | | 8031C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8031C0.png}} | | 8035C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8035C0.png}} | | 8039C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8039C0.png}} | | 803DC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/803DC0.png}} | | 8049C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8049C0.png}} | | 804EC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/804EC0.png}} | | 8055C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8055C0.png}} | | 805FC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/805FC0.png}} | | 806AC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/806AC0.png}} | | 806DC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/806DC0.png}} | | 8071C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8071C0.png}} | | 8075C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8075C0.png}} | | 8078C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8078C0.png}} | | 807BC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/807BC0.png}} | | 807EC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/807EC0.png}} | | 8080C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8080C0.png}} | | 8082C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8082C0.png}} | | 8084C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8084C0.png}} | | 8086C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8086C0.png}} | | 8089C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8089C0.png}} | | 808CC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/808CC0.png}} | | 808EC0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/808EC0.png}} | | 8090C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8090C0.png}} | | 8092C0 | BE | {{http://queueram.com/n64/mk64/tkmk00/be/8092C0.png}} | | 8094C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/8094C0.png}} | | 8162C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/8162C0.png}} | | 81F6C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/81F6C0.png}} | | 8202C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/8202C0.png}} | | 8209C0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/8209C0.png}} | | 820AC0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/820AC0.png}} | | 820FC0 | 01 | {{http://queueram.com/n64/mk64/tkmk00/01/820FC0.png}} | ===== Software Libraries ===== C: tkmk00: [[https://github.com/queueRAM/tkmk00]] C#: TKMK00Encoder:[[https://github.com/mib-f8sm9c/MiscellaneousHacks/blob/master/BetaTools/MarioKartTestingTool/TKMK00Encoder.cs]] ===== References ===== * http://origami64.net/showthread.php?tid=47&pid=3064#pid3064 * http://acmlm.kafuka.org/archive3/thread.php?id=3283