For the complete documentation index, see llms.txt. This page is also available as Markdown.

Source layout and global namespace

A Live GPC file can contain these top-level forms:

  • define

  • enum

  • data(...)

  • typed const arrays, strings, images, and adaptive-trigger data

  • remap and unmap

  • global int variables and runtime arrays

  • optional init section or sections

  • one or more main sections

  • combo / fcombo declarations

  • user-created function declarations

Zen Studio Live accepts multiple init and main sections. The compiler merges all init sections into the one-time initialization phase and all main sections into the repeating main phase. Keeping one of each is normally clearer, but split sections in generated or assembled source are valid.


Name spaces

GPC does not place every declared name in one namespace:

Namespace/scope
Names in it

Data symbols

Runtime variables and arrays, definitions, enum members, and const-data names

Functions

User-created function names

Combos

combo and fcombo names

Function-local

The parameters declared by that function

Names must be unique within the namespace that owns them. A variable cannot reuse a definition, enum-member, or const-data name, but function names, combo names, and function parameters are resolved separately from that data-symbol namespace.

Language keywords and built-in constants are reserved. Declaring main, if, or a constant such as PS5_CROSS as your own name is a hard error.

Built-in function names are not reserved in the data-symbol namespace — int set_val; and define set_val = 5; both compile. What the compiler does reject is naming a user-created function after a built-in; that is reported as GPC4001.


Names are case-sensitive and follow this shape:

Prefer descriptive uppercase names for compile-time constants and lowercase snake case for runtime variables/functions. Even where separate namespaces technically allow the same spelling, distinct names make searches and compiler messages easier to understand.

Last updated