Skip to main content

coloX Platform Specifications

coloX applications declare their target platform specification in the file header. Specifications differ in resolution, color depth, sprite counts, and storage space.


Contents​

  1. Specification identifiers
  2. Complete specification tables
  3. Runtime constants
  4. Color system

1. Specification Identifiers​

The first line of a .clx file is the specification identifier, defining canvas dimensions, color depth, and resource limits:

coloX-16
FormatDescription
coloX-{specification suffix}Fixed specification, such as coloX-4, coloX-16, or coloX-32C
X-{width}x{height}_{bpp}Custom specification, such as X-240x240_16 (generates the corresponding memory layout as needed)
coloX-PICO8Alias for X-128x128_4 (128×128 4bpp compatible specification)

2. Complete Specification Tables​

Standard Specifications (240×240 Round Screen)​

SpecificationResolutionColor depth (bpp)SpritesMap dimensionsROM limit
coloX-4P128×1284512 (16×32)128×32~30 KB
coloX-4240×24041170 (30×30+30×9)128×128~74 KB
coloX-16240×240161170 (30×30+30×9)128×128~184 KB

Large Screen Specifications (454×454)​

SpecificationResolutionColor depth (bpp)SpritesMap dimensionsROM limit
coloX-4B454×45443534 (57×57+57×5)128×128~148 KB
coloX-16B454×454163534 (57×57+57×5)128×128~479 KB
coloX-32B454×454323534 (57×57+57×5)128×128~921 KB

Extra-Large Screen Specifications (480×480)​

SpecificationResolutionColor depth (bpp)SpritesMap dimensionsROM limit
coloX-4C480×48043900 (60×60+60×5)128×128~159 KB
coloX-16C480×480163900 (60×60+60×5)128×128~525 KB
coloX-32C480×480323900 (60×60+60×5)128×128~1013 KB

Tall Screen Specifications (480×800)​

SpecificationResolutionColor depth (bpp)SpritesMap dimensionsROM limit
coloX-4L480×80046300 (60×100+60×5)128×128~234 KB
coloX-16L480×800166300 (60×100+60×5)128×128~825 KB
coloX-32L480×800326300 (60×100+60×5)128×128~1613 KB

Wide Screen Specifications (800×480)​

SpecificationResolutionColor depth (bpp)SpritesMap dimensionsROM limit
coloX-4W800×48046500 (100×60+100×5)128×128~241 KB
coloX-16W800×480166500 (100×60+100×5)128×128~850 KB
coloX-32W800×480326500 (100×60+100×5)128×128~1663 KB

Specification Fields​

FieldDescription
ResolutionCanvas dimensions in pixels (__vm_width × __vm_height)
Color depthBits per pixel: 4 = 16-color palette, 16 = RGB565, 32 = RGBA8888
SpritesTotal number of 8×8 sprites the sprite sheet can hold
Map dimensionsMap grid dimensions in 8×8 tiles (width×height)
ROM limitApproximate maximum binary size after compiling .clx

Development Platforms​

PlatformDescription
NatureMiniLinux development platform supporting multiple specifications with higher performance
ColoPLAYSmall embedded device, ESP32-S3, round screen, supporting up to coloX-16
ColoPLAY V2Small embedded device, ESP32-S31, round touch screen without buttons, supporting up to coloX-16C

3. Runtime Constants​

The following global constants are automatically available at application startup:

Canvas and Display​

ConstantDescription
__vm_widthCanvas width (pixels)
__vm_heightCanvas height (pixels)
__vm_bppCanvas color depth (4/16/32)
__vm_scr_widthPhysical screen width
__vm_scr_heightPhysical screen height
__vm_speed_lvlDevice speed level (0-100); higher values indicate higher performance
__vm_auto_gen_romWhether this is a development build (true in development builds; undefined/nil on devices)

Memory Addresses​

ConstantDescription
__vm_GFXSprite image data address
__vm_MAPMap data address
__vm_FLAGSSprite flag data address
__vm_MUSICMusic data address
__vm_SFXSound effect data address
__vm_USERDATAUser data address
__vm_CARTDATAApplication storage data mapping address
__vm_VRAMVideo memory address (canvas)
__vm_DRAWSTATDrawing state address
__vm_HWSTATHardware state address

4. Color System​

16-Color Palette (Default Colors in 4-bit Mode)​

The following color constants are available in all color depth modes:

ConstantRGBExample
black#000000■
dark_blue#1D2B53■
dark_purple#7E2553■
dark_green#008751■
brown#AB5236■
dark_gray#5F574F■
light_gray#C2C3C7■
white#FFF1E8■
red#FF004D■
orange#FFA300■
yellow#FFEC27■
green#00E436■
blue#29ADFF■
indigo#83769C■
pink#FF77A8■
peach#FFCCAA■

16-bit / 32-bit Colors​

In 16-bit (RGB565) and 32-bit (RGBA8888) modes, colors are not limited to the 16-color palette. Use getcolor() or palrgb() to obtain color values accepted by drawing functions:

-- Create colors directly from RGB in 16/32-bit mode
local my_red = getcolor(0xff, 0x40, 0x20)
circfill(120, 120, 50, my_red)

-- Set a palette entry and get its color value
local custom = palrgb(0, 200, 180, 255)
rectfill(10, 10, 100, 100, custom)