Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:TMD (PlayStation 3D model)

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

Sony's PlayStation modeling data (.tmd, also embedded in archives and the boot logo of every disc): ID word 0x41, a flags word, an object count, then 0x1C-byte object records pointing to vertices, normals and variable-length GPU primitive packets.

Overview

TMD is the 3D model format of the Psy-Q libraries (Library:Psy-Q SDK): the primitives are stored in a form that the GTE and GPU code can consume directly, so a parser mostly walks lists. The logo that the boot ROM shows is a 0x3278-byte TMD in sectors 5-11 of every disc (see Format:CD-ROM XA). Texture data comes separately as Format:TIM (PlayStation texture). Descriptions come from the psx-spx documentation; this page is at recognition level.

Header and objects

Header: ID u32 0x00000041, flags u32 (bit 0 = FIXP: the addresses in the object list are absolute offsets from the file start instead of from the start of the object data), object count u32. Each object record (0x1C bytes) holds the start address and count of the vertices, normals and primitives, and a signed scale shift (positive shifts left; not used by LIBGS).

Vertices, normals, primitives

Vertices are 8 bytes: X, Y, Z signed 16-bit and 2 unused bytes. Normals are 8 bytes with 1.3.12 fixed point components. A primitive has a 4-byte header: output size in words of the GPU command, input size in words of the packet data, a flag byte (bit 0 lighting off, bit 1 no back clip, bit 2 Gouraud) and a mode byte equal to the GP0 command (0x20-0x7F: polygons, lines, sprites). The packet data after it depends on mode: command and colour word, texture coordinates with CLUT and texture page words for textured polygons, extra colours for Gouraud, then 16-bit normal and vertex indices.

Code & repositories

  • https://github.com/psx-spx/psx-spx.github.io @ 6d7d1bc106a7e0b616b0330fe58401ab1ba57f0f · license: none
    Nocash PSX specifications as Markdown: docs/cdromfileformats.md has TMD, PMD, TOD, HMD, RSD layouts.
    Tested on: source read, not run: documentation read · checked 2026-10-19; last activity 2026-10-19; no license: not reusable

Pitfalls

  • A related PMD format (ID 0x42) is similar but with fewer features. Unverified: not covered here.
  • psx-spx marks the layout of rectangle/sprite packets and some index meanings as uncertain.