Skip to content

LTF Spec

NtinosTheGamer2324 edited this page Jun 9, 2026 · 1 revision

LIBTINYFORMAT (LTF) UNIVERSAL TECHNICAL SPECIFICATION v1.0

I pulled these specs from an old project and repurposed them for this context. Most of these are just concepts for now, but they will likely be introduced in later versions of ModuOS.


0. Global Conventions

  1. All "Magic Numbers" are 4-byte ASCII tags stored in Little-Endian.
  2. All structures must be packed (no compiler-inserted padding).
  3. Strings are UTF-8, Null-terminated ('\0').
  4. Reserved fields MUST be initialized to 0x00.

1. Storage & Containers

1.1 TPK (Tiny Package Archive) - [.tpk]

  • Magic: 0x214B5054 ('TPK!')
  • Total Files: uint32_t
  • Entries Table (264 bytes per entry):
    • Filename: char[256] (Null-terminated).
    • Offset: uint32_t (Start of TPK to data).
    • Size: uint32_t (Data bytes).

1.2 TMF (Tiny Media Format) - [.tmf]

  • Magic: 0x21464D54 ('TMF!')
  • Dimensions: uint16_t Width, uint16_t Height
  • Audio: uint8_t FPS, uint8_t Channels (1=Mono, 2=Stereo), uint32_t Sample Rate
  • Data Block: Interleaved Chunks: [4-byte ID][4-byte Size][Payload]
    • IDs: 'VID ' (TVD frame), 'AUD ' (TAS buffer), 'TAM ' (Pulse packet).

2. Visual Assets

2.1 TIF (Tiny Image Format) - [.tif]

  • Magic: 0x594E4954 ('TINY')
  • Dimensions: uint32_t Width, uint32_t Height
  • Compression: uint8_t (0=Raw BGRA8888, 1=RLE-8)

2.2 TVD (Tiny Video Delta) - [.tvd]

  • Magic: 0x21445654 ('TVD!')
  • Frames: uint16_t Total, uint16_t Keyframe interval
  • Logic: Keyframe (Full raw pixels) vs. Delta (XOR-map of pixel changes).

2.4 TMG (Tiny Mesh Geometry) - [.tmg]

  • Magic: 0x21474D54 ('TMG!')
  • Counts: uint32_t Vertex Count, uint32_t Index Count
  • Data: Vertex list (Float X,Y,Z, U,V) followed by uint16_t Index list.

3. Audio Assets

3.1 TAS (Tiny Audio Stream) - [.tas]

  • Magic: 0x64756154 ('Taud')
  • Format: uint32_t Sample Rate (Hz), uint8_t Channels, uint8_t Bit Depth (8, 16, or 24)
  • Data: Raw PCM signed integers.

3.2 TFM (Tiny Frequency Mod) - [.tfm]

  • Sequence (6-byte chunks):
    • Waveform: 0=Sine, 1=Square, 2=Saw, 3=Noise.
    • Freq/Duration: uint16_t Hz, uint16_t ms.
    • Envelope: uint8_t ADSR/Volume.

4. Data & Interactivity

4.1 TBN (Tiny Binary Notation) - [.tbn]

  • Header (6 bytes): Type (Obj, Arr, Str, Int, Float), Key Length, Value Data Length.
  • Key: N-bytes of ASCII text.
  • Value: M-bytes of binary data.

4.2 TCF (Tiny Captions Format) - [.tcf]

  • Magic: 0x21464354 ('TCF!')
  • Metadata: uint32_t Total entries, uint32_t Language ID.
  • Index Table (8 bytes per entry): uint32_t Timestamp (ms), uint32_t Offset to string.

4.3 TAM (Tiny Ambient Metadata) - [.tam]

  • Packet (6 bytes):
    • Color: uint8_t R, G, B
    • Energy: uint8_t (0-255 Amplitude/Motion)
    • Flags: uint16_t (0x01: Flash, 0x02: Shake, 0x04: Rumble)

5. Networking (TTP)

5.1 TTP Packet Header (8 bytes) - Layer 4 Protocol 0xFE

  • Ports: uint16_t Source, uint16_t Destination
  • Sequence: uint16_t (Monotonic)
  • Flags: uint8_t (0x01:ACK, 0x02:SYN, 0x04:FIN)
  • Checksum: uint8_t (XOR of all bytes)

End of Specification

Clone this wiki locally