diff options
| author | vulcandth <vulcandth@gmail.com> | 2023-07-13 20:27:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-13 21:27:56 -0400 |
| commit | d001ced41b53271373753de835a9c3b3413dc318 (patch) | |
| tree | ff2db7f403bddfcdeb12e50def8411cafedcdd5e /scripts/Route8Gate.asm | |
| parent | Make wCurrentBoxNum a byte instead of word (#414) (diff) | |
| download | pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.tar.gz pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.tar.xz pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.zip | |
Add macros, constants, and labels for map scripts and text (#367)
This introduces `def_script_pointers`, `def_text_pointers`, and `object_const_def` macros, and applies them to all maps. Most other map labels have also been identified.
Diffstat (limited to 'scripts/Route8Gate.asm')
| -rw-r--r-- | scripts/Route8Gate.asm | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/scripts/Route8Gate.asm b/scripts/Route8Gate.asm index 3167cd76..af4fe196 100644 --- a/scripts/Route8Gate.asm +++ b/scripts/Route8Gate.asm @@ -5,13 +5,14 @@ Route8Gate_Script: jp CallFunctionInTable Route8Gate_ScriptPointers: - dw Route8GateScript0 - dw Route8GateScript1 + def_script_pointers + dw_const Route8GateDefaultScript, SCRIPT_ROUTE8GATE_DEFAULT + dw_const Route8GatePlayerMovingScript, SCRIPT_ROUTE8GATE_PLAYER_MOVING -Route8GateScript_1e1d7: +Route8GateMovePlayerRightScript: ld hl, wd730 set 7, [hl] - ld a, $10 + ld a, D_RIGHT ld [wSimulatedJoypadStatesEnd], a ld a, $1 ld [wSimulatedJoypadStatesIndex], a @@ -20,11 +21,11 @@ Route8GateScript_1e1d7: ld [wOverrideSimulatedJoypadStatesMask], a ret -Route8GateScript0: +Route8GateDefaultScript: ld a, [wd728] bit 6, a ret nz - ld hl, CoordsData_1e22c + ld hl, .PlayerInCoordsArray call ArePlayerCoordsInArray ret nc ld a, PLAYER_DIR_LEFT @@ -34,27 +35,27 @@ Route8GateScript0: farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a - jr nz, .asm_1e220 - ld a, $2 + jr nz, .have_drink + ld a, TEXT_ROUTE8GATE_GUARD_GEE_IM_THIRSTY ldh [hSpriteIndexOrTextID], a call DisplayTextID - call Route8GateScript_1e1d7 - ld a, $1 + call Route8GateMovePlayerRightScript + ld a, SCRIPT_ROUTE8GATE_PLAYER_MOVING ld [wRoute8GateCurScript], a ret -.asm_1e220 +.have_drink ld hl, wd728 set 6, [hl] - ld a, $3 + ld a, TEXT_ROUTE8GATE_GUARD_GIVE_DRINK ldh [hSpriteIndexOrTextID], a jp DisplayTextID -CoordsData_1e22c: +.PlayerInCoordsArray: dbmapcoord 2, 3 dbmapcoord 2, 4 db -1 ; end -Route8GateScript1: +Route8GatePlayerMovingScript: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -65,6 +66,7 @@ Route8GateScript1: ret Route8Gate_TextPointers: - dw Route8GateText1 - dw Route8GateText2 - dw Route8GateText3 + def_text_pointers + dw_const SaffronGateGuardText, TEXT_ROUTE8GATE_GUARD + dw_const SaffronGateGuardGeeImThirstyText, TEXT_ROUTE8GATE_GUARD_GEE_IM_THIRSTY + dw_const SaffronGateGuardGiveDrinkText, TEXT_ROUTE8GATE_GUARD_GIVE_DRINK |
