Commit graph

67 commits

Author SHA1 Message Date
acamilo
e006db3742 macros: a ball at low HP is the only attack, and the fly types its catch's name
Two operator decisions (2026-09-29, row 69).

Throw on low HP only: in a wild battle with THROW BALL dealt and the
wild Pokemon at the HP where ItemUseBall's HP factor saturates
(W = (MaxHP*255/BallFactor)/max(HP/4,1) >= 255: about a third for a
Poke Ball, a half for a Great Ball), MOVE 1-4, SWITCH, RUN and the bag's
BACK are withheld. ITEM stays for a hurt thrower. Every precondition of
THROW BALL still gates it, so no ball, a caught species or a trainer
gives the ordinary pad back.

Let the fly name it: the naming screen is read (menu bytes, the
keyboard's box, the underscores; wNamingScreenNameLength and
wNamingScreenSubmitName pinned from the cartridge's own stores) before
the battle test and reads Unknown. Its pad is the fly's own D-pad, A, B
and START, passed through Observed::raw while nothing is bound. Once
the name is full or sixty brain seconds have run, CONFIRM alone is
dealt and presses START until the keyboard closes.

Also moves two doc comments row 66 split from their items (review N3).
2026-09-29 18:07:15 +00:00
acamilo
a69a258edd macros: no floor BUY BALL in Viridian before Oak has the parcel; docs for row 66
On the first visit the Viridian clerk's script hands the parcel over, and
his counter sells nothing until Oak has it. MacroState::parcel_delivered
reads EVENT_OAK_GOT_PARCEL (defaulted true).

docs/design/macros.md 12.30 and infra/docs/macros-traps.md row 66: the
GO SHOP ring, the one-button purchase, the bag after a catch, and the
measured choices with the connectome.
2026-09-29 15:38:51 +00:00
acamilo
5da77454c3 macros: BUY BALL is one button from a mart's floor, like HEAL
Operator decision on row 66. Measured with the connectome, the fly walked
to the Viridian clerk again and again and never chose TALK, so the four
choices a purchase took at the counter never happened. BUY BALL is now also
offered on the overworld pad inside a mart whose first stock row is a Poke
Ball (Viridian, Pewter, Cerulean), while service_needed holds (no ball,
money for one, no Oak's parcel) and the clerk is not in the blocked window.
One press walks to the clerk, talks, advances the greeting to BUY/SELL/QUIT
(checking the first row is a Poke Ball), buys one, answers the price box
and is done when the wallet drops. The open-counter BUY BALL is unchanged.

Unit test for each offer condition; ROM row66 floor purchase from
FLY_ROW66_MART_CHECKPOINT: base never dealt on the floor, no ball; branch
dealt, started, done, one ball, 200 paid.
2026-09-29 14:09:02 +00:00
acamilo
36325d82dd palette: a counter the fly walked away from is not walked back to for the window
Row 62 re-deals GO SHOP/GO HEAL whenever the service is needed, with no
window. Live on v0.6.5 from the rung-8 archive that was a ring: GO SHOP to
the Viridian clerk, GO OUT/GO OBJECTIVE back out without TALK, GO SHOP again
(33 in 35 minutes). A completed GO SHOP/GO HEAL facing the counter person now
records TargetKey::Counter on the building's map; the service walk toward it
is withheld for the reached window, from the street and inside. TALK at the
counter is unchanged.

ROM row66 test (FLY_ROW66_MART_CHECKPOINT): base 31 street GO SHOPs in 10,000
frames, branch 0.
2026-09-29 13:55:23 +00:00
acamilo
ceaf55ad48 macros: a yard's one door is taken, and a split map's exits are the fly's own piece's
Cerulean's badge house back door leaves the fly on (9, 9), the door tile of a
closed yard; the pad was empty for the rest of the survey.

- The exit walks fall back on a step-fired warp underfoot once every listed
  goal has failed the route search (goals_of set it aside while any other exit
  was listed, reachable or not).
- The decoded grid marks warp carpets (warp_carpet_tile_ids.asm) on the maps
  whose ExtraWarpCheck reads them; a walk whose goal is a warp underfoot bumps
  toward one (CheckWarpsCollision) instead of row 64's sideways step-off, which
  fires nothing on a tile that is no door.
- The badge house is on the map graph and the yard is a piece of Cerulean, so
  GO OUT in the house takes the front door.
- path::exits keeps the fly's own piece on a split map: refusals from the yard
  no longer rest the town's exits for the whole map.
- The 12.28 guarantee reads where the fly stands: a same-map teleport moved it.

ROM test row65_the_fly_leaves_the_cerulean_badge_houses_back_yard
(FLY_ROW65_YARD_CHECKPOINT); scene_probe's route survey can save its caught
frame (FLY_PROBE_SAVE without FLY_PROBE_SAVE_RANK).
2026-09-29 04:01:16 +00:00
acamilo
2f869fd4bc macros: a floor whose way on is a passage deals no GO OUT fallback
GO OUT's "a room has to be leavable" tier dealt Mt. Moon 1F's mouth back onto
Route 4 (visited, away from the rung) one step from the tile the fly arrives
on, and Route 4's GO ROUTE / GO OBJECTIVE walked it straight back in. With row
62's GO HEAL bringing a hurt fly back to that tile, rows 62+63+64 crossed
Route 4's west doors 34 times in row 59's ROM test (bound 25).

While an unrested passage leads toward the objective, the way out has no
fallback: GO WARP's rule the other way round. The blocked window is the escape
hatch; tiers one and two (somewhere new, toward the objective or an errand)
are untouched, and a hurt party keeps GO HEAL.
2026-09-29 04:01:16 +00:00
acamilo
19d295d111 tests: close row 62's last test, whose brace the row 64 merge took as shared context
Both branches appended tests at the end of the file; resolving the
conflict as both sides left row 62's final test without its closing
brace.
2026-09-29 01:47:23 +00:00
acamilo
ccba5d75a2 tests: row 64's ledge test sees Route 4's centre, which row 62 made an errand
review-row62-r2: merged, the Mt. Moon centre is the errand ahead of the
test's goal on Route 4's west side; the behaviour is right, the fixture
predates row 62.
2026-09-29 01:31:22 +00:00
acamilo
ce12a1d7a5 Merge fix/loop-row64
# Conflicts:
#	docs/design/macros.md
#	infra/docs/macros-traps.md
#	services/flysim/crates/flybrain-gb/src/pokemon_red/macros/tests.rs
#	services/flysim/crates/flysim/tests/rom_macros_mode.rs
2026-09-29 01:31:22 +00:00
acamilo
e2e830076e Merge fix/loop-row62
# Conflicts:
#	docs/design/macros.md
#	infra/docs/macros-traps.md
#	services/flysim/crates/flybrain-gb/src/pokemon_red/macros/tests.rs
#	services/flysim/crates/flysim/tests/rom_macros_mode.rs
2026-09-29 01:30:32 +00:00
acamilo
83e842aee2 macros: a way out that does not take the fly anywhere is not done
The general half of row 64: section 12.2's rule ("a macro that completes
without moving because its precondition is already satisfied is a trap")
held by the executor for every way out, instead of by each macro.

A way out's promise is another map. A Settle arrival on an exit key that
leaves the fly on the same map now ends Blocked, so the exit rests in the
blocked ledger for the window. When the fly never left the tile it pressed
from, row 57's refused-from-here ledger also keeps that button off this
tile for the window, because the last resort ignores the blocked ledger
and would otherwise re-deal the same dead exit once per hold. Nothing is
pressed, ranked or chosen: two ledgers that already exist get one more
honest writer. A pad with nothing left that can run is empty and waits.

On base with only this commit, from the live row-64 checkpoint (72k
frames, GO OBJECTIVE/GO WARP preferred): GO OBJECTIVE done in place 1,500
-> 0; the fly leaves the ladder tile and moves on (still not to Cerulean,
which needs the ledge knowledge). The test fixture's settle now drains the
refused ledger after every finish, as PokemonPalette::record_talk does.
2026-09-28 23:38:06 +00:00
acamilo
e10f48e1c7 macros: a ledge is a hop the route search takes the one way the cartridge does
Row 64, the source of the Mt. Moon ring. Off the ladder, the road reaches
Route 4 east of the mountain, where Cerulean is three ledges down. The
collision list calls a ledge tile a wall, so the route search had no road
from the cave's exit to Cerulean at all: GO OBJECTIVE refused no route, the
east edge rested in the blocked ledger, and the other walks took the fly
back into the cave, onto B1F's exit (27, 3) or down B1F's ladder to B2F
(5, 7), where the ladder ring took over.

- The decoded grid marks LedgeTiles hops (data/tilesets/ledge_tiles.asm,
  OVERWORLD tileset only, the lower-left anchor tiles HandleLedges reads).
- The route search takes a hop from above as one press that lands two
  tiles on; from below a ledge stays a wall; the flood the map's pieces
  are measured with is unchanged.
- The walk holds while the cartridge carries the fly over (scene Unknown,
  scripted, on the hop's own line), so a hop it asked for is not written
  as a push-back.

ROM test from the live checkpoint (FLY_ROW64_CHECKPOINT): base stays on
(5, 7) with 167 done-in-place and never leaves B2F; branch takes the
ladder on the first GO OBJECTIVE, hops Route 4's ledges and reaches
Cerulean City at frame 1,972 with the pushed ledger empty.
2026-09-28 22:50:34 +00:00
acamilo
014d869e14 macros: a walk that starts on its own ladder steps off and back on to take it
Row 64, Mt. Moon B2F (5, 7), two days live. A warp whose exit has no press
fires at the end of a step onto it (CheckWarpsNoCollision) and at no other
time; a bump into the wall beside it warps only at a map edge off the
overworld (ExtraWarpCheck). The fly came down the exit ladder and stood on
it, and GO OBJECTIVE and GO WARP both aimed at the tile underfoot, settled
there and reported done without a press, 27 frames each, ~750 per ten brain
minutes. No ledger was involved, so restarts restored the ring.

A walk whose goal is a step-fired warp the fly already stands on now steps
onto free ground beside it (never another warp) and back, which is what
fires it. Nothing else changes: the pad, the ledgers and every other
arrival are as they were.
2026-09-28 22:49:17 +00:00
acamilo
f2d8a2d491 palette: a centre is the area's from ground the route to it stays on, and no service leaves the rung's room
Review round 2 of row 62. Route 4's east side and Mt. Moon B1F's exit chamber are in
Route 4's area, but the only road to its centre runs through B2F, which is in none:
GO HEAL (and the errand under GO OBJECTIVE) walked into B2F and dropped there, opposite
the road to Cerulean. A building is the area's errand or service only where
geography::route_within holds. And a service is not wanted while the rung's own target
stands in the room (row 29's rule, row 58's gym bounces).
2026-09-28 22:12:09 +00:00
acamilo
87d31bcade palette: a centre or a mart with a job to do is dealt again, and its counter person is found from the door
The errand is paid by the first visit, including one on which the counter
could do nothing (the Viridian clerk handing over Oak's parcel, a centre
entered with a full party), and GO SHOP / GO HEAL never came back; a
counter person this session had talked to or reached was retired for it
too. Live: eleven hours, GO SHOP twice (the parcel), no BUY, no HEAL, no
throw, wLastBlackoutMap still Pallet Town.

service_needed reads the cartridge each time: a centre while the party
needs rest, a mart while the bag has no ball, the wallet covers one and
the bag holds no Oak's parcel. It satisfies itself (a heal leaves the
party full, a purchase leaves a ball). GO SHOP / GO HEAL aim at the
area's building while it holds; inside, the counter walk and TALK at it
ignore the talked and reached ledgers (blocked is kept). HEAL's goals
keep the tile that already faces the nurse, where GO HEAL leaves the fly.
The counter person is read from the drawn and the off-screen sprites
(row 58's reading): from a centre's door the nurse is six rows up and
off the screen, so HEAL, GO HEAL and the counter's suppression were all
off on arrival (loop review row 62).
2026-09-28 22:08:17 +00:00
acamilo
9ad2feff5c executor: a purchase answers the price box the cartridge drew, and is done when paid
After the quantity the mart prints "That will be" and waits for a press
(a cont), then prints the price and only then draws its YES/NO box. The
script's one blind A after a settle was that press, so BUY BALL reported
done before the box existed: 55 starts, 55 done, the wallet unchanged,
from the rung-11 Pewter checkpoint. Step::Prompt pulses A until the box
is drawn (yes_no_prompt, row 56's reading), Step::Paid waits for the
wallet to drop; either running out is blocked. The fake mart now prints
its price, draws the box and charges for a YES (loop review row 62).
2026-09-28 22:08:17 +00:00
acamilo
019bd02dfe geography: Route 4's Pokécenter is a centre on the map graph
MT_MOON_POKECENTER ($44, Route 4's warp at (11, 5)) joins LINKS, Route
4's west piece and AMENITIES as Route 4's centre. It was on no table,
so HEAL was never dealt in it and no errand could walk to it: the last
centre before Mt. Moon, where the live run spent 3.5 hours whiting out
(loop review row 62).
2026-09-28 22:08:17 +00:00
acamilo
e170812e7c palette: a battle menu the cartridge still holds an A on deals no pad
RUN's A is taken and the menu's box stays up while the game stops asking the joypad; a
macro dealt on those frames pressed at a menu already gone and held the pad for its cursor
wait. Empty until the cartridge asks again, 12.13's reading.
2026-09-24 05:29:03 +00:00
acamilo
4178a20529 palette: MOVE 1 is FIGHT's backstop only while nothing else is a move, and ITEM asks the cartridge about its Potion 2026-09-24 04:49:40 +00:00
acamilo
86149dca9b executor: a confirming A waits for the cartridge to have let go of the last one
The Potion's party list reads open before the game asks the joypad again, and until it asks
the A that opened it is still in hJoyLast: an A pressed there is no edge. ITEM confirmed on
that frame, reported done over a list still waiting, and the fly backed out with BACK, BACK.
2026-09-24 04:49:40 +00:00
acamilo
113970f4e1 state: what the cartridge does with an item from the battle bag, and whether it still holds an A
item_routine reads ItemUsePtrTable ($03:$55E1) by id and checks it by its own shape;
battle_item_use answers each routine's refusal on bytes already in WRAM. a_latched reads
hJoyLast, the reading the joypad edge is made against. MacroState gains item_refused and
a_latched, both off by default.
2026-09-24 04:04:08 +00:00
acamilo
cff15804fb state, tests: the challenge covers the "!" bubble too, the doc block back above its impl, and the ROM test asserts no pad inside a challenge 2026-09-23 23:47:36 +00:00
acamilo
0e366cd4e4 state: a trainer's challenge is the cartridge's until its battle is over, in the macros' own scene 2026-09-23 23:27:54 +00:00
acamilo
9ccc0592b1 docs: macros.md 12.24 and the row 59 audit 2026-09-23 22:33:47 +00:00
acamilo
5147ab1a87 geography: a header connection no step on foot crosses is named and is not a way out; Pallet's shore, the sea routes, the League fence 2026-09-23 22:23:01 +00:00
acamilo
97a97a501d geography: a split map is pieces with their own doors and neighbours; Route 4 and Mt. Moon's lower floors, the hop matched on where an exit lands 2026-09-23 22:23:01 +00:00
acamilo
4108fec5ce macros: a push-back is a refusal once the overworld has stayed the fly's for half a second, not on the first frame of it 2026-09-23 22:23:01 +00:00
acamilo
d85ee5026f geography: Route 3/4, 14/15 and 24/25 as the headers connect them, and Mt. Moon's doors on Route 4 2026-09-23 22:23:01 +00:00
acamilo
f3e3e9cf98 palette: a move the cartridge answers with nothing is not dealt beside one it does not
Row 60: TAIL WHIP against a Pidgey at DEFENSE -6 was MOVE 2 183 times. The
rule is PP's: a refused move leaves the pad while another move is usable, and
with none usable the moves stay as PP deals them, so an open list never
comes down to BACK alone.
2026-09-23 17:23:05 +00:00
acamilo
438b2d8540 state: the move table, and whether the battle engine will answer a move with nothing
move_data reads a row of Moves from the cartridge image ($0E:$4000, each row
checked against its own id); move_without_effect answers the refusals the
effect routines make on bytes already in WRAM: a stat stage at its limit or a
stat at 1/999, Mist or a substitute against a stat-lowering move, a status
move against a statused, Poison-type or (Electric) Ground-type target.
MacroState::move_without_effect defaults to false.
2026-09-23 17:23:05 +00:00
acamilo
ddf0743395 a trainer's challenge is not the cartridge refusing a step
Section 12.4 and row 37 read a macro the cartridge ended by taking the
joypad as a refusal and wrote the target blocked and the tile pushed on
the spot. A trainer who sees the fly takes the joypad the same way. In
the Pewter Gym the walk toward the leader crossed the Jr. Trainer's
sight line, and BROCK went into the blocked ledger for ten brain minutes
while the fly lost, blacked out and walked back to a room whose way out
was the pad again.

The entries now wait for the cartridge to give the joypad back: back in
the overworld is a refusal, written as before; a battle is a battle and
teaches the ledgers nothing. Tests for the rung's people off the screen,
facing one of them, and the challenge; the two push-back tests now hand
the joypad back before they read the ledgers.
2026-09-23 11:48:57 +00:00
acamilo
3eb82d7144 a warp's tear deals no pad
wCurMap names the new map thirty-two frames before the header, the
coordinates and the warp table follow it, while the screen fades, and
nothing sets the joypad bits until the fade ends. The seam read
"map 54 at (16, 17)" -- Pewter City's doormat under the gym's id -- as
an overworld, dealt a pad, and a walk started there planned over the
wrong map; what it aimed at and the tile it left went into the ledgers
under the new map's id. Live, GO OUT started and finished in 0.05 s.

The driver reads a tear as the map byte having changed while the fly
still stands on a warp of the loaded table that leads to the map the
byte names (a doormat's LAST_MAP under a town's id included), deals it
as Unknown with an empty pad, and records no ground from it. Teleport
pads do not change the map byte, so they are never a tear; a tear is
bounded at TEAR_FRAMES all the same.
2026-09-23 11:26:49 +00:00
acamilo
484cc075cc the rung's people are in the room when the screen does not show them
CheckSpriteAvailability writes $ff into the image index of a sprite
outside its window, and state::npcs reports what is drawn. From the
Pewter Gym's doormat that is the guide alone, already talked to, so the
rung's list was empty: GO OBJECTIVE had nothing to aim at and GO OUT,
withheld only while the rung's person is in the room, was the pad.
Outside, GO OBJECTIVE walked back in. BROCK was twelve rows up.

state::offscreen_npcs reports the sprites the cartridge hides only for
being outside the window, read from bytes the seam already has, and
objective_targets reads them for a person. Nothing else does: a sprite
out of the window may be a toggleable object switched off, and GO NPC,
TALK and objects keep what is drawn.

Facing any of the rung's people is the arrival: with three in a gym,
leaving out only the one ahead walked GO OBJECTIVE between the leader
and the trainer.
2026-09-23 11:26:49 +00:00
flybrain
cc6f06ed2a a refusal that teaches the ledger something is not held against the tile
Measured with the real brain on the seeded pocket: it pressed GO ROUTE
first, while the gym's door was still the second tier's answer. That
refusal wrote the door to the blocked ledger and also withheld GO ROUTE
on the tile, so the next deal -- the last resort, whose walk now goes
where it can -- was never made, and the fly waited out the window.

Only a last resort deals goals the ledger is already resting, so the
refusal worth remembering where the fly stands is the one that taught
the ledger nothing new. A refusal that writes a new exclusion changes
the next deal by itself.
2026-09-23 07:25:19 +00:00
flybrain
ef98b04547 a last resort that cannot reach the objective's door takes a way out it can
Row 57's pocket had a way out: the road east, three tiles from the fly
and resting in the blocked window. The last resort ignores that window
but narrows to the ways toward the objective, and the only one was the
gym's door beyond the fence, so the route search refused and the road
was never tried. With the refusal withheld the pad went empty and the
fly waited out the road's window, ten brain minutes.

The narrowing is a preference and the dealer cannot search. When start's
route search cannot reach the preferred ways, it tries the rest of the
last resort, nearest reachable first, exactly as every walk chooses. The
pad is unchanged; only where the pressed macro walks.

The ROM proof now asserts the fly leaves the pocket inside a brain
minute: frame 517 (0.14 minutes), against 36,325 (10.1) on the base.
2026-09-23 07:00:07 +00:00
flybrain
acbc655a23 a button refused from here is not dealt again from here
Row 57, live on rung 10 for two hours: the Pewter City pad was GO ROUTE
and nothing else, refused `no route` every 800 brain ms, no button
pressed. The dealer asks the cheap question and start asks the real
one; the blocked ledger closes the gap for every list except a last
resort, which ignores that ledger by design. So GO ROUTE's refusal,
which wrote the gym door to the ledger, could not take the button off
the pad, and re-stamped the door's window every hold, which kept GO
OBJECTIVE's only goal excluded for ever.

A `no route` or `precondition` refusal is now recorded with the tile
the fly stood on, and the dealer does not deal that button from that
tile for the blocked window. It is dealt again the moment the fly
stands anywhere else or the window closes. Nothing presses; a pad with
nothing runnable is empty and the fly waits.
2026-09-23 05:47:38 +00:00
flybrain
ab3d4cb6fb an escorted walk walls the tile it reached, not the one it set out from
Row 57. The pushed ledger (row 37, no window) recorded the tile a macro
set out from when the cartridge moved the fly. For a TALK that is the
tile the script fired on; for a walk it can be the far side of the map.
Pewter City's youngster takes the joypad on four tiles by the road east,
GO ROUTE aims east at Route 3 every time, and one walk from the town's
south entrance walled the south entrance, twenty-six tiles from the
script. Walks start wherever the last one ended, so the walls fenced the
fly into a pocket no route could leave.

A walk now records the tile it last stood the fly on, which is where the
cartridge took over. Every other macro keeps the tile it started on.
2026-09-23 05:47:32 +00:00
flybrain
c9212e5498 survey: the route probe, and a seam to rebuild a session's ledgers
FLY_PROBE_CATCH=route drives the real PokemonPalette from a checkpoint,
one uniform choice per hold, prints every pad it deals and every refusal
with its reason, and reads the frame the pad comes down to one refusing
button on: which list emptied why, the no-window ledgers, and whether the
route search reaches each way out. FLY_PROBE_SEED_* rebuild the session
ledgers a restore starts empty; FLY_PROBE_RATCHET starts from the
ratchet's rollback snapshot; FLY_PROBE_HOLD presses raw directions first.

PokemonPalette gains inspect(), fences() and a doc(hidden) ledgers_mut()
for the survey. The loop never calls them.
2026-09-23 05:46:56 +00:00
flybrain
886509b3b5 a NO inside a conversation declines nothing, so it does not un-arm the talk
The other half of row 56. The Pewter Gym guide's conversation is fifty-two boxes
long and a third of the presses that walk it are `NO`, whose B advances a plain
box exactly as `NEXT`'s A does. Every one of them cleared the pending `TALK`, so
the talked ledger never learned the conversation had happened, `TALK` stayed on
the overworld pad, and an A press at him reopened the whole ring: thirty brain
minutes of scene `dialog` with no walk macro dealt.

12.4's rule -- "the fly said no, so the thing is still on offer" -- is about a
declined *offer*, and which of the two a `NO` was is decided where it can be
seen: by whether the box closes on it. So the decision moves to the frame the
text goes away, which is where the talked entry is written anyway, and the
reading is `pending_answer`: armed only by an answer to a prompt this crate can
read, alive for one hold. A declining `NO` still standing there is a `NO` the
box closed on; anything else is a conversation walked through to its end.
2026-09-23 00:37:44 +00:00
acamilo
8523daf745 macros: a purchase the counter's cursor cannot reach is not on the pad
A mart's buy list scrolls. The cursor walks rows 0, 1, 2 and then the window
moves under it, so an item's position in the counter's stock is its cursor index
only for the first three entries; the offset that would name the rest is not a
pinned address. Pewter's counter carries seven items and the Antidote is its
fourth, so `BUY ANTIDOTE` there aimed a cursor step above the list's own max and
reported `blocked` on its first frame, having pressed nothing -- and a purchase
has no walk target, so nothing was recorded and the button came back on the next
hold.

One accessor answers "which index, if any" for both the pad and the plan, and the
clerk talking is refused through the seam rather than here.
2026-09-22 19:56:38 +00:00
acamilo
4a1df7c3be macros: the mart's list byte says the counter is open, not which screen is up
`wListMenuID` keeps PRICEDITEMLISTMENU for a whole mart visit: the clerk's text
is printed from inside the mart's own routine and never goes through the display
that clears it. So every frame of the Pewter mart read "the priced buy list",
including the "Here you are! Thank you!" box the stream was looking at, whose
leftover cursor bytes belong to a two-option box.

Which screen is up is now read from the figure the game draws, the same
construction the dialogue box's `waiting` test and the YES/NO prompt already
make: a full-width box waiting for a press is the clerk (`ShopScreen::Talking`),
the item window drawn is the buy list, and the item window blank is the counter
menu.
2026-09-22 19:56:38 +00:00
acamilo
c42255e199 macros: an edge the map graph cannot name stops being somewhere new once it is stood on
The rung-11 reading of row 54. Route 3's connections read north and west off the cartridge
(`wCurMapConnections`, and it has no warps at all) while the geography table carries west and east,
so the seven walkable tiles of its north edge had an unnameable destination -- and an unnameable
destination counted as unvisited, which made them first-tier for `GO ROUTE` on every hold for ever,
with `GO OBJECTIVE` off the pad beside them because nothing on that map leads to the objective.

A warp's destination is a byte the cartridge publishes, so `None` there is the `LAST_MAP` case
already handled. An edge's comes only from `geography::connected`, so `None` there means the table
cannot name the map on the other side and never will, and the only record left is the adapter's own
boundary ledger. It narrows: a genuinely new edge is still first-tier until the fly reaches it.

Which map is north of Route 3 is not guessed at here. That is a survey -- walk the fly off the edge
with real presses and read the map id back -- and it is recorded as a residual instead.
2026-09-22 17:19:25 +00:00
acamilo
611fe9e108 macros: an errand arrives inside the building, and a building already entered has none
Two rules for section 13's errands, both from row 54's `GO HEAL`: 204 starts at a mean net of 0.0
tiles and a mean reach of 0.0, cycling with `GO ROUTE` and `GO FRONTIER` over five tiles for seven
and a half brain minutes.

An errand's aim at a door carries no press -- the warp fires when it is stepped on -- so an aim on
the tile the fly is already standing on settles for `SETTLE_FRAMES` and reports `done` with the
world exactly as it was. A completed errand walk writes the reached ledger, which `goals_toward`
does not filter, so the same button was dealt on the next hold and the same nothing happened again.
`exit_goals` has excluded a settled goal underfoot since row 13; this is the one walk that did not
have the rule.

And the errand ledger is session state, so a restore re-armed every errand in the town and walked
the fly back to a counter it had already used. `map_visited` is the adapter's lifetime answer to
the same question and it does survive, so both are asked and either pays the errand.
2026-09-22 14:57:34 +00:00
acamilo
895fb52cda macros: the tile a step is landing on is ground the run has covered
The other half of the same measurement. `wXCoord` and `wYCoord` are the tile the step began on
until the frame it ends, so the stood ledger recorded ground the fly had already left and the tile
under it stayed unstood: `path::frontier` kept offering it, `GO FRONTIER` was dealt aiming one tile
away, and `Arrival::Step` reported `done` the instant the step it did not make landed. A macro that
completes without changing anything, which is section 12.2's trap.

A step that has begun always finishes -- the cartridge owns the animation and no press stops it --
and the screen has already centred on the tile, so it is ground this run has covered. It clears the
map's frontier mark on the same rule the coordinates do: only ground never stood on before.
2026-09-22 14:57:34 +00:00
acamilo
4edc4c9bcf tests: ROM-gated, the fly gets out of the museum and into the gym
From the live rung-10 checkpoint with the stub rotation: map 0x34 to map 0x36 on frame 2423, on
15 macros, against never in five and a half live hours. TALK is on the pad inside the gym -- the
fly standing in front of one of the people rung 11's place names -- and it presses it 15 times
there. BACK on a dialog or unknown frame is 0 against the 189 the hunt measured on Pewter City
alone, no frame deals a pad on an unknown with nothing drawn on it, and GO FRONTIER starts 0
times on the museum's two floors.

The unit test beside it is the other half of "the objective reaches the leader": on the gym's
own map the rung's place resolves to the person standing in it, the walk aims at the four tiles
around them, the door is not a candidate while they are there, and talking to them empties the
list. It also pins what the ROM run showed: the town's errands come first for every map in the
area, the gym included, so both have to be paid before the objective is the leader.
2026-09-22 13:12:31 +00:00
acamilo
e0285016aa ratchet: getting nearer the objective is progress the coverage figure cannot carry
Two Stuck rollbacks fired on rung 10 inside half an hour, both on a fly that was walking, and
both were the ratchet working to contract: the stall window is reset by exploration -- one tile
the run has never stood on -- and a fly crossing a town it has already covered to reach the
rung's own door earns none of it. Entering a map for the first time already counts, because a
new map is ground nobody has stood on; re-entering one does not, which is what the museum was.

So the window gains a second signal, passed in by the caller and meaningless to the ratchet
itself, exactly as coverage is: the Pokemon loop answers with "nearer the objective, in map
hops, than this run has ever been", over the same map graph GO OBJECTIVE walks. It can fire at
most once per step of the road, it spends no budget, it captures nothing and it skips no
trigger. Nothing in the macro layer reads it back and no button is bound on it.

The checkpointed ratchet state is untouched: the signal is a level on one sample, not a counter.
2026-09-22 12:55:39 +00:00
acamilo
26f957e084 macros: a frontier no walk can reach is a fact about the map, not a window
GO FRONTIER was 1,235 of the rung-10 run's macro starts in 47 minutes, over two museum floors
and a town whose ground the fly had already covered. The tiles it aimed at were real and
unreachable: 98 walkable tiles on the museum's ground floor, 62 of them reachable from the door,
39 never stood on and almost all of those behind the admission desk. A walk that can reach none
of its goals refuses no route and writes every goal to the blocked ledger -- which is a ten
brain minute window, so all of it came back and the refusal happened again, once per hold.

A window is right for a target somebody is standing in front of and wrong for ground the map has
fenced off. So the refusal is remembered per map instead, with no window, and it is cleared by
the one event that can change the answer: the fly standing somewhere on that map it had not
stood on before -- a door opened, a script carried it through, somebody moved out of a doorway.
Re-entering the map clears nothing, which is the loop the window made.
2026-09-22 12:48:09 +00:00
acamilo
84ed0410bf macros: an UNKNOWN frame with nothing drawn on it deals no buttons
BACK was 678 macro starts in 47 minutes on rung 10, 189 of them on Pewter City with no text box
on screen at all. BACK is on no overworld and no dialog pad, so every one of them was dealt by
Scene::Unknown -- which holds two states under one name. One is a screen this crate cannot name,
the Pokedex or the trainer card or OPTION, where A and B are what leave it. The other is a frame
of the overworld where the cartridge is driving -- a warp in flight, a scripted push-back, the
museum guide walking the fly through the door -- which the detector calls Unknown because the
buttons are not reaching the player.

On the second, NEXT and BACK are an A and a B pressed into somebody else's script: they change
nothing and they complete where the fly stands, which is section 12.2's trap with no box to
advance. So Unknown's pad is dealt on whether a box is drawn, and a scripted overworld frame is
an empty pad the fly waits out -- the cartridge gives the buttons back by itself.
2026-09-22 12:43:53 +00:00
acamilo
a389734201 geography: the Pewter museum is two rows on the map graph
Rung 10 spent five and a half hours in Pewter City with the objective two doors away, and the
fly kept ending up inside the museum, where GO OBJECTIVE, GO SHOP and GO HEAL were all off the
pad: a map with no row in the graph has no neighbours, so next_hop answers nothing and area_of
answers nothing. Named as a residual by the previous review and worked here.

Both ids come from the cartridge's own warp table, surveyed from the rung-10 checkpoint rather
than counted: Pewter City names 0x34 at (14, 7) and at (19, 5), which are the museum's two
doors, and 0x34 names 0x35 at (7, 7), which is the staircase. The upper floor has no area, for
the same reason a bedroom has none -- no front door of its own -- and the road out of it is the
staircase, which is what the fly needs there.
2026-09-22 12:43:52 +00:00
acamilo
0bf4b965fb macros: tests for the nurse's box
Unit: HEAL is off a full party's pad, including the rung-10 party's own
numbers, which is the assertion that the loop was never the heal's; TALK
is off a rested nurse's pad and on a hurt one's, and an ordinary
villager is unaffected; her prompt deals one answer and a plain box still
deals three; a readable prompt that is not hers deals both answers and no
NEXT; an answer whose prompt reopens is excluded and one that settled the
box is not; a completed heal and a declined prompt both retire her.

ROM-gated from the live checkpoint (FLY_CENTER_CHECKPOINT): the fly
leaves map 0x3a on a bounded number of macros, YES starts stay under
five, NEXT is on no pad while a prompt is readable, and TALK is on no pad
at a rested nurse. The run also counts dialog and prompt frames, which is
what makes the forty-six-to-one ratio visible.
2026-09-22 10:39:15 +00:00