Pay the innkeeper, the screen fades, and the party wakes with full HP and MP. Retail Legaia has no inn system behind that: no dedicated code, no price table, no "this is an inn" flag. Every inn is an ordinary conversation in its town's script, and the price is a number typed into that script. That is what makes the stay portable and editable - and what makes finding a price a byte scan rather than a table lookup.
0x03) - the innkeeper's own dialogue record.0897. No inn overlay, no menu sub-screen.4C 82 <slot>) - the only inn-specific opcode in the game.legaia_scene_formats::inn_costs (price scan); engine path engine-field::inline_dialogue over engine-vm::field.The No answer and the can't-afford skip both land on refusal lines inside the same record; a stay never leaves the script VM.
Nothing but the record's own text boxes is drawn during a stay. The rest is the colour fade, the rest cue and two waits, with no caption over the dark screen; then the record stops the cue, resumes the music, fades back and says good morning. The port's own fallback inn prompt follows suit: its rest beat holds for a moment and draws nothing.
Nothing marks a dialogue as an inn. The hand-off from the offer to the restore is the option picker's per-option relative jump: the record is laid out so that answering Yes lands on the gold gate. Two details of that layout trip up a port - either alone makes every inn unreachable.
| Detail | What it is | What goes wrong if misread |
|---|---|---|
Menu open byte 0x2A | A 2-option picker that animates the box first and clamps (does not wrap) the cursor. Handled by the same arm as 0x27..0x29. | A decoder that stops at 0x29 finds no inn menu - and misses a large share of the game's other menus. |
A2 F8 <clip> / AC F8 08 / AD F8 08 | "Play a clip on the player, clear the end latch, spin until it re-latches." Bit 8 of the actor's clip-control word is the end flag; F8 retargets the player. | Treating the spin as "conversation over" stops one instruction into the Yes branch, before the gate. |
The port runs the innkeeper's own record through its field VM: the gate reads the live purse, the debit is the record's own ADD_MONEY, the restore is its own 4C 82 ops, and the runner parks on the clip spin until the player's clip latches its end.
retock innkeeper1F <greeting> 00 1F <price line> 00 1F <offer question> 00
2A <rel16 yes> <rel16 no> 24 ; 2-option picker + post-page continue
1F <"yes" label> 00 1F <"no" label> 00
; yes-jump target:
A2 F8 <clip> AC F8 08 AD F8 08 ; play a player clip, clear its end latch, spin
... 26 <rel16> ; -> the gate
4E <pp> 30 <cost u16> <skip u16> ; if gold < cost, skip to the refusal
3A <sext24(-cost)> ; take the money
1F <thank-you> 00 1F <good night> 00
35 / 34 01 / 4A / 36 / 4A ; BGM release, colour fade, wait,
; rest cue, wait
4C 82 00 4C 82 01 4C 82 02 ; the restore, one op per party slot
36 FFFF / 35 / 34 00 / 4A ; cue stop, BGM resume, fade back
1F <good morning> 00
The full Yes gesture is the door-swing shape aimed at the player: un-hold, poke the clip, clear + spin, un-clamp, wait, re-clamp, clear + spin again, then hand the player back to the locomotion move. Every operand is an animation bit of the player's +0x62 word, not a local flag of the record.
One stay ends with a scene change instead of a fade. The Conkram innkeeper sets system flag 0x53C and loads CONC3. That scene's entry script spawns a wake-up record only while 0x53C is set and 0x5F7 is clear. The record fades back in, parks the innkeeper, Dr. Usha, his companion and the counter relay on an off-map tile, sets 0x3F9, shows its wake-up page and sets 0x5F7 - so a later visit runs none of it and seats the four again. A disc-gated engine test pins both arms of the entry gate.
The price is a gold-gate + debit pair: op 0x4E sub-op 3 compares the party's gold against a u16 literal and skips when gold is short; op 0x3A (ADD_MONEY) then applies the negative of that literal. A 32-bit sibling (sub-op 10) exists for prices above 65,535 and is used only by the casino's gold-to-coin counters.
legaia_scene_formats::inn_costs finds the pair by byte scan - a literal in a gold compare that reappears as a debit within a few instructions - which survives the picker jump tables that desync a linear walk. The engine runs that scan at scene load. Free rests (Rim Elm's bed, Biron) have no pair at all.
| Scene family | Charge | Form |
|---|---|---|
ropeway, balden, rayman2 inns | 200 G | sub-3, u16 |
retock inn | 240 G | sub-3, u16 |
station3 train ticket, paid tours | up to 3,000 G | sub-3, u16 |
koin* casino counters | 8,500..90,000 G | koin4 carries the only sub-10 u32 sites |
| Function / data | Address | What it proves | Dump |
|---|---|---|---|
Field VM op 0x4E inner jump table | 0x801CEE30 (12 entries) | Sub-3 arm at 0x801E0AEC loads party gold _DAT_8008459C; sub-9 at 0x801E0B34 loads the casino coin bank _DAT_800845A4. Read from the disassembly - the decompiled C collapses these arms. | overlay_0897_801de840.txt |
| Option-jump handler | FUN_80038050 | 0x27..0x2A share one arm: new_pc = O + 1 + index*2 + i16(entry[index]). | 80038050.txt |
| Picker cursor handler | 0x801D941C | Option count comes off the active state (0x18 = 4, 0x16 = 3, else 2); 0x2A enters state 0x11 and clamps. | field overlay dump |
| Actor tick | FUN_800204F8 | Latches bit 8 of actor+0x62 when a clip ends - the bit the AD F8 08 spin waits on. | 800204f8.txt |
| Cross-context id resolver | FUN_8003C83C | Id F8 short-circuits to the live player object _DAT_8007C364. | 8003c83c.txt |
| Disc sweep | every scene MAN | The gate + debit pair resolves in every inn / paid-lodging scene and nowhere a rest is free; the real retock record, run through the port's field VM, moves the gold and the party pools on Yes and leaves both alone on No and can't-afford. | - |
A per-scene cost table in the menu overlay's data segment was the natural first guess; the disc has none. Three port defects hid the real path at once: 0x2A decoded as nothing, the gate read an empty purse, and the clip spin was read as the end of the conversation. See settled threads.
Full provenance: docs/subsystems/inn.md. Source: crates/engine-menus/src/inn.rs, crates/engine-field/src/inline_dialogue.rs.