# Campaign flow and mission rules

Open the [campaign viewer](campaign/index.html) to inspect all nine retail and seven PC Plus parser programs: 66 functions in total. It follows branches, subroutine calls and parser changes, and exposes the original menu choices and their numeric assignments. Scene links lead to the presentation browser; mission rules link to their maps.

The runner supplies editable inspection variables. It starts numeric fields at zero rather than pretending to load a pilot or reproduce a completed mission. Flight and waypoint planning are explicit stopping points. After one of those actions, supply the outcome variables and continue. Unsupported menu commands remain visible and disabled rather than being silently interpreted as ordinary assignments. Completion expressions and FINISH scripts from all 201 mission resources are shown verbatim; the browser does not execute their flight-dependent expressions.

## Native checks

[decode_campaign.py](../tools/decode_campaign.py) runs the original relocated handlers for all **340 branch records** and **219 numeric assignments**. This covers 462 conditional/unconditional branch cases and 876 assignment cases, including 32-bit wrapping. Destination function/statement indices are checked against each program. The original gosub stack and return handlers are included in the checks. [Results](campaign/native-checks.json) retain the record bytes and observed state.

Branch payloads contain a conditional flag, a one-based numeric-variable index, a comparison operator, a 32-bit comparison value, a gosub flag and destination function/statement bytes. All recovered branch comparison operators are equality. Assignment operators are set, add and subtract, with unsigned 32-bit wrapping.

Two previously tentative parser-node labels can now be made specific:

| Node type | Native action | Evidence |
| --- | --- | --- |
| 8 | Options menu | Handler `0xb2c00` calls menu runner `0xd58cc` |
| 9 | Waypoint planner | Handler `0xb2c1b` calls `0xb286c`, then `0xaeda0`; the resource is a `.way` file and the payload carries a planner mode |
| 13 | Load another parser | Loader `0xb29cc` and subflow loader `0xb35d0` |

The PC Plus demo uses its own `mastopts.opt` and `soap_sel.opt`; those are preserved instead of substituting the retail menus. Its altered flow is therefore inspectable alongside the retail campaign, not inferred merely from different briefing text.

This is a verified control-flow inspection tool, not a complete game/session emulator. Native variable persistence, mission expression evaluation, saved-pilot state and live actor events remain separate simulation work.

The map, waypoint and campaign-rule mission choosers share [mission-group metadata](missions/data.json). [Mission navigation notes](terrain-and-scenery.md#finding-missions-and-briefings) explain the retail ordering, briefing links and separate PC Plus reachability/order.
