diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-01 13:13:49 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-01 13:13:49 -0400 |
commit | fce6243b432d1df1b4ab244023be738a54dbe8f3 (patch) | |
tree | c93b0989254b15e86aa0ae07ab255d5bb5fd0afb /engine/events | |
parent | e171c84c2990df2c1a3773885297089869a0fd58 (diff) |
Identify more labels, and use the jumptable macro when possible
Diffstat (limited to 'engine/events')
-rw-r--r-- | engine/events/battle_tower/battle_tower.asm | 33 | ||||
-rw-r--r-- | engine/events/field_moves.asm | 11 | ||||
-rw-r--r-- | engine/events/magnet_train.asm | 11 | ||||
-rw-r--r-- | engine/events/mom.asm | 20 | ||||
-rw-r--r-- | engine/events/mom_phone.asm | 2 |
5 files changed, 10 insertions, 67 deletions
diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index bba5ae3a5..f335a83c9 100644 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -204,16 +204,7 @@ _BattleTowerBattle: ret .do_dw - ld a, [wBattleTowerBattleEnded] - ld e, a - ld d, 0 - ld hl, .dw - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl + jumptable .dw, wBattleTowerBattleEnded .dw dw RunBattleTowerTrainer @@ -625,16 +616,7 @@ Function1704e1: ret .DoJumptable: - ld a, [wJumptableIndex] - ld e, a - ld d, 0 - ld hl, .dw - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl + jumptable .dw, wJumptableIndex .dw dw .Jumptable_0 @@ -869,16 +851,7 @@ Function1704e1: db "れきだいりーダーいちらん@" BattleTowerAction: - ld a, [wScriptVar] - ld e, a - ld d, 0 - ld hl, .dw - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl + jumptable .dw, wScriptVar .dw dw BattleTowerAction_CheckExplanationRead diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index 1cc14bf27..efba9e879 100644 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -154,16 +154,7 @@ CutGrassGFX: INCBIN "gfx/overworld/cut_grass.2bpp" OWCutJumptable: - ld a, [wJumptableIndex] - ld e, a - ld d, 0 - ld hl, .dw - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl + jumptable .dw, wJumptableIndex .dw dw Cut_SpawnAnimateTree diff --git a/engine/events/magnet_train.asm b/engine/events/magnet_train.asm index 2f4c1dca4..14ccb02ba 100644 --- a/engine/events/magnet_train.asm +++ b/engine/events/magnet_train.asm @@ -272,16 +272,7 @@ SetMagnetTrainPals: ret MagnetTrain_Jumptable: - ld a, [wJumptableIndex] - ld e, a - ld d, 0 - ld hl, .Jumptable - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl + jumptable .Jumptable, wJumptableIndex .Jumptable: dw .InitPlayerSpriteAnim diff --git a/engine/events/mom.asm b/engine/events/mom.asm index 5d62a1693..194bae270 100644 --- a/engine/events/mom.asm +++ b/engine/events/mom.asm @@ -18,19 +18,9 @@ BankOfMom: ret .RunJumptable: - ld a, [wJumptableIndex] - ld e, a - ld d, 0 - ld hl, .dw - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl + jumptable .dw, wJumptableIndex .dw - dw .CheckIfBankInitialized dw .InitializeBank dw .IsThisAboutYourMoney @@ -98,7 +88,7 @@ BankOfMom: ld hl, MomBankWhatDoYouWantToDoText call PrintText call LoadStandardMenuHeader - ld hl, MenuHeader_0x166b5 + ld hl, BankOfMom_MenuHeader call CopyMenuHeader call VerticalMenu call CloseWindow @@ -659,13 +649,13 @@ Mom_DepositString: Mom_HeldString: db "HELD@" -MenuHeader_0x166b5: +BankOfMom_MenuHeader: db MENU_BACKUP_TILES ; flags menu_coords 0, 0, 10, 10 - dw MenuData_0x166bd + dw .MenuData db 1 ; default option -MenuData_0x166bd: +.MenuData: db STATICMENU_CURSOR ; flags db 4 ; items db "GET@" diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm index aa26fd5c0..f18685df8 100644 --- a/engine/events/mom_phone.asm +++ b/engine/events/mom_phone.asm @@ -204,8 +204,6 @@ endr INCLUDE "data/items/mom_phone.asm" - db 0, 0, 0 ; unused - MomHiHowAreYouText: text_far _MomHiHowAreYouText text_end |