Table Of Contents
File Formats
Note: All data is little-endian and data types are represented with C type syntax.
PAL
- PALette
- From the PIF library
- File extension: .pal
- Magic bytes: PIFP
Name | Type | Description |
magic | uint8_t[4] | Magic bytes |
last | uint8_t | Index of the last color in the palette |
colors | RGB[last + 1] | List of palette colors in RGB format |
RGB
Name | Type | Description |
r | uint8_t | Red color component |
g | uint8_t | Green color component |
b | uint8_t | Blue color component |
PIF
- Palettized Image File
- From the PIF library
- File extension: .pif
- Magic bytes: PIFI
Name | Type | Description |
magic | uint8_t[4] | Magic bytes |
w | uint16_t | Width of the image |
h | uint16_t | Height of the image |
pixels | uint8_t[w * h] | Image pixel buffer |
Note: A pixel is an index into the color palette.
TFF
- Trinity Font File
- File extension: .tff
- Magic bytes: TRIF
Name | Type | Description |
magic | uint8_t[4] | Magic bytes |
cols | uint8_t | Number of columns in font's sheet |
rows | uint8_t | Number of rows in font's sheet |
chW | uint8_t | Character width |
chH | uint8_t | Character height |
spacing | uint8_t | Spacing between characters |
sheet | uint8_t[ceil(cols * chW * rows * chH / 8)] | Font sheet buffer |
Note: Each bit in the font sheet buffer represents a pixel (on/off). Unused bits caused by a remainder in the size calculation's division are ignored.
Lua
Functions
T_Print
T_Print(args...)
Name | Type | Description |
args... | Any | Any number of values to print |
Debug print into the console.
T_Info
T_Info(args...)
Name | Type | Description |
args... | Any | Any number of values to print |
Debug print info into the console.
T_Sleep
T_Sleep(ms)
Name | Type | Description |
ms | int | Number of milliseconds to sleep for. |
Stops the current script thread for a given amount of time.