Walk a Generation 1 map's load body and the rows a fight leaves behind - #604
Merged
Conversation
The entry script is walked with EnterMap's wCurrentMapScriptFlags bits known set, once per mask, and a script's own set of a bit re-runs that walk on the next frame; EndTrainerBattle sets both bits and leaves the map's script on row 2, which every table now reaches, along with a state another map's script writes. Vermilion Gym's trash cans, Cinnabar Gym's quiz, Pokemon Tower 7F's rockets, the Champion's Room and Pewter City's guides all decode and run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed
EnterMap'swCurrentMapScriptFlagsbits known set, one walk per mask, kept beside the entry script when it differs. A script's ownseton a bit is amap_load_bitnode the world hands to the nextRunMapScript, which the screen runs on the frame the row's box closes. 30 maps of Red and Blue and 29 of Yellow read differently under a bit, every one whole, against 26 and 24 bodies before: Vermilion City's trash can seed and SS Anne walk, the Game Corner's hideout door, Indigo Plateau's Elite Four reset, Lance's room, Silph Co. 6F, 8F, 10F and 11F among the ones that had not decoded.EndTrainerBattlesets both bits back and leaves the map's script on row 2, so every state table's first three rows are reachable, a state another map's script writes is seeded from that store, and a map with a body of its own on row 2 runs it after a header trainer fight. Red and Blue read 173 state bodies of 362 reachable, Yellow 177 of 361, against 148 of 206 and 156 of 210.push bc,pop bc,srl a,adc b,ld d, a,ld e, a,cp coverwCurrentMenuItem,and,add aandsrl aon a known byte, a store of aRandombyte under its mask (store_byte), the three HRAM tempshGymGateIndex,hGymGateAnswerandhBackupGymGateIndex, ajponto a special body as a tail call, the routine behindExecuteCurMapScriptInTable, and a scratch byte handed tohSpriteIndexorhTextID(object_from,map_textfrom).Added
GymTrashScriptas agym_trashnode, the first lock rolled by Vermilion City's load, the second drawn out of the can'sGymTrashCansrow with the bytes past the table the source's own draws read, and the door opened byVermilionGymSetDoorTileon the frame after the second lock. The three lock bytes ride the world snapshot asgen1_bytes.wOpponentAfterWrongAnswerforCinnabarGymDefaultScriptto walk that trainer up and the next state to fight him, on Yellow through the bit his row wants.PokemonTower7FEndBattleScript's rocket saying its line and walking off along themap_coord_movementrow the player stands on (object_coord_move), andPokemonTower7FHideNPCScript's loop overwToggleableObjectList.tools/checks/gen1_walk.gdfinds both locks and the door, answers a quiz right and wrong and is fought by the trainer the wrong answer brings, fights the tower's rocket and watches it leave, and walks into the Champion's Room and its fight;gen1_maps.gdpins the new censuses.Fixed
_map_script_successorsfollowed only a map's own stores, so the Champion's Room, whose byte Agatha's room writes, kept one state of eleven._gen1_sighttook a map script that only wrote blocks as holding the world, so a gate redrawn behind a fight hid the next sighting.map_textnode over a trainer's row isTalkToTrainerafter the fight rather than an empty box.