Files
llamamod/notes/mod-devmode.md
T

58 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Developer mode (`devmode`, CHEATS)
`mods/devmode/DevModeMod` + `DevModePatch` – two groove.exe patches, no data changes. Background and
the full list of what the switch unlocks: `mod-cheats.md`, "Developer switch (property 258)".
## Options
| Key | Default | padAux bit | Effect |
|---|---|---|---|
| `flyKey` | F1 | 0x800 held | Llama (also from standing), LlamaChase, bunny rise while held; frog after a jump |
| `heartKey` | F2 | 0x400 (pressed edge) | +1 heart, +5 purple fruit |
| `idolKey` | F3 | 0x200 held | pink idols +1 per frame, max 99 |
| `coinKey` | F11 | 0x100 held | coins +1 per frame |
| `flyToggle` | off | – | fly key toggles bit 0x800 instead of hold |
Keys are `Hotkeys.option` choices (cross-mod conflict check); defaults avoid practice F5/F8, freecam
F7/F9 and the game's F4/F6/F10. The developer switch itself has no option (always on with the mod).
Two equal keys → apply fails with a message.
## Patches (German / English addresses, all via `Site`)
1. **Property 258 = 1.0.** `PROP_GET` (0x550E60 / 0x550B80) is the strat property getter; its
`jmp [eax*4 + table]` has the table address at +21 (0x552684 / 0x552390, in .text). Entry
0x102 (0x552A8C / 0x552798) pointed at the shared `push 0` handler (0x55231B / 0x55198F; the
patch checks its bytes) and now points at a cave: `mov eax,[esp+14h]; push 0x1000; push eax;
call <push result>; add esp,8; add esp,10h; ret`. The other ids of the shared handler
(de: 0x75, 0x9E, 0xC1, 0xEE; en: 0xC1, 0xEE) stay 0. The table entry has a .reloc entry; the
exe always loads at its image base, so the absolute cave address is fine.
2. **padAux from keys.** `PAD_POLL_END` (0x425B88 / 0x425A08, tail of the pad poll FUN_004256c0:
`mov eax,[padCount]; pop ebx; cmp eax,1; jbe; mov [padAux],0; add esp,8; ret`, 25 bytes) →
`jmp` cave + NOPs. Cave: `pop ebx`, ecx = OR of the bits whose DIK slot in `KEY_STATE`
(0x58226C / 0x5818FC, s32[256] frames held, all 0 while Alt is held) is > 0, 0 while `DEMO`;
`mov [PAD_AUX],ecx` (0x5FCF58 / 0x5FC5E8); `mov eax,[padCount]` (keeps the old return value);
`add esp,8; ret`. The edge detection padAuxPressed (FUN_00425c00, start of each tick) is
untouched and works as before. Toggle mode: 8 data bytes (previous key state, on flag).
Hotkey names → DirectInput scan codes in `DevModePatch.DIK` (test: covers every `Hotkeys.VK` key).
## Verified in game (apptest `devmode-a`, :25, German exe, village 1-1, defaults)
* A+S three times: three different warp points (`img/mods/devmode_teleport.jpg`).
* F2 twice: fruit 0 → 5 → 10, energy bar refilled.
* F1 held 2.5 s: the llama rises above the village, falls back after release.
* F3 held 1.5 s: idols 46; F11 held 1 s: coins 1 → 32 (`img/mods/devmode_keys.jpg`).
* No crash; game starts normally with the mod (one crash in a Wine DLL at 68E9306B on the very
first start of a fresh session prefix, not reproducible in 3 later starts with the mod).
Not checked in game: English exe (unit tests only), toggle mode, river log Space, 8-6 Space+Z,
frog/bunny, LlamaChase.
## Limits
* Level-skip/music debug menu needs property 0 ≠ 0 as well (also hard-wired 0, used by 131 strat
reads incl. cameras) – deliberately not touched.
* Toggle state survives level changes (flying continues in the next level until pressed again).
* With the switch on, CheatTeleport stays alive in 22 levels; A+S (camera left+right together) is
the warp combo, so pressing both camera keys at once now teleports.