Skip to content

Walk a Generation 1 routine's ret back into its caller and run Oak's Lab whole - #605

Merged
Decryptu merged 1 commit into
mainfrom
gen1-map-states
Sep 10, 2026
Merged

Walk a Generation 1 routine's ret back into its caller and run Oak's Lab whole#605
Decryptu merged 1 commit into
mainfrom
gen1-map-states

Conversation

@Decryptu

Copy link
Copy Markdown
Owner

Added

  • Oak's Lab runs from the speech to the rival leaving with the Pokedex: the starter pick, the rival's walks, the fight, his exit, the parcel and the Pokedex hand-over. gen1_walk.gd drives it on Red and Blue and tools/preview_world.gd -- red 0 40 <out.png> live lab_rival@5,6 20 0 photographs the player turning to watch him go.
  • A call to a map's own routine pushes a return frame on the walk's state, so a routine that branches walks the rest of the row on each side; a jp to a named routine pushes none.
  • NPC_CHANGE_FACING is held until the row writes the side over it, FillMemory over wNPCMovementDirections2 is a counted object walk, GetMonName reads a scratch byte, and cp n over wSimulatedJoypadStatesIndex or wNPCNumScriptedSteps is a counted movement test the screen samples at every step boundary of a walk.
  • Yellow's $04 to $07 movement rows run at Func_5288's doubled step, cp value under a CheckEitherEventSet mask is one flag set and one clear, and the Pikachu follower routines answer as no follower.

Changed

  • Every map-script body but the two link maps decodes on all three cartridges: Red and Blue read 183 state bodies of 373, Yellow 223 of 408, against 173 of 362 and 177 of 361.
  • wDoNotWaitForButtonPressAfterDisplayingText lands on the row's last box wherever a routine printed it.

Fixed

  • hSpriteMapYCoord is SPRITESTATEDATA2_MAPY, the cell and four: Pewter City's two guides and Bill were placed four cells off.
  • SetSpritePosition1 over nothing the row wrote is the restore of GetSpritePosition1's save and no longer ends the walk.
  • Gen1WorldImporter._script_node_exact shadowed Object.set.

…Lab whole

A call to a map's own routine pushes a return frame on the walk's state, so a
routine that branches walks the rest of the row on each side and its caller
reads what each side computed; a jp to a named routine pushes none. With it:
NPC_CHANGE_FACING held until the row writes the side over it, FillMemory over
wNPCMovementDirections2 as a counted object walk, SetSpritePosition1 over
nothing written as the restore it is, GetMonName over wRivalStarterTemp, cp n
over a step count sampled at every step boundary, Yellow's $04 to $07 run rows,
cp value under a CheckEitherEventSet mask, and the follower routines Yellow's
lab and Bill's house call answered as no follower. hSpriteMapYCoord is the cell
and four, which had placed Pewter's guides off by four. Every map-script body
but the two link maps decodes on all three cartridges, and the walk drives the
lab from Oak's speech to the rival leaving with the Pokedex.
@Decryptu
Decryptu merged commit 9850229 into main Sep 10, 2026
1 check passed
@Decryptu
Decryptu deleted the gen1-map-states branch September 10, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant