Crusader_Decomp/docs/ROGUE/cheats-and-debug.md
2026-10-11 18:49:46 +02:00

92 lines
No EOL
12 KiB
Markdown

# Rogue Squadron 3D: PC Cheats and Debug Features
## Summary
The correct gameplay target is `Rogue Squadron.EXE`, not the neighboring `ROGUE.EXE` launcher. Static analysis of the gameplay binary found a 35-slot passcode hash table, with 16 slots mapped to 29 spellings so far. The binary confirms which spellings match its table; published PC cheat lists supply most claimed effects, which were not runtime-tested here.
Editor-style debug UI survives in the executable, but the normal startup path disables its `Config` menu before construction. The `Alt+T` caption is therefore a conditional editor command, not an established retail gameplay shortcut. If the menu were enabled by another build or runtime state, it would open a `Debug Data` panel for switching among registered subsystem diagnostics, not a gameplay-cheat menu.
## Scope and Method
- Gameplay target: `C:\RE\Star Wars - Rogue Squadron 3D\ROGUE\Rogue Squadron.EXE`, PE32 x86, SHA-256 `0764709692e559e9de8ed125b9c59389cda2b594339dca5f47266deb10c2d43c`.
- `ROGUE.EXE` is the InstallShield launcher, not the gameplay executable; its SHA-256 is `a10f271a9708fe17e107072fa81243ed003155ab47bdff8514d338d04b847563`.
- Analysis used REA with Ghidra 12.1.4. The binary was loaded into an ephemeral analysis project; no executable bytes were changed, no project was saved, and neither executable was run.
- Addresses below are virtual addresses in `Rogue Squadron.EXE`. Hash-table slot numbers are zero-based.
- Binary observations establish code paths and passcode hash matches, not that a menu or cheat is reachable in a particular runtime state. External cheat effects are attributed to the linked guides and are not treated as binary-confirmed behavior.
## Passcode Recognition
`FUN_0042959e` constructs a 256-entry CRC table using polynomial `0xedb88320`. `FUN_00429549` hashes the requested byte count from seed `0xfac5fac5`; `FUN_004291e0` hashes ten bytes and compares the result against 35 dwords beginning at `0x5eb300`. Matching a slot updates its bit in `DAT_00704248`; slots 7 through 18 are made mutually exclusive. The surrounding lookup wrapper `FUN_004294eb` returns the matching slot or `35` when no table entry matches. These findings are from the executable's pseudocode, not from readable plaintext cheat strings. REA Evidence: CRC table `ev_35bb19672e88b04c20689b7020203e367784d26a151d31fc23632b0fe04cf53e`; hash routine `ev_e04a9605c1db82129bc4a0d7c605dc09786f53509ae9720e8bd872c5de8e7a85`; table matcher `ev_caf5048103c29b0dfee21f185db388b6310ef33cbdd828a601646237e0699bf6`.
The spellings below reproduce these table slots when represented in the ten-byte input consumed by the matcher. Shorter strings were tested with trailing NUL padding. A matching hash establishes recognition by this executable's table, not the reported gameplay effect.
| Slot | Accepted passcode spellings | Published effect (not runtime-tested) |
| ---: | --- | --- |
| 0 | `WIMPAMI` | Unlock bonus missions/levels. [1][4] |
| 2 | `WOOKIEPELT`, `PKDWXE`, `CRBSIFA` | Unlock the Millennium Falcon. [1][2][3][4] |
| 3 | `GOODGUYTIE`, `AAAAFNPDJY` | Unlock a TIE ship, described as the TIE Interceptor or TIE Fighter; some guides say the Falcon must be unlocked first. [1][2][3][4] |
| 5 | `CNDDOBY` | Display a developer-team picture. [1] |
| 11 | `CREDITS`, `ONCHHZU` | View the credits. [1][2][3][4] |
| 14 | `WOOKIYRWMW`, `AAAABDBOHP` | Effect unresolved; GameFAQs groups these with other unknown codes. [1] |
| 15 | `CHICKEN`, `OTOOJKH` | Control an AT-ST; one guide reports it unavailable on Taloraan. [1][2][3][4] |
| 19 | `MAESTRO` | Open the Concert Hall / listen to the music themes. [1][2][3][4] |
| 20 | `DIRECTOR`, `EAAAABUMFU` | View cutscenes; guides direct players to High Scores > At The Movies. [1][2][3][4] |
| 22 | `IAMDOLLY` | Infinite lives. [1][2][3][4] |
| 24 | `TOUGHGUY`, `NAKASGMQ`, `MLVBHF` | All power-ups or a technology upgrade, depending on the guide's wording. [1][2][3][4] |
| 25 | `NDAAFXWSFQ`, `EAAAABYCBA` | Effect unresolved; GameFAQs lists these among unknown codes. [1] |
| 28 | `OOMPAWAMPA`, `GCTHNME` | Conflicting reports: level select versus bonus-mission unlock. [1][2][3][4] |
| 30 | `USEDAFORCE`, `FSSRNB`, `JKQCNMH` | Use any ship available in the current level. [1][2][3][4] |
| 33 | `GUNDARK` | Change joystick force-feedback resistance based on velocity. The bundled README describes forces for varying stick resistance with velocity. [1][2][3][4][5] |
| 34 | `LEIAWRKOUT` | Enable acceleration/deceleration force feedback. The bundled README documents these forces and the `-i` command-line option for desensitizing craft movement caused by them. [1][2][3][4][5] |
The 19 remaining table slots (`1`, `4`, `6`-`10`, `12`-`13`, `16`-`18`, `21`, `23`, `26`-`27`, `29`, `31`-`32`) are not mapped to passcode spellings in this pass. Tested guide-listed candidates `HIKEN`, `NEUC`, `ACE`, `LOKJOT`, and `RECUER` did not match a table hash under the tested ten-byte normalization. This is a bounded mismatch result for those candidates, not proof that all other published lists or game builds are wrong.
### Reported Entry Method and Source Disagreements
The PC guides describe entering passcodes from the main menu through **Settings > Passcodes**; the bundled README specifically places the two force-feedback codes in **General Settings**. This menu interaction was not tested in the game.
Guide wording is not fully consistent. `OOMPAWAMPA`/`GCTHNME` are called a level-select code by Cheat Code Central, GameRevolution, and Super Cheats, while GameFAQs calls them a bonus-mission unlock. Reports also vary between “TIE Fighter” and “TIE Interceptor” for `GOODGUYTIE`, and whether that ship requires the Millennium Falcon first. Treat these as guide claims, not resolved binary semantics. Codes such as `ACE` (Expert Mode), `RECUER` (Imperial Shuttle), `HIKEN` (bonus weapons), and `NEUC` (radar destruction) occur in guide material but did not match the tested hash table for this executable.
## Debug Features
### Reachability and Opening
- `FUN_005081d0` builds an editor-style menu containing `X`, `File`, `Object`, `Tools`, and `Config`. It creates the `Config` menu and its entries only when its second argument is nonzero. The startup routine `FUN_004ea9f0` writes zero to `DAT_00658df0` at `0x4eaa71` and later passes that value to the menu builder. Its two resolved callers are `FUN_004dd07c` and `FUN_004ea726`; both use this initialization path.
- The only direct write found for `DAT_00658df0` is that startup write of zero. The menu callback `FUN_004eba88` also returns without handling events unless `DAT_00658df0 != 0` and the UI event phase is `5`. If enabled, callback item `0x11` (17) invokes `FUN_004f2beb(2)`, which toggles the separate panel-display flag `DAT_00669adc`.
- The caption at `0x62d26c` is `Toggle Debug (Alt+t)`. Its menu-table slot is 17 and matches callback case `0x11`; this proves the intended command in the editor menu, not a working retail shortcut. The conditional route, if another build or state enables `Config`, is **Config > Toggle Debug** or the displayed **Alt+T** accelerator. No normal-play route that sets the gate nonzero was found. The matching menu builder, callback, and toggle are `FUN_005081d0`, `FUN_004eba88`, and `FUN_004f2beb`.
### Panel and Modules
- The `swe_debug` module registers the panel initializer and cleanup callbacks through its `LECMODULE=swe_debug` descriptor. `FUN_004f26f2` queries the `DEBUG` registry, stores each entry's display callback, and initializes its state to zero. It accepts at most 20 entries (indices 0-19); this executable contains seven `DEBUG=` registrations listed below. Missing entries or handlers take logged error paths.
- When enabled, the panel is titled **Debug Data** and has a **Set...** control. Activating it opens **Choose module to modify** with the registered module names. The panel draws the available names as rows. Selecting one sends state `-1` to that module and `0` to every other module; closing the panel clears its display flag and sends state `0` to all handlers. This is a one-module-at-a-time diagnostic selector, not a multi-option cheat menu. REA Evidence: panel builder `ev_aff919a807c9db7b2ee6fc76459630541650ce05764b6c1097ad09318ad8d2e7`; event/draw handler `ev_b0cefbd060522a6ca5a55aec191d2db41b262790e3308fe975e7fb3133f9c213`; cleanup `ev_a8cd442e451cdeac0b07ab05b15f853a1129dee7f531072fd556e44ad318ba48`.
| Registry key | Chooser label | Embedded module description | Initializer |
| --- | --- | --- | --- |
| `DEBUG=swe_link_debug` | `Text Links` | `SWEET text hyperlink System`; debugging interface for the SWEET text-hyperlink module. | `FUN_004f1370` |
| `DEBUG=swe_dirtyrect_debug` | `Dirty Rectangles` | `SWEET Dirty Rectangle System`; debugging interface for the SWEET dirty-rectangles module. | `FUN_00502ee0` |
| `DEBUG=animframe` | `Insane AnimFrame` | `Insane AnimFrame Debug Interface`; debugging interface for the Insane Animation Frame module. | `FUN_00508d40` |
| `DEBUG=insane_animplay` | `Insane AnimPlay` | `Insane AnimPlay Debug Interface`; debugging interface for the Insane Animation module. | `FUN_00509c60` |
| `DEBUG=insane_clami_debug` | `Clami Script` | `Clami Script Debug.`; debugging interface for the Clami Scripting module. | `FUN_0050db50` |
| `DEBUG=insane_bundle` | `File Bundler` | `Insane File-bundler Debug.`; description says “Insance file-bundling system” in the binary. | `FUN_0051e6d8` |
| `DEBUG=insane_cache` | `File Cache` | `Insane File-caching Debug.`; description says “Insance file-caching system” in the binary. | `FUN_0051fbe0` |
The module callbacks' displayed names/descriptions and state setters are present, but this pass did not trace every subsystem's downstream rendering or diagnostic side effects. The names establish the areas covered, not a complete list of counters, overlays, or commands inside each module.
### Other Diagnostic Markers
The binary also contains two separate memory-registry identifiers, `MEMORY=rogue_debug` at `0x60b3c4`/`0x60b3d8` and `MEMORY=insane_debug` at `0x63908c`/`0x6390a0`. They are not entries in the `DEBUG` selector described above. These strings alone do not establish supported command-line switches or visible features. The literal string inventory is recorded in REA Evidence `ev_a5b5fafa357ab084dc9545fa066d67ecb6e8fcb38f74886efebf9410ca0c88c7`.
## Evidence and Confidence
- **High, binary-observed:** executable identity and digest; CRC table construction; ten-byte hash routine; 35-slot comparison table; the mapped spellings' hash matches; Config-menu gating and startup zeroing; the conditional Alt+T callback; Debug Data panel construction, module selection/state behavior, and seven registered diagnostic module labels. See the Evidence IDs attached above.
- **Medium, source-reported:** gameplay effects and passcode entry steps. Multiple PC guides agree on many effects, but they are user-submitted or secondary references and were not tested against this executable.
- **Unresolved:** meanings of the 19 unmapped hash slots; effects of the codes in slots 14 and 25; the `OOMPAWAMPA` effect conflict; exact TIE ship/prerequisite; whether another build/runtime state can set `DAT_00658df0` nonzero; what each diagnostic module renders or logs after activation; differences among regional or repackaged builds.
- **Not performed:** launching the game, entering passcodes, observing the Debug Data panel at runtime, patching bytes, or saving a Ghidra project.
## External References
1. [GameFAQs: Rogue Squadron 3D (PC) cheats](https://gamefaqs.gamespot.com/pc/70612-star-wars-rogue-squadron-3d/cheats) — community-submitted code aliases and reported effects, including unresolved entries.
2. [Cheat Code Central: Star Wars: Rogue Squadron cheats for PC](https://www.cheatcc.com/articles/star-wars-rogue-squadron-cheats-codes-cheat-codes-walkthrough-guide-faq-unlockables-for-pc-pc/) — PC code list and instructions.
3. [GameRevolution: Star Wars: Rogue Squadron PC Cheats](https://www.gamerevolution.com/guides/29965-star-wars-rogue-squadron-pc-cheats) — PC code list.
4. [Super Cheats: Cheat Mode for Rogue Squadron 3D](https://www.supercheats.com/pc/star-wars-rogue-squadron-3d/14926/cheat-mode/) — PC code list; the site notes submissions are not usually tested.
5. `C:\RE\Star Wars - Rogue Squadron 3D\ROGUE\README.TXT`, “Force Feedback Support” — documents `LEIAWRKOUT`, `GUNDARK`, and the `-i` option.