# Supplementary scripts: supply sequences and city power failure

The loader BB3D–BB4D selects a record from resource 04_015 and seeds saved script pointer C789 and the two text-pointer operands C777/C77F. Thirteen stored world records request one of records 5, 6 or 7. [supplementary-scripts.json](../analysis/missions/supplementary-scripts.json) now links every caller to its supplementary path and terminal behaviour. The scenario viewer links directly to the selected supplementary record.

| Record | Callers | Content and terminal behaviour |
|---|---:|---|
| 04_015 / 5 | 1, craft configuration 2 | Weapon selection/reload, transition parameter and shield operations separated by delays; no English text. Ends with context swap at 0D52. Its similarity to record 6 supports interpreting it as a supply sequence. |
| 04_015 / 6 | 7, craft configuration 3 | Text welcomes the player to the **Supa Supply Pad**. Interleaves messages with weapon/reload/shield operations. Ends with context swap at 0DCF. |
| 04_015 / 7 | 5, craft configuration 1 | Beacon row/column changes and messages reporting citywide power failure. Ends in a permanent delay loop at 1828. |

Counts are stored records, not the number of times each sequence occurs in a playthrough. Configuration labels are preserved rather than assuming every stored template is reachable.

## The owner-register link is specific to the blackout sequence

All five decoded opcode-24 registrations occur in records that select supplementary record 7:

| World record | Registration offset |
|---|---|
| 04_003 / 2 | 102C |
| 04_003 / 7 | 3E05 |
| 04_005 / 2 | 10ED |
| 04_007 / 3 | 1F09 |
| 04_010 / 2 | 1414 |

The registered pointer acts as a nonzero trigger at the late main-loop gate. That gate selects the player and installs the saved supplementary context. Record 7 has no opcode 26 anywhere on its decoded entry path: the terminal bytes are `22 C8 25 FC`, meaning delay 200 × 50 = 10,000 ticks, then branch back to that delay. This repeats without swapping or using C789. The loop does not itself freeze the rest of the game.

This substantially narrows the unresolved late-frame SI question. The saved continuation is not consumed by the blackout script's own path. It need not be a valid return address for this one-way script takeover. This is a control-flow conclusion, not proof that no external gameplay path can ever initiate another context exchange.

## Supply sequences return and restart on the next visit

The earlier analysis stopped decoding at opcode 26 and missed the two-byte jump immediately following each swap. These are executable saved continuations, not text:

| Record | Return | Saved continuation bytes | Restart target |
|---|---|---|---|
| 5 | 0D52: `26` | 0D53: `25 CD` | 0D22, sequence entry |
| 6 | 0DCF: `26` | 0DD0: `25 8F` | 0D61, sequence entry |

The native sequence is:

1. Geometry entry C776 saves the current player continuation from +58, selects the saved supplementary pointer, and resets the message cursor from C777.
2. On the first visit that supplementary pointer is the loader-provided sequence entry.
3. At completion, opcode 26 restores the primary script and text context, and saves the pointer to the following relative jump.
4. On a later geometry entry, the saved jump executes and returns to the supplementary sequence's beginning. C777 resets the text cursor again, allowing the same messages to replay.

No reload of the asset or reset of C789 to the entry address is needed. The decoder now records opcode 26's saved continuation as a separate reachable path, adding these two previously omitted instructions; it does not treat that path as immediate fallthrough.

Craft configuration must be distinguished from bank/mode. The original definition table maps configurations 0/1 to mode 0 and configurations 2/3 to mode 1. All eight supply callers use configurations 2/3, matching the C6FB mode-1 geometry gate; the five blackout callers use configuration 1, mode 0. This corrects the earlier suggestion that supply callers might not match the tested gate.

The native return/re-entry fixture checks both original saved jumps, the C776 continuation exchange and the reset text cursor, stopping at the restarted entry before repeating its weapon/message effects. The separate geometry fixture checks eligibility and boundary conditions. These establish a repeatable script mechanism; they do not simulate a complete approach, docking and departure with collision/flight controls.

## Verification

```
PYTHONPATH=/tmp/darker-python python3 tools/inspect_supplementary_scripts.py
PYTHONPATH=/tmp/darker-python python3 tools/verify_supply_reentry.py
python3 tools/mission_browser.py
```

The tool follows all three decoded entry paths and verifies instruction bytes against the original resource. It executes both actual terminal swap opcodes at two clock values with the native interpreter, and eight iterations of the actual blackout delay/branch suffix across clock wrap. The alternate pointer and context flag remain unchanged through that loop.

Preceding beacon, weapon, presentation and message effects are statically inventoried, not executed by this check. No complete real mission is simulated. [Supply approach/departure movement](supply-pad-motion.md) is now checked separately. Next targets are a combined supply motion/script trace and a selected blackout mission's trigger-to-message progression.
