> For the complete documentation index, see [llms.txt](https://guide.cronuszen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cronuszen.com/gpcscripting/gpc-script-guide/learn-gpc/immutable-const-data.md).

# Immutable const data

### Numeric arrays

Choose the smallest type that holds every value:

| Type     | Bytes/value |                           Range |
| -------- | ----------: | ------------------------------: |
| `int8`   |           1 |                     `-128..127` |
| `uint8`  |           1 |                        `0..255` |
| `int16`  |           2 |               `-32,768..32,767` |
| `uint16` |           2 |                     `0..65,535` |
| `int32`  |           4 | `-2,147,483,648..2,147,483,647` |

```cpp
const int8 CURVE[] = { 0, 5, 12, 22, 35, 51, 72, 100 };

const int16 POINTS[][] = {
    { -100, -50, 0, 50, 100 },
    { -100, -25, 0, 25, 100 }
};
```

Every row of a two-dimensional const array must have the same number of columns. Const data is immutable and consumes compiled data/bytecode space even when never used.

Access:

{% code title="const-data-access.gpc" %}

```cpp
int a, b;

main {
    a = CURVE[3];
    b = POINTS[1][4];
}
```

{% endcode %}

***

### Strings

Strings live in the const/data area, not runtime variables:

```cpp
const string STATUS = "READY"; // one string

const string LABELS[] = { "OFF", "ON", "EDIT" };
```

When an API expects an address, pass a const item or `addr(...)` as required by its signature. Bare string literals are not general runtime expression values.

***

### Images

An `image` begins with width and height, followed by exactly `ceil(width * height / 8)` packed pixel bytes:

```cpp
const image BOX_8 = {
    8, 8,
    0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xFF
};
```

Pixels are packed left-to-right, top-to-bottom. Validate the byte count; invalid image data is a compiler error.

An array of image records needs a nested record for each image:

```cpp
const image ICONS[] = {
    { 8, 8, 0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xFF },
    { 8, 8, 0x00, 0x7E, 0x42, 0x42, 0x42, 0x42, 0x7E, 0x00 }
};
```

***

### PS5 adaptive-trigger data

`ps5adt` records contain exactly 11 byte values in this order:

<table data-search="false"><thead><tr><th align="right">Index</th><th>Field selector</th><th>Meaning</th></tr></thead><tbody><tr><td align="right">0</td><td><code>PS5_ADT_MODE</code></td><td>Effect mode</td></tr><tr><td align="right">1</td><td><code>PS5_ADT_START</code></td><td>Start position</td></tr><tr><td align="right">2</td><td><code>PS5_ADT_FORCE1</code></td><td>First force parameter</td></tr><tr><td align="right">3</td><td><code>PS5_ADT_FORCE2</code></td><td>Second force parameter</td></tr><tr><td align="right">4</td><td><code>PS5_ADT_STRENGTH_LOW</code></td><td>Low-zone strength</td></tr><tr><td align="right">5</td><td><code>PS5_ADT_STRENGTH_MID</code></td><td>Mid-zone strength</td></tr><tr><td align="right">6</td><td><code>PS5_ADT_STRENGTH_HIGH</code></td><td>High-zone strength</td></tr><tr><td align="right">7</td><td><code>PS5_ADT_UNK1</code></td><td>Unknown/reserved byte 1</td></tr><tr><td align="right">8</td><td><code>PS5_ADT_UNK2</code></td><td>Unknown/reserved byte 2</td></tr><tr><td align="right">9</td><td><code>PS5_ADT_FREQ</code></td><td>Effect frequency</td></tr><tr><td align="right">10</td><td><code>PS5_ADT_UNK3</code></td><td>Unknown/reserved byte 3</td></tr></tbody></table>

{% code title="trigger-profile.gpc" %}

```cpp
const ps5adt TRIGGER_PROFILE = {
    PS5_ADT_CR, // 0: mode
    0,          // 1: start
    128,        // 2: force 1
    128,        // 3: force 2
    64,         // 4: low strength
    128,        // 5: mid strength
    192,        // 6: high strength
    0,          // 7: unknown/reserved 1
    0,          // 8: unknown/reserved 2
    100,        // 9: frequency
    0           // 10: unknown/reserved 3
};
```

{% endcode %}

Use a named mode and comment every positional field. Do not invent meanings for the three unknown/reserved bytes; preserve them from a known-good profile.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guide.cronuszen.com/gpcscripting/gpc-script-guide/learn-gpc/immutable-const-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
