From 3cd3efd06002a188cebf37d935411d7d73b153be Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 12 Jun 2015 10:26:00 -0500 Subject: Name the last of unnamed text --- scripts/lorelei.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index ab769d94..e82497ef 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -115,7 +115,7 @@ LoreleiScript2: ; 7623f (1d:623f) LoreleiTextPointers: ; 76251 (1d:6251) dw LoreleiText1 - dw LoreleiText2 + dw LoreleiDontRunAwayText LoreleiTrainerHeaders: ; 76255 (1d:6255) LoreleiTrainerHeader0: ; 76255 (1d:6255) @@ -147,6 +147,6 @@ LoreleiAfterBattleText: ; 76276 (1d:6276) TX_FAR _LoreleiAfterBattleText db "@" -LoreleiText2: ; 7627b (1d:627b) - TX_FAR _LoreleiText2 +LoreleiDontRunAwayText: ; 7627b (1d:627b) + TX_FAR _LoreleiDontRunAwayText db "@" -- cgit v1.3.1-sl0p From f4a31b3e0b7ca89e14c4e3836f3d3ad15f38e5ce Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 3 Jul 2015 14:38:12 -0500 Subject: Rename/organize part 2 of 4 rename functions, clean up address/wram comments, other misc only broken up so that all changes are viewable on github --- scripts/agatha.asm | 21 ++--- scripts/battlecenterm.asm | 2 +- scripts/bikeshop.asm | 20 ++--- scripts/billshouse.asm | 30 +++---- scripts/bruno.asm | 21 ++--- scripts/celadoncity.asm | 4 +- scripts/celadondiner.asm | 10 +-- scripts/celadongamecorner.asm | 102 +++++++++++------------ scripts/celadongym.asm | 82 +++++++++---------- scripts/celadonmansion5.asm | 4 +- scripts/celadonmart3.asm | 10 +-- scripts/celadonmartelevator.asm | 6 +- scripts/celadonmartroof.asm | 40 ++++----- scripts/ceruleancity.asm | 66 +++++++-------- scripts/ceruleancity2.asm | 2 +- scripts/ceruleangym.asm | 50 ++++++------ scripts/ceruleanhouse2.asm | 4 +- scripts/ceruleanhousetrashed.asm | 8 +- scripts/cinnabargym.asm | 66 +++++++-------- scripts/copycatshouse2f.asm | 16 ++-- scripts/daycarem.asm | 4 +- scripts/fightingdojo.asm | 42 +++++----- scripts/fuchsiacity.asm | 16 ++-- scripts/fuchsiagym.asm | 74 ++++++++--------- scripts/fuchsiahouse2.asm | 28 +++---- scripts/fuchsiahouse3.asm | 2 +- scripts/gary.asm | 14 ++-- scripts/halloffameroom.asm | 2 +- scripts/lab2.asm | 4 +- scripts/lab3.asm | 10 +-- scripts/lab4.asm | 14 ++-- scripts/lance.asm | 16 ++-- scripts/lavenderhouse1.asm | 26 +++--- scripts/lavenderhouse2.asm | 8 +- scripts/lavendermart.asm | 8 +- scripts/lavendertown.asm | 4 +- scripts/lorelei.asm | 22 ++--- scripts/mansion1.asm | 20 ++--- scripts/mansion2.asm | 14 ++-- scripts/mansion3.asm | 20 ++--- scripts/mansion4.asm | 18 ++--- scripts/mtmoon1.asm | 56 ++++++------- scripts/mtmoon3.asm | 78 +++++++++--------- scripts/mtmoonpokecenter.asm | 20 ++--- scripts/museum1f.asm | 26 +++--- scripts/namerater.asm | 18 ++--- scripts/oakslab.asm | 165 +++++++++++++++++++------------------- scripts/pallettown.asm | 2 +- scripts/pewtercity.asm | 18 ++--- scripts/pewtergym.asm | 50 ++++++------ scripts/pewterpokecenter.asm | 10 +-- scripts/pokemontower2.asm | 24 +++--- scripts/pokemontower3.asm | 24 +++--- scripts/pokemontower4.asm | 24 +++--- scripts/pokemontower5.asm | 38 ++++----- scripts/pokemontower6.asm | 38 ++++----- scripts/pokemontower7.asm | 38 ++++----- scripts/powerplant.asm | 38 ++++----- scripts/redshouse1f.asm | 2 +- scripts/rockethideout1.asm | 40 ++++----- scripts/rockethideout2.asm | 16 ++-- scripts/rockethideout3.asm | 18 ++--- scripts/rockethideout4.asm | 32 ++++---- scripts/rockethideoutelevator.asm | 16 ++-- scripts/rocktunnel1.asm | 84 +++++++++---------- scripts/rocktunnel2.asm | 64 +++++++-------- scripts/route1.asm | 16 ++-- scripts/route10.asm | 48 +++++------ scripts/route11.asm | 80 +++++++++--------- scripts/route11gateupstairs.asm | 10 +-- scripts/route12.asm | 66 +++++++-------- scripts/route12gateupstairs.asm | 14 ++-- scripts/route12house.asm | 6 +- scripts/route13.asm | 80 +++++++++--------- scripts/route14.asm | 80 +++++++++--------- scripts/route15.asm | 100 +++++++++++------------ scripts/route15gateupstairs.asm | 4 +- scripts/route16.asm | 58 +++++++------- scripts/route16gate.asm | 10 +-- scripts/route16gateupstairs.asm | 2 +- scripts/route16house.asm | 6 +- scripts/route17.asm | 80 +++++++++--------- scripts/route18.asm | 24 +++--- scripts/route18gate.asm | 10 +-- scripts/route18gateupstairs.asm | 4 +- scripts/route19.asm | 80 +++++++++--------- scripts/route20.asm | 88 ++++++++++---------- scripts/route21.asm | 72 ++++++++--------- scripts/route22.asm | 80 +++++++++--------- scripts/route22gate.asm | 16 ++-- scripts/route23.asm | 16 ++-- scripts/route24.asm | 66 +++++++-------- scripts/route25.asm | 72 ++++++++--------- scripts/route2gate.asm | 10 +-- scripts/route3.asm | 64 +++++++-------- scripts/route4.asm | 8 +- scripts/route5gate.asm | 14 ++-- scripts/route6.asm | 48 +++++------ scripts/route6gate.asm | 2 +- scripts/route7gate.asm | 2 +- scripts/route8.asm | 72 ++++++++--------- scripts/route8gate.asm | 2 +- scripts/route9.asm | 90 ++++++++++----------- scripts/safarizoneentrance.asm | 14 ++-- scripts/safarizonesecrethouse.asm | 10 +-- scripts/saffrongym.asm | 92 ++++++++++----------- scripts/saffronhouse2.asm | 10 +-- scripts/seafoamislands1.asm | 6 +- scripts/seafoamislands2.asm | 6 +- scripts/seafoamislands3.asm | 6 +- scripts/seafoamislands4.asm | 8 +- scripts/seafoamislands5.asm | 8 +- scripts/silphco10.asm | 18 ++--- scripts/silphco11.asm | 52 ++++++------ scripts/silphco2.asm | 42 +++++----- scripts/silphco3.asm | 22 ++--- scripts/silphco4.asm | 34 ++++---- scripts/silphco5.asm | 42 +++++----- scripts/silphco6.asm | 28 +++---- scripts/silphco7.asm | 62 +++++++------- scripts/silphco8.asm | 30 +++---- scripts/silphco9.asm | 34 ++++---- scripts/silphcoelevator.asm | 6 +- scripts/ssanne10.asm | 50 ++++++------ scripts/ssanne2.asm | 18 ++--- scripts/ssanne5.asm | 18 ++--- scripts/ssanne6.asm | 14 ++-- scripts/ssanne7.asm | 14 ++-- scripts/ssanne8.asm | 32 ++++---- scripts/ssanne9.asm | 32 ++++---- scripts/unknowndungeon3.asm | 8 +- scripts/vermilioncity.asm | 38 ++++----- scripts/vermiliondock.asm | 18 ++--- scripts/vermiliongym.asm | 58 +++++++------- scripts/vermilionhouse2.asm | 4 +- scripts/victoryroad1.asm | 18 ++--- scripts/victoryroad2.asm | 52 ++++++------ scripts/victoryroad3.asm | 40 ++++----- scripts/viridiancity.asm | 44 +++++----- scripts/viridianforest.asm | 24 +++--- scripts/viridiangym.asm | 98 +++++++++++----------- scripts/viridianmart.asm | 8 +- 142 files changed, 2245 insertions(+), 2242 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/scripts/agatha.asm b/scripts/agatha.asm index f9f7fae1..dd83b22f 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -40,7 +40,8 @@ AgathaScriptPointers: ; 76469 (1d:6469) AgathaScript4: ; 76473 (1d:6473) ret -asm_76474: ; 76474 (1d:6474) + +AgathaScript_76474: ; 76474 (1d:6474) ld hl, wSimulatedJoypadStatesEnd ld a, D_UP ld [hli], a @@ -66,16 +67,16 @@ AgathaScript0: ; 76490 (1d:6490) ld [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] cp $3 jr c, .asm_764b4 ld hl, wd865 bit 6, [hl] set 6, [hl] - jr z, asm_76474 + jr z, AgathaScript_76474 .asm_764b4 ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -107,11 +108,11 @@ AgathaScript3: ; 764da (1d:64da) AgathaScript2: ; 764ed (1d:64ed) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, AgathaScript_76464 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, $1 ld [W_GARYCURSCRIPT], a @@ -126,10 +127,10 @@ AgathaTrainerHeader0: ; 76509 (1d:6509) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd865 ; flag's byte - dw AgathaBeforeBattleText ; 0x6520 TextBeforeBattle - dw AgathaAfterBattleText ; 0x652a TextAfterBattle - dw AgathaEndBattleText ; 0x6525 TextEndBattle - dw AgathaEndBattleText ; 0x6525 TextEndBattle + dw AgathaBeforeBattleText ; TextBeforeBattle + dw AgathaAfterBattleText ; TextAfterBattle + dw AgathaEndBattleText ; TextEndBattle + dw AgathaEndBattleText ; TextEndBattle db $ff diff --git a/scripts/battlecenterm.asm b/scripts/battlecenterm.asm index 5ab697a1..997be7c1 100755 --- a/scripts/battlecenterm.asm +++ b/scripts/battlecenterm.asm @@ -3,7 +3,7 @@ BattleCenterMScript: ; 4fd10 (13:7d10) ld a, [$ffaa] cp $2 ld a, $8 - jr z, .asm_4fd1d ; 0x4fd19 $2 + jr z, .asm_4fd1d ld a, $c .asm_4fd1d ld [$ff8d], a diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index 4bd26a7e..2bf6b7e3 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -10,14 +10,14 @@ BikeShopText1: ; 1d745 (7:5745) db $08 ; asm ld a, [wd75f] bit 0, a - jr z, .asm_260d4 ; 0x1d74b + jr z, .asm_260d4 ld hl, BikeShopText_1d82f call PrintText jp .Done -.asm_260d4 ; 0x1d756 +.asm_260d4 ld b, BIKE_VOUCHER call IsItemInBag - jr z, .asm_41190 ; 0x1d75b + jr z, .asm_41190 ld hl, BikeShopText_1d81f call PrintText ld bc, (BICYCLE << 8) | 1 @@ -35,7 +35,7 @@ BikeShopText1: ; 1d745 (7:5745) ld hl, BikeShopText_1d834 call PrintText jr .Done -.asm_41190 ; 0x1d78c +.asm_41190 ld hl, BikeShopText_1d810 call PrintText xor a @@ -66,15 +66,15 @@ BikeShopText1: ; 1d745 (7:5745) call PrintText call HandleMenuInput bit 1, a - jr nz, .asm_b7579 ; 0x1d7dc + jr nz, .asm_b7579 ld hl, wd730 res 6, [hl] ld a, [wCurrentMenuItem] and a - jr nz, .asm_b7579 ; 0x1d7e7 + jr nz, .asm_b7579 ld hl, BikeShopText_1d81a call PrintText -.asm_b7579 ; 0x1d7ef +.asm_b7579 ld hl, BikeShopText_1d82a call PrintText .Done @@ -104,7 +104,7 @@ BikeShopText_1d81f: ; 1d81f (7:581f) db "@" BikeShopText_1d824: ; 1d824 (7:5824) - TX_FAR _BikeShopText_1d824 ; 0x98eb2 + TX_FAR _BikeShopText_1d824 db $11, "@" BikeShopText_1d82a: ; 1d82a (7:582a) @@ -134,9 +134,9 @@ BikeShopText3: ; 1d848 (7:5848) ld a, [wd75f] bit 0, a ld hl, BikeShopText_1d861 - jr nz, .asm_34d2d ; 0x1d851 + jr nz, .asm_34d2d ld hl, BikeShopText_1d85c -.asm_34d2d ; 0x1d856 +.asm_34d2d call PrintText jp TextScriptEnd diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index 61a575b9..321e8808 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -19,7 +19,7 @@ BillsHouseScript1: ; 1e783 (7:6783) ld a, [wSpriteStateData1 + 9] and a ld de, MovementData_1e79c - jr nz, .asm_1e78f ; 0x1e78a $3 + jr nz, .asm_1e78f ld de, MovementData_1e7a0 .asm_1e78f ld a, $1 @@ -70,7 +70,7 @@ BillsHouseScript3: ; 1e7c5 (7:67c5) ld a, HS_BILL_1 ld [wcc4d], a predef ShowObject - ld c, $8 + ld c, 8 call DelayFrames ld a, $2 ld [$ff8c], a @@ -121,37 +121,37 @@ BillsHouseText1: ; 1e83d (7:683d) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, asm_6b196 ; 0x1e84b $d -asm_4d03c: ; 1e84d (7:684d) + jr nz, .asm_1e85a +.asm_1e84d ld hl, BillsHouseText_1e86a call PrintText ld a, $1 ld [W_BILLSHOUSECURSCRIPT], a - jr asm_fd4e2 ; 0x1e858 $8 -asm_6b196: ; 1e85a (7:685a) + jr .asm_1e862 +.asm_1e85a ld hl, BillsHouseText_1e86f call PrintText - jr asm_4d03c ; 0x1e860 $eb -asm_fd4e2 ; 0x1e862 + jr .asm_1e84d +.asm_1e862 jp TextScriptEnd BillsHouseText_1e865: ; 1e865 (7:6865) - TX_FAR _BillsHouseText_1e865 ; 0x8d267 + TX_FAR _BillsHouseText_1e865 db "@" BillsHouseText_1e86a: ; 1e86a (7:686a) - TX_FAR _BillsHouseText_1e86a ; 0x8d345 + TX_FAR _BillsHouseText_1e86a db "@" BillsHouseText_1e86f: ; 1e86f (7:686f) - TX_FAR _BillsHouseText_1e86f ; 0x8d391 + TX_FAR _BillsHouseText_1e86f db "@" BillsHouseText2: ; 1e874 (7:6874) db $08 ; asm ld a, [wd7f2] bit 4, a - jr nz, .asm_5491f ; 0x1e87a + jr nz, .asm_1e8a9 ld hl, BillThankYouText call PrintText ld bc, (S_S__TICKET << 8) | 1 @@ -167,14 +167,14 @@ BillsHouseText2: ; 1e874 (7:6874) ld a, HS_CERULEAN_GUARD_2 ld [wcc4d], a predef HideObject -.asm_5491f ; 0x1e8a9 +.asm_1e8a9 ld hl, BillsHouseText_1e8cb call PrintText - jr .asm_bd408 ; 0x1e8af + jr .asm_1e8b7 .BagFull ld hl, SSTicketNoRoomText call PrintText -.asm_bd408 ; 0x1e8b7 +.asm_1e8b7 jp TextScriptEnd BillThankYouText: ; 1e8ba (7:68ba) diff --git a/scripts/bruno.asm b/scripts/bruno.asm index bc5ec9d4..0e21fe7b 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -40,7 +40,8 @@ BrunoScriptPointers: ; 76312 (1d:6312) BrunoScript4: ; 7631c (1d:631c) ret -asm_7631d: ; 7631d (1d:631d) + +BrunoScript_7631d: ; 7631d (1d:631d) ld hl, wSimulatedJoypadStatesEnd ld a, D_UP ld [hli], a @@ -66,16 +67,16 @@ BrunoScript0: ; 76339 (1d:6339) ld [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] cp $3 jr c, .asm_7635d ld hl, wd864 bit 6, [hl] set 6, [hl] - jr z, asm_7631d + jr z, BrunoScript_7631d .asm_7635d ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -107,11 +108,11 @@ BrunoScript3: ; 76383 (1d:6383) BrunoScript2: ; 76396 (1d:6396) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, BrunoScript_7630d ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp DisplayTextID BrunoTextPointers: ; 763a8 (1d:63a8) @@ -123,10 +124,10 @@ BrunoTrainerHeader0: ; 763ac (1d:63ac) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd864 ; flag's byte - dw BrunoBeforeBattleText ; 0x63c3 TextBeforeBattle - dw BrunoAfterBattleText ; 0x63cd TextAfterBattle - dw BrunoEndBattleText ; 0x63c8 TextEndBattle - dw BrunoEndBattleText ; 0x63c8 TextEndBattle + dw BrunoBeforeBattleText ; TextBeforeBattle + dw BrunoAfterBattleText ; TextAfterBattle + dw BrunoEndBattleText ; TextEndBattle + dw BrunoEndBattleText ; TextEndBattle db $ff diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index 004d8773..40834a3e 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -47,7 +47,7 @@ CeladonCityText5: ; 1999e (6:599e) db $08 ; asm ld a, [wd777] bit 0, a - jr nz, .asm_7053f ; 0x199a4 + jr nz, .asm_7053f ld hl, TM41PreText call PrintText ld bc, (TM_41 << 8) | 1 @@ -62,7 +62,7 @@ CeladonCityText5: ; 1999e (6:599e) ld hl, wd777 set 0, [hl] jr .Done -.asm_7053f ; 0x199c9 +.asm_7053f ld hl, TM41ExplanationText call PrintText .Done diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index 5ae89022..0c1dd4a0 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -29,7 +29,7 @@ CeladonDinerText5: ; 49173 (12:5173) db $08 ; asm ld a, [wd783] bit 0, a - jr nz, .asm_eb14d ; 0x49179 + jr nz, .asm_eb14d ld hl, CeladonDinerText_491a7 call PrintText ld bc, (COIN_CASE << 8) | 1 @@ -39,15 +39,15 @@ CeladonDinerText5: ; 49173 (12:5173) set 0, [hl] ld hl, ReceivedCoinCaseText call PrintText - jr .asm_68b61 ; 0x49194 + jr .asm_68b61 .BagFull ld hl, CoinCaseNoRoomText call PrintText - jr .asm_68b61 ; 0x4919c -.asm_eb14d ; 0x4919e + jr .asm_68b61 +.asm_eb14d ld hl, CeladonDinerText_491b7 call PrintText -.asm_68b61 ; 0x491a4 +.asm_68b61 jp TextScriptEnd CeladonDinerText_491a7: ; 491a7 (12:51a7) diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index 91d6742d..d1ee9951 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -131,22 +131,22 @@ CeladonGameCornerText2: ; 48ca9 (12:4ca9) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_c650b ; 0x48cba + jr nz, .asm_48d0f ld b,COIN_CASE call IsItemInBag - jr z, .asm_ed086 ; 0x48cc1 + jr z, .asm_48d19 call Has9990Coins - jr nc, .asm_31338 ; 0x48cc6 + jr nc, .asm_48d14 xor a ldh [$9f], a ldh [$a1], a ld a, $10 ldh [$a0], a call HasEnoughMoney - jr nc, .asm_b6ef0 ; 0x48cd4 - ld hl, CeladonGameCornerText_48d31 ; $4d31 - jr .asm_e2afd ; 0x48cd9 -.asm_b6ef0 ; 0x48cdb + jr nc, .asm_48cdb + ld hl, CeladonGameCornerText_48d31 + jr .asm_48d1c +.asm_48cdb xor a ldh [$9f], a ldh [$a1], a @@ -167,16 +167,16 @@ CeladonGameCornerText2: ; 48ca9 (12:4ca9) predef AddBCDPredef call CeladonGameCornerScript_48f1e ld hl, CeladonGameCornerText_48d27 - jr .asm_e2afd ; 0x48d0d -.asm_c650b ; 0x48d0f + jr .asm_48d1c +.asm_48d0f ld hl, CeladonGameCornerText_48d2c - jr .asm_e2afd ; 0x48d12 -.asm_31338 ; 0x48d14 + jr .asm_48d1c +.asm_48d14 ld hl, CeladonGameCornerText_48d36 - jr .asm_e2afd ; 0x48d17 -.asm_ed086 ; 0x48d19 + jr .asm_48d1c +.asm_48d19 ld hl, CeladonGameCornerText_48d3b -.asm_e2afd ; 0x48d1c +.asm_48d1c call PrintText jp TextScriptEnd @@ -216,14 +216,14 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a) db $08 ; asm ld a, [wd77e] bit 2, a - jr nz, .asm_d0957 ; 0x48d50 + jr nz, .asm_48d89 ld hl, CeladonGameCornerText_48d9c call PrintText ld b, COIN_CASE call IsItemInBag - jr z, .asm_5aef9 ; 0x48d5d + jr z, .asm_48d93 call Has9990Coins - jr nc, .asm_98546 ; 0x48d62 + jr nc, .asm_48d8e xor a ldh [$9f], a ldh [$a0], a @@ -238,16 +238,16 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a) ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, Received10CoinsText - jr .asm_c7d1a ; 0x48d87 -.asm_d0957 ; 0x48d89 + jr .asm_48d96 +.asm_48d89 ld hl, CeladonGameCornerText_48dac - jr .asm_c7d1a ; 0x48d8c -.asm_98546 ; 0x48d8e + jr .asm_48d96 +.asm_48d8e ld hl, CeladonGameCornerText_48da7 - jr .asm_c7d1a ; 0x48d91 -.asm_5aef9 ; 0x48d93 + jr .asm_48d96 +.asm_48d93 ld hl, CeladonGameCornerText_48f19 -.asm_c7d1a ; 0x48d96 +.asm_48d96 call PrintText jp TextScriptEnd @@ -275,10 +275,10 @@ CeladonGameCornerText7: ; 48db6 (12:4db6) db $08 ; asm ld a, [wd77c] bit 1, a - ld hl, CeladonGameCornerText_48dca ; $4dca - jr z, .asm_be3fd ; 0x48dbf - ld hl, CeladonGameCornerText_48dcf ; $4dcf -.asm_be3fd ; 0x48dc4 + ld hl, CeladonGameCornerText_48dca + jr z, .asm_48dc4 + ld hl, CeladonGameCornerText_48dcf +.asm_48dc4 call PrintText jp TextScriptEnd @@ -298,14 +298,14 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9) db $08 ; asm ld a, [wd77e] bit 4, a - jr nz, .asm_ed8bc ; 0x48ddf + jr nz, .asm_48e13 ld hl, CeladonGameCornerText_48e26 call PrintText ld b, COIN_CASE call IsItemInBag - jr z, .asm_df794 ; 0x48dec + jr z, .asm_48e1d call Has9990Coins - jr nc, .asm_f17c3 ; 0x48df1 + jr nc, .asm_48e18 xor a ldh [$9f], a ldh [$a0], a @@ -318,16 +318,16 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9) ld hl, wd77e set 4, [hl] ld hl, Received20CoinsText - jr .asm_0ddc2 ; 0x48e11 -.asm_ed8bc ; 0x48e13 + jr .asm_48e20 +.asm_48e13 ld hl, CeladonGameCornerText_48e36 - jr .asm_0ddc2 ; 0x48e16 -.asm_f17c3 ; 0x48e18 + jr .asm_48e20 +.asm_48e18 ld hl, CeladonGameCornerText_48e31 - jr .asm_0ddc2 ; 0x48e1b -.asm_df794 ; 0x48e1d + jr .asm_48e20 +.asm_48e1d ld hl, CeladonGameCornerText_48f19 -.asm_0ddc2 ; 0x48e20 +.asm_48e20 call PrintText jp TextScriptEnd @@ -351,14 +351,14 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b) db $08 ; asm ld a, [wd77e] bit 3, a - jr nz, .asm_ff080 ; 0x48e41 - ld hl, CeladonGameCornerText_48e88 ; $4e88 + jr nz, .asm_48e75 + ld hl, CeladonGameCornerText_48e88 call PrintText ld b,COIN_CASE call IsItemInBag - jr z, .asm_4fb0c ; 0x48e4e + jr z, .asm_48e7f call Has9990Coins - jr z, .asm_9505a ; 0x48e53 + jr z, .asm_48e7a xor a ldh [$9f], a ldh [$a0], a @@ -371,16 +371,16 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b) ld hl, wd77e set 3, [hl] ld hl, CeladonGameCornerText_48e8d - jr .asm_78d65 ; 0x48e73 -.asm_ff080 ; 0x48e75 + jr .asm_48e82 +.asm_48e75 ld hl, CeladonGameCornerText_48e98 - jr .asm_78d65 ; 0x48e78 -.asm_9505a ; 0x48e7a + jr .asm_48e82 +.asm_48e7a ld hl, CeladonGameCornerText_48e93 - jr .asm_78d65 ; 0x48e7d -.asm_4fb0c ; 0x48e7f + jr .asm_48e82 +.asm_48e7f ld hl, CeladonGameCornerText_48f19 -.asm_78d65 ; 0x48e82 +.asm_48e82 call PrintText jp TextScriptEnd @@ -389,7 +389,7 @@ CeladonGameCornerText_48e88: ; 48e88 (12:4e88) db "@" CeladonGameCornerText_48e8d: ; 48e8d (12:4e8d) - TX_FAR _CeladonGameCornerText_48e8d ; 0x9dceb + TX_FAR _CeladonGameCornerText_48e8d db $0B, "@" CeladonGameCornerText_48e93: ; 48e93 (12:4e93) @@ -453,7 +453,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) jp TextScriptEnd CeladonGameCornerText_48f09: ; 48f09 (12:4f09) - TX_FAR _CeladonGameCornerText_48f09 ; 0x9ddb0 + TX_FAR _CeladonGameCornerText_48f09 db $8 ld a, (SFX_02_49 - SFX_Headers_02) / 3 call PlaySound diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index b1b1060c..fab2063f 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -12,8 +12,8 @@ CeladonGymScript: ; 4890a (12:490a) ret CeladonGymScript_48927: ; 48927 (12:4927) - ld hl, Gym4CityName ; $4930 - ld de, Gym4LeaderName ; $493d + ld hl, Gym4CityName + ld de, Gym4LeaderName jp LoadGymLeaderAndCityName Gym4CityName: ; 48930 (12:4930) @@ -36,7 +36,7 @@ CeladonGymScriptPointers: ; 4894e (12:494e) dw CeladonGymScript3 CeladonGymScript3: ; 48956 (12:4956) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, CeladonGymText_48943 ld a, $f0 @@ -44,7 +44,7 @@ CeladonGymScript3: ; 48956 (12:4956) CeladonGymText_48963: ; 48963 (12:4963) ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd77c set 1, [hl] @@ -52,14 +52,14 @@ CeladonGymText_48963: ; 48963 (12:4963) call GiveItem jr nc, .BagFull ld a, $a - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd77c set 0, [hl] jr .asm_4898c .BagFull ld a, $b - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_4898c ld hl, W_OBTAINEDBADGES @@ -94,64 +94,64 @@ CeladonGymTrainerHeader0: ; 489bc (12:49bc) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd77c ; flag's byte - dw CeladonGymBattleText2 ; 0x4a8b TextBeforeBattle - dw CeladonGymAfterBattleText2 ; 0x4a95 TextAfterBattle - dw CeladonGymEndBattleText2 ; 0x4a90 TextEndBattle - dw CeladonGymEndBattleText2 ; 0x4a90 TextEndBattle + dw CeladonGymBattleText2 ; TextBeforeBattle + dw CeladonGymAfterBattleText2 ; TextAfterBattle + dw CeladonGymEndBattleText2 ; TextEndBattle + dw CeladonGymEndBattleText2 ; TextEndBattle CeladonGymTrainerHeader2: ; 489c8 (12:49c8) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd77c ; flag's byte - dw CeladonGymBattleText3 ; 0x4aa4 TextBeforeBattle - dw CeladonGymAfterBattleText3 ; 0x4aae TextAfterBattle - dw CeladonGymEndBattleText3 ; 0x4aa9 TextEndBattle - dw CeladonGymEndBattleText3 ; 0x4aa9 TextEndBattle + dw CeladonGymBattleText3 ; TextBeforeBattle + dw CeladonGymAfterBattleText3 ; TextAfterBattle + dw CeladonGymEndBattleText3 ; TextEndBattle + dw CeladonGymEndBattleText3 ; TextEndBattle CeladonGymTrainerHeader3: ; 489d4 (12:49d4) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd77c ; flag's byte - dw CeladonGymBattleText4 ; 0x4abd TextBeforeBattle - dw CeladonGymAfterBattleText4 ; 0x4ac7 TextAfterBattle - dw CeladonGymEndBattleText4 ; 0x4ac2 TextEndBattle - dw CeladonGymEndBattleText4 ; 0x4ac2 TextEndBattle + dw CeladonGymBattleText4 ; TextBeforeBattle + dw CeladonGymAfterBattleText4 ; TextAfterBattle + dw CeladonGymEndBattleText4 ; TextEndBattle + dw CeladonGymEndBattleText4 ; TextEndBattle CeladonGymTrainerHeader4: ; 489e0 (12:49e0) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd77c ; flag's byte - dw CeladonGymBattleText5 ; 0x4ad6 TextBeforeBattle - dw CeladonGymAfterBattleText5 ; 0x4ae0 TextAfterBattle - dw CeladonGymEndBattleText5 ; 0x4adb TextEndBattle - dw CeladonGymEndBattleText5 ; 0x4adb TextEndBattle + dw CeladonGymBattleText5 ; TextBeforeBattle + dw CeladonGymAfterBattleText5 ; TextAfterBattle + dw CeladonGymEndBattleText5 ; TextEndBattle + dw CeladonGymEndBattleText5 ; TextEndBattle CeladonGymTrainerHeader5: ; 489ec (12:49ec) db $6 ; flag's bit db ($2 << 4) ; trainer's view range dw wd77c ; flag's byte - dw CeladonGymBattleText6 ; 0x4aef TextBeforeBattle - dw CeladonGymAfterBattleText6 ; 0x4af9 TextAfterBattle - dw CeladonGymEndBattleText6 ; 0x4af4 TextEndBattle - dw CeladonGymEndBattleText6 ; 0x4af4 TextEndBattle + dw CeladonGymBattleText6 ; TextBeforeBattle + dw CeladonGymAfterBattleText6 ; TextAfterBattle + dw CeladonGymEndBattleText6 ; TextEndBattle + dw CeladonGymEndBattleText6 ; TextEndBattle CeladonGymTrainerHeader6: ; 489f8 (12:49f8) db $7 ; flag's bit db ($2 << 4) ; trainer's view range dw wd77c ; flag's byte - dw CeladonGymBattleText7 ; 0x4b08 TextBeforeBattle - dw CeladonGymAfterBattleText7 ; 0x4b12 TextAfterBattle - dw CeladonGymEndBattleText7 ; 0x4b0d TextEndBattle - dw CeladonGymEndBattleText7 ; 0x4b0d TextEndBattle + dw CeladonGymBattleText7 ; TextBeforeBattle + dw CeladonGymAfterBattleText7 ; TextAfterBattle + dw CeladonGymEndBattleText7 ; TextEndBattle + dw CeladonGymEndBattleText7 ; TextEndBattle CeladonGymTrainerHeader7: ; 48a04 (12:4a04) db $8 ; flag's bit db ($3 << 4) ; trainer's view range dw wd77c ; flag's byte - dw CeladonGymBattleText8 ; 0x4b21 TextBeforeBattle - dw CeladonGymAfterBattleText8 ; 0x4b2b TextAfterBattle - dw CeladonGymEndBattleText8 ; 0x4b26 TextEndBattle - dw CeladonGymEndBattleText8 ; 0x4b26 TextEndBattle + dw CeladonGymBattleText8 ; TextBeforeBattle + dw CeladonGymAfterBattleText8 ; TextAfterBattle + dw CeladonGymEndBattleText8 ; TextEndBattle + dw CeladonGymEndBattleText8 ; TextEndBattle db $ff @@ -159,17 +159,17 @@ CeladonGymText1: ; 48a11 (12:4a11) db $08 ; asm ld a, [wd77c] bit 1, a - jr z, .asm_16064 ; 0x48a17 + jr z, .asm_48a2d bit 0, a - jr nz, .asm_3b22c ; 0x48a1b + jr nz, .asm_48a25 call z, CeladonGymText_48963 call DisableWaitingAfterTextDisplay - jr .asm_96252 ; 0x48a23 -.asm_3b22c ; 0x48a25 + jr .asm_48a5b +.asm_48a25 ld hl, CeladonGymText_48a68 call PrintText - jr .asm_96252 ; 0x48a2b -.asm_16064 ; 0x48a2d + jr .asm_48a5b +.asm_48a2d ld hl, CeladonGymText_48a5e call PrintText ld hl, wd72d @@ -187,7 +187,7 @@ CeladonGymText1: ; 48a11 (12:4a11) ld a, $3 ld [W_CELADONGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a -.asm_96252 ; 0x48a5b +.asm_48a5b jp TextScriptEnd CeladonGymText_48a5e: ; 48a5e (12:4a5e) diff --git a/scripts/celadonmansion5.asm b/scripts/celadonmansion5.asm index c18e36c6..7b2bb58d 100755 --- a/scripts/celadonmansion5.asm +++ b/scripts/celadonmansion5.asm @@ -13,9 +13,9 @@ CeladonMansion5Text2: ; 1dd46 (7:5d46) db $08 ; asm ld bc,(EEVEE << 8) | 25 call GivePokemon - jr nc, .asm_24365 ; 0x1dd4d + jr nc, .asm_24365 ld a, HS_CELADON_MANSION_5_GIFT ld [wcc4d], a predef HideObject -.asm_24365 ; 0x1dd59 +.asm_24365 jp TextScriptEnd diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index 8874a743..50496c85 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -24,7 +24,7 @@ CeladonMart3Text1: ; 4824a (12:424a) db $08 ; asm ld a, [wd778] bit 7, a - jr nz, .asm_a5463 ; 0x48250 + jr nz, .asm_a5463 ld hl, TM18PreReceiveText call PrintText ld bc, (TM_18 << 8) | 1 @@ -33,13 +33,13 @@ CeladonMart3Text1: ; 4824a (12:424a) ld hl, wd778 set 7, [hl] ld hl, ReceivedTM18Text - jr .asm_81359 ; 0x48268 + jr .asm_81359 .BagFull ld hl, TM18NoRoomText - jr .asm_81359 ; 0x4826d -.asm_a5463 ; 0x4826f + jr .asm_81359 +.asm_a5463 ld hl, TM18ExplanationText -.asm_81359 ; 0x48272 +.asm_81359 call PrintText jp TextScriptEnd diff --git a/scripts/celadonmartelevator.asm b/scripts/celadonmartelevator.asm index ff835765..049931e1 100755 --- a/scripts/celadonmartelevator.asm +++ b/scripts/celadonmartelevator.asm @@ -32,9 +32,9 @@ CeladonMartElevatorScript_4862a: ; 4862a (12:462a) ret CeladonMartElevatorScript_48631: ; 48631 (12:4631) - ld hl, CeladonMartElavatorFloors ; $4643 + ld hl, CeladonMartElavatorFloors call LoadItemList - ld hl, CeldaonMartElevatorWarpMaps ; $464a + ld hl, CeldaonMartElevatorWarpMaps ld de, wcc5b ld bc, $000a jp CopyData @@ -65,6 +65,6 @@ CeladonMartElevatorTextPointers: ; 4865c (12:465c) CeladonMartElevatorText1: ; 4865e (12:465e) db $08 ; asm call CeladonMartElevatorScript_48631 - ld hl, CeldaonMartElevatorWarpMaps ; $464a + ld hl, CeldaonMartElevatorWarpMaps predef Func_1c9c6 jp TextScriptEnd diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index d4bb4319..c656630c 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -5,7 +5,7 @@ CeladonMartRoofScript_483d8: ; 483d8 (12:43d8) xor a ld [wcd37], a ld de, wcc5b - ld hl, CeladonMartRoofDrinkList ; $4408 + ld hl, CeladonMartRoofDrinkList .asm_483e2 ld a, [hli] and a @@ -42,19 +42,19 @@ CeladonMartRoofDrinkList: ; 48408 (12:4408) CeladonMartRoofScript_4840c: ; 4840c (12:440c) ld hl, wd730 set 6, [hl] - ld hl, CeladonMartRoofText_484ee ; $44ee + ld hl, CeladonMartRoofText_484ee call PrintText xor a - ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wCurrentMenuItem], a ld a, $3 - ld [wMenuWatchedKeys], a ; wMenuWatchedKeys + ld [wMenuWatchedKeys], a ld a, [wcd37] dec a - ld [wMaxMenuItem], a ; wMaxMenuItem + ld [wMaxMenuItem], a ld a, $2 - ld [wTopMenuItemY], a ; wTopMenuItemY + ld [wTopMenuItemY], a ld a, $1 - ld [wTopMenuItemX], a ; wTopMenuItemX + ld [wTopMenuItemX], a ld a, [wcd37] dec a ld bc, $2 @@ -73,7 +73,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) bit 1, a ret nz ld hl, wcc5b - ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld a, [wCurrentMenuItem] ld d, $0 ld e, a add hl, de @@ -86,7 +86,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) ld a, [wd778] bit 6, a jr nz, .asm_484e0 - ld hl, CeladonMartRoofText_48515 ; $4515 + ld hl, CeladonMartRoofText_48515 call PrintText call RemoveItemByIDBank12 ld bc, (TM_49 << 8) | 1 @@ -101,13 +101,13 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) ld a, [wd778] bit 5, a jr nz, .asm_484e0 - ld hl, CeladonMartRoofText_48504 ; $4504 + ld hl, CeladonMartRoofText_48504 call PrintText call RemoveItemByIDBank12 ld bc, (TM_48 << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, CeladonMartRoofText_4850a ; $450a + ld hl, CeladonMartRoofText_4850a call PrintText ld hl, wd778 set 5, [hl] @@ -116,22 +116,22 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) ld a, [wd778] bit 4, a jr nz, .asm_484e0 - ld hl, CeladonMartRoofText_484f3 ; $44f3 + ld hl, CeladonMartRoofText_484f3 call PrintText call RemoveItemByIDBank12 ld bc, (TM_13 << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, CeladonMartRoofText_484f9 ; $44f9 + ld hl, CeladonMartRoofText_484f9 call PrintText ld hl, wd778 set 4, [hl] ret .BagFull - ld hl, CeladonMartRoofText_48526 ; $4526 + ld hl, CeladonMartRoofText_48526 jp PrintText .asm_484e0 - ld hl, CeladonMartRoofText_4852c ; $452c + ld hl, CeladonMartRoofText_4852c jp PrintText RemoveItemByIDBank12: ; 484e6 (12:44e6) @@ -228,7 +228,7 @@ CeladonMartRoofText2: ; 4856c (12:456c) call CeladonMartRoofScript_483d8 ld a, [wcd37] and a - jr z, .asm_914b9 ; 0x48574 + jr z, .asm_4858f ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, CeladonMartRoofText4 @@ -236,13 +236,13 @@ CeladonMartRoofText2: ; 4856c (12:456c) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_05aa4 ; 0x48588 + jr nz, .asm_48595 call CeladonMartRoofScript_4840c - jr .asm_05aa4 ; 0x4858d -.asm_914b9 ; 0x4858f + jr .asm_48595 +.asm_4858f ld hl, CeladonMartRoofText3 call PrintText -.asm_05aa4 ; 0x48595 +.asm_48595 jp TextScriptEnd CeladonMartRoofText3: ; 48598 (12:4598) diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index bbddad79..32c4868a 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -38,15 +38,15 @@ CeruleanCityScript4: ; 194a7 (6:54a7) CeruleanCityScript0: ; 194c8 (6:54c8) ld a, [wd75b] bit 7, a - jr nz, .asm_194f7 ; 0x194cd $28 + jr nz, .asm_194f7 ld hl, CeruleanCityCoords1 call ArePlayerCoordsInArray - jr nc, .asm_194f7 ; 0x194d5 $20 + jr nc, .asm_194f7 ld a, [wWhichTrade] cp $1 ld a, $8 ld b, $0 - jr nz, .asm_194e6 ; 0x194e0 $4 + jr nz, .asm_194e6 ld a, $4 ld b, $4 .asm_194e6 @@ -66,7 +66,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ret nc ld a, [wWalkBikeSurfState] and a - jr z, .asm_19512 ; 0x19508 $8 + jr z, .asm_19512 ld a, $ff ld [wc0ee], a call PlaySound @@ -80,7 +80,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld [wJoyIgnore], a ld a, [W_XCOORD] cp $14 - jr z, .asm_19535 ; 0x19526 $d + jr z, .asm_19535 ld a, $1 ld [$ff8c], a ld a, $5 @@ -140,12 +140,12 @@ CeruleanCityScript1: ; 19567 (6:5567) ; select which team to use during the encounter ld a, [W_RIVALSTARTER] cp STARTER2 - jr nz, .NotSquirtle ; 0x19592 $4 + jr nz, .NotSquirtle ld a, $7 jr .done .NotSquirtle cp STARTER3 - jr nz, .Charmander ; 0x1959a $4 + jr nz, .Charmander ld a, $8 jr .done .Charmander @@ -181,9 +181,9 @@ CeruleanCityScript2: ; 195b1 (6:55b1) call SetSpriteMovementBytesToFF ld a, [W_XCOORD] cp $14 - jr nz, .asm_195f0 ; 0x195e9 $5 + jr nz, .asm_195f0 ld de, CeruleanCityMovement4 - jr .asm_195f3 ; 0x195ee $3 + jr .asm_195f3 .asm_195f0 ld de, CeruleanCityMovement3 .asm_195f3 @@ -242,11 +242,11 @@ CeruleanCityText1: ; 1964f (6:564f) ; or talk about bill ld hl, CeruleanCityText_19677 call PrintText - jr .end ; 0x1965d -.PreBattleText ; 0x1965f + jr .end +.PreBattleText ld hl, CeruleanCityText_19668 call PrintText -.end ; 0x19665 +.end jp TextScriptEnd CeruleanCityText_19668: ; 19668 (6:5668) @@ -269,7 +269,7 @@ CeruleanCityText2: ; 1967c (6:567c) db $8 ld a, [wd75b] bit 7, a - jr nz, .asm_4ca20 ; 0x19682 $29 + jr nz, .asm_4ca20 ld hl, CeruleanCityText_196d9 call PrintText ld hl, wd72d @@ -285,7 +285,7 @@ CeruleanCityText2: ; 1967c (6:567c) ld a, $4 ld [W_CERULEANCITYCURSCRIPT], a jp TextScriptEnd -.asm_4ca20 ; 0x196ad +.asm_4ca20 ld hl, CeruleanCityText_196f3 call PrintText ld bc, (TM_28 << 8) + 1 @@ -299,7 +299,7 @@ CeruleanCityText2: ; 1967c (6:567c) ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, ReceivedTM28Text call PrintText - callba Func_74872 + callba CeruleanHideRocket .Done jp TextScriptEnd @@ -346,20 +346,20 @@ CeruleanCityText7: ; 1970c (6:570c) db $08 ; asm ldh a, [$d3] cp $b4 - jr c, .asm_e9fc9 ; 0x19711 + jr c, .asm_e9fc9 ld hl, CeruleanCityText_19730 call PrintText - jr .asm_d486e ; 0x19719 -.asm_e9fc9 ; 0x1971b + jr .asm_d486e +.asm_e9fc9 cp $64 - jr c, .asm_df99b ; 0x1971d + jr c, .asm_df99b ld hl, CeruleanCityText_19735 call PrintText - jr .asm_d486e ; 0x19725 -.asm_df99b ; 0x19727 + jr .asm_d486e +.asm_df99b ld hl, CeruleanCityText_1973a call PrintText -.asm_d486e ; 0x1972d +.asm_d486e jp TextScriptEnd CeruleanCityText_19730: ; 19730 (6:5730) @@ -376,28 +376,28 @@ CeruleanCityText_1973a: ; 1973a (6:573a) CeruleanCityText8: ; 1973f (6:573f) db $08 ; asm - ldh a, [$d3] + ld a, [hRandomAdd] cp $b4 - jr c, .asm_e28da ; 0x19744 + jr c, .asm_e28da ld hl, CeruleanCityText_1976f call PrintText - jr .asm_f2f38 ; 0x1974c -.asm_e28da ; 0x1974e + jr .asm_f2f38 +.asm_e28da cp $78 - jr c, .asm_15d08 ; 0x19750 + jr c, .asm_15d08 ld hl, CeruleanCityText_19774 call PrintText - jr .asm_f2f38 ; 0x19758 -.asm_15d08 ; 0x1975a + jr .asm_f2f38 +.asm_15d08 cp $3c - jr c, .asm_d7fea ; 0x1975c + jr c, .asm_d7fea ld hl, CeruleanCityText_19779 call PrintText - jr .asm_f2f38 ; 0x19764 -.asm_d7fea ; 0x19766 + jr .asm_f2f38 +.asm_d7fea ld hl, CeruleanCityText_1977e call PrintText -.asm_f2f38 ; 0x1976c +.asm_f2f38 jp TextScriptEnd CeruleanCityText_1976f: ; 1976f (6:576f) diff --git a/scripts/ceruleancity2.asm b/scripts/ceruleancity2.asm index 72ee4a86..2232b0f4 100755 --- a/scripts/ceruleancity2.asm +++ b/scripts/ceruleancity2.asm @@ -1,4 +1,4 @@ -Func_74872: ; 74872 (1d:4872) +CeruleanHideRocket: ; 74872 (1d:4872) ; code similar to this appears in a lot of banks; this particular ; one is called after you beat the Rocket that gives you TM28 DIG. ; the screen then fades out, he disappears, and fades back in diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index 079844f3..ba9d270d 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -12,8 +12,8 @@ CeruleanGymScript: ; 5c6b3 (17:46b3) ret CeruleanGymScript_5c6d0: ; 5c6d0 (17:46d0) - ld hl, Gym2CityName ; $46d9 - ld de, Gym2LeaderName ; $46e7 + ld hl, Gym2CityName + ld de, Gym2LeaderName jp LoadGymLeaderAndCityName Gym2CityName: ; 5c6d9 (17:46d9) @@ -36,7 +36,7 @@ CeruleanGymScriptPointers: ; 5c6f8 (17:46f8) dw CeruleanGymScript3 CeruleanGymScript3: ; 5c700 (17:4700) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, CeruleanGymScript_5c6ed ld a, $f0 @@ -44,7 +44,7 @@ CeruleanGymScript3: ; 5c700 (17:4700) CeruleanGymScript_5c70d: ; 5c70d (17:470d) ld a, $5 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd75e set 7, [hl] @@ -52,14 +52,14 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) call GiveItem jr nc, .BagFull ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd75e set 6, [hl] jr .asm_5c736 .BagFull ld a, $7 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_5c736 ld hl, W_OBTAINEDBADGES @@ -88,19 +88,19 @@ CeruleanGymTrainerHeader0: ; 5c758 (17:4758) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd75e ; flag's byte - dw CeruleanGymBattleText1 ; 0x47e9 TextBeforeBattle - dw CeruleanGymAfterBattleText1 ; 0x47f3 TextAfterBattle - dw CeruleanGymEndBattleText1 ; 0x47ee TextEndBattle - dw CeruleanGymEndBattleText1 ; 0x47ee TextEndBattle + dw CeruleanGymBattleText1 ; TextBeforeBattle + dw CeruleanGymAfterBattleText1 ; TextAfterBattle + dw CeruleanGymEndBattleText1 ; TextEndBattle + dw CeruleanGymEndBattleText1 ; TextEndBattle CeruleanGymTrainerHeader1: ; 5c764 (17:4764) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd75e ; flag's byte - dw CeruleanGymBattleText2 ; 0x4802 TextBeforeBattle - dw CeruleanGymAfterBattleText2 ; 0x480c TextAfterBattle - dw CeruleanGymEndBattleText2 ; 0x4807 TextEndBattle - dw CeruleanGymEndBattleText2 ; 0x4807 TextEndBattle + dw CeruleanGymBattleText2 ; TextBeforeBattle + dw CeruleanGymAfterBattleText2 ; TextAfterBattle + dw CeruleanGymEndBattleText2 ; TextEndBattle + dw CeruleanGymEndBattleText2 ; TextEndBattle db $ff @@ -108,17 +108,17 @@ CeruleanGymText1: ; 5c771 (17:4771) db $08 ; asm ld a, [wd75e] bit 7, a - jr z, .asm_10854 ; 0x5c777 + jr z, .asm_5c78d bit 6, a - jr nz, .asm_37a1b ; 0x5c77b + jr nz, .asm_5c785 call z, CeruleanGymScript_5c70d call DisableWaitingAfterTextDisplay - jr .asm_95b04 ; 0x5c783 -.asm_37a1b ; 0x5c785 + jr .asm_5c7bb +.asm_5c785 ld hl, CeruleanGymText_5c7c3 call PrintText - jr .asm_95b04 ; 0x5c78b -.asm_10854 ; 0x5c78d + jr .asm_5c7bb +.asm_5c78d ld hl, CeruleanGymText_5c7be call PrintText ld hl, wd72d @@ -137,7 +137,7 @@ CeruleanGymText1: ; 5c771 (17:4771) ldh [$b4], a ld a, $3 ld [W_CERULEANGYMCURSCRIPT], a -.asm_95b04 ; 0x5c7bb +.asm_5c7bb jp TextScriptEnd CeruleanGymText_5c7be: ; 5c7be (17:47be) @@ -205,14 +205,14 @@ CeruleanGymText4: ; 5c811 (17:4811) db $08 ; asm ld a, [wd75e] bit 7, a - jr nz, .asm_f80ce ; 0x5c817 + jr nz, .asm_5c821 ld hl, CeruleanGymText_5c82a call PrintText - jr .asm_18a31 ; 0x5c81f -.asm_f80ce ; 0x5c821 + jr .asm_5c827 +.asm_5c821 ld hl, CeruleanGymText_5c82f call PrintText -.asm_18a31 ; 0x5c827 +.asm_5c827 jp TextScriptEnd CeruleanGymText_5c82a: ; 5c82a (17:482a) diff --git a/scripts/ceruleanhouse2.asm b/scripts/ceruleanhouse2.asm index a40d9224..9f7e4ddd 100755 --- a/scripts/ceruleanhouse2.asm +++ b/scripts/ceruleanhouse2.asm @@ -31,7 +31,7 @@ CeruleanHouse2Text1: ; 74e15 (1d:4e15) ld a, SPECIALLISTMENU ld [wListMenuID], a call DisplayListMenuID - jr c, .asm_74e60 ; 0x74e49 $15 + jr c, .asm_74e60 ld hl, TextPointers_74e86 ld a, [wcf91] sub $15 @@ -43,7 +43,7 @@ CeruleanHouse2Text1: ; 74e15 (1d:4e15) ld h, [hl] ld l, a call PrintText - jr .asm_74e23 ; 0x74e5e $c3 + jr .asm_74e23 .asm_74e60 xor a ld [wListScrollOffset], a diff --git a/scripts/ceruleanhousetrashed.asm b/scripts/ceruleanhousetrashed.asm index ee60cda7..a78b3bb6 100755 --- a/scripts/ceruleanhousetrashed.asm +++ b/scripts/ceruleanhousetrashed.asm @@ -12,14 +12,14 @@ CeruleanHouseTrashedText1: ; 1d68f (7:568f) ld b, $e4 predef IsItemInBag_ and b - jr z, .asm_f8734 ; 0x1d698 + jr z, .asm_f8734 ld hl, CeruleanHouseTrashedText_1d6b0 call PrintText - jr .asm_8dfe9 ; 0x1d6a0 -.asm_f8734 ; 0x1d6a2 + jr .asm_8dfe9 +.asm_f8734 ld hl, CeruleanHouseTrashedText_1d6ab call PrintText -.asm_8dfe9 ; 0x1d6a8 +.asm_8dfe9 jp TextScriptEnd CeruleanHouseTrashedText_1d6ab: ; 1d6ab (7:56ab) diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index 48133c52..b4955786 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -37,7 +37,7 @@ CinnabarGymScript_75792: ; 75792 (1d:5792) ret CinnabarGymScript_757a0: ; 757a0 (1d:57a0) - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + ld a, [H_DOWNARROWBLINKCNT2] ld [wTrainerHeaderFlagBit], a ret @@ -53,11 +53,11 @@ CinnabarGymScript0: ; 757ae (1d:57ae) ret z ld [$ff8c], a cp $4 - jr nz, .asm_757c3 ; 0x757b7 $a + jr nz, .asm_757c3 ld a, $4 ld [wd528], a ld de, MovementData_757d7 - jr .asm_757cb ; 0x757c1 $8 + jr .asm_757cb .asm_757c3 ld de, MovementData_757da ld a, $1 @@ -101,7 +101,7 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) call CinnabarGymScript_757f1 ld a, c and a - jr nz, .asm_7581b ; 0x7580e $b + jr nz, .asm_7581b call WaitForSoundToFinish ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound @@ -148,7 +148,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) call DisplayTextID ld hl, wd79a set 0, [hl] - jr .asm_75880 ; 0x75877 $7 + jr .asm_75880 .BagFull ld a, $c ld [$ff8c], a @@ -186,7 +186,7 @@ CinnabarGymTextPointers: ; 7589f (1d:589f) dw TM38NoRoomText CinnabarGymScript_758b7: ; 758b7 (1d:58b7) - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + ld a, [H_DOWNARROWBLINKCNT2] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters @@ -209,17 +209,17 @@ CinnabarGymText1: ; 758df (1d:58df) db $8 ld a, [wd79a] bit 1, a - jr z, .asm_d9332 ; 0x758e5 $16 + jr z, .asm_d9332 bit 0, a - jr nz, .asm_3012f ; 0x758e9 $9 + jr nz, .asm_3012f call z, CinnabarGymScript3_75857 call DisableWaitingAfterTextDisplay jp TextScriptEnd -.asm_3012f ; 0x758f4 +.asm_3012f ld hl, BlaineFireBlastText call PrintText jp TextScriptEnd -.asm_d9332 ; 0x758fd +.asm_d9332 ld hl, BlaineBattleText call PrintText ld hl, BlaineEndBattleText @@ -262,14 +262,14 @@ CinnabarGymText2: ; 75939 (1d:5939) call CinnabarGymScript_757a0 ld a, [wd79a] bit 2, a - jr nz, .asm_46bb4 ; 0x75942 + jr nz, .asm_46bb4 ld hl, CinnabarGymText_7595f call PrintText ld hl, CinnabarGymText_75964 - ld de, CinnabarGymText_75964 ; $5964 XXX + ld de, CinnabarGymText_75964 call SaveEndBattleTextPointers jp CinnabarGymScript_758b7 -.asm_46bb4 ; 0x75956 +.asm_46bb4 ld hl, CinnabarGymText_75969 call PrintText jp TextScriptEnd @@ -291,14 +291,14 @@ CinnabarGymText3: ; 7596e (1d:596e) call CinnabarGymScript_757a0 ld a, [wd79a] bit 3, a - jr nz, .asm_4b406 ; 0x75977 + jr nz, .asm_4b406 ld hl, CinnabarGymText_75994 call PrintText ld hl, CinnabarGymText_75999 - ld de, CinnabarGymText_75999 ; $5999 XXX + ld de, CinnabarGymText_75999 call SaveEndBattleTextPointers jp CinnabarGymScript_758b7 -.asm_4b406 ; 0x7598b +.asm_4b406 ld hl, CinnabarGymText_7599e call PrintText jp TextScriptEnd @@ -320,14 +320,14 @@ CinnabarGymText4: ; 759a3 (1d:59a3) call CinnabarGymScript_757a0 ld a, [wd79a] bit 4, a - jr nz, .asm_c0673 ; 0x759ac + jr nz, .asm_c0673 ld hl, CinnabarGymText_759c9 call PrintText ld hl, CinnabarGymText_759ce - ld de, CinnabarGymText_759ce ; $59ce XXX + ld de, CinnabarGymText_759ce call SaveEndBattleTextPointers jp CinnabarGymScript_758b7 -.asm_c0673 ; 0x759c0 +.asm_c0673 ld hl, CinnabarGymText_759d3 call PrintText jp TextScriptEnd @@ -349,14 +349,14 @@ CinnabarGymText5: ; 759d8 (1d:59d8) call CinnabarGymScript_757a0 ld a, [wd79a] bit 5, a - jr nz, .asm_5cfd7 ; 0x759e1 + jr nz, .asm_5cfd7 ld hl, CinnabarGymText_759fe call PrintText ld hl, CinnabarGymText_75a03 - ld de, CinnabarGymText_75a03 ; $5a03 XXX + ld de, CinnabarGymText_75a03 call SaveEndBattleTextPointers jp CinnabarGymScript_758b7 -.asm_5cfd7 ; 0x759f5 +.asm_5cfd7 ld hl, CinnabarGymText_75a08 call PrintText jp TextScriptEnd @@ -378,14 +378,14 @@ CinnabarGymText6: ; 75a0d (1d:5a0d) call CinnabarGymScript_757a0 ld a, [wd79a] bit 6, a - jr nz, .asm_776b4 ; 0x75a16 + jr nz, .asm_776b4 ld hl, CinnabarGymText_75a33 call PrintText ld hl, CinnabarGymText_75a38 ld de, CinnabarGymText_75a38 call SaveEndBattleTextPointers jp CinnabarGymScript_758b7 -.asm_776b4 ; 0x75a2a +.asm_776b4 ld hl, CinnabarGymText_75a3d call PrintText jp TextScriptEnd @@ -407,14 +407,14 @@ CinnabarGymText7: ; 75a42 (1d:5a42) call CinnabarGymScript_757a0 ld a, [wd79a] bit 7, a - jr nz, .asm_2f755 ; 0x75a4b + jr nz, .asm_2f755 ld hl, CinnabarGymText_75a68 call PrintText ld hl, CinnabarGymText_75a6d ld de, CinnabarGymText_75a6d call SaveEndBattleTextPointers jp CinnabarGymScript_758b7 -.asm_2f755 ; 0x75a5f +.asm_2f755 ld hl, CinnabarGymText_75a72 call PrintText jp TextScriptEnd @@ -436,14 +436,14 @@ CinnabarGymText8: ; 75a77 (1d:5a77) call CinnabarGymScript_757a0 ld a, [wd79b] bit 0, a - jr nz, .asm_d87be ; 0x75a80 + jr nz, .asm_d87be ld hl, CinnabarGymText_75a9d call PrintText ld hl, CinnabarGymText_75aa2 - ld de, CinnabarGymText_75aa2 ; $5aa2 XXX + ld de, CinnabarGymText_75aa2 call SaveEndBattleTextPointers jp CinnabarGymScript_758b7 -.asm_d87be ; 0x75a94 +.asm_d87be ld hl, CinnabarGymText_75aa7 call PrintText jp TextScriptEnd @@ -464,12 +464,12 @@ CinnabarGymText9: ; 75aac (1d:5aac) db $08 ; asm ld a, [wd79a] bit 1, a - jr nz, .asm_627d9 ; 0x75ab2 + jr nz, .asm_627d9 ld hl, CinnabarGymText_75ac2 - jr .asm_0b11d ; 0x75ab7 -.asm_627d9 ; 0x75ab9 + jr .asm_0b11d +.asm_627d9 ld hl, CinnabarGymText_75ac7 -.asm_0b11d ; 0x75abc +.asm_0b11d call PrintText jp TextScriptEnd diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index b7a1255c..5bdb98b2 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -14,14 +14,14 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) db $08 ; asm ld a, [wd7af] bit 0, a - jr nz, .asm_7ccf3 ; 0x5cc88 + jr nz, .asm_7ccf3 ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, CopycatsHouse2FText_5ccd4 call PrintText ld b, POKE_DOLL call IsItemInBag - jr z, .asm_62ecd ; 0x5cc9a + jr z, .asm_62ecd ld hl, TM31PreReceiveText call PrintText ld bc, (TM_31 << 8) | 1 @@ -34,15 +34,15 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) callba RemoveItemByID ld hl, wd7af set 0, [hl] - jr .asm_62ecd ; 0x5ccc1 + jr .asm_62ecd .BagFull ld hl, TM31NoRoomText call PrintText - jr .asm_62ecd ; 0x5ccc9 -.asm_7ccf3 ; 0x5cccb + jr .asm_62ecd +.asm_7ccf3 ld hl, TM31ExplanationText2 call PrintText -.asm_62ecd ; 0x5ccd1 +.asm_62ecd jp TextScriptEnd CopycatsHouse2FText_5ccd4: ; 5ccd4 (17:4cd4) @@ -87,9 +87,9 @@ CopycatsHouse2FText7: ; 5cd03 (17:4d03) ld a, [wSpriteStateData1 + 9] cp $4 ld hl, CopycatsHouse2FText_5cd1c - jr nz, .asm_399a4 ; 0x5cd0c + jr nz, .asm_399a4 ld hl, CopycatsHouse2FText_5cd17 -.asm_399a4 ; 0x5cd11 +.asm_399a4 call PrintText jp TextScriptEnd diff --git a/scripts/daycarem.asm b/scripts/daycarem.asm index 1830d2c0..fdfca235 100755 --- a/scripts/daycarem.asm +++ b/scripts/daycarem.asm @@ -239,9 +239,9 @@ DayCareMText_56432: ; 56432 (15:6432) db "@" DayCareMText_56437: ; 56437 (15:6437) - TX_FAR _DayCareMText_56437 ; 0x8c000 + TX_FAR _DayCareMText_56437 DayCareMText_5643b: ; 5643b (15:643b) - TX_FAR _DayCareMText_5643b ; 0x8c013 + TX_FAR _DayCareMText_5643b db "@" DayCareMText_56440: ; 56440 (15:6440) diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index e26da1b1..79647fe3 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -99,37 +99,37 @@ FightingDojoTrainerHeader0: ; 5ce13 (17:4e13) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7b1 ; flag's byte - dw FightingDojoBattleText1 ; 0x4eac TextBeforeBattle - dw FightingDojoAfterBattleText1 ; 0x4eb6 TextAfterBattle - dw FightingDojoEndBattleText1 ; 0x4eb1 TextEndBattle - dw FightingDojoEndBattleText1 ; 0x4eb1 TextEndBattle + dw FightingDojoBattleText1 ; TextBeforeBattle + dw FightingDojoAfterBattleText1 ; TextAfterBattle + dw FightingDojoEndBattleText1 ; TextEndBattle + dw FightingDojoEndBattleText1 ; TextEndBattle FightingDojoTrainerHeader1: ; 5ce1f (17:4e1f) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7b1 ; flag's byte - dw FightingDojoBattleText2 ; 0x4ec5 TextBeforeBattle - dw FightingDojoAfterBattleText2 ; 0x4ecf TextAfterBattle - dw FightingDojoEndBattleText2 ; 0x4eca TextEndBattle - dw FightingDojoEndBattleText2 ; 0x4eca TextEndBattle + dw FightingDojoBattleText2 ; TextBeforeBattle + dw FightingDojoAfterBattleText2 ; TextAfterBattle + dw FightingDojoEndBattleText2 ; TextEndBattle + dw FightingDojoEndBattleText2 ; TextEndBattle FightingDojoTrainerHeader2: ; 5ce2b (17:4e2b) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b1 ; flag's byte - dw FightingDojoBattleText3 ; 0x4ede TextBeforeBattle - dw FightingDojoAfterBattleText3 ; 0x4ee8 TextAfterBattle - dw FightingDojoEndBattleText3 ; 0x4ee3 TextEndBattle - dw FightingDojoEndBattleText3 ; 0x4ee3 TextEndBattle + dw FightingDojoBattleText3 ; TextBeforeBattle + dw FightingDojoAfterBattleText3 ; TextAfterBattle + dw FightingDojoEndBattleText3 ; TextEndBattle + dw FightingDojoEndBattleText3 ; TextEndBattle FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b1 ; flag's byte - dw FightingDojoBattleText4 ; 0x4ef7 TextBeforeBattle - dw FightingDojoAfterBattleText4 ; 0x4f01 TextAfterBattle - dw FightingDojoEndBattleText4 ; 0x4efc TextEndBattle - dw FightingDojoEndBattleText4 ; 0x4efc TextEndBattle + dw FightingDojoBattleText4 ; TextBeforeBattle + dw FightingDojoAfterBattleText4 ; TextAfterBattle + dw FightingDojoEndBattleText4 ; TextEndBattle + dw FightingDojoEndBattleText4 ; TextEndBattle db $ff @@ -155,15 +155,15 @@ FightingDojoText1: ; 5ce44 (17:4e44) ld a, $3 ld [W_FIGHTINGDOJOCURSCRIPT], a ld [W_CURMAPSCRIPT], a - jr .asm_9dba4 ; 0x5ce7b -.continue1 ; 0x5ce7d + jr .asm_9dba4 +.continue1 ld hl, FightingDojoText_5ce9d call PrintText - jr .asm_9dba4 ; 0x5ce83 -.continue2 ; 0x5ce85f + jr .asm_9dba4 +.continue2 ld hl, FightingDojoText8 call PrintText -.asm_9dba4 ; 0x5ce8b +.asm_9dba4 jp TextScriptEnd FightingDojoText_5ce8e: ; 5ce8e (17:4e8e) diff --git a/scripts/fuchsiacity.asm b/scripts/fuchsiacity.asm index 6b7e067b..62372c9c 100755 --- a/scripts/fuchsiacity.asm +++ b/scripts/fuchsiacity.asm @@ -137,24 +137,24 @@ FuchsiaCityText24: ; 19af4 (6:5af4) db $08 ; asm ld a, [wd7f6] bit 6, a - jr nz, .asm_3b4e8 ; 0x19afa + jr nz, .asm_3b4e8 bit 7, a - jr nz, .asm_667d5 ; 0x19afe + jr nz, .asm_667d5 ld hl, FuchsiaCityText_19b2a call PrintText - jr .asm_4343f ; 0x19b06 -.asm_3b4e8 ; 0x19b08 + jr .asm_4343f +.asm_3b4e8 ld hl, FuchsiaCityOmanyteText call PrintText ld a, OMANYTE - jr .asm_81556 ; 0x19b10 -.asm_667d5 ; 0x19b12 + jr .asm_81556 +.asm_667d5 ld hl, FuchsiaCityKabutoText call PrintText ld a, KABUTO -.asm_81556 ; 0x19b1a +.asm_81556 call DisplayPokedex -.asm_4343f ; 0x19b1d +.asm_4343f jp TextScriptEnd FuchsiaCityOmanyteText: ; 19b20 (6:5b20) diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index 01ca96d9..729192c6 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -37,14 +37,14 @@ FuchsiaGymScriptPointers: ; 75482 (1d:5482) dw FuchsiaGymScript3 FuchsiaGymScript3: ; 7548a (1d:548a) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, FuchsiaGymScript_75477 ld a, $f0 ld [wJoyIgnore], a FuchsiaGymScript3_75497: ; 75497 (1d:5497) ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd792 set 1, [hl] @@ -52,14 +52,14 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) call GiveItem jr nc, .BagFull ld a, $a - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd792 set 0, [hl] jr .asm_754c0 .BagFull ld a, $b - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_754c0 ld hl, W_OBTAINEDBADGES @@ -92,55 +92,55 @@ FuchsiaGymTrainerHeader0: ; 754eb (1d:54eb) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd792 ; flag's byte - dw FuchsiaGymBattleText1 ; 0x55ae TextBeforeBattle - dw FuchsiaGymAfterBattleText1 ; 0x55b8 TextAfterBattle - dw FuchsiaGymEndBattleText1 ; 0x55b3 TextEndBattle - dw FuchsiaGymEndBattleText1 ; 0x55b3 TextEndBattle + dw FuchsiaGymBattleText1 ; TextBeforeBattle + dw FuchsiaGymAfterBattleText1 ; TextAfterBattle + dw FuchsiaGymEndBattleText1 ; TextEndBattle + dw FuchsiaGymEndBattleText1 ; TextEndBattle FuchsiaGymTrainerHeader2: ; 754f7 (1d:54f7) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd792 ; flag's byte - dw FuchsiaGymBattleText2 ; 0x55c7 TextBeforeBattle - dw FuchsiaGymAfterBattleText2 ; 0x55d1 TextAfterBattle - dw FuchsiaGymEndBattleText2 ; 0x55cc TextEndBattle - dw FuchsiaGymEndBattleText2 ; 0x55cc TextEndBattle + dw FuchsiaGymBattleText2 ; TextBeforeBattle + dw FuchsiaGymAfterBattleText2 ; TextAfterBattle + dw FuchsiaGymEndBattleText2 ; TextEndBattle + dw FuchsiaGymEndBattleText2 ; TextEndBattle FuchsiaGymTrainerHeader3: ; 75503 (1d:5503) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd792 ; flag's byte - dw FuchsiaGymBattleText3 ; 0x55e0 TextBeforeBattle - dw FuchsiaGymAfterBattleText3 ; 0x55ea TextAfterBattle - dw FuchsiaGymEndBattleText3 ; 0x55e5 TextEndBattle - dw FuchsiaGymEndBattleText3 ; 0x55e5 TextEndBattle + dw FuchsiaGymBattleText3 ; TextBeforeBattle + dw FuchsiaGymAfterBattleText3 ; TextAfterBattle + dw FuchsiaGymEndBattleText3 ; TextEndBattle + dw FuchsiaGymEndBattleText3 ; TextEndBattle FuchsiaGymTrainerHeader4: ; 7550f (1d:550f) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd792 ; flag's byte - dw FuchsiaGymBattleText4 ; 0x55f9 TextBeforeBattle - dw FuchsiaGymAfterBattleText4 ; 0x5603 TextAfterBattle - dw FuchsiaGymEndBattleText4 ; 0x55fe TextEndBattle - dw FuchsiaGymEndBattleText4 ; 0x55fe TextEndBattle + dw FuchsiaGymBattleText4 ; TextBeforeBattle + dw FuchsiaGymAfterBattleText4 ; TextAfterBattle + dw FuchsiaGymEndBattleText4 ; TextEndBattle + dw FuchsiaGymEndBattleText4 ; TextEndBattle FuchsiaGymTrainerHeader5: ; 7551b (1d:551b) db $6 ; flag's bit db ($2 << 4) ; trainer's view range dw wd792 ; flag's byte - dw FuchsiaGymBattleText5 ; 0x5612 TextBeforeBattle - dw FuchsiaGymAfterBattleText5 ; 0x561c TextAfterBattle - dw FuchsiaGymEndBattleText5 ; 0x5617 TextEndBattle - dw FuchsiaGymEndBattleText5 ; 0x5617 TextEndBattle + dw FuchsiaGymBattleText5 ; TextBeforeBattle + dw FuchsiaGymAfterBattleText5 ; TextAfterBattle + dw FuchsiaGymEndBattleText5 ; TextEndBattle + dw FuchsiaGymEndBattleText5 ; TextEndBattle FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) db $7 ; flag's bit db ($2 << 4) ; trainer's view range dw wd792 ; flag's byte - dw FuchsiaGymBattleText6 ; 0x562b TextBeforeBattle - dw FuchsiaGymAfterBattleText6 ; 0x5635 TextAfterBattle - dw FuchsiaGymEndBattleText6 ; 0x5630 TextEndBattle - dw FuchsiaGymEndBattleText6 ; 0x5630 TextEndBattle + dw FuchsiaGymBattleText6 ; TextBeforeBattle + dw FuchsiaGymAfterBattleText6 ; TextAfterBattle + dw FuchsiaGymEndBattleText6 ; TextEndBattle + dw FuchsiaGymEndBattleText6 ; TextEndBattle db $ff @@ -148,17 +148,17 @@ FuchsiaGymText1: ; 75534 (1d:5534) db $08 ; asm ld a, [wd792] bit 1, a - jr z, .asm_181b6 ; 0x7553a + jr z, .asm_181b6 bit 0, a - jr nz, .asm_adc3b ; 0x7553e + jr nz, .asm_adc3b call z, FuchsiaGymScript3_75497 call DisableWaitingAfterTextDisplay - jr .asm_e84c6 ; 0x75546 -.asm_adc3b ; 0x75548 + jr .asm_e84c6 +.asm_adc3b ld hl, KogaExplainToxicText call PrintText - jr .asm_e84c6 ; 0x7554e -.asm_181b6 ; 0x75550 + jr .asm_e84c6 +.asm_181b6 ld hl, KogaBeforeBattleText call PrintText ld hl, wd72d @@ -177,7 +177,7 @@ FuchsiaGymText1: ; 75534 (1d:5534) ldh [$b4], a ld a, $3 ld [W_FUCHSIAGYMCURSCRIPT], a -.asm_e84c6 ; 0x7557e +.asm_e84c6 jp TextScriptEnd KogaBeforeBattleText: ; 75581 (1d:5581) @@ -321,9 +321,9 @@ FuchsiaGymText8: ; 7563a (1d:563a) ld a, [wd792] bit 1, a ld hl, FuchsiaGymText_75653 - jr nz, .asm_50671 ; 0x75643 + jr nz, .asm_50671 ld hl, FuchsiaGymText_7564e -.asm_50671 ; 0x75648 +.asm_50671 call PrintText jp TextScriptEnd diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index 33bae7e4..73ad188d 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -12,25 +12,25 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) db $08 ; asm ld a, [wd78e] bit 0, a - jr nz, .subtract ; 0x750c8 + jr nz, .subtract ld b,GOLD_TEETH call IsItemInBag - jr nz, .asm_3f30f ; 0x750cf + jr nz, .asm_3f30f ld a, [wd78e] bit 1, a - jr nz, .asm_60cba ; 0x750d6 + jr nz, .asm_60cba ld hl, WardenGibberishText1 call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a ld hl, WardenGibberishText3 - jr nz, .asm_61238 ; 0x750e8 + jr nz, .asm_61238 ld hl, WardenGibberishText2 -.asm_61238 ; 0x750ed +.asm_61238 call PrintText - jr .asm_52039 ; 0x750f0 -.asm_3f30f ; 0x750f2 + jr .asm_52039 +.asm_3f30f ld hl, WardenTeethText1 call PrintText ld a, GOLD_TEETH @@ -38,7 +38,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) callba RemoveItemByID ld hl, wd78e set 1, [hl] -.asm_60cba ; 0x75109 +.asm_60cba ld hl, WardenThankYouText call PrintText ld bc,(HM_04 << 8) | 1 @@ -48,15 +48,15 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) call PrintText ld hl, wd78e set 0, [hl] - jr .asm_52039 ; 0x75122 -.subtract ; 0x75124 + jr .asm_52039 +.subtract ld hl, HM04ExplanationText call PrintText - jr .asm_52039 ; 0x7512a + jr .asm_52039 .BagFull ld hl, HM04NoRoomText call PrintText -.asm_52039 ; 0x75132 +.asm_52039 jp TextScriptEnd WardenGibberishText1: ; 75135 (1d:5135) @@ -101,9 +101,9 @@ FuchsiaHouse2Text4: ; 75163 (1d:5163) ldh a, [$8c] cp $4 ld hl, FuchsiaHouse2Text_7517b - jr nz, .asm_4c9a2 ; 0x7516b + jr nz, .asm_4c9a2 ld hl, FuchsiaHouse2Text_75176 -.asm_4c9a2 ; 0x75170 +.asm_4c9a2 call PrintText jp TextScriptEnd diff --git a/scripts/fuchsiahouse3.asm b/scripts/fuchsiahouse3.asm index d35a506d..31e5f76c 100755 --- a/scripts/fuchsiahouse3.asm +++ b/scripts/fuchsiahouse3.asm @@ -48,7 +48,7 @@ FuchsiaHouse3Text_561bd: ; 561bd (15:61bd) db "@" FuchsiaHouse3Text_561c2: ; 561c2 (15:61c2) - TX_FAR _FuchsiaHouse3Text_561c2 ; 0xa06e8 + TX_FAR _FuchsiaHouse3Text_561c2 db $0B db "@" diff --git a/scripts/gary.asm b/scripts/gary.asm index c0785cab..f5d30528 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -70,12 +70,12 @@ GaryScript2: ; 75f6a (1d:5f6a) ; select which team to use during the encounter ld a, [W_RIVALSTARTER] cp STARTER2 - jr nz, .NotSquirtle ; 0x75f9f $4 + jr nz, .NotSquirtle ld a, $1 jr .done .NotSquirtle cp STARTER3 - jr nz, .Charmander ; 0x75fa7 $4 + jr nz, .Charmander ld a, $2 jr .done .Charmander @@ -93,7 +93,7 @@ GaryScript3: ; 75fbb (1d:5fbb) ld a, [W_ISINBATTLE] cp $ff jp z, GaryScript_75f29 - call UpdateSprites ; move sprites + call UpdateSprites ld hl, wd867 set 1, [hl] ld a, $f0 @@ -210,7 +210,7 @@ GaryScript9: ; 76099 (1d:6099) ld [W_GARYCURSCRIPT], a ret -RLEMovement760b4 ; 760b4 (1d:60b4) +RLEMovement760b4: ; 760b4 (1d:60b4) db $40,4 db $20,1 db $ff @@ -225,7 +225,7 @@ GaryScript10: ; 760b9 (1d:60b9) ld [W_GARYCURSCRIPT], a ret -GaryScript_760c8 ; 760c8 (1d:60c8) +GaryScript_760c8: ; 760c8 (1d:60c8) ld a, $f0 ld [wJoyIgnore], a call DisplayTextID @@ -245,9 +245,9 @@ GaryText1: ; 760e0 (1d:60e0) ld a, [wd867] bit 1, a ld hl, GaryText_760f4 - jr z, .asm_17e9f ; 0x760e9 + jr z, .asm_17e9f ld hl, GaryText_76103 -.asm_17e9f ; 0x760ee +.asm_17e9f call PrintText jp TextScriptEnd diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index c44622c7..1d522e60 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -55,7 +55,7 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) ld c, 600 / 5 call DelayFrames dec b - jr nz, .asm_5a4ff ; 0x5a505 $f8 + jr nz, .asm_5a4ff call WaitForTextScrollButtonPress jp Init diff --git a/scripts/lab2.asm b/scripts/lab2.asm index 9839a563..8e490b14 100755 --- a/scripts/lab2.asm +++ b/scripts/lab2.asm @@ -14,12 +14,12 @@ Lab2Text2: ; 75c2f (1d:5c2f) db $8 ld a, $7 ld [wWhichTrade], a - jr asm_78552 ; 0x75c35 $6 + jr Lab2DoTrade Lab2Text3: ; 75c37 (1d:5c37) db $8 ld a, $8 ld [wWhichTrade], a -asm_78552: ; 75c3d (1d:5c3d) +Lab2DoTrade: ; 75c3d (1d:5c3d) predef DoInGameTradeDialogue jp TextScriptEnd diff --git a/scripts/lab3.asm b/scripts/lab3.asm index 66839b17..80a103ca 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -12,7 +12,7 @@ Lab3Text1: ; 75c94 (1d:5c94) db $08 ; asm ld a, [wd7a1] bit 7, a - jr nz, .asm_e551a ; 0x75c9a + jr nz, .asm_e551a ld hl, TM35PreReceiveText call PrintText ld bc, (TM_35 << 8) | 1 @@ -22,15 +22,15 @@ Lab3Text1: ; 75c94 (1d:5c94) call PrintText ld hl, wd7a1 set 7, [hl] - jr .asm_eb896 ; 0x75cb5 + jr .asm_eb896 .BagFull ld hl, TM35NoRoomText call PrintText - jr .asm_eb896 ; 0x75cbd -.asm_e551a ; 0x75cbf + jr .asm_eb896 +.asm_e551a ld hl, TM35ExplanationText call PrintText -.asm_eb896 ; 0x75cc5 +.asm_eb896 jp TextScriptEnd TM35PreReceiveText: ; 75cc8 (1d:5cc8) diff --git a/scripts/lab4.asm b/scripts/lab4.asm index 1e818676..ee252cc1 100755 --- a/scripts/lab4.asm +++ b/scripts/lab4.asm @@ -51,15 +51,15 @@ Lab4Text1: ; 75d6c (1d:5d6c) db $8 ld a, [wd7a3] bit 0, a - jr nz, .asm_75d96 ; 0x75d72 $22 + jr nz, .asm_75d96 ld hl, Lab4Text_75dc6 call PrintText call Lab4Script_75d38 ld a, [wcd37] and a - jr z, .asm_75d8d ; 0x75d81 $a + jr z, .asm_75d8d callba GiveFossilToCinnabarLab - jr .asm_75d93 ; 0x75d8b $6 + jr .asm_75d93 .asm_75d8d ld hl, Lab4Text_75dcb call PrintText @@ -67,10 +67,10 @@ Lab4Text1: ; 75d6c (1d:5d6c) jp TextScriptEnd .asm_75d96 bit 1, a - jr z, .asm_75da2 ; 0x75d98 $8 + jr z, .asm_75da2 ld hl, Lab4Text_75dd0 call PrintText - jr .asm_75d93 ; 0x75da0 $f1 + jr .asm_75d93 .asm_75da2 call LoadFossilItemAndMonNameBank1D ld hl, Lab4Text_75dd5 @@ -81,12 +81,12 @@ Lab4Text1: ; 75d6c (1d:5d6c) ld b, a ld c, 30 call GivePokemon - jr nc, .asm_75d93 ; 0x75db9 $d8 + jr nc, .asm_75d93 ld hl, wd7a3 res 0, [hl] res 1, [hl] res 2, [hl] - jr .asm_75d93 ; 0x75dc4 $cd + jr .asm_75d93 Lab4Text_75dc6: ; 75dc6 (1d:5dc6) TX_FAR _Lab4Text_75dc6 diff --git a/scripts/lance.asm b/scripts/lance.asm index f2523098..ce8c6cd7 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -60,11 +60,11 @@ LanceScript0: ; 5a305 (16:6305) jp nc, CheckFightingMapTrainers xor a ld [hJoyHeld], a - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] cp $3 jr nc, .asm_5a325 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp DisplayTextID .asm_5a325 cp $5 @@ -89,11 +89,11 @@ CoordsData_5a33e: ; 5a33e (16:633e) LanceScript2: ; 5a349 (16:6349) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, LanceScript_5a2f5 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp DisplayTextID LanceScript_5a35b: ; 5a35b (16:635b) @@ -136,10 +136,10 @@ LanceTrainerHeader0: ; 5a397 (16:6397) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd866 ; flag's byte - dw LanceBeforeBattleText ; 0x63ae TextBeforeBattle - dw LanceAfterBattleText ; 0x63b8 TextAfterBattle - dw LanceEndBattleText ; 0x63b3 TextEndBattle - dw LanceEndBattleText ; 0x63b3 TextEndBattle + dw LanceBeforeBattleText ; TextBeforeBattle + dw LanceAfterBattleText ; TextAfterBattle + dw LanceEndBattleText ; TextEndBattle + dw LanceEndBattleText ; TextEndBattle db $ff diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index 5fd1dd34..ab6d13fd 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -14,14 +14,14 @@ LavenderHouse1Text1: ; 1d8b8 (7:58b8) db $08 ; asm ld a, [wd7e0] bit 7, a - jr nz, .asm_72e5d ; 0x1d8be + jr nz, .asm_72e5d ld hl, LavenderHouse1Text_1d8d1 call PrintText - jr .asm_6957f ; 0x1d8c6 -.asm_72e5d ; 0x1d8c8 + jr .asm_6957f +.asm_72e5d ld hl, LavenderHouse1Text_1d8d6 call PrintText -.asm_6957f ; 0x1d8ce +.asm_6957f jp TextScriptEnd LavenderHouse1Text_1d8d1: ; 1d8d1 (7:58d1) @@ -36,14 +36,14 @@ LavenderHouse1Text2: ; 1d8db (7:58db) db $08 ; asm ld a, [wd7e0] bit 7, a - jr nz, .asm_06470 ; 0x1d8e1 + jr nz, .asm_06470 ld hl, LavenderHouse1Text_1d8f4 call PrintText - jr .asm_3d208 ; 0x1d8e9 -.asm_06470 ; 0x1d8eb + jr .asm_3d208 +.asm_06470 ld hl, LavenderHouse1Text_1d8f9 call PrintText -.asm_3d208 ; 0x1d8f1 +.asm_3d208 jp TextScriptEnd LavenderHouse1Text_1d8f4: ; 1d8f4 (7:58f4) @@ -72,7 +72,7 @@ LavenderHouse1Text5: ; 1d918 (7:5918) db $08 ; asm ld a, [wd76c] bit 0, a - jr nz, .asm_15ac2 ; 0x1d91e + jr nz, .asm_15ac2 ld hl, LavenderHouse1Text_1d94c call PrintText ld bc, (POKE_FLUTE << 8) | 1 @@ -82,15 +82,15 @@ LavenderHouse1Text5: ; 1d918 (7:5918) call PrintText ld hl, wd76c set 0, [hl] - jr .asm_da749 ; 0x1d939 + jr .asm_da749 .BagFull ld hl, FluteNoRoomText call PrintText - jr .asm_da749 ; 0x1d941 -.asm_15ac2 ; 0x1d943 + jr .asm_da749 +.asm_15ac2 ld hl, MrFujiAfterFluteText call PrintText -.asm_da749 ; 0x1d949 +.asm_da749 jp TextScriptEnd LavenderHouse1Text_1d94c: ; 1d94c (7:594c) diff --git a/scripts/lavenderhouse2.asm b/scripts/lavenderhouse2.asm index c2120058..b9de2663 100755 --- a/scripts/lavenderhouse2.asm +++ b/scripts/lavenderhouse2.asm @@ -17,14 +17,14 @@ LavenderHouse2Text2: ; 1d9c3 (7:59c3) db $08 ; asm ld a, [wd7e0] bit 7, a - jr nz, .asm_65711 ; 0x1d9c9 + jr nz, .asm_65711 ld hl, LavenderHouse2Text_1d9dc call PrintText - jr .asm_64be1 ; 0x1d9d1 -.asm_65711 ; 0x1d9d3 + jr .asm_64be1 +.asm_65711 ld hl, LavenderHouse2Text_1d9e1 call PrintText -.asm_64be1 ; 0x1d9d9 +.asm_64be1 jp TextScriptEnd LavenderHouse2Text_1d9dc: ; 1d9dc (7:59dc) diff --git a/scripts/lavendermart.asm b/scripts/lavendermart.asm index 3852a235..1d60a127 100755 --- a/scripts/lavendermart.asm +++ b/scripts/lavendermart.asm @@ -14,14 +14,14 @@ LavenderMartText3: ; 5c93a (17:493a) db $08 ; asm ld a, [wd7e0] bit 7, a - jr nz, .asm_c88d4 ; 0x5c940 + jr nz, .asm_c88d4 ld hl, LavenderMart_5c953 call PrintText - jr .asm_6d225 ; 0x5c948 -.asm_c88d4 ; 0x5c94a + jr .asm_6d225 +.asm_c88d4 ld hl, LavenderMart_5c958 call PrintText -.asm_6d225 ; 0x5c950 +.asm_6d225 jp TextScriptEnd LavenderMart_5c953: ; 5c953 (17:4953) diff --git a/scripts/lavendertown.asm b/scripts/lavendertown.asm index a4f1f200..6ac56ba0 100755 --- a/scripts/lavendertown.asm +++ b/scripts/lavendertown.asm @@ -20,9 +20,9 @@ LavenderTownText1: ; 44120 (11:4120) ld a, [wCurrentMenuItem] and a ld hl, LavenderTownText_44146 - jr nz, .asm_40831 ; 0x44131 + jr nz, .asm_40831 ld hl, LavenderTownText_44141 -.asm_40831 ; 0x44136 +.asm_40831 call PrintText jp TextScriptEnd diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index e82497ef..ee50849b 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -41,7 +41,8 @@ LoreleiScriptPointers: ; 761bb (1d:61bb) LoreleiScript4: ; 761c5 (1d:61c5) ret -asm_761c6: ; 761c6 (1d:61c6) + +LoreleiScript_761c6: ; 761c6 (1d:61c6) ld hl, wSimulatedJoypadStatesEnd ld a, D_UP ld [hli], a @@ -57,6 +58,7 @@ asm_761c6: ; 761c6 (1d:61c6) ld [W_LORELEICURSCRIPT], a ld [W_CURMAPSCRIPT], a ret + LoreleiScript0: ; 761e2 (1d:61e2) ld hl, CoordsData_76223 call ArePlayerCoordsInArray @@ -66,16 +68,16 @@ LoreleiScript0: ; 761e2 (1d:61e2) ld [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] cp $3 jr c, .asm_76206 ld hl, wd863 bit 6, [hl] set 6, [hl] - jr z, asm_761c6 + jr z, LoreleiScript_761c6 .asm_76206 ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -106,11 +108,11 @@ LoreleiScript3: ; 7622c (1d:622c) ret LoreleiScript2: ; 7623f (1d:623f) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, LoreleiScript_761b6 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp DisplayTextID LoreleiTextPointers: ; 76251 (1d:6251) @@ -122,10 +124,10 @@ LoreleiTrainerHeader0: ; 76255 (1d:6255) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd863 ; flag's byte - dw LoreleiBeforeBattleText ; 0x626c TextBeforeBattle - dw LoreleiAfterBattleText ; 0x6276 TextAfterBattle - dw LoreleiEndBattleText ; 0x6271 TextEndBattle - dw LoreleiEndBattleText ; 0x6271 TextEndBattle + dw LoreleiBeforeBattleText ; TextBeforeBattle + dw LoreleiAfterBattleText ; TextAfterBattle + dw LoreleiEndBattleText ; TextEndBattle + dw LoreleiEndBattleText ; TextEndBattle db $ff diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index 3e067a98..22a87366 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -15,7 +15,7 @@ Mansion1Subscript1: ; 442c5 (11:42c5) ret z ld a, [wd796] bit 0, a - jr nz, .asm_442ec ; 0x442d2 $18 + jr nz, .asm_442ec ld bc, $060c call Mansion1Script_4430b ld bc, $0308 @@ -37,12 +37,12 @@ Mansion1Subscript1: ; 442c5 (11:42c5) Mansion1Script_44304: ; 44304 (11:4304) ld a, $2d ld [wd09f], a - jr asm_44310 + jr Mansion1ReplaceBlock Mansion1Script_4430b: ; 4430b (11:430b) ld a, $e ld [wd09f], a -asm_44310: ; 44310 (11:4310) +Mansion1ReplaceBlock: ; 44310 (11:4310) predef ReplaceTileBlock ret @@ -72,10 +72,10 @@ Mansion1TrainerHeader0: ; 44334 (11:4334) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd798 ; flag's byte - dw Mansion1BattleText2 ; 0x434b TextBeforeBattle - dw Mansion1AfterBattleText2 ; 0x4355 TextAfterBattle - dw Mansion1EndBattleText2 ; 0x4350 TextEndBattle - dw Mansion1EndBattleText2 ; 0x4350 TextEndBattle + dw Mansion1BattleText2 ; TextBeforeBattle + dw Mansion1AfterBattleText2 ; TextAfterBattle + dw Mansion1EndBattleText2 ; TextEndBattle + dw Mansion1EndBattleText2 ; TextEndBattle db $ff @@ -104,7 +104,7 @@ Mansion1Text4: ; 4435a (11:435a) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_4438c ; 0x44368 $22 + jr nz, .asm_4438c ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, wd126 @@ -116,9 +116,9 @@ Mansion1Text4: ; 4435a (11:435a) ld hl, wd796 bit 0, [hl] set 0, [hl] - jr z, .asm_44392 ; 0x44386 $a + jr z, .asm_44392 res 0, [hl] - jr .asm_44392 ; 0x4438a $6 + jr .asm_44392 .asm_4438c ld hl, MansionSwitchNotPressedText call PrintText diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index c643d229..fdc1ec18 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -69,10 +69,10 @@ Mansion2TrainerHeader0: ; 52057 (14:6057) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd847 ; flag's byte - dw Mansion2BattleText1 ; 0x606e TextBeforeBattle - dw Mansion2AfterBattleText1 ; 0x6078 TextAfterBattle - dw Mansion2EndBattleText1 ; 0x6073 TextEndBattle - dw Mansion2EndBattleText1 ; 0x6073 TextEndBattle + dw Mansion2BattleText1 ; TextBeforeBattle + dw Mansion2AfterBattleText1 ; TextAfterBattle + dw Mansion2EndBattleText1 ; TextEndBattle + dw Mansion2EndBattleText1 ; TextEndBattle db $ff @@ -110,7 +110,7 @@ Mansion2Text5: ; 52087 (14:6087) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_520b9 ; 0x52095 $22 + jr nz, .asm_520b9 ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, wd126 @@ -122,9 +122,9 @@ Mansion2Text5: ; 52087 (14:6087) ld hl, wd796 bit 0, [hl] set 0, [hl] - jr z, .asm_520bf ; 0x520b3 $a + jr z, .asm_520bf res 0, [hl] - jr .asm_520bf ; 0x520b7 $6 + jr .asm_520bf .asm_520b9 ld hl, Mansion2Text_520cc call PrintText diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index 6ad02dd9..b0f82b88 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -65,7 +65,7 @@ Mansion3Script_5225b: ; 5225b (14:625b) ret nz call ArePlayerCoordsInArray ret nc - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] ld [wWhichDungeonWarp], a ld hl, wd72d set 4, [hl] @@ -80,7 +80,7 @@ Mansion3Script_Switches: ; 5227a (14:627a) xor a ld [hJoyHeld], a ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp DisplayTextID Mansion3TextPointers: ; 5228a (14:628a) @@ -96,19 +96,19 @@ Mansion3TrainerHeader0: ; 52296 (14:6296) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd849 ; flag's byte - dw Mansion3BattleText1 ; 0x62c3 TextBeforeBattle - dw Mansion3AfterBattleText1 ; 0x62cd TextAfterBattle - dw Mansion3EndBattleText1 ; 0x62c8 TextEndBattle - dw Mansion3EndBattleText1 ; 0x62c8 TextEndBattle + dw Mansion3BattleText1 ; TextBeforeBattle + dw Mansion3AfterBattleText1 ; TextAfterBattle + dw Mansion3EndBattleText1 ; TextEndBattle + dw Mansion3EndBattleText1 ; TextEndBattle Mansion3TrainerHeader2: ; 522a2 (14:62a2) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd849 ; flag's byte - dw Mansion3BattleText2 ; 0x62d2 TextBeforeBattle - dw Mansion3AfterBattleText2 ; 0x62dc TextAfterBattle - dw Mansion3EndBattleText2 ; 0x62d7 TextEndBattle - dw Mansion3EndBattleText2 ; 0x62d7 TextEndBattle + dw Mansion3BattleText2 ; TextBeforeBattle + dw Mansion3AfterBattleText2 ; TextAfterBattle + dw Mansion3EndBattleText2 ; TextEndBattle + dw Mansion3EndBattleText2 ; TextEndBattle db $ff diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index b89af5f2..765571d0 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -51,7 +51,7 @@ Mansion4Script_Switches: ; 52420 (14:6420) xor a ld [hJoyHeld], a ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp DisplayTextID Mansion4ScriptPointers: ; 52430 (14:6430) @@ -75,19 +75,19 @@ Mansion4TrainerHeader0: ; 52448 (14:6448) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd84b ; flag's byte - dw Mansion4BattleText1 ; 0x6475 TextBeforeBattle - dw Mansion4AfterBattleText1 ; 0x647f TextAfterBattle - dw Mansion4EndBattleText1 ; 0x647a TextEndBattle - dw Mansion4EndBattleText1 ; 0x647a TextEndBattle + dw Mansion4BattleText1 ; TextBeforeBattle + dw Mansion4AfterBattleText1 ; TextAfterBattle + dw Mansion4EndBattleText1 ; TextEndBattle + dw Mansion4EndBattleText1 ; TextEndBattle Mansion4TrainerHeader2: ; 52454 (14:6454) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd84b ; flag's byte - dw Mansion4BattleText2 ; 0x6484 TextBeforeBattle - dw Mansion4AfterBattleText2 ; 0x648e TextAfterBattle - dw Mansion4EndBattleText2 ; 0x6489 TextEndBattle - dw Mansion4EndBattleText2 ; 0x6489 TextEndBattle + dw Mansion4BattleText2 ; TextBeforeBattle + dw Mansion4AfterBattleText2 ; TextAfterBattle + dw Mansion4EndBattleText2 ; TextEndBattle + dw Mansion4EndBattleText2 ; TextEndBattle db $ff diff --git a/scripts/mtmoon1.asm b/scripts/mtmoon1.asm index def597ba..be46f624 100755 --- a/scripts/mtmoon1.asm +++ b/scripts/mtmoon1.asm @@ -33,64 +33,64 @@ MtMoon1TrainerHeader0: ; 499fd (12:59fd) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7f5 ; flag's byte - dw MtMoon1BattleText2 ; 0x5a98 TextBeforeBattle - dw MtMoon1AfterBattleText2 ; 0x5aa2 TextAfterBattle - dw MtMoon1EndBattleText2 ; 0x5a9d TextEndBattle - dw MtMoon1EndBattleText2 ; 0x5a9d TextEndBattle + dw MtMoon1BattleText2 ; TextBeforeBattle + dw MtMoon1AfterBattleText2 ; TextAfterBattle + dw MtMoon1EndBattleText2 ; TextEndBattle + dw MtMoon1EndBattleText2 ; TextEndBattle MtMoon1TrainerHeader2: ; 49a09 (12:5a09) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f5 ; flag's byte - dw MtMoon1BattleText3 ; 0x5aa7 TextBeforeBattle - dw MtMoon1AfterBattleText3 ; 0x5ab1 TextAfterBattle - dw MtMoon1EndBattleText3 ; 0x5aac TextEndBattle - dw MtMoon1EndBattleText3 ; 0x5aac TextEndBattle + dw MtMoon1BattleText3 ; TextBeforeBattle + dw MtMoon1AfterBattleText3 ; TextAfterBattle + dw MtMoon1EndBattleText3 ; TextEndBattle + dw MtMoon1EndBattleText3 ; TextEndBattle MtMoon1TrainerHeader3: ; 49a15 (12:5a15) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f5 ; flag's byte - dw MtMoon1BattleText4 ; 0x5ab6 TextBeforeBattle - dw MtMoon1AfterBattleText4 ; 0x5ac0 TextAfterBattle - dw MtMoon1EndBattleText4 ; 0x5abb TextEndBattle - dw MtMoon1EndBattleText4 ; 0x5abb TextEndBattle + dw MtMoon1BattleText4 ; TextBeforeBattle + dw MtMoon1AfterBattleText4 ; TextAfterBattle + dw MtMoon1EndBattleText4 ; TextEndBattle + dw MtMoon1EndBattleText4 ; TextEndBattle MtMoon1TrainerHeader4: ; 49a21 (12:5a21) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f5 ; flag's byte - dw MtMoon1BattleText5 ; 0x5ac5 TextBeforeBattle - dw MtMoon1AfterBattleText5 ; 0x5acf TextAfterBattle - dw MtMoon1EndBattleText5 ; 0x5aca TextEndBattle - dw MtMoon1EndBattleText5 ; 0x5aca TextEndBattle + dw MtMoon1BattleText5 ; TextBeforeBattle + dw MtMoon1AfterBattleText5 ; TextAfterBattle + dw MtMoon1EndBattleText5 ; TextEndBattle + dw MtMoon1EndBattleText5 ; TextEndBattle MtMoon1TrainerHeader5: ; 49a2d (12:5a2d) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f5 ; flag's byte - dw MtMoon1BattleText6 ; 0x5ad4 TextBeforeBattle - dw MtMoon1AfterBattleText6 ; 0x5ade TextAfterBattle - dw MtMoon1EndBattleText6 ; 0x5ad9 TextEndBattle - dw MtMoon1EndBattleText6 ; 0x5ad9 TextEndBattle + dw MtMoon1BattleText6 ; TextBeforeBattle + dw MtMoon1AfterBattleText6 ; TextAfterBattle + dw MtMoon1EndBattleText6 ; TextEndBattle + dw MtMoon1EndBattleText6 ; TextEndBattle MtMoon1TrainerHeader6: ; 49a39 (12:5a39) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f5 ; flag's byte - dw MtMoon1BattleText7 ; 0x5ae3 TextBeforeBattle - dw MtMoon1AfterBattleText7 ; 0x5aed TextAfterBattle - dw MtMoon1EndBattleText7 ; 0x5ae8 TextEndBattle - dw MtMoon1EndBattleText7 ; 0x5ae8 TextEndBattle + dw MtMoon1BattleText7 ; TextBeforeBattle + dw MtMoon1AfterBattleText7 ; TextAfterBattle + dw MtMoon1EndBattleText7 ; TextEndBattle + dw MtMoon1EndBattleText7 ; TextEndBattle MtMoon1TrainerHeader7: ; 49a45 (12:5a45) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f5 ; flag's byte - dw MtMoon1BattleText8 ; 0x5af2 TextBeforeBattle - dw MtMoon1AfterBattleText8 ; 0x5afc TextAfterBattle - dw MtMoon1EndBattleText8 ; 0x5af7 TextEndBattle - dw MtMoon1EndBattleText8 ; 0x5af7 TextEndBattle + dw MtMoon1BattleText8 ; TextBeforeBattle + dw MtMoon1AfterBattleText8 ; TextAfterBattle + dw MtMoon1EndBattleText8 ; TextEndBattle + dw MtMoon1EndBattleText8 ; TextEndBattle db $ff diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index eb0fc301..0d9acb8a 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -1,6 +1,6 @@ MtMoon3Script: ; 49d0b (12:5d0b) call EnableAutoTextBoxDrawing - ld hl, MtMoon3TrainerHeader0 ; $5e48 + ld hl, MtMoon3TrainerHeader0 ld de, MtMoon3ScriptPointers ld a, [W_MTMOON3CURSCRIPT] call ExecuteCurMapScriptInTable @@ -10,7 +10,7 @@ MtMoon3Script: ; 49d0b (12:5d0b) ret z ld hl, CoordsData_49d37 call ArePlayerCoordsInArray - jr nc, .asm_49d31 ; 0x49d29 $6 + jr nc, .asm_49d31 ld hl, wd72e set 4, [hl] ret @@ -57,16 +57,16 @@ MtMoon3Script0: ; 49d6f (12:5d6f) ld a, [wd7f6] bit 1, a jp nz, MtMoon3Script_49d91 - ld a, [W_YCOORD] ; wd361 + ld a, [W_YCOORD] cp $8 jp nz, MtMoon3Script_49d91 - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] cp $d jp nz, MtMoon3Script_49d91 xor a ld [hJoyHeld], a ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp DisplayTextID MtMoon3Script_49d91: ; 49d91 (12:5d91) @@ -76,7 +76,7 @@ MtMoon3Script_49d91: ; 49d91 (12:5d91) ret MtMoon3Script3: ; 49d9a (12:5d9a) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, MtMoon3Script_49d58 call UpdateSprites @@ -92,7 +92,7 @@ MtMoon3Script3: ; 49d9a (12:5d9a) MtMoon3Script4: ; 49dba (12:5dba) ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call SetSpriteMovementBytesToFF ld hl, CoordsData_49dea call ArePlayerCoordsInArray @@ -106,7 +106,7 @@ MtMoon3Script4: ; 49dba (12:5dba) ld de, MovementData_49df8 .asm_49dda ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call MoveSprite ld a, $5 ld [W_MTMOON3CURSCRIPT], a @@ -140,7 +140,7 @@ MtMoon3Script5: ; 49dfb (12:5dfb) ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld a, $a - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, [wd7f6] bit 6, a @@ -176,37 +176,37 @@ MtMoon3TrainerHeader0: ; 49e48 (12:5e48) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7f6 ; flag's byte - dw MtMoon3BattleText2 ; 0x5f9f TextBeforeBattle - dw MtMoon3AfterBattleText2 ; 0x5fa9 TextAfterBattle - dw MtMoon3EndBattleText2 ; 0x5fa4 TextEndBattle - dw MtMoon3EndBattleText2 ; 0x5fa4 TextEndBattle + dw MtMoon3BattleText2 ; TextBeforeBattle + dw MtMoon3AfterBattleText2 ; TextAfterBattle + dw MtMoon3EndBattleText2 ; TextEndBattle + dw MtMoon3EndBattleText2 ; TextEndBattle MtMoon3TrainerHeader2: ; 49e54 (12:5e54) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7f6 ; flag's byte - dw MtMoon3BattleText3 ; 0x5fae TextBeforeBattle - dw MtMoon3AfterBattleText3 ; 0x5fb8 TextAfterBattle - dw MtMoon3EndBattleText3 ; 0x5fb3 TextEndBattle - dw MtMoon3EndBattleText3 ; 0x5fb3 TextEndBattle + dw MtMoon3BattleText3 ; TextBeforeBattle + dw MtMoon3AfterBattleText3 ; TextAfterBattle + dw MtMoon3EndBattleText3 ; TextEndBattle + dw MtMoon3EndBattleText3 ; TextEndBattle MtMoon3TrainerHeader3: ; 49e60 (12:5e60) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7f6 ; flag's byte - dw MtMoon3BattleText4 ; 0x5fbd TextBeforeBattle - dw MtMoon3AfterBattleText4 ; 0x5fc7 TextAfterBattle - dw MtMoon3EndBattleText4 ; 0x5fc2 TextEndBattle - dw MtMoon3EndBattleText4 ; 0x5fc2 TextEndBattle + dw MtMoon3BattleText4 ; TextBeforeBattle + dw MtMoon3AfterBattleText4 ; TextAfterBattle + dw MtMoon3EndBattleText4 ; TextEndBattle + dw MtMoon3EndBattleText4 ; TextEndBattle MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7f6 ; flag's byte - dw MtMoon3BattleText5 ; 0x5fcc TextBeforeBattle - dw MtMoon3AfterBattleText5 ; 0x5fd6 TextAfterBattle - dw MtMoon3EndBattleText5 ; 0x5fd1 TextEndBattle - dw MtMoon3EndBattleText5 ; 0x5fd1 TextEndBattle + dw MtMoon3BattleText5 ; TextBeforeBattle + dw MtMoon3AfterBattleText5 ; TextAfterBattle + dw MtMoon3EndBattleText5 ; TextEndBattle + dw MtMoon3EndBattleText5 ; TextEndBattle db $ff @@ -214,13 +214,13 @@ MtMoon3Text1: ; 49e79 (12:5e79) db $08 ; asm ld a, [wd7f6] bit 1, a - jr z, .asm_be1e0 ; 0x49e7f + jr z, .asm_49e8d and $c0 - jr nz, .asm_f8cd4 ; 0x49e83 + jr nz, .asm_49eb8 ld hl, MtMoon3Text_49f8f call PrintText - jr .asm_f1fba ; 0x49e8b -.asm_be1e0 ; 0x49e8d + jr .asm_49ebe +.asm_49e8d ld hl, MtMoon3Text_49f85 call PrintText ld hl, wd72d @@ -236,11 +236,11 @@ MtMoon3Text1: ; 49e79 (12:5e79) ld a, $3 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a - jr .asm_f1fba ; 0x49eb6 -.asm_f8cd4 ; 0x49eb8 + jr .asm_49ebe +.asm_49eb8 ld hl, MtMoon3Text_49f94 call PrintText -.asm_f1fba ; 0x49ebe +.asm_49ebe jp TextScriptEnd MtMoon3Text2: ; 49ec1 (12:5ec1) @@ -263,7 +263,7 @@ MtMoon3Text4: ; 49ed5 (12:5ed5) MtMoon3Text5: ; 49edf (12:5edf) db $08 ; asm - ld hl, MtMoon3TrainerHeader4 ; $5e6c + ld hl, MtMoon3TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -276,7 +276,7 @@ MtMoon3Text6: ; 49ee9 (12:5ee9) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_1fa5e ; 0x49efc + jr nz, .asm_49f21 ld bc,(DOME_FOSSIL << 8) | 1 call GiveItem jp nc, MtMoon3Script_49f76 @@ -289,7 +289,7 @@ MtMoon3Text6: ; 49ee9 (12:5ee9) ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a -.asm_1fa5e ; 0x49f21 +.asm_49f21 jp TextScriptEnd MtMoon3Text_49f24: ; 49f24 (12:5f24) @@ -305,7 +305,7 @@ MtMoon3Text7: ; 49f29 (12:5f29) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_8e988 ; 0x49f3c + jr nz, .asm_49f61 ld bc, (HELIX_FOSSIL << 8) | 1 call GiveItem jp nc, MtMoon3Script_49f76 @@ -318,7 +318,7 @@ MtMoon3Text7: ; 49f29 (12:5f29) ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a -.asm_8e988 ; 0x49f61 +.asm_49f61 jp TextScriptEnd MtMoon3Text_49f64: ; 49f64 (12:5f64) @@ -330,7 +330,7 @@ MtMoon3Script_49f69: ; 49f69 (12:5f69) jp PrintText MtMoon3Text_49f6f: ; 49f6f (12:5f6f) - TX_FAR _MtMoon3Text_49f6f ; 0x80995 + TX_FAR _MtMoon3Text_49f6f db $11, $d, "@" MtMoon3Script_49f76: ; 49f76 (12:5f76) @@ -339,7 +339,7 @@ MtMoon3Script_49f76: ; 49f76 (12:5f76) jp TextScriptEnd MtMoon3Text_49f7f: ; 49f7f (12:5f7f) - TX_FAR _MtMoon3Text_49f7f ; 0x809a8 + TX_FAR _MtMoon3Text_49f7f db $d, "@" MtMoon3Text_49f85: ; 49f85 (12:5f85) diff --git a/scripts/mtmoonpokecenter.asm b/scripts/mtmoonpokecenter.asm index bfe9add8..23e1b082 100755 --- a/scripts/mtmoonpokecenter.asm +++ b/scripts/mtmoonpokecenter.asm @@ -40,13 +40,13 @@ MtMoonPokecenterText4: ; 492ec (12:52ec) ld a, $5 ldh [$a0], a call HasEnoughMoney - jr nc, .asm_faa09 ; 0x49317 + jr nc, .asm_faa09 ld hl, MtMoonPokecenterText_49366 - jr .asm_49356 ; 0x4931c -.asm_faa09 ; 0x4931e + jr .asm_49356 +.asm_faa09 ld bc,(MAGIKARP << 8) | 5 call GivePokemon - jr nc, .asm_49359 ; 0x49324 + jr nc, .asm_49359 xor a ld [wWhichTrade], a ld [wTrainerFacingDirection], a @@ -61,15 +61,15 @@ MtMoonPokecenterText4: ; 492ec (12:52ec) call DisplayTextBoxID ld hl, wd7c6 set 7, [hl] - jr .asm_49359 ; 0x4934c -.asm_4934e ; 0x4934e + jr .asm_49359 +.asm_4934e ld hl, MtMoonPokecenterText_49361 - jr .asm_49356 ; 0x49351 -.asm_49353 ; 0x49353 + jr .asm_49356 +.asm_49353 ld hl, MtMoonPokecenterText_4936b -.asm_49356 ; 0x49356 +.asm_49356 call PrintText -.asm_49359 ; 0x49359 +.asm_49359 jp TextScriptEnd MtMoonPokecenterText_4935c: ; 4935c (12:535c) diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index cd2b3c29..3b953c84 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -17,7 +17,7 @@ Museum1FScript0: ; 5c10d (17:410d) ret nz ld a, [W_XCOORD] cp $9 - jr z, .asm_5c120 ; 0x5c118 $6 + jr z, .asm_5c120 ld a, [W_XCOORD] cp $a ret nz @@ -59,7 +59,7 @@ Museum1FText1: ; 5c135 (17:4135) jr nz, .asm_31a16 ld hl, Museum1FText_5c23d call PrintText - jp asm_d1145 + jp Museum1FScriptEnd .asm_b8709 ld a, [wd754] bit 0, a @@ -67,7 +67,7 @@ Museum1FText1: ; 5c135 (17:4135) .asm_31a16 ld hl, Museum1FText_5c242 call PrintText - jp asm_d1145 + jp Museum1FScriptEnd .asm_3ded4 ld a, $13 ld [wTextBoxID], a @@ -112,7 +112,7 @@ Museum1FText1: ; 5c135 (17:4135) call WaitForSoundToFinish jr .asm_0b094 .asm_de133 - ld hl, Museum1FText_5c21a ; $421a + ld hl, Museum1FText_5c21a call PrintText ld a, $1 ld [wSimulatedJoypadStatesIndex], a @@ -120,11 +120,11 @@ Museum1FText1: ; 5c135 (17:4135) ld [wSimulatedJoypadStatesEnd], a call StartSimulatingJoypadStates call UpdateSprites - jr asm_d1145 + jr Museum1FScriptEnd .asm_0b094 ld a, $1 ld [W_MUSEUM1FCURSCRIPT], a - jr asm_d1145 + jr Museum1FScriptEnd Museum1FScript_5c1f9: ; 5c1f9 (17:41f9) ld hl, Museum1FText_5c22e @@ -135,11 +135,11 @@ Museum1FScript_5c1f9: ; 5c1f9 (17:41f9) jr nz, .asm_d1144 ld hl, Museum1FText_5c233 call PrintText - jr asm_d1145 + jr Museum1FScriptEnd .asm_d1144 ld hl, Museum1FText_5c238 call PrintText -asm_d1145: ; 5c217 (17:4217) +Museum1FScriptEnd: ; 5c217 (17:4217) jp TextScriptEnd Museum1FText_5c21a: ; 5c21a (17:421a) @@ -192,7 +192,7 @@ Museum1FText3: ; 5c256 (17:4256) db $08 ; asm ld a, [wd754] bit 1, a - jr nz, .asm_16599 ; 0x5c25c + jr nz, .asm_5c285 ld hl, Museum1FText_5c28e call PrintText ld bc, (OLD_AMBER << 8) | 1 @@ -204,13 +204,13 @@ Museum1FText3: ; 5c256 (17:4256) ld [wcc4d], a predef HideObject ld hl, ReceivedOldAmberText - jr .asm_52e0f ; 0x5c27e + jr .asm_5c288 .BagFull ld hl, Museum1FText_5c29e - jr .asm_52e0f ; 0x5c283 -.asm_16599 ; 0x5c285 + jr .asm_5c288 +.asm_5c285 ld hl, Museum1FText_5c299 -.asm_52e0f ; 0x5c288 +.asm_5c288 call PrintText jp TextScriptEnd diff --git a/scripts/namerater.asm b/scripts/namerater.asm index c9e3bfb4..e71db6ed 100755 --- a/scripts/namerater.asm +++ b/scripts/namerater.asm @@ -16,7 +16,7 @@ NameRaterScript_1da20: ; 1da20 (7:5a20) ld de, wPlayerName ld c, $b call .asm_1da47 - jr c, .asm_1da52 ; 0x1da34 $1c + jr c, .asm_1da52 ld hl, wPartyMon1OTID ld bc, $002c ld a, [wWhichPokemon] @@ -26,11 +26,11 @@ NameRaterScript_1da20: ; 1da20 (7:5a20) .asm_1da47 ld a, [de] cp [hl] - jr nz, .asm_1da52 ; 0x1da49 $7 + jr nz, .asm_1da52 inc hl inc de dec c - jr nz, .asm_1da47 ; 0x1da4e $f7 + jr nz, .asm_1da47 and a ret .asm_1da52 @@ -45,7 +45,7 @@ NameRaterText1: ; 1da56 (7:5a56) call SaveScreenTilesToBuffer2 ld hl, NameRaterText_1dab3 call NameRaterScript_1da15 - jr nz, .asm_1daae ; 0x1da60 $4c + jr nz, .asm_1daae ld hl, NameRaterText_1dab8 call PrintText xor a @@ -58,25 +58,25 @@ NameRaterText1: ; 1da56 (7:5a56) call RestoreScreenTilesAndReloadTilePatterns call LoadGBPal pop af - jr c, .asm_1daae ; 0x1da80 $2c + jr c, .asm_1daae call GetPartyMonName2 call NameRaterScript_1da20 ld hl, NameRaterText_1dad1 - jr c, .asm_1daa8 ; 0x1da8b $1b + jr c, .asm_1daa8 ld hl, NameRaterText_1dabd call NameRaterScript_1da15 - jr nz, .asm_1daae ; 0x1da93 $19 + jr nz, .asm_1daae ld hl, NameRaterText_1dac2 call PrintText callba Func_655c - jr c, .asm_1daae ; 0x1daa3 $9 + jr c, .asm_1daae ld hl, NameRaterText_1dac7 .asm_1daa8 call PrintText jp TextScriptEnd .asm_1daae ld hl, NameRaterText_1dacc - jr .asm_1daa8 ; 0x1dab1 $f5 + jr .asm_1daa8 NameRaterText_1dab3: ; 1dab3 (7:5ab3) TX_FAR _NameRaterText_1dab3 diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 8f23cd3e..464cd755 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -194,17 +194,17 @@ OaksLabScript7: ; 1cc72 (7:4c72) OaksLabScript8: ; 1cc80 (7:4c80) ld a, [W_PLAYERSTARTER] cp STARTER1 - jr z, .Charmander ; 0x1cc85 $6 + jr z, .Charmander cp STARTER2 - jr z, .Squirtle ; 0x1cc89 $1d - jr .Bulbasaur ; 0x1cc8b $38 + jr z, .Squirtle + jr .Bulbasaur .Charmander ld de, .MiddleBallMovement1 ld a, [W_YCOORD] cp $4 ; is the player standing below the table? - jr z, .asm_1ccf3 ; 0x1cc95 $5c + jr z, .asm_1ccf3 ld de, .MiddleBallMovement2 - jr .asm_1ccf3 ; 0x1cc9a $57 + jr .asm_1ccf3 .MiddleBallMovement1 db 0,0,$C0,$C0,$C0,$40,$FF @@ -215,9 +215,9 @@ OaksLabScript8: ; 1cc80 (7:4c80) ld de, .RightBallMovement1 ld a, [W_YCOORD] cp $4 ; is the player standing below the table? - jr z, .asm_1ccf3 ; 0x1ccb0 $41 + jr z, .asm_1ccf3 ld de, .RightBallMovement2 - jr .asm_1ccf3 ; 0x1ccb5 $3c + jr .asm_1ccf3 .RightBallMovement1 db 0,0,$C0,$C0,$C0,$C0,$40,$FF @@ -228,7 +228,7 @@ OaksLabScript8: ; 1cc80 (7:4c80) ld de, .LeftBallMovement1 ld a, [W_XCOORD] cp $9 ; is the player standing to the right of the table? - jr nz, .asm_1ccf3 ; 0x1cccd $24 + jr nz, .asm_1ccf3 push hl ld a, $1 ld [H_SPRITEINDEX], a @@ -247,7 +247,7 @@ OaksLabScript8: ; 1cc80 (7:4c80) ld [hl], $9 ld de, .LeftBallMovement2 ; the rival is not currently onscreen, so account for that pop hl - jr .asm_1ccf3 ; 0x1cced $4 + jr .asm_1ccf3 .LeftBallMovement1 db $00,$C0 ; not yet terminated! @@ -279,14 +279,14 @@ OaksLabScript9: ; 1cd00 (7:4d00) call DisplayTextID ld a, [wTrainerEngageDistance] cp $2 - jr nz, .asm_1cd28 ; 0x1cd22 $4 + jr nz, .asm_1cd28 ld a, HS_STARTER_BALL_1 - jr .asm_1cd32 ; 0x1cd26 $a + jr .asm_1cd32 .asm_1cd28 cp $3 - jr nz, .asm_1cd30 ; 0x1cd2a $4 + jr nz, .asm_1cd30 ld a, HS_STARTER_BALL_2 - jr .asm_1cd32 ; 0x1cd2e $2 + jr .asm_1cd32 .asm_1cd30 ld a, HS_STARTER_BALL_3 .asm_1cd32 @@ -328,7 +328,7 @@ OaksLabScript10: ; 1cd6d (7:4d6d) ld [wd528], a ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL - call PlayMusic ; play music + call PlayMusic ld a, $f ld [$ff8c], a call DisplayTextID @@ -361,14 +361,14 @@ OaksLabScript11: ; 1cdb9 (7:4db9) ld [W_CUROPPONENT], a ld a, [W_RIVALSTARTER] cp STARTER2 - jr nz, .NotSquirtle ; 0x1cdc9 $4 + jr nz, .NotSquirtle ld a, $1 - jr .done ; 0x1cdcd $a + jr .done .NotSquirtle cp STARTER3 - jr nz, .Charmander ; 0x1cdd1 $4 + jr nz, .Charmander ld a, $2 - jr .done ; 0x1cdd5 $2 + jr .done .Charmander ld a, $3 .done @@ -413,7 +413,7 @@ OaksLabScript12: ; 1ce03 (7:4e03) ret OaksLabScript13: ; 1ce32 (7:4e32) - ld c, $14 + ld c, 20 call DelayFrames ld a, $10 ld [$ff8c], a @@ -426,9 +426,9 @@ OaksLabScript13: ; 1ce32 (7:4e32) ld a, [W_XCOORD] cp $4 ; move left or right depending on where the player is standing - jr nz, .asm_1ce5b ; 0x1ce55 $4 + jr nz, .asm_1ce5b ld a, $c0 - jr .asm_1ce5d ; 0x1ce59 $2 + jr .asm_1ce5d .asm_1ce5b ld a, $80 .asm_1ce5d @@ -444,7 +444,7 @@ OaksLabScript13: ; 1ce32 (7:4e32) OaksLabScript14: ; 1ce6d (7:4e6d) ld a, [wd730] bit 0, a - jr nz, .asm_1ce8c ; 0x1ce72 $18 + jr nz, .asm_1ce8c ld a, HS_OAKS_LAB_RIVAL ld [wcc4d], a predef HideObject @@ -453,21 +453,21 @@ OaksLabScript14: ; 1ce6d (7:4e6d) call PlayDefaultMusic ; reset to map music ld a, $12 ld [W_OAKSLABCURSCRIPT], a - jr .done ; 0x1ce8a $23 + jr .done .asm_1ce8c ld a, [wcf0f] cp $5 - jr nz, .asm_1cea8 ; 0x1ce91 $15 + jr nz, .asm_1cea8 ld a, [W_XCOORD] cp $4 - jr nz, .asm_1cea1 ; 0x1ce98 $7 + jr nz, .asm_1cea1 ld a, $c ld [wSpriteStateData1 + 9], a - jr .done ; 0x1ce9f $e + jr .done .asm_1cea1 ld a, $8 ld [wSpriteStateData1 + 9], a - jr .done ; 0x1cea6 $7 + jr .done .asm_1cea8 cp $4 ret nz @@ -508,7 +508,7 @@ OaksLabScript15: ; 1ceb0 (7:4eb0) ld [W_OAKSLABCURSCRIPT], a ret -OaksLabScript_1cefd ; 1cefd (7:4efd) +OaksLabScript_1cefd: ; 1cefd (7:4efd) ld a, $1 ld [H_SPRITEINDEX], a ld a, $4 @@ -631,10 +631,10 @@ OaksLabScript_1d00a: ; 1d00a (7:500a) cp $ff ret z cp OAKS_PARCEL - jr z, .GotParcel ; 0x1d016 $4 + jr z, .GotParcel inc hl inc c - jr .asm_1d010 ; 0x1d01a $f4 + jr .asm_1d010 .GotParcel ld hl, wNumBagItems ld a, c @@ -650,29 +650,29 @@ OaksLabScript_1d02b: ; 1d02b (7:502b) ld [$ffee], a ld a, [W_YCOORD] cp $3 - jr nz, .asm_1d045 ; 0x1d038 $b + jr nz, .asm_1d045 ld a, $4 ld [wNPCMovementDirections2Index], a ld a, $30 ld b, $b - jr .asm_1d068 ; 0x1d043 $23 + jr .asm_1d068 .asm_1d045 cp $1 - jr nz, .asm_1d054 ; 0x1d047 $b + jr nz, .asm_1d054 ld a, $2 ld [wNPCMovementDirections2Index], a ld a, $30 ld b, $9 - jr .asm_1d068 ; 0x1d052 $14 + jr .asm_1d068 .asm_1d054 ld a, $3 ld [wNPCMovementDirections2Index], a ld b, $a ld a, [W_XCOORD] cp $4 - jr nz, .asm_1d066 ; 0x1d060 $4 + jr nz, .asm_1d066 ld a, $40 - jr .asm_1d068 ; 0x1d064 $2 + jr .asm_1d068 .asm_1d066 ld a, $20 .asm_1d068 @@ -685,7 +685,7 @@ OaksLabScript_1d02b: ; 1d02b (7:502b) ret OaksLabScript_1d076: ; 1d076 (7:5076) - ld hl, OaksLabTextPointers + $36 ; $50b8 ; starts at OaksLabText28 + ld hl, OaksLabTextPointers + $36 ; starts at OaksLabText28 ld a, l ld [W_MAPTEXTPTR], a ld a, h @@ -737,20 +737,20 @@ OaksLabText1: ; 1d0ce (7:50ce) db $08 ; asm ld a, [wd74b] bit 0, a - jr nz, .asm_1d0de ; 0x1d0d4 + jr nz, .asm_1d0de ld hl, OaksLabGaryText1 call PrintText - jr .asm_1d0f0 ; 0x1d0dc -.asm_1d0de ; 0x1d0de + jr .asm_1d0f0 +.asm_1d0de bit 2, a - jr nz, .asm_1d0ea ; 0x1d0e0 + jr nz, .asm_1d0ea ld hl, OaksLabText40 call PrintText - jr .asm_1d0f0 ; 0x1d0e8 -.asm_1d0ea ; 0x1d0ea + jr .asm_1d0f0 +.asm_1d0ea ld hl, OaksLabText41 call PrintText -.asm_1d0f0 ; 0x1d0f0 +.asm_1d0f0 jp TextScriptEnd OaksLabGaryText1: ; 1d0f3 (7:50f3) @@ -774,7 +774,7 @@ OaksLabText2: ; 1d102 (7:5102) ld [wTrainerEngageDistance], a ld a, STARTER1 ld b, $2 - jr OaksLabScript_1d133 ; 0x1d111 $20 + jr OaksLabScript_1d133 OaksLabText30: ; 1d113 (7:5113) OaksLabText3: ; 1d113 (7:5113) @@ -785,7 +785,7 @@ OaksLabText3: ; 1d113 (7:5113) ld [wTrainerEngageDistance], a ld a, STARTER2 ld b, $3 - jr OaksLabScript_1d133 ; 0x1d122 $f + jr OaksLabScript_1d133 OaksLabText31: ; 1d124 (7:5124) OaksLabText4: ; 1d124 (7:5124) @@ -806,7 +806,7 @@ OaksLabScript_1d133: ; 1d133 (7:5133) bit 2, a jp nz, OaksLabScript_1d22d bit 1, a - jr nz, OaksLabScript_1d157 ; 0x1d147 $e + jr nz, OaksLabScript_1d157 ld hl, OaksLabText39 call PrintText jp TextScriptEnd @@ -822,7 +822,6 @@ OaksLabScript_1d157: ; 1d157 (7:5157) ld [$ff8b], a call GetPointerWithinSpriteStateData1 ld [hl], $0 - ; manually fixed some disassembler issues around here ld a, $1 ld [H_SPRITEINDEX], a ld a, $9 @@ -835,7 +834,7 @@ OaksLabScript_1d157: ; 1d157 (7:5157) ld hl, wd730 res 6, [hl] call ReloadMapData - ld c, $a + ld c, 10 call DelayFrames ld a, [wSpriteIndex] cp $2 @@ -844,7 +843,7 @@ OaksLabScript_1d157: ; 1d157 (7:5157) jr z, OaksLabLookAtSquirtle jr OaksLabLookAtBulbasaur -OaksLabLookAtCharmander ; 0x1d195 +OaksLabLookAtCharmander: ; 1d195 (7:5195) ld hl, OaksLabCharmanderText jr OaksLabMonChoiceMenu OaksLabCharmanderText: ; 1d19a (7:519a) @@ -879,17 +878,17 @@ OaksLabMonChoiceMenu: ; 1d1b3 (7:51b3) call GetMonName ld a, [wSpriteIndex] cp $2 - jr nz, asm_1d1db ; 0x1d1d5 $4 + jr nz, .asm_1d1db ld a, HS_STARTER_BALL_1 - jr asm_1d1e5 ; 0x1d1d9 $a -asm_1d1db: ; 1d1db (7:51db) + jr .asm_1d1e5 +.asm_1d1db cp $3 - jr nz, asm_1d1e3 ; 0x1d1dd $4 + jr nz, .asm_1d1e3 ld a, HS_STARTER_BALL_2 - jr asm_1d1e5 ; 0x1d1e1 $2 -asm_1d1e3: ; 1d1e3 (7:51e3) + jr .asm_1d1e5 +.asm_1d1e3 ld a, HS_STARTER_BALL_3 -asm_1d1e5: ; 1d1e5 (7:51e5) +.asm_1d1e5 ld [wcc4d], a predef HideObject ld a, $1 @@ -942,77 +941,77 @@ OaksLabText5: ; 1d248 (7:5248) db $08 ; asm ld a, [wd747] bit 6, a - jr nz, .asm_50e81 ; 0x1d24e + jr nz, .asm_1d266 ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits ld a, [wd11e] cp $2 - jr c, .asm_b28b0 ; 0x1d25d + jr c, .asm_1d279 ld a, [wd74b] bit 5, a - jr z, .asm_b28b0 ; 0x1d264 -.asm_50e81 ; 0x1d266 + jr z, .asm_1d279 +.asm_1d266 ld hl, OaksLabText_1d31d call PrintText ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a predef DisplayDexRating - jp .asm_0f042 -.asm_b28b0 ; 0x1d279 + jp .asm_1d2ed +.asm_1d279 ld b,POKE_BALL call IsItemInBag - jr nz, .asm_17c30 ; 0x1d27e + jr nz, .asm_1d2e7 ld a, [wd7eb] bit 5, a - jr nz, .asm_f1adc ; 0x1d285 + jr nz, .asm_1d2d0 ld a, [wd74b] bit 5, a - jr nz, .asm_333a2 ; 0x1d28c + jr nz, .asm_1d2c8 bit 3, a - jr nz, .asm_76269 ; 0x1d290 + jr nz, .asm_1d2a9 ld a, [wd72e] bit 3, a - jr nz, .asm_4a5e0 ; 0x1d297 + jr nz, .asm_1d2a1 ld hl, OaksLabText_1d2f0 call PrintText - jr .asm_0f042 ; 0x1d29f -.asm_4a5e0 ; 0x1d2a1 + jr .asm_1d2ed +.asm_1d2a1 ld hl, OaksLabText_1d2f5 call PrintText - jr .asm_0f042 ; 0x1d2a7 -.asm_76269 ; 0x1d2a9 + jr .asm_1d2ed +.asm_1d2a9 ld b, OAKS_PARCEL call IsItemInBag - jr nz, .asm_a8fcf ; 0x1d2ae + jr nz, .asm_1d2b8 ld hl, OaksLabText_1d2fa call PrintText - jr .asm_0f042 ; 0x1d2b6 -.asm_a8fcf ; 0x1d2b8 + jr .asm_1d2ed +.asm_1d2b8 ld hl, OaksLabDeliverParcelText call PrintText call OaksLabScript_1d00a ld a, $f ld [W_OAKSLABCURSCRIPT], a - jr .asm_0f042 ; 0x1d2c6 -.asm_333a2 ; 0x1d2c8 + jr .asm_1d2ed +.asm_1d2c8 ld hl, OaksLabAroundWorldText call PrintText - jr .asm_0f042 ; 0x1d2ce -.asm_f1adc ; 0x1d2d0 + jr .asm_1d2ed +.asm_1d2d0 ld hl, wd74b bit 4, [hl] set 4, [hl] - jr nz, .asm_17c30 ; 0x1d2d7 + jr nz, .asm_1d2e7 ld bc, (POKE_BALL << 8) | 5 call GiveItem ld hl, OaksLabGivePokeballsText call PrintText - jr .asm_0f042 ; 0x1d2e5 -.asm_17c30 ; 0x1d2e7 + jr .asm_1d2ed +.asm_1d2e7 ld hl, OaksLabPleaseVisitText call PrintText -.asm_0f042 ; 0x1d2ed +.asm_1d2ed jp TextScriptEnd OaksLabText_1d2f0: ; 1d2f0 (7:52f0) diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index c43b9682..c615107c 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -35,7 +35,7 @@ PalletTownScript0: ; 18e81 (6:4e81) ld a, BANK(Music_MeetProfOak) ld c,a ; song bank ld a, MUSIC_MEET_PROF_OAK ; “oak appears” music - call PlayMusic ; plays music + call PlayMusic ld a,$FC ld [wJoyIgnore],a ld hl,wd74b diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index 55369df9..21d1c643 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -72,7 +72,7 @@ PewterCityScript1: ; 19280 (6:5280) call SetSpritePosition1 ld a, $3 ld [$ff8c], a - ld de, MovementData_PewterMuseumGuyExit ; $52ce + ld de, MovementData_PewterMuseumGuyExit call MoveSprite ld a, $2 ld [W_PEWTERCITYCURSCRIPT], a @@ -200,11 +200,11 @@ PewterCityText3: ; 193b1 (6:53b1) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_f46a9 ; 0x193bf + jr nz, .asm_193c9 ld hl, PewterCityText_193f6 call PrintText - jr .asm_ac429 ; 0x193c7 -.asm_f46a9 ; 0x193c9 + jr .asm_193ee +.asm_193c9 ld hl, PewterCityText_193fb call PrintText xor a @@ -220,7 +220,7 @@ PewterCityText3: ; 193b1 (6:53b1) call GetSpritePosition2 ld a, $1 ld [W_PEWTERCITYCURSCRIPT], a -.asm_ac429 ; 0x193ee +.asm_193ee jp TextScriptEnd PewterCityText_193f1: ; 193f1 (6:53f1) @@ -246,14 +246,14 @@ PewterCityText4: ; 19405 (6:5405) call YesNoChoice ld a, [wCurrentMenuItem] cp $0 - jr nz, .asm_e4603 + jr nz, .asm_1941e ld hl, PewterCityText_1942c call PrintText - jr .asm_e4604 ; 0x1941c $6 -.asm_e4603 + jr .asm_19424 +.asm_1941e ld hl, PewterCityText_19431 call PrintText -.asm_e4604 ; 0x19424 +.asm_19424 jp TextScriptEnd PewterCityText_19427: ; 19427 (6:5427) diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 9f9c7c3b..39adaa32 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -12,8 +12,8 @@ PewterGymScript: ; 5c387 (17:4387) ret PewterGymScript_5c3a4: ; 5c3a4 (17:43a4) - ld hl, Gym1CityName ; $43ad - ld de, Gym1LeaderName ; $43b9 + ld hl, Gym1CityName + ld de, Gym1LeaderName jp LoadGymLeaderAndCityName Gym1CityName: ; 5c3ad (17:43ad) @@ -36,7 +36,7 @@ PewterGymScriptPointers: ; 5c3ca (17:43ca) dw PewterGymScript3 PewterGymScript3: ; 5c3d2 (17:43d2) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, PewterGymScript_5c3bf ld a, $f0 @@ -44,7 +44,7 @@ PewterGymScript3: ; 5c3d2 (17:43d2) PewterGymScript_5c3df: ; 5c3df (17:43df) ld a, $4 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd755 set 7, [hl] @@ -52,14 +52,14 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) call GiveItem jr nc, .BagFull ld a, $5 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd755 set 6, [hl] jr .asm_5c408 .BagFull ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_5c408 ld hl, W_OBTAINEDBADGES @@ -97,10 +97,10 @@ PewterGymTrainerHeader0: ; 5c441 (17:4441) db $2 ; flag's bit db ($5 << 4) ; trainer's view range dw wd755 ; flag's byte - dw PewterGymBattleText1 ; 0x44d0 TextBeforeBattle - dw PewterGymAfterBattleText1 ; 0x44da TextAfterBattle - dw PewterGymEndBattleText1 ; 0x44d5 TextEndBattle - dw PewterGymEndBattleText1 ; 0x44d5 TextEndBattle + dw PewterGymBattleText1 ; TextBeforeBattle + dw PewterGymAfterBattleText1 ; TextAfterBattle + dw PewterGymEndBattleText1 ; TextEndBattle + dw PewterGymEndBattleText1 ; TextEndBattle db $ff @@ -108,17 +108,17 @@ PewterGymText1: ; 5c44e (17:444e) db $08 ; asm ld a, [wd755] bit 7, a - jr z, .asm_4a735 ; 0x5c454 + jr z, .asm_5c46a bit 6, a - jr nz, .asm_ff7d0 ; 0x5c458 + jr nz, .asm_5c462 call z, PewterGymScript_5c3df call DisableWaitingAfterTextDisplay - jr .asm_e0ffb ; 0x5c460 -.asm_ff7d0 ; 0x5c462 + jr .asm_5c49b +.asm_5c462 ld hl, PewterGymText_5c4a3 call PrintText - jr .asm_e0ffb ; 0x5c468 -.asm_4a735 ; 0x5c46a + jr .asm_5c49b +.asm_5c46a ld hl, PewterGymText_5c49e call PrintText ld hl, wd72d @@ -138,7 +138,7 @@ PewterGymText1: ; 5c44e (17:444e) ld a, $3 ld [W_PEWTERGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a -.asm_e0ffb ; 0x5c49b +.asm_5c49b jp TextScriptEnd PewterGymText_5c49e: ; 5c49e (17:449e) @@ -191,27 +191,27 @@ PewterGymText3: ; 5c4df (17:44df) db $08 ; asm ld a, [wd72a] bit 0, a - jr nz, .asm_71369 ; 0x5c4e5 + jr nz, .asm_5c50c ld hl, PewterGymText_5c515 call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_6123a ; 0x5c4f4 + jr nz, .asm_5c4fe ld hl, PewterGymText_5c51a call PrintText - jr .asm_d1578 ; 0x5c4fc -.asm_6123a ; 0x5c4fe + jr .asm_5c504 +.asm_5c4fe ld hl, PewterGymText_5c524 call PrintText -.asm_d1578 ; 0x5c504 +.asm_5c504 ld hl, PewterGymText_5c51f call PrintText - jr .asm_07013 ; 0x5c50a -.asm_71369 ; 0x5c50c + jr .asm_5c512 +.asm_5c50c ld hl, PewterGymText_5c529 call PrintText -.asm_07013 ; 0x5c512 +.asm_5c512 jp TextScriptEnd PewterGymText_5c515: ; 5c515 (17:4515) diff --git a/scripts/pewterpokecenter.asm b/scripts/pewterpokecenter.asm index 4cc4ffd2..8b2ac8f9 100755 --- a/scripts/pewterpokecenter.asm +++ b/scripts/pewterpokecenter.asm @@ -23,7 +23,7 @@ PewterPokecenterText3: ; 5c59b (17:459b) call PrintText ld a, $ff call PlaySound - ld c, $20 + ld c, 32 call DelayFrames ld hl, JigglypuffFacingDirections ld de, wTrainerFacingDirection @@ -34,7 +34,7 @@ PewterPokecenterText3: ; 5c59b (17:459b) .asm_5c5c3 cp [hl] inc hl - jr nz, .asm_5c5c3 ; 0x5c5c5 $fc + jr nz, .asm_5c5c3 dec hl push hl ld c, BANK(Music_JigglypuffSong) @@ -52,14 +52,14 @@ PewterPokecenterText3: ; 5c59b (17:459b) ld a, [wTrainerEngageDistance] ld [wcd42], a pop hl - ld c, $18 + ld c, 24 call DelayFrames ld a, [wc026] ld b, a ld a, [wc027] or b - jr nz, .asm_5c5d1 ; 0x5c5f6 $d9 - ld c, $30 + jr nz, .asm_5c5d1 + ld c, 48 call DelayFrames call PlayDefaultMusic jp TextScriptEnd diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index dc9275f2..1bde3ba6 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -20,7 +20,7 @@ PokemonTower2Script0: ; 6050f (18:450f) ld a, [wd764] bit 7, a ret nz - ld hl, CoordsData_6055e ; $455e + ld hl, CoordsData_6055e call ArePlayerCoordsInArray ret nc ld a, $ff @@ -35,7 +35,7 @@ PokemonTower2Script0: ; 6050f (18:450f) cp $1 ld a, $8 ld b, $0 - jr nz, .asm_60544 ; 0x60539 $9 + jr nz, .asm_60544 ld hl, wd764 set 6, [hl] ld a, $2 @@ -74,7 +74,7 @@ PokemonTower2Script1: ; 60563 (18:4563) ld de, MovementData_605b2 ld a, [wd764] bit 6, a - jr nz, .asm_60589 ; 0x60584 $3 + jr nz, .asm_60589 ld de, MovementData_605a9 .asm_60589 ld a, $1 @@ -118,18 +118,18 @@ PokemonTower2Text1: ; 605df (18:45df) db $08 ; asm ld a, [wd764] bit 7, a - jr z, .asm_16f24 ; 0x605e5 + jr z, .asm_16f24 ld hl, PokemonTower2Text_6063c call PrintText - jr .asm_41852 ; 0x605ed -.asm_16f24 ; 0x605ef + jr .asm_41852 +.asm_16f24 ld hl, PokemonTower2Text_6062d call PrintText ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, PokemonTower2Text_60632 - ld de, PokemonTower2Text_60637 ; XXX $4637 + ld de, PokemonTower2Text_60637 call SaveEndBattleTextPointers ld a, SONY2 + $c8 ld [W_CUROPPONENT], a @@ -137,15 +137,15 @@ PokemonTower2Text1: ; 605df (18:45df) ; select which team to use during the encounter ld a, [W_RIVALSTARTER] cp STARTER2 - jr nz, .NotSquirtle ; 0x6060f + jr nz, .NotSquirtle ld a, $4 jr .done -.NotSquirtle ; 0x60615 +.NotSquirtle cp STARTER3 - jr nz, .Charmander ; 0x60617 + jr nz, .Charmander ld a, $5 jr .done -.Charmander ; 0x6061d +.Charmander ld a, $6 .done ld [W_TRAINERNO], a @@ -153,7 +153,7 @@ PokemonTower2Text1: ; 605df (18:45df) ld a, $1 ld [W_POKEMONTOWER2CURSCRIPT], a ld [W_CURMAPSCRIPT], a -.asm_41852 ; 0x6062a +.asm_41852 jp TextScriptEnd PokemonTower2Text_6062d: ; 6062d (18:462d) diff --git a/scripts/pokemontower3.asm b/scripts/pokemontower3.asm index 8df5bfc5..78c53c2f 100755 --- a/scripts/pokemontower3.asm +++ b/scripts/pokemontower3.asm @@ -23,28 +23,28 @@ PokemonTower3TrainerHeader0: ; 606ed (18:46ed) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd765 ; flag's byte - dw PokemonTower3BattleText1 ; 0x4730 TextBeforeBattle - dw PokemonTower3AfterBattleText1 ; 0x473a TextAfterBattle - dw PokemonTower3EndBattleText1 ; 0x4735 TextEndBattle - dw PokemonTower3EndBattleText1 ; 0x4735 TextEndBattle + dw PokemonTower3BattleText1 ; TextBeforeBattle + dw PokemonTower3AfterBattleText1 ; TextAfterBattle + dw PokemonTower3EndBattleText1 ; TextEndBattle + dw PokemonTower3EndBattleText1 ; TextEndBattle PokemonTower3TrainerHeader1: ; 606f9 (18:46f9) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd765 ; flag's byte - dw PokemonTower3BattleText2 ; 0x473f TextBeforeBattle - dw PokemonTower3AfterBattleText2 ; 0x4749 TextAfterBattle - dw PokemonTower3EndBattleText2 ; 0x4744 TextEndBattle - dw PokemonTower3EndBattleText2 ; 0x4744 TextEndBattle + dw PokemonTower3BattleText2 ; TextBeforeBattle + dw PokemonTower3AfterBattleText2 ; TextAfterBattle + dw PokemonTower3EndBattleText2 ; TextEndBattle + dw PokemonTower3EndBattleText2 ; TextEndBattle PokemonTower3TrainerHeader2: ; 60705 (18:4705) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd765 ; flag's byte - dw PokemonTower3BattleText3 ; 0x474e TextBeforeBattle - dw PokemonTower3AfterBattleText3 ; 0x4758 TextAfterBattle - dw PokemonTower3EndBattleText3 ; 0x4753 TextEndBattle - dw PokemonTower3EndBattleText3 ; 0x4753 TextEndBattle + dw PokemonTower3BattleText3 ; TextBeforeBattle + dw PokemonTower3AfterBattleText3 ; TextAfterBattle + dw PokemonTower3EndBattleText3 ; TextEndBattle + dw PokemonTower3EndBattleText3 ; TextEndBattle db $ff PokemonTower3Text1: ; 60712 (18:4712) diff --git a/scripts/pokemontower4.asm b/scripts/pokemontower4.asm index 760bb604..3c48fdca 100755 --- a/scripts/pokemontower4.asm +++ b/scripts/pokemontower4.asm @@ -25,28 +25,28 @@ PokemonTower4TrainerHeader0: ; 6081b (18:481b) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd766 ; flag's byte - dw PokemonTower4BattleText1 ; 0x485e TextBeforeBattle - dw PokemonTower4AfterBattleText1 ; 0x4868 TextAfterBattle - dw PokemonTower4EndBattleText1 ; 0x4863 TextEndBattle - dw PokemonTower4EndBattleText1 ; 0x4863 TextEndBattle + dw PokemonTower4BattleText1 ; TextBeforeBattle + dw PokemonTower4AfterBattleText1 ; TextAfterBattle + dw PokemonTower4EndBattleText1 ; TextEndBattle + dw PokemonTower4EndBattleText1 ; TextEndBattle PokemonTower4TrainerHeader1: ; 60827 (18:4827) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd766 ; flag's byte - dw PokemonTower4BattleText2 ; 0x486d TextBeforeBattle - dw PokemonTower4AfterBattleText2 ; 0x4877 TextAfterBattle - dw PokemonTower4EndBattleText2 ; 0x4872 TextEndBattle - dw PokemonTower4EndBattleText2 ; 0x4872 TextEndBattle + dw PokemonTower4BattleText2 ; TextBeforeBattle + dw PokemonTower4AfterBattleText2 ; TextAfterBattle + dw PokemonTower4EndBattleText2 ; TextEndBattle + dw PokemonTower4EndBattleText2 ; TextEndBattle PokemonTower4TrainerHeader2: ; 60833 (18:4833) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd766 ; flag's byte - dw PokemonTower4BattleText3 ; 0x487c TextBeforeBattle - dw PokemonTower4AfterBattleText3 ; 0x4886 TextAfterBattle - dw PokemonTower4EndBattleText3 ; 0x4881 TextEndBattle - dw PokemonTower4EndBattleText3 ; 0x4881 TextEndBattle + dw PokemonTower4BattleText3 ; TextBeforeBattle + dw PokemonTower4AfterBattleText3 ; TextAfterBattle + dw PokemonTower4EndBattleText3 ; TextEndBattle + dw PokemonTower4EndBattleText3 ; TextEndBattle db $ff diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index b70f9e28..1c5e6c1e 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -13,7 +13,7 @@ PokemonTower5ScriptPointers: ; 60945 (18:4945) dw EndTrainerBattle PokemonTower5Script0: ; 6094b (18:494b) - ld hl, CoordsData_60992 ; $4992 + ld hl, CoordsData_60992 call ArePlayerCoordsInArray jr c, .asm_60960 ld hl, wd72e @@ -38,7 +38,7 @@ PokemonTower5Script0: ; 6094b (18:494b) call Delay3 call GBFadeInFromWhite ld a, $7 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -65,37 +65,37 @@ PokemonTower5TrainerHeader0: ; 609a9 (18:49a9) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd767 ; flag's byte - dw PokemonTower5BattleText1 ; 0x49e9 TextBeforeBattle - dw PokemonTower5AfterBattleText1 ; 0x49f3 TextAfterBattle - dw PokemonTower5EndBattleText1 ; 0x49ee TextEndBattle - dw PokemonTower5EndBattleText1 ; 0x49ee TextEndBattle + dw PokemonTower5BattleText1 ; TextBeforeBattle + dw PokemonTower5AfterBattleText1 ; TextAfterBattle + dw PokemonTower5EndBattleText1 ; TextEndBattle + dw PokemonTower5EndBattleText1 ; TextEndBattle PokemonTower5TrainerHeader1: ; 609b5 (18:49b5) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd767 ; flag's byte - dw PokemonTower5BattleText2 ; 0x4a02 TextBeforeBattle - dw PokemonTower5AfterBattleText2 ; 0x4a0c TextAfterBattle - dw PokemonTower5EndBattleText2 ; 0x4a07 TextEndBattle - dw PokemonTower5EndBattleText2 ; 0x4a07 TextEndBattle + dw PokemonTower5BattleText2 ; TextBeforeBattle + dw PokemonTower5AfterBattleText2 ; TextAfterBattle + dw PokemonTower5EndBattleText2 ; TextEndBattle + dw PokemonTower5EndBattleText2 ; TextEndBattle PokemonTower5TrainerHeader2: ; 609c1 (18:49c1) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd767 ; flag's byte - dw PokemonTower5BattleText3 ; 0x4a1b TextBeforeBattle - dw PokemonTower5AfterBattleText3 ; 0x4a25 TextAfterBattle - dw PokemonTower5EndBattleText3 ; 0x4a20 TextEndBattle - dw PokemonTower5EndBattleText3 ; 0x4a20 TextEndBattle + dw PokemonTower5BattleText3 ; TextBeforeBattle + dw PokemonTower5AfterBattleText3 ; TextAfterBattle + dw PokemonTower5EndBattleText3 ; TextEndBattle + dw PokemonTower5EndBattleText3 ; TextEndBattle PokemonTower5TrainerHeader3: ; 609cd (18:49cd) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd767 ; flag's byte - dw PokemonTower5BattleText4 ; 0x4a34 TextBeforeBattle - dw PokemonTower5AfterBattleText4 ; 0x4a3e TextAfterBattle - dw PokemonTower5EndBattleText4 ; 0x4a39 TextEndBattle - dw PokemonTower5EndBattleText4 ; 0x4a39 TextEndBattle + dw PokemonTower5BattleText4 ; TextBeforeBattle + dw PokemonTower5AfterBattleText4 ; TextAfterBattle + dw PokemonTower5EndBattleText4 ; TextEndBattle + dw PokemonTower5EndBattleText4 ; TextEndBattle db $ff @@ -159,7 +159,7 @@ PokemonTower5AfterBattleText3: ; 60a25 (18:4a25) PokemonTower5Text5: ; 60a2a (18:4a2a) db $08 ; asm - ld hl, PokemonTower5TrainerHeader3 ; $49cd + ld hl, PokemonTower5TrainerHeader3 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index 58968d17..54171ddc 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -25,18 +25,18 @@ PokemonTower6Script0: ; 60b17 (18:4b17) ld a, [wd768] bit 7, a jp nz, CheckFightingMapTrainers - ld hl, CoordsData_60b45 ; $4b45 + ld hl, CoordsData_60b45 call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a ld [hJoyHeld], a ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, MAROWAK - ld [W_CUROPPONENT], a ; wd059 + ld [W_CUROPPONENT], a ld a, 30 - ld [W_CURENEMYLVL], a ; W_CURENEMYLVL + ld [W_CURENEMYLVL], a ld a, $4 ld [W_POKEMONTOWER6CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -46,7 +46,7 @@ CoordsData_60b45: ; 60b45 (18:4b45) db $10,$0A,$FF PokemonTower6Script4: ; 60b48 (18:4b48) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, PokemonTower6Script_60b02 ld a, $ff @@ -63,7 +63,7 @@ PokemonTower6Script4: ; 60b48 (18:4b48) ld hl, wd768 set 7, [hl] ld a, $7 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -110,28 +110,28 @@ PokemonTower6TrainerHeader0: ; 60bbf (18:4bbf) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd768 ; flag's byte - dw PokemonTower6BattleText1 ; 0x4c29 TextBeforeBattle - dw PokemonTower6AfterBattleText1 ; 0x4c33 TextAfterBattle - dw PokemonTower6EndBattleText1 ; 0x4c2e TextEndBattle - dw PokemonTower6EndBattleText1 ; 0x4c2e TextEndBattle + dw PokemonTower6BattleText1 ; TextBeforeBattle + dw PokemonTower6AfterBattleText1 ; TextAfterBattle + dw PokemonTower6EndBattleText1 ; TextEndBattle + dw PokemonTower6EndBattleText1 ; TextEndBattle PokemonTower6TrainerHeader1: ; 60bcb (18:4bcb) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd768 ; flag's byte - dw PokemonTower6BattleText2 ; 0x4c38 TextBeforeBattle - dw PokemonTower6AfterBattleText2 ; 0x4c42 TextAfterBattle - dw PokemonTower6EndBattleText2 ; 0x4c3d TextEndBattle - dw PokemonTower6EndBattleText2 ; 0x4c3d TextEndBattle + dw PokemonTower6BattleText2 ; TextBeforeBattle + dw PokemonTower6AfterBattleText2 ; TextAfterBattle + dw PokemonTower6EndBattleText2 ; TextEndBattle + dw PokemonTower6EndBattleText2 ; TextEndBattle PokemonTower6TrainerHeader2: ; 60bd7 (18:4bd7) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd768 ; flag's byte - dw PokemonTower6BattleText3 ; 0x4c47 TextBeforeBattle - dw PokemonTower6AfterBattleText3 ; 0x4c51 TextAfterBattle - dw PokemonTower6EndBattleText3 ; 0x4c4c TextEndBattle - dw PokemonTower6EndBattleText3 ; 0x4c4c TextEndBattle + dw PokemonTower6BattleText3 ; TextBeforeBattle + dw PokemonTower6AfterBattleText3 ; TextAfterBattle + dw PokemonTower6EndBattleText3 ; TextEndBattle + dw PokemonTower6EndBattleText3 ; TextEndBattle db $ff @@ -160,7 +160,7 @@ PokemonTower6Text7: ; 60c02 (18:4c02) ld a, MAROWAK call PlayCry call WaitForSoundToFinish - ld c, $1e + ld c, 30 call DelayFrames ld hl, PokemonTower2Text_60c24 call PrintText diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index ab42121d..32cd0e83 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -24,14 +24,14 @@ PokemonTower7ScriptPointers: PokemonTower7Script2: ; 60d23 (18:4d23) ld hl, wFlags_0xcd60 res 0, [hl] - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, PokemonTower7Script_60d18 call EndTrainerBattle ld a, $f0 ld [wJoyIgnore], a ld a, [wSpriteIndex] - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID call PokemonTower7Script_60db6 ld a, $3 @@ -72,7 +72,7 @@ PokemonTower7Script4: ; 60d86 (18:4d86) ld a, $4 ld [wSpriteStateData1 + 9], a ld a, LAVENDER_HOUSE_1 - ld [H_DOWNARROWBLINKCNT1], a ; $ff8b + ld [H_DOWNARROWBLINKCNT1], a ld a, $1 ld [wDestinationWarpID], a ld a, LAVENDER_TOWN @@ -85,16 +85,16 @@ PokemonTower7Script4: ; 60d86 (18:4d86) ret PokemonTower7Script_60db6: ; 60db6 (18:4db6) - ld hl, CoordsData_60de3 ; $4de3 + ld hl, CoordsData_60de3 ld a, [wSpriteIndex] dec a swap a ld d, $0 ld e, a add hl, de - ld a, [W_YCOORD] ; wd361 + ld a, [W_YCOORD] ld b, a - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] ld c, a .asm_60dcb ld a, [hli] @@ -107,7 +107,7 @@ PokemonTower7Script_60db6: ; 60db6 (18:4db6) ld d, [hl] ld e, a ld a, [wSpriteIndex] - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp MoveSprite .asm_60dde inc hl @@ -171,28 +171,28 @@ PokemonTower7TrainerHeader0: ; 60e47 (18:4e47) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd769 ; flag's byte - dw PokemonTower7BattleText1 ; 0x4ec9 TextBeforeBattle - dw PokemonTower7AfterBattleText1 ; 0x4ed3 TextAfterBattle - dw PokemonTower7EndBattleText1 ; 0x4ece TextEndBattle - dw PokemonTower7EndBattleText1 ; 0x4ece TextEndBattle + dw PokemonTower7BattleText1 ; TextBeforeBattle + dw PokemonTower7AfterBattleText1 ; TextAfterBattle + dw PokemonTower7EndBattleText1 ; TextEndBattle + dw PokemonTower7EndBattleText1 ; TextEndBattle PokemonTower7TrainerHeader1: ; 60e53 (18:4e53) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd769 ; flag's byte - dw PokemonTower7BattleText2 ; 0x4ed8 TextBeforeBattle - dw PokemonTower7AfterBattleText2 ; 0x4ee2 TextAfterBattle - dw PokemonTower7EndBattleText2 ; 0x4edd TextEndBattle - dw PokemonTower7EndBattleText2 ; 0x4edd TextEndBattle + dw PokemonTower7BattleText2 ; TextBeforeBattle + dw PokemonTower7AfterBattleText2 ; TextAfterBattle + dw PokemonTower7EndBattleText2 ; TextEndBattle + dw PokemonTower7EndBattleText2 ; TextEndBattle PokemonTower7TrainerHeader2: ; 60e5f (18:4e5f) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd769 ; flag's byte - dw PokemonTower7BattleText3 ; 0x4ee7 TextBeforeBattle - dw PokemonTower7AfterBattleText3 ; 0x4ef1 TextAfterBattle - dw PokemonTower7EndBattleText3 ; 0x4eec TextEndBattle - dw PokemonTower7EndBattleText3 ; 0x4eec TextEndBattle + dw PokemonTower7BattleText3 ; TextBeforeBattle + dw PokemonTower7AfterBattleText3 ; TextAfterBattle + dw PokemonTower7EndBattleText3 ; TextEndBattle + dw PokemonTower7EndBattleText3 ; TextEndBattle db $ff diff --git a/scripts/powerplant.asm b/scripts/powerplant.asm index ec4f89b3..4355c039 100755 --- a/scripts/powerplant.asm +++ b/scripts/powerplant.asm @@ -112,7 +112,7 @@ PowerPlantTrainerHeader8: ; 1e35b (7:635b) db $ff -asm_234cc: ; 1e368 (7:6368) +InitVoltorbBattle: ; 1e368 (7:6368) call TalkToTrainer ld a, [W_CURMAPSCRIPT] ld [W_POWERPLANTCURSCRIPT], a @@ -120,48 +120,48 @@ asm_234cc: ; 1e368 (7:6368) PowerPlantText1: ; 1e374 (7:6374) db $8 ; asm - ld hl, PowerPlantTrainerHeader0 ; $62fb - jr asm_234cc ; 0x1e378 $ee + ld hl, PowerPlantTrainerHeader0 + jr InitVoltorbBattle PowerPlantText2: ; 1e37a (7:637a) db $8 ; asm - ld hl, PowerPlantTrainerHeader1 ; $6307 - jr asm_234cc ; 0x1e37e $e8 + ld hl, PowerPlantTrainerHeader1 + jr InitVoltorbBattle PowerPlantText3: ; 1e380 (7:6380) db $8 ; asm - ld hl, PowerPlantTrainerHeader2 ; $6313 - jr asm_234cc ; 0x1e384 $e2 + ld hl, PowerPlantTrainerHeader2 + jr InitVoltorbBattle PowerPlantText4: ; 1e386 (7:6386) db $8 ; asm - ld hl, PowerPlantTrainerHeader3 ; $631f - jr asm_234cc ; 0x1e38a $dc + ld hl, PowerPlantTrainerHeader3 + jr InitVoltorbBattle PowerPlantText5: ; 1e38c (7:638c) db $8 ; asm - ld hl, PowerPlantTrainerHeader4 ; $632b - jr asm_234cc ; 0x1e390 $d6 + ld hl, PowerPlantTrainerHeader4 + jr InitVoltorbBattle PowerPlantText6: ; 1e392 (7:6392) db $8 ; asm - ld hl, PowerPlantTrainerHeader5 ; $6337 - jr asm_234cc ; 0x1e396 $d0 + ld hl, PowerPlantTrainerHeader5 + jr InitVoltorbBattle PowerPlantText7: ; 1e398 (7:6398) db $8 ; asm - ld hl, PowerPlantTrainerHeader6 ; $6343 - jr asm_234cc ; 0x1e39c $ca + ld hl, PowerPlantTrainerHeader6 + jr InitVoltorbBattle PowerPlantText8: ; 1e39e (7:639e) db $8 ; asm - ld hl, PowerPlantTrainerHeader7 ; $634f - jr asm_234cc ; 0x1e3a2 $c4 + ld hl, PowerPlantTrainerHeader7 + jr InitVoltorbBattle PowerPlantText9: ; 1e3a4 (7:63a4) db $8 ; asm - ld hl, PowerPlantTrainerHeader8 ; $635b - jr asm_234cc ; 0x1e3a8 $be + ld hl, PowerPlantTrainerHeader8 + jr InitVoltorbBattle VoltorbBattleText: ; 1e3aa (7:63aa) TX_FAR _VoltorbBattleText diff --git a/scripts/redshouse1f.asm b/scripts/redshouse1f.asm index 7b3f1f87..d00ee9de 100755 --- a/scripts/redshouse1f.asm +++ b/scripts/redshouse1f.asm @@ -30,7 +30,7 @@ MomHealPokemon: ; 4818a (12:418a) predef HealParty ld a, MUSIC_PKMN_HEALED ld [wc0ee], a - call PlaySound ; play sound? + call PlaySound .next ld a, [wc026] cp MUSIC_PKMN_HEALED diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index 499f77ef..f8b911fe 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -51,46 +51,46 @@ RocketHideout1TrainerHeader0: ; 44c22 (11:4c22) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd815 ; flag's byte - dw RocketHideout1BattleText2 ; 0x4ca1 TextBeforeBattle - dw RocketHideout1AfterBattleTxt2 ; 0x4cab TextAfterBattle - dw RocketHideout1EndBattleText2 ; 0x4ca6 TextEndBattle - dw RocketHideout1EndBattleText2 ; 0x4ca6 TextEndBattle + dw RocketHideout1BattleText2 ; TextBeforeBattle + dw RocketHideout1AfterBattleTxt2 ; TextAfterBattle + dw RocketHideout1EndBattleText2 ; TextEndBattle + dw RocketHideout1EndBattleText2 ; TextEndBattle RocketHideout1TrainerHeader2: ; 44c2e (11:4c2e) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd815 ; flag's byte - dw RocketHideout1BattleText3 ; 0x4cb0 TextBeforeBattle - dw RocketHideout1AfterBattleTxt3 ; 0x4cba TextAfterBattle - dw RocketHideout1EndBattleText3 ; 0x4cb5 TextEndBattle - dw RocketHideout1EndBattleText3 ; 0x4cb5 TextEndBattle + dw RocketHideout1BattleText3 ; TextBeforeBattle + dw RocketHideout1AfterBattleTxt3 ; TextAfterBattle + dw RocketHideout1EndBattleText3 ; TextEndBattle + dw RocketHideout1EndBattleText3 ; TextEndBattle RocketHideout1TrainerHeader3: ; 44c3a (11:4c3a) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd815 ; flag's byte - dw RocketHideout1BattleText4 ; 0x4cbf TextBeforeBattle - dw RocketHideout1AfterBattleTxt4 ; 0x4cc9 TextAfterBattle - dw RocketHideout1EndBattleText4 ; 0x4cc4 TextEndBattle - dw RocketHideout1EndBattleText4 ; 0x4cc4 TextEndBattle + dw RocketHideout1BattleText4 ; TextBeforeBattle + dw RocketHideout1AfterBattleTxt4 ; TextAfterBattle + dw RocketHideout1EndBattleText4 ; TextEndBattle + dw RocketHideout1EndBattleText4 ; TextEndBattle RocketHideout1TrainerHeader4: ; 44c46 (11:4c46) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd815 ; flag's byte - dw RocketHideout1BattleText5 ; 0x4cce TextBeforeBattle - dw RocketHideout1AfterBattleTxt5 ; 0x4cd8 TextAfterBattle - dw RocketHideout1EndBattleText5 ; 0x4cd3 TextEndBattle - dw RocketHideout1EndBattleText5 ; 0x4cd3 TextEndBattle + dw RocketHideout1BattleText5 ; TextBeforeBattle + dw RocketHideout1AfterBattleTxt5 ; TextAfterBattle + dw RocketHideout1EndBattleText5 ; TextEndBattle + dw RocketHideout1EndBattleText5 ; TextEndBattle RocketHideout1TrainerHeader5: ; 44c52 (11:4c52) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd815 ; flag's byte - dw RocketHideout1BattleText6 ; 0x4cdd TextBeforeBattle - dw RocketHideout1AfterBattleTxt6 ; 0x4ce2 TextAfterBattle - dw RocketHideout1EndBattleText6 ; 0x4c91 TextEndBattle - dw RocketHideout1EndBattleText6 ; 0x4c91 TextEndBattle + dw RocketHideout1BattleText6 ; TextBeforeBattle + dw RocketHideout1AfterBattleTxt6 ; TextAfterBattle + dw RocketHideout1EndBattleText6 ; TextEndBattle + dw RocketHideout1EndBattleText6 ; TextEndBattle db $ff diff --git a/scripts/rockethideout2.asm b/scripts/rockethideout2.asm index 99754658..05bdc9b6 100755 --- a/scripts/rockethideout2.asm +++ b/scripts/rockethideout2.asm @@ -321,17 +321,17 @@ LoadSpinnerArrowTiles: ; 44fd7 (11:4fd7) ld a, [wSpriteStateData1 + 2] srl a srl a - ld hl, SpinnerPlayerFacingDirections ; $5083 + ld hl, SpinnerPlayerFacingDirections ld c, a ld b, $0 add hl, bc ld a, [hl] ld [wSpriteStateData1 + 2], a - ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET + ld a, [W_CURMAPTILESET] cp FACILITY - ld hl, FacilitySpinnerArrows ; $5023 + ld hl, FacilitySpinnerArrows jr z, .asm_44ff6 - ld hl, GymSpinnerArrows ; $5053 + ld hl, GymSpinnerArrows .asm_44ff6 ld a, [wSimulatedJoypadStatesIndex] bit 0, a @@ -429,10 +429,10 @@ RocketHideout2TrainerHeader0: ; 450d1 (11:50d1) db $1 ; flag's bit db ($4 << 4) ; trainer's view range dw wd817 ; flag's byte - dw RocketHideout2BattleText2 ; 0x50e8 TextBeforeBattle - dw RocketHideout2AfterBattleTxt2 ; 0x50f2 TextAfterBattle - dw RocketHideout2EndBattleText2 ; 0x50ed TextEndBattle - dw RocketHideout2EndBattleText2 ; 0x50ed TextEndBattle + dw RocketHideout2BattleText2 ; TextBeforeBattle + dw RocketHideout2AfterBattleTxt2 ; TextAfterBattle + dw RocketHideout2EndBattleText2 ; TextEndBattle + dw RocketHideout2EndBattleText2 ; TextEndBattle db $ff diff --git a/scripts/rockethideout3.asm b/scripts/rockethideout3.asm index 6dc467ab..f94438e9 100755 --- a/scripts/rockethideout3.asm +++ b/scripts/rockethideout3.asm @@ -135,7 +135,7 @@ RocketHideout3ArrowMovement12: ; 452e1 (11:52e1) db $40,$01 db $FF -RocketHideout3Script3 ; 452e4 (11:452e4) +RocketHideout3Script3: ; 452e4 (11:452e4) ld a, [wSimulatedJoypadStatesIndex] and a jp nz, LoadSpinnerArrowTiles @@ -158,19 +158,19 @@ RocketHideout3TrainerHeader0: ; 45302 (11:5302) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd819 ; flag's byte - dw RocketHideout3BattleText2 ; 0x5325 TextBeforeBattle - dw RocketHideout3AfterBattleTxt2 ; 0x532f TextAfterBattle - dw RocketHideout3EndBattleText2 ; 0x532a TextEndBattle - dw RocketHideout3EndBattleText2 ; 0x532a TextEndBattle + dw RocketHideout3BattleText2 ; TextBeforeBattle + dw RocketHideout3AfterBattleTxt2 ; TextAfterBattle + dw RocketHideout3EndBattleText2 ; TextEndBattle + dw RocketHideout3EndBattleText2 ; TextEndBattle RocketHideout3TrainerHeader2: ; 4530e (11:530e) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd819 ; flag's byte - dw RocketHideout3BattleTxt ; 0x533e TextBeforeBattle - dw RocketHideout3AfterBattleText3 ; 0x5348 TextAfterBattle - dw RocketHideout3EndBattleText3 ; 0x5343 TextEndBattle - dw RocketHideout3EndBattleText3 ; 0x5343 TextEndBattle + dw RocketHideout3BattleTxt ; TextBeforeBattle + dw RocketHideout3AfterBattleText3 ; TextAfterBattle + dw RocketHideout3EndBattleText3 ; TextEndBattle + dw RocketHideout3EndBattleText3 ; TextEndBattle db $ff diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index f1b46653..98132f99 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -93,28 +93,28 @@ RocketHideout4TrainerHeader0: ; 45515 (11:5515) db $2 ; flag's bit db ($0 << 4) ; trainer's view range dw wd81b ; flag's byte - dw RocketHideout4BattleText2 ; 0x5593 TextBeforeBattle - dw RocketHideout4AfterBattleText2 ; 0x559d TextAfterBattle - dw RocketHideout4EndBattleText2 ; 0x5598 TextEndBattle - dw RocketHideout4EndBattleText2 ; 0x5598 TextEndBattle + dw RocketHideout4BattleText2 ; TextBeforeBattle + dw RocketHideout4AfterBattleText2 ; TextAfterBattle + dw RocketHideout4EndBattleText2 ; TextEndBattle + dw RocketHideout4EndBattleText2 ; TextEndBattle RocketHideout4TrainerHeader2: ; 45521 (11:5521) db $3 ; flag's bit db ($0 << 4) ; trainer's view range dw wd81b ; flag's byte - dw RocketHideout4BattleText3 ; 0x55ac TextBeforeBattle - dw RocketHideout4AfterBattleText3 ; 0x55b6 TextAfterBattle - dw RocketHideout4EndBattleText3 ; 0x55b1 TextEndBattle - dw RocketHideout4EndBattleText3 ; 0x55b1 TextEndBattle + dw RocketHideout4BattleText3 ; TextBeforeBattle + dw RocketHideout4AfterBattleText3 ; TextAfterBattle + dw RocketHideout4EndBattleText3 ; TextEndBattle + dw RocketHideout4EndBattleText3 ; TextEndBattle RocketHideout4TrainerHeader3: ; 4552d (11:552d) db $4 ; flag's bit db ($1 << 4) ; trainer's view range dw wd81b ; flag's byte - dw RocketHideout4BattleText4 ; 0x55c5 TextBeforeBattle - dw RocketHideout4AfterBattleText4 ; 0x55cf TextAfterBattle - dw RocketHideout4EndBattleText4 ; 0x55ca TextEndBattle - dw RocketHideout4EndBattleText4 ; 0x55ca TextEndBattle + dw RocketHideout4BattleText4 ; TextBeforeBattle + dw RocketHideout4AfterBattleText4 ; TextAfterBattle + dw RocketHideout4EndBattleText4 ; TextEndBattle + dw RocketHideout4EndBattleText4 ; TextEndBattle db $ff @@ -140,11 +140,11 @@ RocketHideout4Text1: ; 4553a (11:553a) ld a, $3 ld [W_ROCKETHIDEOUT4CURSCRIPT], a ld [W_CURMAPSCRIPT], a - jr .asm_209f0 ; 0x4556f + jr .asm_209f0 .asm_545571 ld hl, RocketHideout4Text10 call PrintText -.asm_209f0 ; 0x45577 +.asm_209f0 jp TextScriptEnd RocketHideout4Text_4557a: ; 4557a (11:557a) @@ -211,12 +211,12 @@ RocketHideout4EndBattleText4: ; 455ca (11:55ca) RocketHideout4AfterBattleText4: ; 455cf (11:55cf) db $8 - ld hl, RocketHideout4Text_455ec ; $55ec + ld hl, RocketHideout4Text_455ec call PrintText ld hl, wd81b bit 6, [hl] set 6, [hl] - jr nz, .asm_455e9 ; 0x455dd $a + jr nz, .asm_455e9 ld a, HS_ROCKET_HIDEOUT_4_ITEM_5 ld [wcc4d], a predef ShowObject diff --git a/scripts/rockethideoutelevator.asm b/scripts/rockethideoutelevator.asm index e7bc24f3..70564e7a 100755 --- a/scripts/rockethideoutelevator.asm +++ b/scripts/rockethideoutelevator.asm @@ -32,9 +32,9 @@ RocketHideoutElevatorScript_4573a: ; 4573a (11:573a) ret RocketHideoutElevatorScript_45741: ; 45741 (11:5741) - ld hl, RocketHideoutElavatorFloors ; $5754 + ld hl, RocketHideoutElavatorFloors call LoadItemList - ld hl, RocketHideoutElevatorWarpMaps ; $5759 + ld hl, RocketHideoutElevatorWarpMaps ld de, wcc5b ld bc, $0006 call CopyData @@ -65,17 +65,17 @@ RocketHideoutElevatorText1: ; 4576d (11:576d) db $08 ; asm ld b, LIFT_KEY call IsItemInBag - jr z, .asm_8d8f0 ; 0x45773 + jr z, .asm_45782 call RocketHideoutElevatorScript_45741 - ld hl, RocketHideoutElevatorWarpMaps ; $5759 + ld hl, RocketHideoutElevatorWarpMaps predef Func_1c9c6 - jr .asm_46c43 ; 0x45780 -.asm_8d8f0 ; 0x45782 + jr .asm_45788 +.asm_45782 ld hl, RocketHideoutElevatorText_4578b call PrintText -.asm_46c43 ; 0x45788 +.asm_45788 jp TextScriptEnd RocketHideoutElevatorText_4578b: ; 4578b (11:578b) - TX_FAR _RocketElevatorText_4578b ; 0x82438 + TX_FAR _RocketElevatorText_4578b db $d, "@" diff --git a/scripts/rocktunnel1.asm b/scripts/rocktunnel1.asm index 1d514a05..b5b840bf 100755 --- a/scripts/rocktunnel1.asm +++ b/scripts/rocktunnel1.asm @@ -27,101 +27,101 @@ RockTunnel1TrainerHeader1: ; 44505 (11:4505) db $1 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d2 ; flag's byte - dw RockTunnel1BattleText1 ; 0x4588 TextBeforeBattle - dw RockTunnel1AfterBattleText1 ; 0x4592 TextAfterBattle - dw RockTunnel1EndBattleText1 ; 0x458d TextEndBattle - dw RockTunnel1EndBattleText1 ; 0x458d TextEndBattle + dw RockTunnel1BattleText1 ; TextBeforeBattle + dw RockTunnel1AfterBattleText1 ; TextAfterBattle + dw RockTunnel1EndBattleText1 ; TextEndBattle + dw RockTunnel1EndBattleText1 ; TextEndBattle RockTunnel1TrainerHeader2: ; 44511 (11:4511) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d2 ; flag's byte - dw RockTunnel1BattleText2 ; 0x4597 TextBeforeBattle - dw RockTunnel1AfterBattleText2 ; 0x45a1 TextAfterBattle - dw RockTunnel1EndBattleText2 ; 0x459c TextEndBattle - dw RockTunnel1EndBattleText2 ; 0x459c TextEndBattle + dw RockTunnel1BattleText2 ; TextBeforeBattle + dw RockTunnel1AfterBattleText2 ; TextAfterBattle + dw RockTunnel1EndBattleText2 ; TextEndBattle + dw RockTunnel1EndBattleText2 ; TextEndBattle RockTunnel1TrainerHeader3: ; 4451d (11:451d) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d2 ; flag's byte - dw RockTunnel1BattleText3 ; 0x45a6 TextBeforeBattle - dw RockTunnel1AfterBattleText3 ; 0x45b0 TextAfterBattle - dw RockTunnel1EndBattleText3 ; 0x45ab TextEndBattle - dw RockTunnel1EndBattleText3 ; 0x45ab TextEndBattle + dw RockTunnel1BattleText3 ; TextBeforeBattle + dw RockTunnel1AfterBattleText3 ; TextAfterBattle + dw RockTunnel1EndBattleText3 ; TextEndBattle + dw RockTunnel1EndBattleText3 ; TextEndBattle RockTunnel1TrainerHeader4: ; 44529 (11:4529) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d2 ; flag's byte - dw RockTunnel1BattleText4 ; 0x45b5 TextBeforeBattle - dw RockTunnel1AfterBattleText4 ; 0x45bf TextAfterBattle - dw RockTunnel1EndBattleText4 ; 0x45ba TextEndBattle - dw RockTunnel1EndBattleText4 ; 0x45ba TextEndBattle + dw RockTunnel1BattleText4 ; TextBeforeBattle + dw RockTunnel1AfterBattleText4 ; TextAfterBattle + dw RockTunnel1EndBattleText4 ; TextEndBattle + dw RockTunnel1EndBattleText4 ; TextEndBattle RockTunnel1TrainerHeader5: ; 44535 (11:4535) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d2 ; flag's byte - dw RockTunnel1BattleText5 ; 0x45c4 TextBeforeBattle - dw RockTunnel1AfterBattleText5 ; 0x45ce TextAfterBattle - dw RockTunnel1EndBattleText5 ; 0x45c9 TextEndBattle - dw RockTunnel1EndBattleText5 ; 0x45c9 TextEndBattle + dw RockTunnel1BattleText5 ; TextBeforeBattle + dw RockTunnel1AfterBattleText5 ; TextAfterBattle + dw RockTunnel1EndBattleText5 ; TextEndBattle + dw RockTunnel1EndBattleText5 ; TextEndBattle RockTunnel1TrainerHeader6: ; 44541 (11:4541) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d2 ; flag's byte - dw RockTunnel1BattleText6 ; 0x45d3 TextBeforeBattle - dw RockTunnel1AfterBattleText6 ; 0x45dd TextAfterBattle - dw RockTunnel1EndBattleText6 ; 0x45d8 TextEndBattle - dw RockTunnel1EndBattleText6 ; 0x45d8 TextEndBattle + dw RockTunnel1BattleText6 ; TextBeforeBattle + dw RockTunnel1AfterBattleText6 ; TextAfterBattle + dw RockTunnel1EndBattleText6 ; TextEndBattle + dw RockTunnel1EndBattleText6 ; TextEndBattle RockTunnel1TrainerHeader7: ; 4454d (11:454d) db $7 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d2 ; flag's byte - dw RockTunnel1BattleText7 ; 0x45e2 TextBeforeBattle - dw RockTunnel1AfterBattleText7 ; 0x45ec TextAfterBattle - dw RockTunnel1EndBattleText7 ; 0x45e7 TextEndBattle - dw RockTunnel1EndBattleText7 ; 0x45e7 TextEndBattle + dw RockTunnel1BattleText7 ; TextBeforeBattle + dw RockTunnel1AfterBattleText7 ; TextAfterBattle + dw RockTunnel1EndBattleText7 ; TextEndBattle + dw RockTunnel1EndBattleText7 ; TextEndBattle db $ff RockTunnel1Text1: ; 4455a (11:455a) db $8 - ld hl, RockTunnel1TrainerHeader1 ; $4505 - jr asm_0c916 ; 0x4455e $22 + ld hl, RockTunnel1TrainerHeader1 + jr RockTunnel1TalkToTrainer RockTunnel1Text2: ; 44560 (11:4560) db $8 - ld hl, RockTunnel1TrainerHeader2 ; $4511 - jr asm_0c916 ; 0x44564 $1c + ld hl, RockTunnel1TrainerHeader2 + jr RockTunnel1TalkToTrainer RockTunnel1Text3: ; 44566 (11:4566) db $8 - ld hl, RockTunnel1TrainerHeader3 ; $451d - jr asm_0c916 ; 0x4456a $16 + ld hl, RockTunnel1TrainerHeader3 + jr RockTunnel1TalkToTrainer RockTunnel1Text4: ; 4456c (11:456c) db $8 - ld hl, RockTunnel1TrainerHeader4 ; $4529 - jr asm_0c916 ; 0x44570 $10 + ld hl, RockTunnel1TrainerHeader4 + jr RockTunnel1TalkToTrainer RockTunnel1Text5: ; 44572 (11:4572) db $8 - ld hl, RockTunnel1TrainerHeader5 ; $4535 - jr asm_0c916 ; 0x44576 $a + ld hl, RockTunnel1TrainerHeader5 + jr RockTunnel1TalkToTrainer RockTunnel1Text6: ; 44578 (11:4578) db $8 - ld hl, RockTunnel1TrainerHeader6 ; $4541 - jr asm_0c916 ; 0x4457c $4 + ld hl, RockTunnel1TrainerHeader6 + jr RockTunnel1TalkToTrainer RockTunnel1Text7: ; 4457e (11:457e) db $8 - ld hl, RockTunnel1TrainerHeader7 ; $454d -asm_0c916: ; 44582 (11:4582) + ld hl, RockTunnel1TrainerHeader7 +RockTunnel1TalkToTrainer: ; 44582 (11:4582) call TalkToTrainer jp TextScriptEnd diff --git a/scripts/rocktunnel2.asm b/scripts/rocktunnel2.asm index 98b804a7..173ede7c 100755 --- a/scripts/rocktunnel2.asm +++ b/scripts/rocktunnel2.asm @@ -27,73 +27,73 @@ RockTunnel2TrainerHeader0: ; 46014 (11:6014) db $1 ; flag's bit db ($4 << 4) ; trainer's view range dw wd87d ; flag's byte - dw RockTunnel2BattleText2 ; 0x60c5 TextBeforeBattle - dw RockTunnel2AfterBattleText2 ; 0x60cf TextAfterBattle - dw RockTunnel2EndBattleText2 ; 0x60ca TextEndBattle - dw RockTunnel2EndBattleText2 ; 0x60ca TextEndBattle + dw RockTunnel2BattleText2 ; TextBeforeBattle + dw RockTunnel2AfterBattleText2 ; TextAfterBattle + dw RockTunnel2EndBattleText2 ; TextEndBattle + dw RockTunnel2EndBattleText2 ; TextEndBattle RockTunnel2TrainerHeader2: ; 46020 (11:6020) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd87d ; flag's byte - dw RockTunnel2BattleText3 ; 0x60d4 TextBeforeBattle - dw RockTunnel2AfterBattleText3 ; 0x60de TextAfterBattle - dw RockTunnel2EndBattleText3 ; 0x60d9 TextEndBattle - dw RockTunnel2EndBattleText3 ; 0x60d9 TextEndBattle + dw RockTunnel2BattleText3 ; TextBeforeBattle + dw RockTunnel2AfterBattleText3 ; TextAfterBattle + dw RockTunnel2EndBattleText3 ; TextEndBattle + dw RockTunnel2EndBattleText3 ; TextEndBattle RockTunnel2TrainerHeader3: ; 4602c (11:602c) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd87d ; flag's byte - dw RockTunnel2BattleText4 ; 0x60e3 TextBeforeBattle - dw RockTunnel2AfterBattleText4 ; 0x60ed TextAfterBattle - dw RockTunnel2EndBattleText4 ; 0x60e8 TextEndBattle - dw RockTunnel2EndBattleText4 ; 0x60e8 TextEndBattle + dw RockTunnel2BattleText4 ; TextBeforeBattle + dw RockTunnel2AfterBattleText4 ; TextAfterBattle + dw RockTunnel2EndBattleText4 ; TextEndBattle + dw RockTunnel2EndBattleText4 ; TextEndBattle RockTunnel2TrainerHeader4: ; 46038 (11:6038) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd87d ; flag's byte - dw RockTunnel2BattleText5 ; 0x60f2 TextBeforeBattle - dw RockTunnel2AfterBattleText5 ; 0x60fc TextAfterBattle - dw RockTunnel2EndBattleText5 ; 0x60f7 TextEndBattle - dw RockTunnel2EndBattleText5 ; 0x60f7 TextEndBattle + dw RockTunnel2BattleText5 ; TextBeforeBattle + dw RockTunnel2AfterBattleText5 ; TextAfterBattle + dw RockTunnel2EndBattleText5 ; TextEndBattle + dw RockTunnel2EndBattleText5 ; TextEndBattle RockTunnel2TrainerHeader5: ; 46044 (11:6044) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd87d ; flag's byte - dw RockTunnel2BattleText6 ; 0x6101 TextBeforeBattle - dw RockTunnel2AfterBattleText6 ; 0x610b TextAfterBattle - dw RockTunnel2EndBattleText6 ; 0x6106 TextEndBattle - dw RockTunnel2EndBattleText6 ; 0x6106 TextEndBattle + dw RockTunnel2BattleText6 ; TextBeforeBattle + dw RockTunnel2AfterBattleText6 ; TextAfterBattle + dw RockTunnel2EndBattleText6 ; TextEndBattle + dw RockTunnel2EndBattleText6 ; TextEndBattle RockTunnel2TrainerHeader6: ; 46050 (11:6050) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd87d ; flag's byte - dw RockTunnel2BattleText7 ; 0x6110 TextBeforeBattle - dw RockTunnel2AfterBattleText7 ; 0x611a TextAfterBattle - dw RockTunnel2EndBattleText7 ; 0x6115 TextEndBattle - dw RockTunnel2EndBattleText7 ; 0x6115 TextEndBattle + dw RockTunnel2BattleText7 ; TextBeforeBattle + dw RockTunnel2AfterBattleText7 ; TextAfterBattle + dw RockTunnel2EndBattleText7 ; TextEndBattle + dw RockTunnel2EndBattleText7 ; TextEndBattle RockTunnel2TrainerHeader7: ; 4605c (11:605c) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd87d ; flag's byte - dw RockTunnel2BattleText8 ; 0x611f TextBeforeBattle - dw RockTunnel2AfterBattleText8 ; 0x6129 TextAfterBattle - dw RockTunnel2EndBattleText8 ; 0x6124 TextEndBattle - dw RockTunnel2EndBattleText8 ; 0x6124 TextEndBattle + dw RockTunnel2BattleText8 ; TextBeforeBattle + dw RockTunnel2AfterBattleText8 ; TextAfterBattle + dw RockTunnel2EndBattleText8 ; TextEndBattle + dw RockTunnel2EndBattleText8 ; TextEndBattle RockTunnel2TrainerHeader8: ; 46068 (11:6068) db $8 ; flag's bit db ($3 << 4) ; trainer's view range dw wd87d ; flag's byte - dw RockTunnel2BattleText9 ; 0x612e TextBeforeBattle - dw RockTunnel2AfterBattleText9 ; 0x6138 TextAfterBattle - dw RockTunnel2EndBattleText9 ; 0x6133 TextEndBattle - dw RockTunnel2EndBattleText9 ; 0x6133 TextEndBattle + dw RockTunnel2BattleText9 ; TextBeforeBattle + dw RockTunnel2AfterBattleText9 ; TextAfterBattle + dw RockTunnel2EndBattleText9 ; TextEndBattle + dw RockTunnel2EndBattleText9 ; TextEndBattle db $ff diff --git a/scripts/route1.asm b/scripts/route1.asm index 189b987b..c5023134 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -11,20 +11,20 @@ Route1Text1: ; 1cab8 (7:4ab8) ld hl, wd7bf bit 0, [hl] set 0, [hl] - jr nz, .asm_02840 ; 0x1cac0 + jr nz, .asm_1cada ld hl, Route1ViridianMartSampleText call PrintText ld bc, (POTION << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, Route1Text_1cae8 ; $4ae8 - jr .asm_46d43 ; 0x1cad3 + ld hl, Route1Text_1cae8 + jr .asm_1cadd .BagFull - ld hl, Route1Text_1caf3 ; $4af3 - jr .asm_46d43 ; 0x1cad8 -.asm_02840 ; 0x1cada - ld hl, Route1Text_1caee ; $4aee -.asm_46d43 ; 0x1cadd + ld hl, Route1Text_1caf3 + jr .asm_1cadd +.asm_1cada + ld hl, Route1Text_1caee +.asm_1cadd call PrintText jp TextScriptEnd diff --git a/scripts/route10.asm b/scripts/route10.asm index c587b1df..3f7e99a3 100755 --- a/scripts/route10.asm +++ b/scripts/route10.asm @@ -29,55 +29,55 @@ Route10TrainerHeader0: ; 59363 (16:5363) db $1 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d1 ; flag's byte - dw Route10BattleText1 ; 0x53b6 TextBeforeBattle - dw Route10AfterBattleText1 ; 0x53c0 TextAfterBattle - dw Route10EndBattleText1 ; 0x53bb TextEndBattle - dw Route10EndBattleText1 ; 0x53bb TextEndBattle + dw Route10BattleText1 ; TextBeforeBattle + dw Route10AfterBattleText1 ; TextAfterBattle + dw Route10EndBattleText1 ; TextEndBattle + dw Route10EndBattleText1 ; TextEndBattle Route10TrainerHeader1: ; 5936f (16:536f) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d1 ; flag's byte - dw Route10BattleText2 ; 0x53cf TextBeforeBattle - dw Route10AfterBattleText2 ; 0x53d9 TextAfterBattle - dw Route10EndBattleText2 ; 0x53d4 TextEndBattle - dw Route10EndBattleText2 ; 0x53d4 TextEndBattle + dw Route10BattleText2 ; TextBeforeBattle + dw Route10AfterBattleText2 ; TextAfterBattle + dw Route10EndBattleText2 ; TextEndBattle + dw Route10EndBattleText2 ; TextEndBattle Route10TrainerHeader2: ; 5937b (16:537b) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d1 ; flag's byte - dw Route10BattleText3 ; 0x53e8 TextBeforeBattle - dw Route10AfterBattleText3 ; 0x53f2 TextAfterBattle - dw Route10EndBattleText3 ; 0x53ed TextEndBattle - dw Route10EndBattleText3 ; 0x53ed TextEndBattle + dw Route10BattleText3 ; TextBeforeBattle + dw Route10AfterBattleText3 ; TextAfterBattle + dw Route10EndBattleText3 ; TextEndBattle + dw Route10EndBattleText3 ; TextEndBattle Route10TrainerHeader3: ; 59387 (16:5387) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d1 ; flag's byte - dw Route10BattleText4 ; 0x5401 TextBeforeBattle - dw Route10AfterBattleText4 ; 0x540b TextAfterBattle - dw Route10EndBattleText4 ; 0x5406 TextEndBattle - dw Route10EndBattleText4 ; 0x5406 TextEndBattle + dw Route10BattleText4 ; TextBeforeBattle + dw Route10AfterBattleText4 ; TextAfterBattle + dw Route10EndBattleText4 ; TextEndBattle + dw Route10EndBattleText4 ; TextEndBattle Route10TrainerHeader4: ; 59393 (16:5393) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d1 ; flag's byte - dw Route10BattleText5 ; 0x541a TextBeforeBattle - dw Route10AfterBattleText5 ; 0x5424 TextAfterBattle - dw Route10EndBattleText5 ; 0x541f TextEndBattle - dw Route10EndBattleText5 ; 0x541f TextEndBattle + dw Route10BattleText5 ; TextBeforeBattle + dw Route10AfterBattleText5 ; TextAfterBattle + dw Route10EndBattleText5 ; TextEndBattle + dw Route10EndBattleText5 ; TextEndBattle Route10TrainerHeader5: ; 5939f (16:539f) db $6 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d1 ; flag's byte - dw Route10BattleText6 ; 0x5433 TextBeforeBattle - dw Route10AfterBattleText6 ; 0x543d TextAfterBattle - dw Route10EndBattleText6 ; 0x5438 TextEndBattle - dw Route10EndBattleText6 ; 0x5438 TextEndBattle + dw Route10BattleText6 ; TextBeforeBattle + dw Route10AfterBattleText6 ; TextAfterBattle + dw Route10EndBattleText6 ; TextEndBattle + dw Route10EndBattleText6 ; TextEndBattle db $ff diff --git a/scripts/route11.asm b/scripts/route11.asm index 629a6efd..7607be9c 100755 --- a/scripts/route11.asm +++ b/scripts/route11.asm @@ -30,91 +30,91 @@ Route11TrainerHeader0: ; 5947b (16:547b) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText1 ; 0x54fe TextBeforeBattle - dw Route11AfterBattleText1 ; 0x5508 TextAfterBattle - dw Route11EndBattleText1 ; 0x5503 TextEndBattle - dw Route11EndBattleText1 ; 0x5503 TextEndBattle + dw Route11BattleText1 ; TextBeforeBattle + dw Route11AfterBattleText1 ; TextAfterBattle + dw Route11EndBattleText1 ; TextEndBattle + dw Route11EndBattleText1 ; TextEndBattle Route11TrainerHeader1: ; 59487 (16:5487) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText2 ; 0x5517 TextBeforeBattle - dw Route11AfterBattleText2 ; 0x5521 TextAfterBattle - dw Route11EndBattleText2 ; 0x551c TextEndBattle - dw Route11EndBattleText2 ; 0x551c TextEndBattle + dw Route11BattleText2 ; TextBeforeBattle + dw Route11AfterBattleText2 ; TextAfterBattle + dw Route11EndBattleText2 ; TextEndBattle + dw Route11EndBattleText2 ; TextEndBattle Route11TrainerHeader2: ; 59493 (16:5493) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText3 ; 0x5530 TextBeforeBattle - dw Route11AfterBattleText3 ; 0x553a TextAfterBattle - dw Route11EndBattleText3 ; 0x5535 TextEndBattle - dw Route11EndBattleText3 ; 0x5535 TextEndBattle + dw Route11BattleText3 ; TextBeforeBattle + dw Route11AfterBattleText3 ; TextAfterBattle + dw Route11EndBattleText3 ; TextEndBattle + dw Route11EndBattleText3 ; TextEndBattle Route11TrainerHeader3: ; 5949f (16:549f) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText4 ; 0x5549 TextBeforeBattle - dw Route11AfterBattleText4 ; 0x5553 TextAfterBattle - dw Route11EndBattleText4 ; 0x554e TextEndBattle - dw Route11EndBattleText4 ; 0x554e TextEndBattle + dw Route11BattleText4 ; TextBeforeBattle + dw Route11AfterBattleText4 ; TextAfterBattle + dw Route11EndBattleText4 ; TextEndBattle + dw Route11EndBattleText4 ; TextEndBattle Route11TrainerHeader4: ; 594ab (16:54ab) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText5 ; 0x5562 TextBeforeBattle - dw Route11AfterBattleText5 ; 0x556c TextAfterBattle - dw Route11EndBattleText5 ; 0x5567 TextEndBattle - dw Route11EndBattleText5 ; 0x5567 TextEndBattle + dw Route11BattleText5 ; TextBeforeBattle + dw Route11AfterBattleText5 ; TextAfterBattle + dw Route11EndBattleText5 ; TextEndBattle + dw Route11EndBattleText5 ; TextEndBattle Route11TrainerHeader5: ; 594b7 (16:54b7) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText6 ; 0x557b TextBeforeBattle - dw Route11AfterBattleText6 ; 0x5585 TextAfterBattle - dw Route11EndBattleText6 ; 0x5580 TextEndBattle - dw Route11EndBattleText6 ; 0x5580 TextEndBattle + dw Route11BattleText6 ; TextBeforeBattle + dw Route11AfterBattleText6 ; TextAfterBattle + dw Route11EndBattleText6 ; TextEndBattle + dw Route11EndBattleText6 ; TextEndBattle Route11TrainerHeader6: ; 594c3 (16:54c3) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText7 ; 0x5594 TextBeforeBattle - dw Route11AfterBattleText7 ; 0x559e TextAfterBattle - dw Route11EndBattleText7 ; 0x5599 TextEndBattle - dw Route11EndBattleText7 ; 0x5599 TextEndBattle + dw Route11BattleText7 ; TextBeforeBattle + dw Route11AfterBattleText7 ; TextAfterBattle + dw Route11EndBattleText7 ; TextEndBattle + dw Route11EndBattleText7 ; TextEndBattle Route11TrainerHeader7: ; 594cf (16:54cf) db $8 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText8 ; 0x55ad TextBeforeBattle - dw Route11AfterBattleText8 ; 0x55b7 TextAfterBattle - dw Route11EndBattleText8 ; 0x55b2 TextEndBattle - dw Route11EndBattleText8 ; 0x55b2 TextEndBattle + dw Route11BattleText8 ; TextBeforeBattle + dw Route11AfterBattleText8 ; TextAfterBattle + dw Route11EndBattleText8 ; TextEndBattle + dw Route11EndBattleText8 ; TextEndBattle Route11TrainerHeader8: ; 594db (16:54db) db $9 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText9 ; 0x55c6 TextBeforeBattle - dw Route11AfterBattleText9 ; 0x55d0 TextAfterBattle - dw Route11EndBattleText9 ; 0x55cb TextEndBattle - dw Route11EndBattleText9 ; 0x55cb TextEndBattle + dw Route11BattleText9 ; TextBeforeBattle + dw Route11AfterBattleText9 ; TextAfterBattle + dw Route11EndBattleText9 ; TextEndBattle + dw Route11EndBattleText9 ; TextEndBattle Route11TrainerHeader9: ; 594e7 (16:54e7) db $a ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d5 ; flag's byte - dw Route11BattleText10 ; 0x55df TextBeforeBattle - dw Route11AfterBattleText10 ; 0x55e9 TextAfterBattle - dw Route11EndBattleText10 ; 0x55e4 TextEndBattle - dw Route11EndBattleText10 ; 0x55e4 TextEndBattle + dw Route11BattleText10 ; TextBeforeBattle + dw Route11AfterBattleText10 ; TextAfterBattle + dw Route11EndBattleText10 ; TextEndBattle + dw Route11EndBattleText10 ; TextEndBattle db $ff diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index d8740986..4fac2144 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -12,14 +12,14 @@ Route11GateUpstairsText1: ; 4945f (12:545f) xor a ld [wWhichTrade], a predef DoInGameTradeDialogue -asm_49469: ; 49469 (12:5469) +Route11GateUpstairsScriptEnd: ; 49469 (12:5469) jp TextScriptEnd Route11GateUpstairsText2: ; 4946c (12:546c) db $8 ld a, [wd7d6] add a - jr c, .asm_4949b ; 0x49471 $28 + jr c, .asm_4949b ld a, 30 ; pokemon needed ld [$ffdb], a ld a, ITEMFINDER ; oak's aide reward @@ -34,14 +34,14 @@ Route11GateUpstairsText2: ; 4946c (12:546c) predef OaksAideScript ; call oak's aide script ld a, [$ffdb] dec a - jr nz, .asm_494a1 ; 0x49494 $b + jr nz, .asm_494a1 ld hl, wd7d6 set 7, [hl] .asm_4949b ld hl, Route11GateUpstairsText_494a3 call PrintText .asm_494a1 - jr asm_49469 ; 0x494a1 $c6 + jr Route11GateUpstairsScriptEnd Route11GateUpstairsText_494a3: ; 494a3 (12:54a3) TX_FAR _Route11GateUpstairsText_494a3 @@ -71,7 +71,7 @@ BinocularsNoSnorlaxText: Route11GateUpstairsText4: ; 494ce (12:54ce) db $8 - ld hl, Route11GateUpstairsText_494d5 ; $54d5 + ld hl, Route11GateUpstairsText_494d5 jp Route12GateUpstairsScript_495c9 Route11GateUpstairsText_494d5: ; 494d5 (12:54d5) diff --git a/scripts/route12.asm b/scripts/route12.asm index fdaf2a85..af412d3a 100755 --- a/scripts/route12.asm +++ b/scripts/route12.asm @@ -28,12 +28,12 @@ Route12Script0: ; 59619 (16:5619) res 6, [hl] jp z, CheckFightingMapTrainers ld a, $d - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, SNORLAX - ld [W_CUROPPONENT], a ; wd059 + ld [W_CUROPPONENT], a ld a, 30 - ld [W_CURENEMYLVL], a ; W_CURENEMYLVL + ld [W_CURENEMYLVL], a ld a, HS_ROUTE_12_SNORLAX ld [wcc4d], a predef HideObject @@ -43,7 +43,7 @@ Route12Script0: ; 59619 (16:5619) ret Route12Script3: ; 5964c (16:564c) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jr z, Route12Script_59606 call UpdateSprites @@ -51,7 +51,7 @@ Route12Script3: ; 5964c (16:564c) cp $2 jr z, .asm_59664 ld a, $e - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_59664 ld hl, wd7d8 @@ -83,64 +83,64 @@ Route12TrainerHeader0: ; 59691 (16:5691) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d7 ; flag's byte - dw Route12BattleText1 ; 0x56ff TextBeforeBattle - dw Route12AfterBattleText1 ; 0x5709 TextAfterBattle - dw Route12EndBattleText1 ; 0x5704 TextEndBattle - dw Route12EndBattleText1 ; 0x5704 TextEndBattle + dw Route12BattleText1 ; TextBeforeBattle + dw Route12AfterBattleText1 ; TextAfterBattle + dw Route12EndBattleText1 ; TextEndBattle + dw Route12EndBattleText1 ; TextEndBattle Route12TrainerHeader1: ; 5969d (16:569d) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d7 ; flag's byte - dw Route12BattleText2 ; 0x5718 TextBeforeBattle - dw Route12AfterBattleText2 ; 0x5722 TextAfterBattle - dw Route12EndBattleText2 ; 0x571d TextEndBattle - dw Route12EndBattleText2 ; 0x571d TextEndBattle + dw Route12BattleText2 ; TextBeforeBattle + dw Route12AfterBattleText2 ; TextAfterBattle + dw Route12EndBattleText2 ; TextEndBattle + dw Route12EndBattleText2 ; TextEndBattle Route12TrainerHeader2: ; 596a9 (16:56a9) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d7 ; flag's byte - dw Route12BattleText3 ; 0x5731 TextBeforeBattle - dw Route12AfterBattleText3 ; 0x573b TextAfterBattle - dw Route12EndBattleText3 ; 0x5736 TextEndBattle - dw Route12EndBattleText3 ; 0x5736 TextEndBattle + dw Route12BattleText3 ; TextBeforeBattle + dw Route12AfterBattleText3 ; TextAfterBattle + dw Route12EndBattleText3 ; TextEndBattle + dw Route12EndBattleText3 ; TextEndBattle Route12TrainerHeader3: ; 596b5 (16:56b5) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d7 ; flag's byte - dw Route12BattleText4 ; 0x574a TextBeforeBattle - dw Route12AfterBattleText4 ; 0x5754 TextAfterBattle - dw Route12EndBattleText4 ; 0x574f TextEndBattle - dw Route12EndBattleText4 ; 0x574f TextEndBattle + dw Route12BattleText4 ; TextBeforeBattle + dw Route12AfterBattleText4 ; TextAfterBattle + dw Route12EndBattleText4 ; TextEndBattle + dw Route12EndBattleText4 ; TextEndBattle Route12TrainerHeader4: ; 596c1 (16:56c1) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d7 ; flag's byte - dw Route12BattleText5 ; 0x5763 TextBeforeBattle - dw Route12AfterBattleText5 ; 0x576d TextAfterBattle - dw Route12EndBattleText5 ; 0x5768 TextEndBattle - dw Route12EndBattleText5 ; 0x5768 TextEndBattle + dw Route12BattleText5 ; TextBeforeBattle + dw Route12AfterBattleText5 ; TextAfterBattle + dw Route12EndBattleText5 ; TextEndBattle + dw Route12EndBattleText5 ; TextEndBattle Route12TrainerHeader5: ; 596cd (16:56cd) db $7 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d7 ; flag's byte - dw Route12BattleText6 ; 0x577c TextBeforeBattle - dw Route12AfterBattleText6 ; 0x5786 TextAfterBattle - dw Route12EndBattleText6 ; 0x5781 TextEndBattle - dw Route12EndBattleText6 ; 0x5781 TextEndBattle + dw Route12BattleText6 ; TextBeforeBattle + dw Route12AfterBattleText6 ; TextAfterBattle + dw Route12EndBattleText6 ; TextEndBattle + dw Route12EndBattleText6 ; TextEndBattle Route12TrainerHeader6: ; 596d9 (16:56d9) db $8 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7d7 ; flag's byte - dw Route12BattleText7 ; 0x5795 TextBeforeBattle - dw Route12AfterBattleText7 ; 0x579f TextAfterBattle - dw Route12EndBattleText7 ; 0x579a TextEndBattle - dw Route12EndBattleText7 ; 0x579a TextEndBattle + dw Route12BattleText7 ; TextBeforeBattle + dw Route12AfterBattleText7 ; TextAfterBattle + dw Route12EndBattleText7 ; TextEndBattle + dw Route12EndBattleText7 ; TextEndBattle db $ff diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index c4c05cd6..68f9cc68 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -10,7 +10,7 @@ Route12GateUpstairsText1: ; 49569 (12:5569) db $08 ; asm ld a, [wd7d7] rrca - jr c, .asm_0ad3c ; 0x4956e + jr c, .asm_0ad3c ld hl, TM39PreReceiveText call PrintText ld bc, (TM_39 << 8) | 1 @@ -20,15 +20,15 @@ Route12GateUpstairsText1: ; 49569 (12:5569) call PrintText ld hl, wd7d7 set 0, [hl] - jr .asm_4ba56 ; 0x49589 + jr .asm_4ba56 .BagFull ld hl, TM39NoRoomText call PrintText - jr .asm_4ba56 ; 0x49591 -.asm_0ad3c ; 0x49593 + jr .asm_4ba56 +.asm_0ad3c ld hl, TM39ExplanationText call PrintText -.asm_4ba56 ; 0x49599 +.asm_4ba56 jp TextScriptEnd TM39PreReceiveText: ; 4959c (12:559c) @@ -68,9 +68,9 @@ Route12GateUpstairsText_495c4: ; 495c4 (12:55c4) Route12GateUpstairsScript_495c9: ; 495c9 (12:55c9) ld a, [wSpriteStateData1 + 9] cp $4 - jr z, .asm_495d4 ; 0x495ce $4 + jr z, .asm_495d4 ld a, $1 - jr .asm_495d8 ; 0x495d2 $4 + jr .asm_495d8 .asm_495d4 call PrintText xor a diff --git a/scripts/route12house.asm b/scripts/route12house.asm index 44667b24..733109da 100755 --- a/scripts/route12house.asm +++ b/scripts/route12house.asm @@ -27,7 +27,7 @@ Route12HouseText1: ; 56484 (15:6484) jr .asm_df984 .asm_a2d76 ld hl, Route12HouseText_564cf - jr .asm_df984 ; 0x564b5 + jr .asm_df984 .asm_b4cad ld hl, Route12HouseText_564d4 .asm_df984 @@ -39,9 +39,9 @@ Route12HouseText_564c0: ; 564c0 (15:64c0) db "@" Route12HouseText_564c5: ; 564c5 (15:64c5) - TX_FAR _Route12HouseText_564c5 ; 0x8ca00 + TX_FAR _Route12HouseText_564c5 db $0B - TX_FAR _Route12HouseText_564ca ; 0x8ca4f + TX_FAR _Route12HouseText_564ca db "@" Route12HouseText_564cf: ; 564cf (15:64cf) diff --git a/scripts/route13.asm b/scripts/route13.asm index 21862dfc..38d80425 100755 --- a/scripts/route13.asm +++ b/scripts/route13.asm @@ -32,91 +32,91 @@ Route13TrainerHeader0: ; 55851 (15:5851) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText2 ; 0x58d4 TextBeforeBattle - dw Route13AfterBattleText2 ; 0x58de TextAfterBattle - dw Route13EndBattleText2 ; 0x58d9 TextEndBattle - dw Route13EndBattleText2 ; 0x58d9 TextEndBattle + dw Route13BattleText2 ; TextBeforeBattle + dw Route13AfterBattleText2 ; TextAfterBattle + dw Route13EndBattleText2 ; TextEndBattle + dw Route13EndBattleText2 ; TextEndBattle Route13TrainerHeader2: ; 5585d (15:585d) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText3 ; 0x58ed TextBeforeBattle - dw Route13AfterBattleText3 ; 0x58f7 TextAfterBattle - dw Route13EndBattleText3 ; 0x58f2 TextEndBattle - dw Route13EndBattleText3 ; 0x58f2 TextEndBattle + dw Route13BattleText3 ; TextBeforeBattle + dw Route13AfterBattleText3 ; TextAfterBattle + dw Route13EndBattleText3 ; TextEndBattle + dw Route13EndBattleText3 ; TextEndBattle Route13TrainerHeader3: ; 55869 (15:5869) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText4 ; 0x5906 TextBeforeBattle - dw Route13AfterBattleText4 ; 0x5910 TextAfterBattle - dw Route13EndBattleText4 ; 0x590b TextEndBattle - dw Route13EndBattleText4 ; 0x590b TextEndBattle + dw Route13BattleText4 ; TextBeforeBattle + dw Route13AfterBattleText4 ; TextAfterBattle + dw Route13EndBattleText4 ; TextEndBattle + dw Route13EndBattleText4 ; TextEndBattle Route13TrainerHeader4: ; 55875 (15:5875) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText5 ; 0x591f TextBeforeBattle - dw Route13AfterBattleText5 ; 0x5929 TextAfterBattle - dw Route13EndBattleText5 ; 0x5924 TextEndBattle - dw Route13EndBattleText5 ; 0x5924 TextEndBattle + dw Route13BattleText5 ; TextBeforeBattle + dw Route13AfterBattleText5 ; TextAfterBattle + dw Route13EndBattleText5 ; TextEndBattle + dw Route13EndBattleText5 ; TextEndBattle Route13TrainerHeader5: ; 55881 (15:5881) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText6 ; 0x5938 TextBeforeBattle - dw Route13AfterBattleText6 ; 0x5942 TextAfterBattle - dw Route13EndBattleText6 ; 0x593d TextEndBattle - dw Route13EndBattleText6 ; 0x593d TextEndBattle + dw Route13BattleText6 ; TextBeforeBattle + dw Route13AfterBattleText6 ; TextAfterBattle + dw Route13EndBattleText6 ; TextEndBattle + dw Route13EndBattleText6 ; TextEndBattle Route13TrainerHeader6: ; 5588d (15:588d) db $6 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText7 ; 0x5951 TextBeforeBattle - dw Route13AfterBattleText7 ; 0x595b TextAfterBattle - dw Route13EndBattleText7 ; 0x5956 TextEndBattle - dw Route13EndBattleText7 ; 0x5956 TextEndBattle + dw Route13BattleText7 ; TextBeforeBattle + dw Route13AfterBattleText7 ; TextAfterBattle + dw Route13EndBattleText7 ; TextEndBattle + dw Route13EndBattleText7 ; TextEndBattle Route13TrainerHeader7: ; 55899 (15:5899) db $7 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText8 ; 0x596a TextBeforeBattle - dw Route13AfterBattleText8 ; 0x5974 TextAfterBattle - dw Route13EndBattleText8 ; 0x596f TextEndBattle - dw Route13EndBattleText8 ; 0x596f TextEndBattle + dw Route13BattleText8 ; TextBeforeBattle + dw Route13AfterBattleText8 ; TextAfterBattle + dw Route13EndBattleText8 ; TextEndBattle + dw Route13EndBattleText8 ; TextEndBattle Route13TrainerHeader8: ; 558a5 (15:58a5) db $8 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText9 ; 0x5983 TextBeforeBattle - dw Route13AfterBattleText9 ; 0x598d TextAfterBattle - dw Route13EndBattleText9 ; 0x5988 TextEndBattle - dw Route13EndBattleText9 ; 0x5988 TextEndBattle + dw Route13BattleText9 ; TextBeforeBattle + dw Route13AfterBattleText9 ; TextAfterBattle + dw Route13EndBattleText9 ; TextEndBattle + dw Route13EndBattleText9 ; TextEndBattle Route13TrainerHeader9: ; 558b1 (15:58b1) db $9 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText10 ; 0x599c TextBeforeBattle - dw Route13AfterBattleText10 ; 0x59a6 TextAfterBattle - dw Route13EndBattleText10 ; 0x59a1 TextEndBattle - dw Route13EndBattleText10 ; 0x59a1 TextEndBattle + dw Route13BattleText10 ; TextBeforeBattle + dw Route13AfterBattleText10 ; TextAfterBattle + dw Route13EndBattleText10 ; TextEndBattle + dw Route13EndBattleText10 ; TextEndBattle Route13TrainerHeader10: ; 558bd (15:58bd) db $a ; flag's bit db ($4 << 4) ; trainer's view range dw wd7d9 ; flag's byte - dw Route13BattleText11 ; 0x59b5 TextBeforeBattle - dw Route13AfterBattleText11 ; 0x59bf TextAfterBattle - dw Route13EndBattleText11 ; 0x59ba TextEndBattle - dw Route13EndBattleText11 ; 0x59ba TextEndBattle + dw Route13BattleText11 ; TextBeforeBattle + dw Route13AfterBattleText11 ; TextAfterBattle + dw Route13EndBattleText11 ; TextEndBattle + dw Route13EndBattleText11 ; TextEndBattle db $ff diff --git a/scripts/route14.asm b/scripts/route14.asm index d430f858..37b7df19 100755 --- a/scripts/route14.asm +++ b/scripts/route14.asm @@ -30,91 +30,91 @@ Route14TrainerHeader0: ; 55a02 (15:5a02) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText1 ; 0x5a85 TextBeforeBattle - dw Route14AfterBattleText1 ; 0x5a8f TextAfterBattle - dw Route14EndBattleText1 ; 0x5a8a TextEndBattle - dw Route14EndBattleText1 ; 0x5a8a TextEndBattle + dw Route14BattleText1 ; TextBeforeBattle + dw Route14AfterBattleText1 ; TextAfterBattle + dw Route14EndBattleText1 ; TextEndBattle + dw Route14EndBattleText1 ; TextEndBattle Route14TrainerHeader1: ; 55a0e (15:5a0e) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText2 ; 0x5a9e TextBeforeBattle - dw Route14AfterBattleText2 ; 0x5aa8 TextAfterBattle - dw Route14EndBattleText2 ; 0x5aa3 TextEndBattle - dw Route14EndBattleText2 ; 0x5aa3 TextEndBattle + dw Route14BattleText2 ; TextBeforeBattle + dw Route14AfterBattleText2 ; TextAfterBattle + dw Route14EndBattleText2 ; TextEndBattle + dw Route14EndBattleText2 ; TextEndBattle Route14TrainerHeader2: ; 55a1a (15:5a1a) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText3 ; 0x5ab7 TextBeforeBattle - dw Route14AfterBattleText3 ; 0x5ac1 TextAfterBattle - dw Route14EndBattleText3 ; 0x5abc TextEndBattle - dw Route14EndBattleText3 ; 0x5abc TextEndBattle + dw Route14BattleText3 ; TextBeforeBattle + dw Route14AfterBattleText3 ; TextAfterBattle + dw Route14EndBattleText3 ; TextEndBattle + dw Route14EndBattleText3 ; TextEndBattle Route14TrainerHeader3: ; 55a26 (15:5a26) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText4 ; 0x5ad0 TextBeforeBattle - dw Route14AfterBattleText4 ; 0x5ada TextAfterBattle - dw Route14EndBattleText4 ; 0x5ad5 TextEndBattle - dw Route14EndBattleText4 ; 0x5ad5 TextEndBattle + dw Route14BattleText4 ; TextBeforeBattle + dw Route14AfterBattleText4 ; TextAfterBattle + dw Route14EndBattleText4 ; TextEndBattle + dw Route14EndBattleText4 ; TextEndBattle Route14TrainerHeader4: ; 55a32 (15:5a32) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText5 ; 0x5ae9 TextBeforeBattle - dw Route14AfterBattleText5 ; 0x5af3 TextAfterBattle - dw Route14EndBattleText5 ; 0x5aee TextEndBattle - dw Route14EndBattleText5 ; 0x5aee TextEndBattle + dw Route14BattleText5 ; TextBeforeBattle + dw Route14AfterBattleText5 ; TextAfterBattle + dw Route14EndBattleText5 ; TextEndBattle + dw Route14EndBattleText5 ; TextEndBattle Route14TrainerHeader5: ; 55a3e (15:5a3e) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText6 ; 0x5b02 TextBeforeBattle - dw Route14AfterBattleText6 ; 0x5b0c TextAfterBattle - dw Route14EndBattleText6 ; 0x5b07 TextEndBattle - dw Route14EndBattleText6 ; 0x5b07 TextEndBattle + dw Route14BattleText6 ; TextBeforeBattle + dw Route14AfterBattleText6 ; TextAfterBattle + dw Route14EndBattleText6 ; TextEndBattle + dw Route14EndBattleText6 ; TextEndBattle Route14TrainerHeader6: ; 55a4a (15:5a4a) db $7 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText7 ; 0x5b1b TextBeforeBattle - dw Route14AfterBattleText7 ; 0x5b25 TextAfterBattle - dw Route14EndBattleText7 ; 0x5b20 TextEndBattle - dw Route14EndBattleText7 ; 0x5b20 TextEndBattle + dw Route14BattleText7 ; TextBeforeBattle + dw Route14AfterBattleText7 ; TextAfterBattle + dw Route14EndBattleText7 ; TextEndBattle + dw Route14EndBattleText7 ; TextEndBattle Route14TrainerHeader7: ; 55a56 (15:5a56) db $8 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText8 ; 0x5b34 TextBeforeBattle - dw Route14AfterBattleText8 ; 0x5b3e TextAfterBattle - dw Route14EndBattleText8 ; 0x5b39 TextEndBattle - dw Route14EndBattleText8 ; 0x5b39 TextEndBattle + dw Route14BattleText8 ; TextBeforeBattle + dw Route14AfterBattleText8 ; TextAfterBattle + dw Route14EndBattleText8 ; TextEndBattle + dw Route14EndBattleText8 ; TextEndBattle Route14TrainerHeader8: ; 55a62 (15:5a62) db $9 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText9 ; 0x5b4d TextBeforeBattle - dw Route14AfterBattleText9 ; 0x5b57 TextAfterBattle - dw Route14EndBattleText9 ; 0x5b52 TextEndBattle - dw Route14EndBattleText9 ; 0x5b52 TextEndBattle + dw Route14BattleText9 ; TextBeforeBattle + dw Route14AfterBattleText9 ; TextAfterBattle + dw Route14EndBattleText9 ; TextEndBattle + dw Route14EndBattleText9 ; TextEndBattle Route14TrainerHeader9: ; 55a6e (15:5a6e) db $a ; flag's bit db ($4 << 4) ; trainer's view range dw wd7db ; flag's byte - dw Route14BattleText10 ; 0x5b66 TextBeforeBattle - dw Route14AfterBattleText10 ; 0x5b70 TextAfterBattle - dw Route14EndBattleText10 ; 0x5b6b TextEndBattle - dw Route14EndBattleText10 ; 0x5b6b TextEndBattle + dw Route14BattleText10 ; TextBeforeBattle + dw Route14AfterBattleText10 ; TextAfterBattle + dw Route14EndBattleText10 ; TextEndBattle + dw Route14EndBattleText10 ; TextEndBattle db $ff diff --git a/scripts/route15.asm b/scripts/route15.asm index 733d4a1c..8b2c38ec 100755 --- a/scripts/route15.asm +++ b/scripts/route15.asm @@ -31,143 +31,143 @@ Route15TrainerHeader0: ; 597df (16:57df) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText1 ; 0x5898 TextBeforeBattle - dw Route15AfterBattleText1 ; 0x58a2 TextAfterBattle - dw Route15EndBattleText1 ; 0x589d TextEndBattle - dw Route15EndBattleText1 ; 0x589d TextEndBattle + dw Route15BattleText1 ; TextBeforeBattle + dw Route15AfterBattleText1 ; TextAfterBattle + dw Route15EndBattleText1 ; TextEndBattle + dw Route15EndBattleText1 ; TextEndBattle Route15TrainerHeader1: ; 597eb (16:57eb) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText2 ; 0x58a7 TextBeforeBattle - dw Route15AfterBattleText2 ; 0x58b1 TextAfterBattle - dw Route15EndBattleText2 ; 0x58ac TextEndBattle - dw Route15EndBattleText2 ; 0x58ac TextEndBattle + dw Route15BattleText2 ; TextBeforeBattle + dw Route15AfterBattleText2 ; TextAfterBattle + dw Route15EndBattleText2 ; TextEndBattle + dw Route15EndBattleText2 ; TextEndBattle Route15TrainerHeader2: ; 597f7 (16:57f7) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText3 ; 0x58b6 TextBeforeBattle - dw Route15AfterBattleText3 ; 0x58c0 TextAfterBattle - dw Route15EndBattleText3 ; 0x58bb TextEndBattle - dw Route15EndBattleText3 ; 0x58bb TextEndBattle + dw Route15BattleText3 ; TextBeforeBattle + dw Route15AfterBattleText3 ; TextAfterBattle + dw Route15EndBattleText3 ; TextEndBattle + dw Route15EndBattleText3 ; TextEndBattle Route15TrainerHeader3: ; 59803 (16:5803) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText4 ; 0x58c5 TextBeforeBattle - dw Route15AfterBattleText4 ; 0x58cf TextAfterBattle - dw Route15EndBattleText4 ; 0x58ca TextEndBattle - dw Route15EndBattleText4 ; 0x58ca TextEndBattle + dw Route15BattleText4 ; TextBeforeBattle + dw Route15AfterBattleText4 ; TextAfterBattle + dw Route15EndBattleText4 ; TextEndBattle + dw Route15EndBattleText4 ; TextEndBattle Route15TrainerHeader4: ; 5980f (16:580f) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText5 ; 0x58d4 TextBeforeBattle - dw Route15AfterBattleText5 ; 0x58de TextAfterBattle - dw Route15EndBattleText5 ; 0x58d9 TextEndBattle - dw Route15EndBattleText5 ; 0x58d9 TextEndBattle + dw Route15BattleText5 ; TextBeforeBattle + dw Route15AfterBattleText5 ; TextAfterBattle + dw Route15EndBattleText5 ; TextEndBattle + dw Route15EndBattleText5 ; TextEndBattle Route15TrainerHeader5: ; 5981b (16:581b) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText6 ; 0x58e3 TextBeforeBattle - dw Route15AfterBattleText6 ; 0x58ed TextAfterBattle - dw Route15EndBattleText6 ; 0x58e8 TextEndBattle - dw Route15EndBattleText6 ; 0x58e8 TextEndBattle + dw Route15BattleText6 ; TextBeforeBattle + dw Route15AfterBattleText6 ; TextAfterBattle + dw Route15EndBattleText6 ; TextEndBattle + dw Route15EndBattleText6 ; TextEndBattle Route15TrainerHeader6: ; 59827 (16:5827) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText7 ; 0x58f2 TextBeforeBattle - dw Route15AfterBattleText7 ; 0x58fc TextAfterBattle - dw Route15EndBattleText7 ; 0x58f7 TextEndBattle - dw Route15EndBattleText7 ; 0x58f7 TextEndBattle + dw Route15BattleText7 ; TextBeforeBattle + dw Route15AfterBattleText7 ; TextAfterBattle + dw Route15EndBattleText7 ; TextEndBattle + dw Route15EndBattleText7 ; TextEndBattle Route15TrainerHeader7: ; 59833 (16:5833) db $8 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText8 ; 0x5901 TextBeforeBattle - dw Route15AfterBattleText8 ; 0x590b TextAfterBattle - dw Route15EndBattleText8 ; 0x5906 TextEndBattle - dw Route15EndBattleText8 ; 0x5906 TextEndBattle + dw Route15BattleText8 ; TextBeforeBattle + dw Route15AfterBattleText8 ; TextAfterBattle + dw Route15EndBattleText8 ; TextEndBattle + dw Route15EndBattleText8 ; TextEndBattle Route15TrainerHeader8: ; 5983f (16:583f) db $9 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText9 ; 0x5910 TextBeforeBattle - dw Route15AfterBattleText9 ; 0x591a TextAfterBattle - dw Route15EndBattleText9 ; 0x5915 TextEndBattle - dw Route15EndBattleText9 ; 0x5915 TextEndBattle + dw Route15BattleText9 ; TextBeforeBattle + dw Route15AfterBattleText9 ; TextAfterBattle + dw Route15EndBattleText9 ; TextEndBattle + dw Route15EndBattleText9 ; TextEndBattle Route15TrainerHeader9: ; 5984b (16:584b) db $a ; flag's bit db ($3 << 4) ; trainer's view range dw wd7dd ; flag's byte - dw Route15BattleText10 ; 0x591f TextBeforeBattle - dw Route15AfterBattleText10 ; 0x5929 TextAfterBattle - dw Route15EndBattleText10 ; 0x5924 TextEndBattle - dw Route15EndBattleText10 ; 0x5924 TextEndBattle + dw Route15BattleText10 ; TextBeforeBattle + dw Route15AfterBattleText10 ; TextAfterBattle + dw Route15EndBattleText10 ; TextEndBattle + dw Route15EndBattleText10 ; TextEndBattle db $ff Route15Text1: ; 59858 (16:5858) db $8 ; asm ld hl, Route15TrainerHeader0 - jr asm_33cb7 ; 0x5985c $34 + jr Route15TalkToTrainer Route15Text2: ; 5985e (16:585e) db $8 ; asm ld hl, Route15TrainerHeader1 - jr asm_33cb7 ; 0x59862 $2e + jr Route15TalkToTrainer Route15Text3: ; 59864 (16:5864) db $8 ; asm ld hl, Route15TrainerHeader2 - jr asm_33cb7 ; 0x59868 $28 + jr Route15TalkToTrainer Route15Text4: ; 5986a (16:586a) db $8 ; asm ld hl, Route15TrainerHeader3 - jr asm_33cb7 ; 0x5986e $22 + jr Route15TalkToTrainer Route15Text5: ; 59870 (16:5870) db $8 ; asm ld hl, Route15TrainerHeader4 - jr asm_33cb7 ; 0x59874 $1c + jr Route15TalkToTrainer Route15Text6: ; 59876 (16:5876) db $8 ; asm ld hl, Route15TrainerHeader5 - jr asm_33cb7 ; 0x5987a $16 + jr Route15TalkToTrainer Route15Text7: ; 5987c (16:587c) db $8 ; asm ld hl, Route15TrainerHeader6 - jr asm_33cb7 ; 0x59880 $10 + jr Route15TalkToTrainer Route15Text8: ; 59882 (16:5882) db $8 ; asm ld hl, Route15TrainerHeader7 - jr asm_33cb7 ; 0x59886 $a + jr Route15TalkToTrainer Route15Text9: ; 59888 (16:5888) db $8 ; asm ld hl, Route15TrainerHeader8 - jr asm_33cb7 ; 0x5988c $4 + jr Route15TalkToTrainer Route15Text10: ; 5988e (16:588e) db $8 ; asm ld hl, Route15TrainerHeader9 -asm_33cb7: ; 59892 (16:5892) +Route15TalkToTrainer: ; 59892 (16:5892) call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index 2d328122..1e581cc3 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -9,7 +9,7 @@ Route15GateUpstairsText1: ; 49651 (12:5651) db $8 ld a, [wd7dd] bit 0, a - jr nz, .asm_49683 ; 0x49657 $2a + jr nz, .asm_49683 ld a, 50 ; pokemon needed ld [$ffdb], a ld a, EXP__ALL ; oak's aide reward @@ -23,7 +23,7 @@ Route15GateUpstairsText1: ; 49651 (12:5651) predef OaksAideScript ; call oak's aide script ld a, [$ffdb] cp $1 - jr nz, .asm_49689 ; 0x4967c $b + jr nz, .asm_49689 ld hl, wd7dd set 0, [hl] .asm_49683 diff --git a/scripts/route16.asm b/scripts/route16.asm index ef5b5859..6091e416 100755 --- a/scripts/route16.asm +++ b/scripts/route16.asm @@ -28,12 +28,12 @@ Route16Script0: ; 59959 (16:5959) res 0, [hl] jp z, CheckFightingMapTrainers ld a, $a - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, SNORLAX - ld [W_CUROPPONENT], a ; wd059 + ld [W_CUROPPONENT], a ld a, 30 - ld [W_CURENEMYLVL], a ; W_CURENEMYLVL + ld [W_CURENEMYLVL], a ld a, HS_ROUTE_16_SNORLAX ld [wcc4d], a predef HideObject @@ -44,7 +44,7 @@ Route16Script0: ; 59959 (16:5959) ret Route16Script3: ; 5998f (16:598f) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, Route16Script_59946 call UpdateSprites @@ -52,7 +52,7 @@ Route16Script3: ; 5998f (16:598f) cp $2 jr z, .asm_599a8 ld a, $b - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_599a8 ld hl, wd7e0 @@ -81,55 +81,55 @@ Route16TrainerHeader0: ; 599cf (16:59cf) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7df ; flag's byte - dw Route16BattleText1 ; 0x5a22 TextBeforeBattle - dw Route16AfterBattleText1 ; 0x5a2c TextAfterBattle - dw Route16EndBattleText1 ; 0x5a27 TextEndBattle - dw Route16EndBattleText1 ; 0x5a27 TextEndBattle + dw Route16BattleText1 ; TextBeforeBattle + dw Route16AfterBattleText1 ; TextAfterBattle + dw Route16EndBattleText1 ; TextEndBattle + dw Route16EndBattleText1 ; TextEndBattle Route16TrainerHeader1: ; 599db (16:59db) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7df ; flag's byte - dw Route16BattleText2 ; 0x5a3b TextBeforeBattle - dw Route16AfterBattleText2 ; 0x5a45 TextAfterBattle - dw Route16EndBattleText2 ; 0x5a40 TextEndBattle - dw Route16EndBattleText2 ; 0x5a40 TextEndBattle + dw Route16BattleText2 ; TextBeforeBattle + dw Route16AfterBattleText2 ; TextAfterBattle + dw Route16EndBattleText2 ; TextEndBattle + dw Route16EndBattleText2 ; TextEndBattle Route16TrainerHeader2: ; 599e7 (16:59e7) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7df ; flag's byte - dw Route16BattleText3 ; 0x5a54 TextBeforeBattle - dw Route16AfterBattleText3 ; 0x5a5e TextAfterBattle - dw Route16EndBattleText3 ; 0x5a59 TextEndBattle - dw Route16EndBattleText3 ; 0x5a59 TextEndBattle + dw Route16BattleText3 ; TextBeforeBattle + dw Route16AfterBattleText3 ; TextAfterBattle + dw Route16EndBattleText3 ; TextEndBattle + dw Route16EndBattleText3 ; TextEndBattle Route16TrainerHeader3: ; 599f3 (16:59f3) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7df ; flag's byte - dw Route16BattleText4 ; 0x5a6d TextBeforeBattle - dw Route16AfterBattleText4 ; 0x5a77 TextAfterBattle - dw Route16EndBattleText4 ; 0x5a72 TextEndBattle - dw Route16EndBattleText4 ; 0x5a72 TextEndBattle + dw Route16BattleText4 ; TextBeforeBattle + dw Route16AfterBattleText4 ; TextAfterBattle + dw Route16EndBattleText4 ; TextEndBattle + dw Route16EndBattleText4 ; TextEndBattle Route16TrainerHeader4: ; 599ff (16:59ff) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7df ; flag's byte - dw Route16BattleText5 ; 0x5a86 TextBeforeBattle - dw Route16AfterBattleText5 ; 0x5a90 TextAfterBattle - dw Route16EndBattleText5 ; 0x5a8b TextEndBattle - dw Route16EndBattleText5 ; 0x5a8b TextEndBattle + dw Route16BattleText5 ; TextBeforeBattle + dw Route16AfterBattleText5 ; TextAfterBattle + dw Route16EndBattleText5 ; TextEndBattle + dw Route16EndBattleText5 ; TextEndBattle Route16TrainerHeader5: ; 59a0b (16:5a0b) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7df ; flag's byte - dw Route16BattleText6 ; 0x5a9f TextBeforeBattle - dw Route16AfterBattleText6 ; 0x5aa9 TextAfterBattle - dw Route16EndBattleText6 ; 0x5aa4 TextEndBattle - dw Route16EndBattleText6 ; 0x5aa4 TextEndBattle + dw Route16BattleText6 ; TextBeforeBattle + dw Route16AfterBattleText6 ; TextAfterBattle + dw Route16EndBattleText6 ; TextEndBattle + dw Route16EndBattleText6 ; TextEndBattle db $ff diff --git a/scripts/route16gate.asm b/scripts/route16gate.asm index 54bca413..f631d0ec 100755 --- a/scripts/route16gate.asm +++ b/scripts/route16gate.asm @@ -25,7 +25,7 @@ Route16GateScript0: ; 496d7 (12:56d7) ld [hJoyHeld], a ld a, [wWhichTrade] cp $1 - jr z, .asm_4970e ; 0x496f1 $1b + jr z, .asm_4970e ld a, [wWhichTrade] dec a ld [wSimulatedJoypadStatesIndex], a @@ -94,14 +94,14 @@ Route16GateTextPointers: ; 4975a (12:575a) Route16GateText1: ; 49760 (12:5760) db $08 ; asm call Route16GateScript_49755 - jr z, .asm_0bdf3 ; 0x49764 + jr z, .asm_0bdf3 ld hl, Route16GateText_4977c call PrintText - jr .asm_56c9d ; 0x4976c -.asm_0bdf3 ; 0x4976e + jr .asm_56c9d +.asm_0bdf3 ld hl, Route16GateText_49777 call PrintText -.asm_56c9d ; 0x49774 +.asm_56c9d jp TextScriptEnd Route16GateText_49777: ; 49777 (12:5777) diff --git a/scripts/route16gateupstairs.asm b/scripts/route16gateupstairs.asm index c9996dcd..0515e8d9 100755 --- a/scripts/route16gateupstairs.asm +++ b/scripts/route16gateupstairs.asm @@ -38,7 +38,7 @@ Route16GateUpstairsText_4983b: ; 4983b (12:583b) Route16GateUpstairsText4: ; 49840 (12:5840) db $8 - ld hl, Route16GateUpstairsText_49847 ; $5847 + ld hl, Route16GateUpstairsText_49847 jp Route12GateUpstairsScript_495c9 Route16GateUpstairsText_49847: ; 49847 (12:5847) diff --git a/scripts/route16house.asm b/scripts/route16house.asm index 9a189757..a3d61281 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -10,7 +10,7 @@ Route16HouseText1: ; 1e5ff (7:65ff) ld a, [wd7e0] bit 6, a ld hl, HM02ExplanationText - jr nz, .asm_13616 ; 0x1e608 + jr nz, .asm_13616 ld hl, Route16HouseText3 call PrintText ld bc, (HM_02 << 8) | 1 @@ -19,10 +19,10 @@ Route16HouseText1: ; 1e5ff (7:65ff) ld hl, wd7e0 set 6, [hl] ld hl, ReceivedHM02Text - jr .asm_13616 ; 0x1e620 + jr .asm_13616 .BagFull ld hl, HM02NoRoomText -.asm_13616 ; 0x1e625 +.asm_13616 call PrintText jp TextScriptEnd diff --git a/scripts/route17.asm b/scripts/route17.asm index ffd00634..f528f0d6 100755 --- a/scripts/route17.asm +++ b/scripts/route17.asm @@ -35,91 +35,91 @@ Route17TrainerHeader0: ; 55bb3 (15:5bb3) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText1 ; 0x5c36 TextBeforeBattle - dw Route17AfterBattleText1 ; 0x5c40 TextAfterBattle - dw Route17EndBattleText1 ; 0x5c3b TextEndBattle - dw Route17EndBattleText1 ; 0x5c3b TextEndBattle + dw Route17BattleText1 ; TextBeforeBattle + dw Route17AfterBattleText1 ; TextAfterBattle + dw Route17EndBattleText1 ; TextEndBattle + dw Route17EndBattleText1 ; TextEndBattle Route17TrainerHeader1: ; 55bbf (15:5bbf) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText2 ; 0x5c4f TextBeforeBattle - dw Route17AfterBattleText2 ; 0x5c59 TextAfterBattle - dw Route17EndBattleText2 ; 0x5c54 TextEndBattle - dw Route17EndBattleText2 ; 0x5c54 TextEndBattle + dw Route17BattleText2 ; TextBeforeBattle + dw Route17AfterBattleText2 ; TextAfterBattle + dw Route17EndBattleText2 ; TextEndBattle + dw Route17EndBattleText2 ; TextEndBattle Route17TrainerHeader2: ; 55bcb (15:5bcb) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText3 ; 0x5c68 TextBeforeBattle - dw Route17AfterBattleText3 ; 0x5c72 TextAfterBattle - dw Route17EndBattleText3 ; 0x5c6d TextEndBattle - dw Route17EndBattleText3 ; 0x5c6d TextEndBattle + dw Route17BattleText3 ; TextBeforeBattle + dw Route17AfterBattleText3 ; TextAfterBattle + dw Route17EndBattleText3 ; TextEndBattle + dw Route17EndBattleText3 ; TextEndBattle Route17TrainerHeader3: ; 55bd7 (15:5bd7) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText4 ; 0x5c81 TextBeforeBattle - dw Route17AfterBattleText4 ; 0x5c8b TextAfterBattle - dw Route17EndBattleText4 ; 0x5c86 TextEndBattle - dw Route17EndBattleText4 ; 0x5c86 TextEndBattle + dw Route17BattleText4 ; TextBeforeBattle + dw Route17AfterBattleText4 ; TextAfterBattle + dw Route17EndBattleText4 ; TextEndBattle + dw Route17EndBattleText4 ; TextEndBattle Route17TrainerHeader4: ; 55be3 (15:5be3) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText5 ; 0x5c9a TextBeforeBattle - dw Route17AfterBattleText5 ; 0x5ca4 TextAfterBattle - dw Route17EndBattleText5 ; 0x5c9f TextEndBattle - dw Route17EndBattleText5 ; 0x5c9f TextEndBattle + dw Route17BattleText5 ; TextBeforeBattle + dw Route17AfterBattleText5 ; TextAfterBattle + dw Route17EndBattleText5 ; TextEndBattle + dw Route17EndBattleText5 ; TextEndBattle Route17TrainerHeader5: ; 55bef (15:5bef) db $6 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText6 ; 0x5cb3 TextBeforeBattle - dw Route17AfterBattleText6 ; 0x5cbd TextAfterBattle - dw Route17EndBattleText6 ; 0x5cb8 TextEndBattle - dw Route17EndBattleText6 ; 0x5cb8 TextEndBattle + dw Route17BattleText6 ; TextBeforeBattle + dw Route17AfterBattleText6 ; TextAfterBattle + dw Route17EndBattleText6 ; TextEndBattle + dw Route17EndBattleText6 ; TextEndBattle Route17TrainerHeader6: ; 55bfb (15:5bfb) db $7 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText7 ; 0x5ccc TextBeforeBattle - dw Route17AfterBattleText7 ; 0x5cd6 TextAfterBattle - dw Route17EndBattleText7 ; 0x5cd1 TextEndBattle - dw Route17EndBattleText7 ; 0x5cd1 TextEndBattle + dw Route17BattleText7 ; TextBeforeBattle + dw Route17AfterBattleText7 ; TextAfterBattle + dw Route17EndBattleText7 ; TextEndBattle + dw Route17EndBattleText7 ; TextEndBattle Route17TrainerHeader7: ; 55c07 (15:5c07) db $8 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText8 ; 0x5ce5 TextBeforeBattle - dw Route17AfterBattleText8 ; 0x5cef TextAfterBattle - dw Route17EndBattleText8 ; 0x5cea TextEndBattle - dw Route17EndBattleText8 ; 0x5cea TextEndBattle + dw Route17BattleText8 ; TextBeforeBattle + dw Route17AfterBattleText8 ; TextAfterBattle + dw Route17EndBattleText8 ; TextEndBattle + dw Route17EndBattleText8 ; TextEndBattle Route17TrainerHeader8: ; 55c13 (15:5c13) db $9 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText9 ; 0x5cfe TextBeforeBattle - dw Route17AfterBattleText9 ; 0x5d08 TextAfterBattle - dw Route17EndBattleText9 ; 0x5d03 TextEndBattle - dw Route17EndBattleText9 ; 0x5d03 TextEndBattle + dw Route17BattleText9 ; TextBeforeBattle + dw Route17AfterBattleText9 ; TextAfterBattle + dw Route17EndBattleText9 ; TextEndBattle + dw Route17EndBattleText9 ; TextEndBattle Route17TrainerHeader9: ; 55c1f (15:5c1f) db $a ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e1 ; flag's byte - dw Route17BattleText10 ; 0x5d17 TextBeforeBattle - dw Route17AfterBattleText10 ; 0x5d21 TextAfterBattle - dw Route17EndBattleText10 ; 0x5d1c TextEndBattle - dw Route17EndBattleText10 ; 0x5d1c TextEndBattle + dw Route17BattleText10 ; TextBeforeBattle + dw Route17AfterBattleText10 ; TextAfterBattle + dw Route17EndBattleText10 ; TextEndBattle + dw Route17EndBattleText10 ; TextEndBattle db $ff diff --git a/scripts/route18.asm b/scripts/route18.asm index de2fe19a..85c58d4c 100755 --- a/scripts/route18.asm +++ b/scripts/route18.asm @@ -24,28 +24,28 @@ Route18TrainerHeader0: ; 59aea (16:5aea) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e3 ; flag's byte - dw Route18BattleText1 ; 0x5b19 TextBeforeBattle - dw Route18AfterBattleText1 ; 0x5b23 TextAfterBattle - dw Route18EndBattleText1 ; 0x5b1e TextEndBattle - dw Route18EndBattleText1 ; 0x5b1e TextEndBattle + dw Route18BattleText1 ; TextBeforeBattle + dw Route18AfterBattleText1 ; TextAfterBattle + dw Route18EndBattleText1 ; TextEndBattle + dw Route18EndBattleText1 ; TextEndBattle Route18TrainerHeader1: ; 59af6 (16:5af6) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e3 ; flag's byte - dw Route18BattleText2 ; 0x5b32 TextBeforeBattle - dw Route18AfterBattleText2 ; 0x5b3c TextAfterBattle - dw Route18EndBattleText2 ; 0x5b37 TextEndBattle - dw Route18EndBattleText2 ; 0x5b37 TextEndBattle + dw Route18BattleText2 ; TextBeforeBattle + dw Route18AfterBattleText2 ; TextAfterBattle + dw Route18EndBattleText2 ; TextEndBattle + dw Route18EndBattleText2 ; TextEndBattle Route18TrainerHeader2: ; 59b02 (16:5b02) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e3 ; flag's byte - dw Route18BattleText3 ; 0x5b4b TextBeforeBattle - dw Route18AfterBattleText3 ; 0x5b55 TextAfterBattle - dw Route18EndBattleText3 ; 0x5b50 TextEndBattle - dw Route18EndBattleText3 ; 0x5b50 TextEndBattle + dw Route18BattleText3 ; TextBeforeBattle + dw Route18AfterBattleText3 ; TextAfterBattle + dw Route18EndBattleText3 ; TextEndBattle + dw Route18EndBattleText3 ; TextEndBattle db $ff diff --git a/scripts/route18gate.asm b/scripts/route18gate.asm index 1500f578..fae15e7b 100755 --- a/scripts/route18gate.asm +++ b/scripts/route18gate.asm @@ -25,7 +25,7 @@ Route18GateScript0: ; 4988f (12:588f) ld [hJoyHeld], a ld a, [wWhichTrade] cp $1 - jr z, .asm_498c6 ; 0x498a9 $1b + jr z, .asm_498c6 ld a, [wWhichTrade] dec a ld [wSimulatedJoypadStatesIndex], a @@ -89,14 +89,14 @@ Route18GateTextPointers: ; 4990d (12:590d) Route18GateText1: ; 49911 (12:5911) db $08 ; asm call Route16GateScript_49755 - jr z, .asm_3c84d ; 0x49915 + jr z, .asm_3c84d ld hl, Route18GateText_4992d call PrintText - jr .asm_a8410 ; 0x4991d -.asm_3c84d ; 0x4991f + jr .asm_a8410 +.asm_3c84d ld hl, Route18GateText_49928 call PrintText -.asm_a8410 ; 0x49925 +.asm_a8410 jp TextScriptEnd Route18GateText_49928: ; 49928 (12:5928) diff --git a/scripts/route18gateupstairs.asm b/scripts/route18gateupstairs.asm index aaa1b34e..8d0c3638 100755 --- a/scripts/route18gateupstairs.asm +++ b/scripts/route18gateupstairs.asm @@ -15,7 +15,7 @@ Route18GateUpstairsText1: ; 4997e (12:597e) Route18GateUpstairsText2: ; 4998c (12:598c) db $8 - ld hl, Route18GateUpstairsText_49993 ; $5993 + ld hl, Route18GateUpstairsText_49993 jp Route12GateUpstairsScript_495c9 Route18GateUpstairsText_49993: ; 49993 (12:5993) @@ -24,7 +24,7 @@ Route18GateUpstairsText_49993: ; 49993 (12:5993) Route18GateUpstairsText3: ; 49998 (12:5998) db $8 - ld hl, Route18GateUpstairsText_4999f ; $599f + ld hl, Route18GateUpstairsText_4999f jp Route12GateUpstairsScript_495c9 Route18GateUpstairsText_4999f: ; 4999f (12:599f) diff --git a/scripts/route19.asm b/scripts/route19.asm index 40c7aeb3..6f8781b3 100755 --- a/scripts/route19.asm +++ b/scripts/route19.asm @@ -30,91 +30,91 @@ Route19TrainerHeader0: ; 55d73 (15:5d73) db $1 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText1 ; 0x5e50 TextBeforeBattle - dw Route19AfterBattleText1 ; 0x5e5a TextAfterBattle - dw Route19EndBattleText1 ; 0x5e55 TextEndBattle - dw Route19EndBattleText1 ; 0x5e55 TextEndBattle + dw Route19BattleText1 ; TextBeforeBattle + dw Route19AfterBattleText1 ; TextAfterBattle + dw Route19EndBattleText1 ; TextEndBattle + dw Route19EndBattleText1 ; TextEndBattle Route19TrainerHeader1: ; 55d7f (15:5d7f) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText2 ; 0x5e5f TextBeforeBattle - dw Route19AfterBattleText2 ; 0x5e69 TextAfterBattle - dw Route19EndBattleText2 ; 0x5e64 TextEndBattle - dw Route19EndBattleText2 ; 0x5e64 TextEndBattle + dw Route19BattleText2 ; TextBeforeBattle + dw Route19AfterBattleText2 ; TextAfterBattle + dw Route19EndBattleText2 ; TextEndBattle + dw Route19EndBattleText2 ; TextEndBattle Route19TrainerHeader2: ; 55d8b (15:5d8b) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText3 ; 0x5e6e TextBeforeBattle - dw Route19AfterBattleText3 ; 0x5e78 TextAfterBattle - dw Route19EndBattleText3 ; 0x5e73 TextEndBattle - dw Route19EndBattleText3 ; 0x5e73 TextEndBattle + dw Route19BattleText3 ; TextBeforeBattle + dw Route19AfterBattleText3 ; TextAfterBattle + dw Route19EndBattleText3 ; TextEndBattle + dw Route19EndBattleText3 ; TextEndBattle Route19TrainerHeader3: ; 55d97 (15:5d97) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText4 ; 0x5e7d TextBeforeBattle - dw Route19AfterBattleText4 ; 0x5e87 TextAfterBattle - dw Route19EndBattleText4 ; 0x5e82 TextEndBattle - dw Route19EndBattleText4 ; 0x5e82 TextEndBattle + dw Route19BattleText4 ; TextBeforeBattle + dw Route19AfterBattleText4 ; TextAfterBattle + dw Route19EndBattleText4 ; TextEndBattle + dw Route19EndBattleText4 ; TextEndBattle Route19TrainerHeader4: ; 55da3 (15:5da3) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText5 ; 0x5e8c TextBeforeBattle - dw Route19AfterBattleText5 ; 0x5e96 TextAfterBattle - dw Route19EndBattleText5 ; 0x5e91 TextEndBattle - dw Route19EndBattleText5 ; 0x5e91 TextEndBattle + dw Route19BattleText5 ; TextBeforeBattle + dw Route19AfterBattleText5 ; TextAfterBattle + dw Route19EndBattleText5 ; TextEndBattle + dw Route19EndBattleText5 ; TextEndBattle Route19TrainerHeader5: ; 55daf (15:5daf) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText6 ; 0x5e9b TextBeforeBattle - dw Route19AfterBattleText6 ; 0x5ea5 TextAfterBattle - dw Route19EndBattleText6 ; 0x5ea0 TextEndBattle - dw Route19EndBattleText6 ; 0x5ea0 TextEndBattle + dw Route19BattleText6 ; TextBeforeBattle + dw Route19AfterBattleText6 ; TextAfterBattle + dw Route19EndBattleText6 ; TextEndBattle + dw Route19EndBattleText6 ; TextEndBattle Route19TrainerHeader6: ; 55dbb (15:5dbb) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText7 ; 0x5eaa TextBeforeBattle - dw Route19AfterBattleText7 ; 0x5eb4 TextAfterBattle - dw Route19EndBattleText7 ; 0x5eaf TextEndBattle - dw Route19EndBattleText7 ; 0x5eaf TextEndBattle + dw Route19BattleText7 ; TextBeforeBattle + dw Route19AfterBattleText7 ; TextAfterBattle + dw Route19EndBattleText7 ; TextEndBattle + dw Route19EndBattleText7 ; TextEndBattle Route19TrainerHeader7: ; 55dc7 (15:5dc7) db $8 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText8 ; 0x5eb9 TextBeforeBattle - dw Route19AfterBattleText8 ; 0x5ec3 TextAfterBattle - dw Route19EndBattleText8 ; 0x5ebe TextEndBattle - dw Route19EndBattleText8 ; 0x5ebe TextEndBattle + dw Route19BattleText8 ; TextBeforeBattle + dw Route19AfterBattleText8 ; TextAfterBattle + dw Route19EndBattleText8 ; TextEndBattle + dw Route19EndBattleText8 ; TextEndBattle Route19TrainerHeader8: ; 55dd3 (15:5dd3) db $9 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText9 ; 0x5ec8 TextBeforeBattle - dw Route19AfterBattleText9 ; 0x5ed2 TextAfterBattle - dw Route19EndBattleText9 ; 0x5ecd TextEndBattle - dw Route19EndBattleText9 ; 0x5ecd TextEndBattle + dw Route19BattleText9 ; TextBeforeBattle + dw Route19AfterBattleText9 ; TextAfterBattle + dw Route19EndBattleText9 ; TextEndBattle + dw Route19EndBattleText9 ; TextEndBattle Route19TrainerHeader9: ; 55ddf (15:5ddf) db $a ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e5 ; flag's byte - dw Route19BattleText10 ; 0x5ed7 TextBeforeBattle - dw Route19AfterBattleText10 ; 0x5ee1 TextAfterBattle - dw Route19EndBattleText10 ; 0x5edc TextEndBattle - dw Route19EndBattleText10 ; 0x5edc TextEndBattle + dw Route19BattleText10 ; TextBeforeBattle + dw Route19AfterBattleText10 ; TextAfterBattle + dw Route19EndBattleText10 ; TextEndBattle + dw Route19EndBattleText10 ; TextEndBattle db $ff diff --git a/scripts/route20.asm b/scripts/route20.asm index 4ef57e23..0f8b9eae 100755 --- a/scripts/route20.asm +++ b/scripts/route20.asm @@ -4,7 +4,7 @@ Route20Script: ; 50ca9 (14:4ca9) res 0, [hl] call nz, Route20Script_50cc6 call EnableAutoTextBoxDrawing - ld hl, Route20TrainerHeader0 ; $4d3a + ld hl, Route20TrainerHeader0 ld de, Route20ScriptPointers ld a, [W_ROUTE20CURSCRIPT] call ExecuteCurMapScriptInTable @@ -16,11 +16,11 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) and $3 cp $3 jr z, .asm_50cef - ld a, $d7 + ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 call Route20Script_50d0c - ld a, $d8 + ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_2 call Route20Script_50d0c - ld hl, .MissableObjectIDs ; $4ce8 + ld hl, .MissableObjectIDs .asm_50cdc ld a, [hli] cp $ff @@ -86,91 +86,91 @@ Route20TrainerHeader0: ; 50d3a (14:4d3a) db $1 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText1 ; 0x4e17 TextBeforeBattle - dw Route20AfterBattleText1 ; 0x4e21 TextAfterBattle - dw Route20EndBattleText1 ; 0x4e1c TextEndBattle - dw Route20EndBattleText1 ; 0x4e1c TextEndBattle + dw Route20BattleText1 ; TextBeforeBattle + dw Route20AfterBattleText1 ; TextAfterBattle + dw Route20EndBattleText1 ; TextEndBattle + dw Route20EndBattleText1 ; TextEndBattle Route20TrainerHeader2: ; 50d46 (14:4d46) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText2 ; 0x4e26 TextBeforeBattle - dw Route20AfterBattleText2 ; 0x4e30 TextAfterBattle - dw Route20EndBattleText2 ; 0x4e2b TextEndBattle - dw Route20EndBattleText2 ; 0x4e2b TextEndBattle + dw Route20BattleText2 ; TextBeforeBattle + dw Route20AfterBattleText2 ; TextAfterBattle + dw Route20EndBattleText2 ; TextEndBattle + dw Route20EndBattleText2 ; TextEndBattle Route20TrainerHeader3: ; 50d52 (14:4d52) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText3 ; 0x4e35 TextBeforeBattle - dw Route20AfterBattleText3 ; 0x4e3f TextAfterBattle - dw Route20EndBattleText3 ; 0x4e3a TextEndBattle - dw Route20EndBattleText3 ; 0x4e3a TextEndBattle + dw Route20BattleText3 ; TextBeforeBattle + dw Route20AfterBattleText3 ; TextAfterBattle + dw Route20EndBattleText3 ; TextEndBattle + dw Route20EndBattleText3 ; TextEndBattle Route20TrainerHeader4: ; 50d5e (14:4d5e) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText4 ; 0x4e44 TextBeforeBattle - dw Route20AfterBattleText4 ; 0x4e4e TextAfterBattle - dw Route20EndBattleText4 ; 0x4e49 TextEndBattle - dw Route20EndBattleText4 ; 0x4e49 TextEndBattle + dw Route20BattleText4 ; TextBeforeBattle + dw Route20AfterBattleText4 ; TextAfterBattle + dw Route20EndBattleText4 ; TextEndBattle + dw Route20EndBattleText4 ; TextEndBattle Route20TrainerHeader5: ; 50d6a (14:4d6a) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText5 ; 0x4e53 TextBeforeBattle - dw Route20AfterBattleText5 ; 0x4e5d TextAfterBattle - dw Route20EndBattleText5 ; 0x4e58 TextEndBattle - dw Route20EndBattleText5 ; 0x4e58 TextEndBattle + dw Route20BattleText5 ; TextBeforeBattle + dw Route20AfterBattleText5 ; TextAfterBattle + dw Route20EndBattleText5 ; TextEndBattle + dw Route20EndBattleText5 ; TextEndBattle Route20TrainerHeader6: ; 50d76 (14:4d76) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText6 ; 0x4e62 TextBeforeBattle - dw Route20AfterBattleText6 ; 0x4e6c TextAfterBattle - dw Route20EndBattleText6 ; 0x4e67 TextEndBattle - dw Route20EndBattleText6 ; 0x4e67 TextEndBattle + dw Route20BattleText6 ; TextBeforeBattle + dw Route20AfterBattleText6 ; TextAfterBattle + dw Route20EndBattleText6 ; TextEndBattle + dw Route20EndBattleText6 ; TextEndBattle Route20TrainerHeader7: ; 50d82 (14:4d82) db $7 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText7 ; 0x4e71 TextBeforeBattle - dw Route20AfterBattleText7 ; 0x4e7b TextAfterBattle - dw Route20EndBattleText7 ; 0x4e76 TextEndBattle - dw Route20EndBattleText7 ; 0x4e76 TextEndBattle + dw Route20BattleText7 ; TextBeforeBattle + dw Route20AfterBattleText7 ; TextAfterBattle + dw Route20EndBattleText7 ; TextEndBattle + dw Route20EndBattleText7 ; TextEndBattle Route20TrainerHeader8: ; 50d8e (14:4d8e) db $8 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText8 ; 0x4e80 TextBeforeBattle - dw Route20AfterBattleText8 ; 0x4e8a TextAfterBattle - dw Route20EndBattleText8 ; 0x4e85 TextEndBattle - dw Route20EndBattleText8 ; 0x4e85 TextEndBattle + dw Route20BattleText8 ; TextBeforeBattle + dw Route20AfterBattleText8 ; TextAfterBattle + dw Route20EndBattleText8 ; TextEndBattle + dw Route20EndBattleText8 ; TextEndBattle Route20TrainerHeader9: ; 50d9a (14:4d9a) db $9 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText9 ; 0x4e8f TextBeforeBattle - dw Route20AfterBattleText9 ; 0x4e99 TextAfterBattle - dw Route20EndBattleText9 ; 0x4e94 TextEndBattle - dw Route20EndBattleText9 ; 0x4e94 TextEndBattle + dw Route20BattleText9 ; TextBeforeBattle + dw Route20AfterBattleText9 ; TextAfterBattle + dw Route20EndBattleText9 ; TextEndBattle + dw Route20EndBattleText9 ; TextEndBattle Route20TrainerHeader10: ; 50da6 (14:4da6) db $a ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e7 ; flag's byte - dw Route20BattleText10 ; 0x4e9e TextBeforeBattle - dw Route20AfterBattleText10 ; 0x4ea8 TextAfterBattle - dw Route20EndBattleText10 ; 0x4ea3 TextEndBattle - dw Route20EndBattleText10 ; 0x4ea3 TextEndBattle + dw Route20BattleText10 ; TextBeforeBattle + dw Route20AfterBattleText10 ; TextAfterBattle + dw Route20EndBattleText10 ; TextEndBattle + dw Route20EndBattleText10 ; TextEndBattle db $ff diff --git a/scripts/route21.asm b/scripts/route21.asm index de2046dc..d98c38c4 100755 --- a/scripts/route21.asm +++ b/scripts/route21.asm @@ -28,82 +28,82 @@ Route21TrainerHeader0: ; 55f16 (15:5f16) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText1 ; 0x5fdd TextBeforeBattle - dw Route21AfterBattleText1 ; 0x5fe7 TextAfterBattle - dw Route21EndBattleText1 ; 0x5fe2 TextEndBattle - dw Route21EndBattleText1 ; 0x5fe2 TextEndBattle + dw Route21BattleText1 ; TextBeforeBattle + dw Route21AfterBattleText1 ; TextAfterBattle + dw Route21EndBattleText1 ; TextEndBattle + dw Route21EndBattleText1 ; TextEndBattle Route21TrainerHeader1: ; 55f22 (15:5f22) db $2 ; flag's bit db ($0 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText2 ; 0x5fec TextBeforeBattle - dw Route21AfterBattleText2 ; 0x5ff6 TextAfterBattle - dw Route21EndBattleText2 ; 0x5ff1 TextEndBattle - dw Route21EndBattleText2 ; 0x5ff1 TextEndBattle + dw Route21BattleText2 ; TextBeforeBattle + dw Route21AfterBattleText2 ; TextAfterBattle + dw Route21EndBattleText2 ; TextEndBattle + dw Route21EndBattleText2 ; TextEndBattle Route21TrainerHeader2: ; 55f2e (15:5f2e) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText3 ; 0x5ffb TextBeforeBattle - dw Route21AfterBattleText3 ; 0x6005 TextAfterBattle - dw Route21EndBattleText3 ; 0x6000 TextEndBattle - dw Route21EndBattleText3 ; 0x6000 TextEndBattle + dw Route21BattleText3 ; TextBeforeBattle + dw Route21AfterBattleText3 ; TextAfterBattle + dw Route21EndBattleText3 ; TextEndBattle + dw Route21EndBattleText3 ; TextEndBattle Route21TrainerHeader3: ; 55f3a (15:5f3a) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText4 ; 0x600a TextBeforeBattle - dw Route21AfterBattleText4 ; 0x6014 TextAfterBattle - dw Route21EndBattleText4 ; 0x600f TextEndBattle - dw Route21EndBattleText4 ; 0x600f TextEndBattle + dw Route21BattleText4 ; TextBeforeBattle + dw Route21AfterBattleText4 ; TextAfterBattle + dw Route21EndBattleText4 ; TextEndBattle + dw Route21EndBattleText4 ; TextEndBattle Route21TrainerHeader4: ; 55f46 (15:5f46) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText5 ; 0x6019 TextBeforeBattle - dw Route21AfterBattleText5 ; 0x6023 TextAfterBattle - dw Route21EndBattleText5 ; 0x601e TextEndBattle - dw Route21EndBattleText5 ; 0x601e TextEndBattle + dw Route21BattleText5 ; TextBeforeBattle + dw Route21AfterBattleText5 ; TextAfterBattle + dw Route21EndBattleText5 ; TextEndBattle + dw Route21EndBattleText5 ; TextEndBattle Route21TrainerHeader5: ; 55f52 (15:5f52) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText6 ; 0x6028 TextBeforeBattle - dw Route21AfterBattleText6 ; 0x6032 TextAfterBattle - dw Route21EndBattleText6 ; 0x602d TextEndBattle - dw Route21EndBattleText6 ; 0x602d TextEndBattle + dw Route21BattleText6 ; TextBeforeBattle + dw Route21AfterBattleText6 ; TextAfterBattle + dw Route21EndBattleText6 ; TextEndBattle + dw Route21EndBattleText6 ; TextEndBattle Route21TrainerHeader6: ; 55f5e (15:5f5e) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText7 ; 0x6037 TextBeforeBattle - dw Route21AfterBattleText7 ; 0x6041 TextAfterBattle - dw Route21EndBattleText7 ; 0x603c TextEndBattle - dw Route21EndBattleText7 ; 0x603c TextEndBattle + dw Route21BattleText7 ; TextBeforeBattle + dw Route21AfterBattleText7 ; TextAfterBattle + dw Route21EndBattleText7 ; TextEndBattle + dw Route21EndBattleText7 ; TextEndBattle Route21TrainerHeader7: ; 55f6a (15:5f6a) db $8 ; flag's bit db ($0 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText8 ; 0x6046 TextBeforeBattle - dw Route21AfterBattleText8 ; 0x6050 TextAfterBattle - dw Route21EndBattleText8 ; 0x604b TextEndBattle - dw Route21EndBattleText8 ; 0x604b TextEndBattle + dw Route21BattleText8 ; TextBeforeBattle + dw Route21AfterBattleText8 ; TextAfterBattle + dw Route21EndBattleText8 ; TextEndBattle + dw Route21EndBattleText8 ; TextEndBattle Route21TrainerHeader8: ; 55f76 (15:5f76) db $9 ; flag's bit db ($0 << 4) ; trainer's view range dw wd7e9 ; flag's byte - dw Route21BattleText9 ; 0x6055 TextBeforeBattle - dw Route21AfterBattleText9 ; 0x605f TextAfterBattle - dw Route21EndBattleText9 ; 0x605a TextEndBattle - dw Route21EndBattleText9 ; 0x605a TextEndBattle + dw Route21BattleText9 ; TextBeforeBattle + dw Route21AfterBattleText9 ; TextAfterBattle + dw Route21EndBattleText9 ; TextEndBattle + dw Route21EndBattleText9 ; TextEndBattle db $ff diff --git a/scripts/route22.asm b/scripts/route22.asm index 9181380a..66df3bb2 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -22,7 +22,7 @@ Route22Script7: ; 50ed5 (14:4ed5) ret Route22Script_50ed6: ; 50ed6 (14:4ed6) - ld a, [W_RIVALSTARTER] ; wd715 + ld a, [W_RIVALSTARTER] ld b, a .asm_50eda ld a, [hli] @@ -32,11 +32,11 @@ Route22Script_50ed6: ; 50ed6 (14:4ed6) jr .asm_50eda .asm_50ee1 ld a, [hl] - ld [W_TRAINERNO], a ; wd05d + ld [W_TRAINERNO], a ret Route22MoveRivalSprite: ; 50ee6 (14:4ee6) - ld de, Route22RivalMovementData ; $4efb + ld de, Route22RivalMovementData ld a, [wcf0d] cp $1 jr z, .asm_50ef1 @@ -54,7 +54,7 @@ Route22Script0: ; 50f00 (14:4f00) ld a, [wd7eb] bit 7, a ret z - ld hl, .Route22RivalBattleCoords ; $4f2d + ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray ret nc ld a, [wWhichTrade] @@ -67,7 +67,7 @@ Route22Script0: ; 50f00 (14:4f00) ld [wd528], a ld a, [wd7eb] bit 0, a ; is this the rival battle at the beginning of the game? - jr nz, .firstRivalBattle ; 0x50f25 $b + jr nz, .firstRivalBattle bit 1, a ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret @@ -85,7 +85,7 @@ Route22Script0: ; 50f00 (14:4f00) predef EmotionBubble ld a, [wWalkBikeSurfState] and a - jr z, .asm_50f4e ; 0x50f44 $8 + jr z, .asm_50f4e ld a, $ff ld [wc0ee], a call PlaySound @@ -106,11 +106,11 @@ Route22Script1: ; 50f62 (14:4f62) ret nz ld a, [wcf0d] cp $1 - jr nz, .asm_50f78 ; 0x50f6d $9 + jr nz, .asm_50f78 ld a, $4 ld [wd528], a ld a, $4 - jr .asm_50f7a ; 0x50f76 $2 + jr .asm_50f7a .asm_50f78 ld a, $c .asm_50f7a @@ -131,7 +131,7 @@ Route22Script1: ; 50f62 (14:4f62) call SaveEndBattleTextPointers ld a, SONY1 + $c8 ld [W_CUROPPONENT], a - ld hl, StarterMons_50faf ; $4faf + ld hl, StarterMons_50faf call Route22Script_50ed6 ld a, $2 ld [W_ROUTE22CURSCRIPT], a @@ -149,9 +149,9 @@ Route22Script2: ; 50fb5 (14:4fb5) jp z, Route22Script_50ece ld a, [wSpriteStateData1 + 9] and a - jr nz, .asm_50fc7 ; 0x50fc1 $4 + jr nz, .asm_50fc7 ld a, $4 - jr .asm_50fc9 ; 0x50fc5 $2 + jr .asm_50fc9 .asm_50fc7 ld a, $c .asm_50fc9 @@ -172,9 +172,9 @@ Route22Script2: ; 50fb5 (14:4fb5) callba Music_RivalAlternateStart ld a, [wcf0d] cp $1 - jr nz, .asm_50fff ; 0x50ff8 $5 + jr nz, .asm_50fff call Route22Script_51008 - jr .asm_51002 ; 0x50ffd $3 + jr .asm_51002 .asm_50fff call Route22Script_5100d .asm_51002 @@ -183,12 +183,12 @@ Route22Script2: ; 50fb5 (14:4fb5) ret Route22Script_51008: ; 51008 (14:5008) - ld de, Route22RivalExitMovementData1 ; $5017 - jr asm_51010 + ld de, Route22RivalExitMovementData1 + jr Route22MoveRival1 Route22Script_5100d: ; 5100d (14:500d) - ld de, Route22RivalExitMovementData2 ; $501f -asm_51010 + ld de, Route22RivalExitMovementData2 +Route22MoveRival1: ; 51010 (14:5010) ld a, $1 ld [H_SPRITEHEIGHT], a jp MoveSprite @@ -234,7 +234,7 @@ Route22Script_5104e: ; 5104e (14:504e) call PlaySound callba Music_RivalAlternateTempo ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call Route22MoveRivalSprite ld a, $4 ld [W_ROUTE22CURSCRIPT], a @@ -245,7 +245,7 @@ Route22Script4: ; 51087 (14:5087) bit 0, a ret nz ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a ld a, [wcf0d] cp $1 jr nz, .asm_510a1 @@ -263,17 +263,17 @@ Route22Script4: ; 51087 (14:5087) xor a ld [wJoyIgnore], a ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd72d set 6, [hl] set 7, [hl] - ld hl, Route22RivalDefeatedText2 ; $51cb - ld de, Route22Text_511d0 ; $51d0 + ld hl, Route22RivalDefeatedText2 + ld de, Route22Text_511d0 call SaveEndBattleTextPointers ld a, SONY2 + $c8 - ld [W_CUROPPONENT], a ; wd059 - ld hl, StarterMons_510d9 ; $50d9 + ld [W_CUROPPONENT], a + ld hl, StarterMons_510d9 call Route22Script_50ed6 ld a, $5 ld [W_ROUTE22CURSCRIPT], a @@ -285,11 +285,11 @@ StarterMons_510d9: ; 510d9 (14:50d9) db STARTER1,$0c Route22Script5: ; 510df (14:50df) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, Route22Script_50ece ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a ld a, [wcf0d] cp $1 jr nz, .asm_510fb @@ -309,7 +309,7 @@ Route22Script5: ; 510df (14:50df) ld hl, wd7eb set 6, [hl] ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, $ff ld [wc0ee], a @@ -328,14 +328,14 @@ Route22Script5: ; 510df (14:50df) ret Route22Script_5113d: ; 5113d (14:513d) - ld de, MovementData_5114c ; $514c - jr asm_51145 + ld de, MovementData_5114c + jr Route22MoveRival2 Route22Script_51142: ; 51142 (14:5142) - ld de, MovementData_5114d ; $514d -asm_51145: ; 51145 (14:5145) + ld de, MovementData_5114d +Route22MoveRival2: ; 51145 (14:5145) ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp MoveSprite MovementData_5114c: ; 5114c (14:514c) @@ -370,28 +370,28 @@ Route22Text1: ; 5117b (14:517b) db $08 ; asm ld a, [wd7eb] bit 5, a - jr z, .asm_a88cf ; 0x51181 + jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText - jr .asm_48088 ; 0x51189 -.asm_a88cf ; 0x5118b + jr .asm_51191 +.asm_5118b ld hl, Route22RivalBeforeBattleText1 call PrintText -.asm_48088 ; 0x51191 +.asm_51191 jp TextScriptEnd Route22Text2: ; 51194 (14:5194) db $08 ; asm ld a, [wd7eb] bit 6, a - jr z, .asm_58c0a ; 0x5119a + jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText - jr .asm_673ee ; 0x511a2 -.asm_58c0a ; 0x511a4 + jr .asm_511aa +.asm_511a4 ld hl, Route22RivalBeforeBattleText2 call PrintText -.asm_673ee ; 0x511aa +.asm_511aa jp TextScriptEnd Route22RivalBeforeBattleText1: ; 511ad (14:51ad) diff --git a/scripts/route22gate.asm b/scripts/route22gate.asm index 6618d6a2..0d3c3489 100755 --- a/scripts/route22gate.asm +++ b/scripts/route22gate.asm @@ -6,7 +6,7 @@ Route22GateScript: ; 1e683 (7:6683) ld a, [W_YCOORD] cp $4 ld a, ROUTE_23 - jr c, .asm_1e69a ; 0x1e696 $2 + jr c, .asm_1e69a ld a, ROUTE_22 .asm_1e69a ld [wLastMap], a @@ -60,27 +60,27 @@ Route22GateText1: ; 1e6e1 (7:66e1) db $8 ld a, [W_OBTAINEDBADGES] bit 0, a - jr nz, .asm_8a809 ; 0x1e6e7 $d + jr nz, .asm_1e6f6 ld hl, Route22GateText_1e704 call PrintText call Route22GateScript_1e6ba ld a, $1 - jr .asm_20f7e ; 0x1e6f4 $8 -.asm_8a809 ; 0x1e6f6 + jr .asm_1e6fe +.asm_1e6f6 ld hl, Route22GateText_1e71a call PrintText ld a, $2 -.asm_20f7e ; 0x1e6fe +.asm_1e6fe ld [W_ROUTE22GATECURSCRIPT], a jp TextScriptEnd Route22GateText_1e704: ; 1e704 (7:6704) - TX_FAR _Route22GateText_1e704 ; 0x8cfbb + TX_FAR _Route22GateText_1e704 db $8 ld a, (SFX_02_51 - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent call WaitForSoundToFinish - ld hl, Route22GateText_1e715 ; $6715 + ld hl, Route22GateText_1e715 ret Route22GateText_1e715: ; 1e715 (7:6715) @@ -88,5 +88,5 @@ Route22GateText_1e715: ; 1e715 (7:6715) db "@" Route22GateText_1e71a: ; 1e71a (7:671a) - TX_FAR _Route22GateText_1e71a ; 0x8d03e + TX_FAR _Route22GateText_1e71a db $0B, "@" diff --git a/scripts/route23.asm b/scripts/route23.asm index 6d3849f4..937b5a26 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -29,7 +29,7 @@ Route23ScriptPointers: ; 51213 (14:5213) dw Route23Script2 Route23Script0: ; 51219 (14:5219) - ld hl, YCoordsData_51255 ; $5255 + ld hl, YCoordsData_51255 ld a, [W_YCOORD] ld b, a ld e, $0 @@ -41,9 +41,9 @@ Route23Script0: ; 51219 (14:5219) inc e dec c cp b - jr nz, .asm_51224 ; 0x5122b $f7 + jr nz, .asm_51224 cp $23 - jr nz, .asm_51237 ; 0x5122f $6 + jr nz, .asm_51237 ld a, [W_XCOORD] cp $e ret nc @@ -68,8 +68,8 @@ YCoordsData_51255: ; 51255 (14:5255) db $23,$38,$55,$60,$69,$77,$88,$FF Route23Script_5125d: ; 5125d (14:525d) - ld hl, BadgeTextPointers ; $5276 - ld a, [wWhichTrade] ; wWhichTrade + ld hl, BadgeTextPointers + ld a, [wWhichTrade] ld c, a ld b, $0 add hl, bc @@ -188,9 +188,9 @@ Route23Text7: ; 5133d (14:533d) jp TextScriptEnd Route23Script_51346: ; 51346 (14:5346) - ld [wWhichTrade], a ; wWhichTrade + ld [wWhichTrade], a call Route23Script_5125d - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] inc a ld c, a ld b, $2 @@ -208,7 +208,7 @@ Route23Script_51346: ; 51346 (14:5346) .asm_5136e ld hl, VictoryRoadGuardText2 call PrintText - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] ld c, a ld b, $1 ld hl, wd7ed diff --git a/scripts/route24.asm b/scripts/route24.asm index 6916cbe7..abfea174 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -25,13 +25,13 @@ Route24Script0: ; 513d5 (14:53d5) ld a, [wd7ef] bit 0, a jp nz, CheckFightingMapTrainers - ld hl, CoordsData_5140e ; $540e + ld hl, CoordsData_5140e call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a ld [hJoyHeld], a ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd7f0 bit 1, [hl] @@ -61,7 +61,7 @@ Route24Script4: ; 51411 (14:5411) ret Route24Script3: ; 51422 (14:5422) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, Route24Script_513c0 call UpdateSprites @@ -70,7 +70,7 @@ Route24Script3: ; 51422 (14:5422) ld hl, wd7ef set 1, [hl] ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -94,55 +94,55 @@ Route24TrainerHeader0: ; 5145b (14:545b) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7ef ; flag's byte - dw Route24BattleText1 ; 0x5571 TextBeforeBattle - dw Route24AfterBattleText1 ; 0x557b TextAfterBattle - dw Route24EndBattleText1 ; 0x5576 TextEndBattle - dw Route24EndBattleText1 ; 0x5576 TextEndBattle + dw Route24BattleText1 ; TextBeforeBattle + dw Route24AfterBattleText1 ; TextAfterBattle + dw Route24EndBattleText1 ; TextEndBattle + dw Route24EndBattleText1 ; TextEndBattle Route24TrainerHeader2: ; 51467 (14:5467) db $3 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7ef ; flag's byte - dw Route24BattleText2 ; 0x5580 TextBeforeBattle - dw Route24AfterBattleText2 ; 0x558a TextAfterBattle - dw Route24EndBattleText2 ; 0x5585 TextEndBattle - dw Route24EndBattleText2 ; 0x5585 TextEndBattle + dw Route24BattleText2 ; TextBeforeBattle + dw Route24AfterBattleText2 ; TextAfterBattle + dw Route24EndBattleText2 ; TextEndBattle + dw Route24EndBattleText2 ; TextEndBattle Route24TrainerHeader3: ; 51473 (14:5473) db $4 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7ef ; flag's byte - dw Route24BattleText3 ; 0x558f TextBeforeBattle - dw Route24AfterBattleText3 ; 0x5599 TextAfterBattle - dw Route24EndBattleText3 ; 0x5594 TextEndBattle - dw Route24EndBattleText3 ; 0x5594 TextEndBattle + dw Route24BattleText3 ; TextBeforeBattle + dw Route24AfterBattleText3 ; TextAfterBattle + dw Route24EndBattleText3 ; TextEndBattle + dw Route24EndBattleText3 ; TextEndBattle Route24TrainerHeader4: ; 5147f (14:547f) db $5 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7ef ; flag's byte - dw Route24BattleText4 ; 0x559e TextBeforeBattle - dw Route24AfterBattleText4 ; 0x55a8 TextAfterBattle - dw Route24EndBattleText4 ; 0x55a3 TextEndBattle - dw Route24EndBattleText4 ; 0x55a3 TextEndBattle + dw Route24BattleText4 ; TextBeforeBattle + dw Route24AfterBattleText4 ; TextAfterBattle + dw Route24EndBattleText4 ; TextEndBattle + dw Route24EndBattleText4 ; TextEndBattle Route24TrainerHeader5: ; 5148b (14:548b) db $6 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7ef ; flag's byte - dw Route24BattleText5 ; 0x55ad TextBeforeBattle - dw Route24AfterBattleText5 ; 0x55b7 TextAfterBattle - dw Route24EndBattleText5 ; 0x55b2 TextEndBattle - dw Route24EndBattleText5 ; 0x55b2 TextEndBattle + dw Route24BattleText5 ; TextBeforeBattle + dw Route24AfterBattleText5 ; TextAfterBattle + dw Route24EndBattleText5 ; TextEndBattle + dw Route24EndBattleText5 ; TextEndBattle Route24TrainerHeader6: ; 51497 (14:5497) db $7 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7ef ; flag's byte - dw Route24BattleText6 ; 0x55bc TextBeforeBattle - dw Route24AfterBattleText6 ; 0x55c6 TextAfterBattle - dw Route24EndBattleText6 ; 0x55c1 TextEndBattle - dw Route24EndBattleText6 ; 0x55c1 TextEndBattle + dw Route24BattleText6 ; TextBeforeBattle + dw Route24AfterBattleText6 ; TextAfterBattle + dw Route24EndBattleText6 ; TextEndBattle + dw Route24EndBattleText6 ; TextEndBattle db $ff @@ -152,7 +152,7 @@ Route24Text1: ; 514a4 (14:54a4) res 1, [hl] ld a, [wd7ef] bit 0, a - jr nz, .asm_a03f5 ; 0x514af $48 + jr nz, .asm_514f9 ld hl, Route24Text_51510 call PrintText ld bc, (NUGGET << 8) | 1 @@ -180,7 +180,7 @@ Route24Text1: ; 514a4 (14:54a4) ld [W_ROUTE24CURSCRIPT], a ld [W_CURMAPSCRIPT], a jp TextScriptEnd -.asm_a03f5 ; 0x514f9 +.asm_514f9 ld hl, Route24Text_51530 call PrintText jp TextScriptEnd @@ -192,13 +192,13 @@ Route24Text1: ; 514a4 (14:54a4) jp TextScriptEnd Route24Text_51510: ; 51510 (14:5510) - TX_FAR _Route24Text_51510 ; 0x92721 + TX_FAR _Route24Text_51510 db $0B - TX_FAR _Route24Text_51515 ; 0x92755 + TX_FAR _Route24Text_51515 db "@" Route24Text_5151a: ; 5151a (14:551a) - TX_FAR _Route24Text_5151a ; 0x92779 + TX_FAR _Route24Text_5151a db $0B, $6, "@" Route24Text_51521: ; 51521 (14:5521) diff --git a/scripts/route25.asm b/scripts/route25.asm index b915bdee..0c827802 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -59,82 +59,82 @@ Route25TrainerHeader0: ; 5163e (14:563e) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText1 ; 0x5705 TextBeforeBattle - dw Route25AfterBattleText1 ; 0x570f TextAfterBattle - dw Route25EndBattleText1 ; 0x570a TextEndBattle - dw Route25EndBattleText1 ; 0x570a TextEndBattle + dw Route25BattleText1 ; TextBeforeBattle + dw Route25AfterBattleText1 ; TextAfterBattle + dw Route25EndBattleText1 ; TextEndBattle + dw Route25EndBattleText1 ; TextEndBattle Route25TrainerHeader2: ; 5164a (14:564a) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText2 ; 0x5714 TextBeforeBattle - dw Route25AfterBattleText2 ; 0x571e TextAfterBattle - dw Route25EndBattleText2 ; 0x5719 TextEndBattle - dw Route25EndBattleText2 ; 0x5719 TextEndBattle + dw Route25BattleText2 ; TextBeforeBattle + dw Route25AfterBattleText2 ; TextAfterBattle + dw Route25EndBattleText2 ; TextEndBattle + dw Route25EndBattleText2 ; TextEndBattle Route25TrainerHeader3: ; 51656 (14:5656) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText3 ; 0x5723 TextBeforeBattle - dw Route25AfterBattleText3 ; 0x572d TextAfterBattle - dw Route25EndBattleText3 ; 0x5728 TextEndBattle - dw Route25EndBattleText3 ; 0x5728 TextEndBattle + dw Route25BattleText3 ; TextBeforeBattle + dw Route25AfterBattleText3 ; TextAfterBattle + dw Route25EndBattleText3 ; TextEndBattle + dw Route25EndBattleText3 ; TextEndBattle Route25TrainerHeader4: ; 51662 (14:5662) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText4 ; 0x5732 TextBeforeBattle - dw Route25AfterBattleText4 ; 0x573c TextAfterBattle - dw Route25EndBattleText4 ; 0x5737 TextEndBattle - dw Route25EndBattleText4 ; 0x5737 TextEndBattle + dw Route25BattleText4 ; TextBeforeBattle + dw Route25AfterBattleText4 ; TextAfterBattle + dw Route25EndBattleText4 ; TextEndBattle + dw Route25EndBattleText4 ; TextEndBattle Route25TrainerHeader5: ; 5166e (14:566e) db $5 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText5 ; 0x5741 TextBeforeBattle - dw Route25AfterBattleText5 ; 0x574b TextAfterBattle - dw Route25EndBattleText5 ; 0x5746 TextEndBattle - dw Route25EndBattleText5 ; 0x5746 TextEndBattle + dw Route25BattleText5 ; TextBeforeBattle + dw Route25AfterBattleText5 ; TextAfterBattle + dw Route25EndBattleText5 ; TextEndBattle + dw Route25EndBattleText5 ; TextEndBattle Route25TrainerHeader6: ; 5167a (14:567a) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText6 ; 0x5750 TextBeforeBattle - dw Route25AfterBattleText6 ; 0x575a TextAfterBattle - dw Route25EndBattleText6 ; 0x5755 TextEndBattle - dw Route25EndBattleText6 ; 0x5755 TextEndBattle + dw Route25BattleText6 ; TextBeforeBattle + dw Route25AfterBattleText6 ; TextAfterBattle + dw Route25EndBattleText6 ; TextEndBattle + dw Route25EndBattleText6 ; TextEndBattle Route25TrainerHeader7: ; 51686 (14:5686) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText7 ; 0x575f TextBeforeBattle - dw Route25AfterBattleText7 ; 0x5769 TextAfterBattle - dw Route25EndBattleText7 ; 0x5764 TextEndBattle - dw Route25EndBattleText7 ; 0x5764 TextEndBattle + dw Route25BattleText7 ; TextBeforeBattle + dw Route25AfterBattleText7 ; TextAfterBattle + dw Route25EndBattleText7 ; TextEndBattle + dw Route25EndBattleText7 ; TextEndBattle Route25TrainerHeader8: ; 51692 (14:5692) db $8 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText8 ; 0x576e TextBeforeBattle - dw Route25AfterBattleText8 ; 0x5778 TextAfterBattle - dw Route25EndBattleText8 ; 0x5773 TextEndBattle - dw Route25EndBattleText8 ; 0x5773 TextEndBattle + dw Route25BattleText8 ; TextBeforeBattle + dw Route25AfterBattleText8 ; TextAfterBattle + dw Route25EndBattleText8 ; TextEndBattle + dw Route25EndBattleText8 ; TextEndBattle Route25TrainerHeader9: ; 5169e (14:569e) db $9 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7f1 ; flag's byte - dw Route25BattleText9 ; 0x577d TextBeforeBattle - dw Route25AfterBattleText9 ; 0x5787 TextAfterBattle - dw Route25EndBattleText9 ; 0x5782 TextEndBattle - dw Route25EndBattleText9 ; 0x5782 TextEndBattle + dw Route25BattleText9 ; TextBeforeBattle + dw Route25AfterBattleText9 ; TextAfterBattle + dw Route25EndBattleText9 ; TextEndBattle + dw Route25EndBattleText9 ; TextEndBattle db $ff diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index 8ee087c8..9d29a311 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -9,13 +9,13 @@ Route2GateText1: ; 5d5db (17:55db) db $08 ; asm ld a, [wd7c2] bit 0, a - jr nz, .asm_6592c ; 0x5d5e1 + jr nz, .asm_5d60d ld a, 10 ; pokemon needed ldh [$db], a ld a, HM_05 ; oak's aide reward ldh [$dc], a ld [wd11e], a - call GetItemName ; $2fcf + call GetItemName ld hl, wcd6d ld de, wcc5b ld bc, $000d @@ -23,13 +23,13 @@ Route2GateText1: ; 5d5db (17:55db) predef OaksAideScript ; call oak's aide script ldh a, [$db] cp $1 - jr nz, .asm_ad646 ; 0x5d606 + jr nz, .asm_5d613 ld hl, wd7c2 set 0, [hl] -.asm_6592c ; 0x5d60d +.asm_5d60d ld hl, Route2GateText_5d616 call PrintText -.asm_ad646 ; 0x5d613 +.asm_5d613 jp TextScriptEnd Route2GateText_5d616: ; 5d616 (17:5616) diff --git a/scripts/route3.asm b/scripts/route3.asm index acb2afce..6f9d0e2c 100755 --- a/scripts/route3.asm +++ b/scripts/route3.asm @@ -29,73 +29,73 @@ Route3TrainerHeader0: ; 55525 (15:5525) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7c3 ; flag's byte - dw Route3BattleText1 ; 0x5595 TextBeforeBattle - dw Route3AfterBattleText1 ; 0x559f TextAfterBattle - dw Route3EndBattleText1 ; 0x559a TextEndBattle - dw Route3EndBattleText1 ; 0x559a TextEndBattle + dw Route3BattleText1 ; TextBeforeBattle + dw Route3AfterBattleText1 ; TextAfterBattle + dw Route3EndBattleText1 ; TextEndBattle + dw Route3EndBattleText1 ; TextEndBattle Route3TrainerHeader2: ; 55531 (15:5531) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7c3 ; flag's byte - dw Route3BattleText2 ; 0x55ae TextBeforeBattle - dw Route3AfterBattleText2 ; 0x55b8 TextAfterBattle - dw Route3EndBattleText2 ; 0x55b3 TextEndBattle - dw Route3EndBattleText2 ; 0x55b3 TextEndBattle + dw Route3BattleText2 ; TextBeforeBattle + dw Route3AfterBattleText2 ; TextAfterBattle + dw Route3EndBattleText2 ; TextEndBattle + dw Route3EndBattleText2 ; TextEndBattle Route3TrainerHeader3: ; 5553d (15:553d) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7c3 ; flag's byte - dw Route3BattleText3 ; 0x55c7 TextBeforeBattle - dw Route3AfterBattleText3 ; 0x55d1 TextAfterBattle - dw Route3EndBattleText3 ; 0x55cc TextEndBattle - dw Route3EndBattleText3 ; 0x55cc TextEndBattle + dw Route3BattleText3 ; TextBeforeBattle + dw Route3AfterBattleText3 ; TextAfterBattle + dw Route3EndBattleText3 ; TextEndBattle + dw Route3EndBattleText3 ; TextEndBattle Route3TrainerHeader4: ; 55549 (15:5549) db $5 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7c3 ; flag's byte - dw Route3BattleText4 ; 0x55e0 TextBeforeBattle - dw Route3AfterBattleText4 ; 0x55ea TextAfterBattle - dw Route3EndBattleText4 ; 0x55e5 TextEndBattle - dw Route3EndBattleText4 ; 0x55e5 TextEndBattle + dw Route3BattleText4 ; TextBeforeBattle + dw Route3AfterBattleText4 ; TextAfterBattle + dw Route3EndBattleText4 ; TextEndBattle + dw Route3EndBattleText4 ; TextEndBattle Route3TrainerHeader5: ; 55555 (15:5555) db $6 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7c3 ; flag's byte - dw Route3BattleText5 ; 0x55f9 TextBeforeBattle - dw Route3AfterBattleText5 ; 0x5603 TextAfterBattle - dw Route3EndBattleText5 ; 0x55fe TextEndBattle - dw Route3EndBattleText5 ; 0x55fe TextEndBattle + dw Route3BattleText5 ; TextBeforeBattle + dw Route3AfterBattleText5 ; TextAfterBattle + dw Route3EndBattleText5 ; TextEndBattle + dw Route3EndBattleText5 ; TextEndBattle Route3TrainerHeader6: ; 55561 (15:5561) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7c3 ; flag's byte - dw Route3BattleText6 ; 0x5612 TextBeforeBattle - dw Route3AfterBattleText6 ; 0x561c TextAfterBattle - dw Route3EndBattleText6 ; 0x5617 TextEndBattle - dw Route3EndBattleText6 ; 0x5617 TextEndBattle + dw Route3BattleText6 ; TextBeforeBattle + dw Route3AfterBattleText6 ; TextAfterBattle + dw Route3EndBattleText6 ; TextEndBattle + dw Route3EndBattleText6 ; TextEndBattle Route3TrainerHeader7: ; 5556d (15:556d) db $8 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7c3 ; flag's byte - dw Route3BattleText7 ; 0x562b TextBeforeBattle - dw Route3AfterBattleText7 ; 0x5635 TextAfterBattle - dw Route3EndBattleText7 ; 0x5630 TextEndBattle - dw Route3EndBattleText7 ; 0x5630 TextEndBattle + dw Route3BattleText7 ; TextBeforeBattle + dw Route3AfterBattleText7 ; TextAfterBattle + dw Route3EndBattleText7 ; TextEndBattle + dw Route3EndBattleText7 ; TextEndBattle Route3TrainerHeader8: ; 55579 (15:5579) db $9 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7c3 ; flag's byte - dw Route3BattleText8 ; 0x5644 TextBeforeBattle - dw Route3AfterBattleText8 ; 0x564e TextAfterBattle - dw Route3EndBattleText8 ; 0x5649 TextEndBattle - dw Route3EndBattleText8 ; 0x5649 TextEndBattle + dw Route3BattleText8 ; TextBeforeBattle + dw Route3AfterBattleText8 ; TextAfterBattle + dw Route3EndBattleText8 ; TextEndBattle + dw Route3EndBattleText8 ; TextEndBattle db $ff diff --git a/scripts/route4.asm b/scripts/route4.asm index 5eafb4f7..f9031ad8 100755 --- a/scripts/route4.asm +++ b/scripts/route4.asm @@ -25,10 +25,10 @@ Route4TrainerHeader0: ; 5567d (15:567d) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7c5 ; flag's byte - dw Route4BattleText1 ; 0x5699 TextBeforeBattle - dw Route4AfterBattleText1 ; 0x56a3 TextAfterBattle - dw Route4EndBattleText1 ; 0x569e TextEndBattle - dw Route4EndBattleText1 ; 0x569e TextEndBattle + dw Route4BattleText1 ; TextBeforeBattle + dw Route4AfterBattleText1 ; TextAfterBattle + dw Route4EndBattleText1 ; TextEndBattle + dw Route4EndBattleText1 ; TextEndBattle db $ff diff --git a/scripts/route5gate.asm b/scripts/route5gate.asm index bee70e77..1a1c6b9c 100755 --- a/scripts/route5gate.asm +++ b/scripts/route5gate.asm @@ -29,7 +29,7 @@ Route5GateScript0: ; 1df50 (7:5f50) callba RemoveGuardDrink ld a, [$ffdb] and a - jr nz, .asm_1df82 ; 0x1df70 $10 + jr nz, .asm_1df82 ld a, $2 ld [$ff8c], a call DisplayTextID @@ -72,24 +72,24 @@ Route5GateText1: ; 1dfaa (7:5faa) db $8 ld a, [wd728] bit 6, a - jr nz, .asm_88856 ; 0x1dfb0 $2c + jr nz, .asm_88856 callba RemoveGuardDrink ld a, [$ffdb] and a - jr nz, .asm_768a2 ; 0x1dfbd $11 + jr nz, .asm_768a2 ld hl, Route5GateText2 call PrintText call Route5GateScript_1df43 ld a, $1 ld [W_ROUTE5GATECURSCRIPT], a jp TextScriptEnd -.asm_768a2 ; 0x1dfd0 +.asm_768a2 ld hl, Route5GateText3 call PrintText ld hl, wd728 set 6, [hl] jp TextScriptEnd -.asm_88856 ; 0x1dfde +.asm_88856 ld hl, SaffronGateText_1dff6 call PrintText jp TextScriptEnd @@ -105,9 +105,9 @@ Route8GateText3: ; 1dfec (7:5fec) Route7GateText3: ; 1dfec (7:5fec) Route6GateText3: ; 1dfec (7:5fec) Route5GateText3: ; 1dfec (7:5fec) - TX_FAR _SaffronGateText_8aaa9 ; 0x8aaa9 + TX_FAR _SaffronGateText_8aaa9 db $11 - TX_FAR _SaffronGateText_1dff1 ; 0x8aaef + TX_FAR _SaffronGateText_1dff1 db "@" SaffronGateText_1dff6: ; 1dff6 (7:5ff6) diff --git a/scripts/route6.asm b/scripts/route6.asm index ee6258cd..733c5eac 100755 --- a/scripts/route6.asm +++ b/scripts/route6.asm @@ -26,55 +26,55 @@ Route6TrainerHeader0: ; 590d7 (16:50d7) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd7c9 ; flag's byte - dw Route6BattleText1 ; 0x512a TextBeforeBattle - dw Route6AfterBattleText1 ; 0x5134 TextAfterBattle - dw Route6EndBattleText1 ; 0x512f TextEndBattle - dw Route6EndBattleText1 ; 0x512f TextEndBattle + dw Route6BattleText1 ; TextBeforeBattle + dw Route6AfterBattleText1 ; TextAfterBattle + dw Route6EndBattleText1 ; TextEndBattle + dw Route6EndBattleText1 ; TextEndBattle Route6TrainerHeader1: ; 590e3 (16:50e3) db $2 ; flag's bit db ($0 << 4) ; trainer's view range dw wd7c9 ; flag's byte - dw Route6BattleText2 ; 0x5143 TextBeforeBattle - dw Route6AfterBattleText1 ; 0x5134 TextAfterBattle - dw Route6EndBattleText2 ; 0x5148 TextEndBattle - dw Route6EndBattleText2 ; 0x5148 TextEndBattle + dw Route6BattleText2 ; TextBeforeBattle + dw Route6AfterBattleText1 ; TextAfterBattle + dw Route6EndBattleText2 ; TextEndBattle + dw Route6EndBattleText2 ; TextEndBattle Route6TrainerHeader2: ; 590ef (16:50ef) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7c9 ; flag's byte - dw Route6BattleText3 ; 0x5157 TextBeforeBattle - dw Route6AfterBattleText3 ; 0x5161 TextAfterBattle - dw Route6EndBattleText3 ; 0x515c TextEndBattle - dw Route6EndBattleText3 ; 0x515c TextEndBattle + dw Route6BattleText3 ; TextBeforeBattle + dw Route6AfterBattleText3 ; TextAfterBattle + dw Route6EndBattleText3 ; TextEndBattle + dw Route6EndBattleText3 ; TextEndBattle Route6TrainerHeader3: ; 590fb (16:50fb) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7c9 ; flag's byte - dw Route6BattleText4 ; 0x5170 TextBeforeBattle - dw Route6AfterBattleText4 ; 0x517a TextAfterBattle - dw Route6EndBattleText4 ; 0x5175 TextEndBattle - dw Route6EndBattleText4 ; 0x5175 TextEndBattle + dw Route6BattleText4 ; TextBeforeBattle + dw Route6AfterBattleText4 ; TextAfterBattle + dw Route6EndBattleText4 ; TextEndBattle + dw Route6EndBattleText4 ; TextEndBattle Route6TrainerHeader4: ; 59107 (16:5107) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7c9 ; flag's byte - dw Route6BattleText5 ; 0x5189 TextBeforeBattle - dw Route6AfterBattleText5 ; 0x5193 TextAfterBattle - dw Route6EndBattleText5 ; 0x518e TextEndBattle - dw Route6EndBattleText5 ; 0x518e TextEndBattle + dw Route6BattleText5 ; TextBeforeBattle + dw Route6AfterBattleText5 ; TextAfterBattle + dw Route6EndBattleText5 ; TextEndBattle + dw Route6EndBattleText5 ; TextEndBattle Route6TrainerHeader5: ; 59113 (16:5113) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7c9 ; flag's byte - dw Route6BattleText6 ; 0x51a2 TextBeforeBattle - dw Route6AfterBattleText6 ; 0x51ac TextAfterBattle - dw Route6EndBattleText6 ; 0x51a7 TextEndBattle - dw Route6EndBattleText6 ; 0x51a7 TextEndBattle + dw Route6BattleText6 ; TextBeforeBattle + dw Route6AfterBattleText6 ; TextAfterBattle + dw Route6EndBattleText6 ; TextEndBattle + dw Route6EndBattleText6 ; TextEndBattle db $ff diff --git a/scripts/route6gate.asm b/scripts/route6gate.asm index 44d03a75..82e2414a 100755 --- a/scripts/route6gate.asm +++ b/scripts/route6gate.asm @@ -23,7 +23,7 @@ Route6GateScript0: ; 1e04e (7:604e) callba RemoveGuardDrink ld a, [$ffdb] and a - jr nz, .asm_1e080 ; 0x1e06e $10 + jr nz, .asm_1e080 ld a, $2 ld [$ff8c], a call DisplayTextID diff --git a/scripts/route7gate.asm b/scripts/route7gate.asm index beab96bf..4a05acc3 100755 --- a/scripts/route7gate.asm +++ b/scripts/route7gate.asm @@ -35,7 +35,7 @@ Route7GateScript0: ; 1e128 (7:6128) callba RemoveGuardDrink ld a, [$ffdb] and a - jr nz, .asm_1e15a ; 0x1e148 $10 + jr nz, .asm_1e15a ld a, $2 ld [$ff8c], a call DisplayTextID diff --git a/scripts/route8.asm b/scripts/route8.asm index eed57c7b..143af7cd 100755 --- a/scripts/route8.asm +++ b/scripts/route8.asm @@ -29,82 +29,82 @@ Route8TrainerHeader0: ; 591e3 (16:51e3) db $1 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText1 ; 0x525a TextBeforeBattle - dw Route8AfterBattleText1 ; 0x5264 TextAfterBattle - dw Route8EndBattleText1 ; 0x525f TextEndBattle - dw Route8EndBattleText1 ; 0x525f TextEndBattle + dw Route8BattleText1 ; TextBeforeBattle + dw Route8AfterBattleText1 ; TextAfterBattle + dw Route8EndBattleText1 ; TextEndBattle + dw Route8EndBattleText1 ; TextEndBattle Route8TrainerHeader1: ; 591ef (16:51ef) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText2 ; 0x5273 TextBeforeBattle - dw Route8AfterBattleText2 ; 0x527d TextAfterBattle - dw Route8EndBattleText2 ; 0x5278 TextEndBattle - dw Route8EndBattleText2 ; 0x5278 TextEndBattle + dw Route8BattleText2 ; TextBeforeBattle + dw Route8AfterBattleText2 ; TextAfterBattle + dw Route8EndBattleText2 ; TextEndBattle + dw Route8EndBattleText2 ; TextEndBattle Route8TrainerHeader2: ; 591fb (16:51fb) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText3 ; 0x528c TextBeforeBattle - dw Route8AfterBattleText3 ; 0x5296 TextAfterBattle - dw Route8EndBattleText3 ; 0x5291 TextEndBattle - dw Route8EndBattleText3 ; 0x5291 TextEndBattle + dw Route8BattleText3 ; TextBeforeBattle + dw Route8AfterBattleText3 ; TextAfterBattle + dw Route8EndBattleText3 ; TextEndBattle + dw Route8EndBattleText3 ; TextEndBattle Route8TrainerHeader3: ; 59207 (16:5207) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText4 ; 0x52a5 TextBeforeBattle - dw Route8AfterBattleText4 ; 0x52af TextAfterBattle - dw Route8EndBattleText4 ; 0x52aa TextEndBattle - dw Route8EndBattleText4 ; 0x52aa TextEndBattle + dw Route8BattleText4 ; TextBeforeBattle + dw Route8AfterBattleText4 ; TextAfterBattle + dw Route8EndBattleText4 ; TextEndBattle + dw Route8EndBattleText4 ; TextEndBattle Route8TrainerHeader4: ; 59213 (16:5213) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText5 ; 0x52be TextBeforeBattle - dw Route8AfterBattleText5 ; 0x52c8 TextAfterBattle - dw Route8EndBattleText5 ; 0x52c3 TextEndBattle - dw Route8EndBattleText5 ; 0x52c3 TextEndBattle + dw Route8BattleText5 ; TextBeforeBattle + dw Route8AfterBattleText5 ; TextAfterBattle + dw Route8EndBattleText5 ; TextEndBattle + dw Route8EndBattleText5 ; TextEndBattle Route8TrainerHeader5: ; 5921f (16:521f) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText6 ; 0x52d7 TextBeforeBattle - dw Route8AfterBattleText6 ; 0x52e1 TextAfterBattle - dw Route8EndBattleText6 ; 0x52dc TextEndBattle - dw Route8EndBattleText6 ; 0x52dc TextEndBattle + dw Route8BattleText6 ; TextBeforeBattle + dw Route8AfterBattleText6 ; TextAfterBattle + dw Route8EndBattleText6 ; TextEndBattle + dw Route8EndBattleText6 ; TextEndBattle Route8TrainerHeader6: ; 5922b (16:522b) db $7 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText7 ; 0x52f0 TextBeforeBattle - dw Route8AfterBattleText7 ; 0x52fa TextAfterBattle - dw Route8EndBattleText7 ; 0x52f5 TextEndBattle - dw Route8EndBattleText7 ; 0x52f5 TextEndBattle + dw Route8BattleText7 ; TextBeforeBattle + dw Route8AfterBattleText7 ; TextAfterBattle + dw Route8EndBattleText7 ; TextEndBattle + dw Route8EndBattleText7 ; TextEndBattle Route8TrainerHeader7: ; 59237 (16:5237) db $8 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText8 ; 0x5309 TextBeforeBattle - dw Route8AfterBattleText8 ; 0x5313 TextAfterBattle - dw Route8EndBattleText8 ; 0x530e TextEndBattle - dw Route8EndBattleText8 ; 0x530e TextEndBattle + dw Route8BattleText8 ; TextBeforeBattle + dw Route8AfterBattleText8 ; TextAfterBattle + dw Route8EndBattleText8 ; TextEndBattle + dw Route8EndBattleText8 ; TextEndBattle Route8TrainerHeader8: ; 59243 (16:5243) db $9 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7cd ; flag's byte - dw Route8BattleText9 ; 0x5322 TextBeforeBattle - dw Route8AfterBattleText9 ; 0x532c TextAfterBattle - dw Route8EndBattleText9 ; 0x5327 TextEndBattle - dw Route8EndBattleText9 ; 0x5327 TextEndBattle + dw Route8BattleText9 ; TextBeforeBattle + dw Route8AfterBattleText9 ; TextAfterBattle + dw Route8EndBattleText9 ; TextEndBattle + dw Route8EndBattleText9 ; TextEndBattle db $ff diff --git a/scripts/route8gate.asm b/scripts/route8gate.asm index 8ea12f04..de0a856f 100755 --- a/scripts/route8gate.asm +++ b/scripts/route8gate.asm @@ -34,7 +34,7 @@ Route8GateScript0: ; 1e1ee (7:61ee) callba RemoveGuardDrink ld a, [$ffdb] and a - jr nz, .asm_1e220 ; 0x1e20e $10 + jr nz, .asm_1e220 ld a, $2 ld [$ff8c], a call DisplayTextID diff --git a/scripts/route9.asm b/scripts/route9.asm index 77b216c6..67b04e9a 100755 --- a/scripts/route9.asm +++ b/scripts/route9.asm @@ -30,129 +30,129 @@ Route9TrainerHeader0: ; 556eb (15:56eb) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText1 ; 0x5792 TextBeforeBattle - dw Route9AfterBattleText1 ; 0x579c TextAfterBattle - dw Route9EndBattleText1 ; 0x5797 TextEndBattle - dw Route9EndBattleText1 ; 0x5797 TextEndBattle + dw Route9BattleText1 ; TextBeforeBattle + dw Route9AfterBattleText1 ; TextAfterBattle + dw Route9EndBattleText1 ; TextEndBattle + dw Route9EndBattleText1 ; TextEndBattle Route9TrainerHeader2: ; 556f7 (15:56f7) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText2 ; 0x57a1 TextBeforeBattle - dw Route9AfterBattleText2 ; 0x57ab TextAfterBattle - dw Route9EndBattleText2 ; 0x57a6 TextEndBattle - dw Route9EndBattleText2 ; 0x57a6 TextEndBattle + dw Route9BattleText2 ; TextBeforeBattle + dw Route9AfterBattleText2 ; TextAfterBattle + dw Route9EndBattleText2 ; TextEndBattle + dw Route9EndBattleText2 ; TextEndBattle Route9TrainerHeader3: ; 55703 (15:5703) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText3 ; 0x57b0 TextBeforeBattle - dw Route9AfterBattleText3 ; 0x57ba TextAfterBattle - dw Route9EndBattleText3 ; 0x57b5 TextEndBattle - dw Route9EndBattleText3 ; 0x57b5 TextEndBattle + dw Route9BattleText3 ; TextBeforeBattle + dw Route9AfterBattleText3 ; TextAfterBattle + dw Route9EndBattleText3 ; TextEndBattle + dw Route9EndBattleText3 ; TextEndBattle Route9TrainerHeader4: ; 5570f (15:570f) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText4 ; 0x57bf TextBeforeBattle - dw Route9AfterBattleText4 ; 0x57c9 TextAfterBattle - dw Route9EndBattleText4 ; 0x57c4 TextEndBattle - dw Route9EndBattleText4 ; 0x57c4 TextEndBattle + dw Route9BattleText4 ; TextBeforeBattle + dw Route9AfterBattleText4 ; TextAfterBattle + dw Route9EndBattleText4 ; TextEndBattle + dw Route9EndBattleText4 ; TextEndBattle Route9TrainerHeader5: ; 5571b (15:571b) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText5 ; 0x57ce TextBeforeBattle - dw Route9AfterBattleText5 ; 0x57d8 TextAfterBattle - dw Route9EndBattleText5 ; 0x57d3 TextEndBattle - dw Route9EndBattleText5 ; 0x57d3 TextEndBattle + dw Route9BattleText5 ; TextBeforeBattle + dw Route9AfterBattleText5 ; TextAfterBattle + dw Route9EndBattleText5 ; TextEndBattle + dw Route9EndBattleText5 ; TextEndBattle Route9TrainerHeader6: ; 55727 (15:5727) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText6 ; 0x57dd TextBeforeBattle - dw Route9AfterBattleText6 ; 0x57e7 TextAfterBattle - dw Route9EndBattleText6 ; 0x57e2 TextEndBattle - dw Route9EndBattleText6 ; 0x57e2 TextEndBattle + dw Route9BattleText6 ; TextBeforeBattle + dw Route9AfterBattleText6 ; TextAfterBattle + dw Route9EndBattleText6 ; TextEndBattle + dw Route9EndBattleText6 ; TextEndBattle Route9TrainerHeader7: ; 55733 (15:5733) db $7 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText7 ; 0x57ec TextBeforeBattle - dw Route9AfterBattleText7 ; 0x57f6 TextAfterBattle - dw Route9EndBattleText7 ; 0x57f1 TextEndBattle - dw Route9EndBattleText7 ; 0x57f1 TextEndBattle + dw Route9BattleText7 ; TextBeforeBattle + dw Route9AfterBattleText7 ; TextAfterBattle + dw Route9EndBattleText7 ; TextEndBattle + dw Route9EndBattleText7 ; TextEndBattle Route9TrainerHeader8: ; 5573f (15:573f) db $8 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText8 ; 0x57fb TextBeforeBattle - dw Route9AfterBattleText8 ; 0x5805 TextAfterBattle - dw Route9EndBattleText8 ; 0x5800 TextEndBattle - dw Route9EndBattleText8 ; 0x5800 TextEndBattle + dw Route9BattleText8 ; TextBeforeBattle + dw Route9AfterBattleText8 ; TextAfterBattle + dw Route9EndBattleText8 ; TextEndBattle + dw Route9EndBattleText8 ; TextEndBattle Route9TrainerHeader9: ; 5574b (15:574b) db $9 ; flag's bit db ($2 << 4) ; trainer's view range dw wd7cf ; flag's byte - dw Route9BattleText9 ; 0x580a TextBeforeBattle - dw Route9AfterBattleText9 ; 0x5814 TextAfterBattle - dw Route9EndBattleText9 ; 0x580f TextEndBattle - dw Route9EndBattleText9 ; 0x580f TextEndBattle + dw Route9BattleText9 ; TextBeforeBattle + dw Route9AfterBattleText9 ; TextAfterBattle + dw Route9EndBattleText9 ; TextEndBattle + dw Route9EndBattleText9 ; TextEndBattle db $ff Route9Text1: ; 55758 (15:5758) db $8 ; asm ld hl, Route9TrainerHeader0 - jr asm_8be3d ; 0x5575c $2e + jr Route9TalkToTrainer Route9Text2: ; 5575e (15:575e) db $8 ; asm ld hl, Route9TrainerHeader2 - jr asm_8be3d ; 0x55762 $28 + jr Route9TalkToTrainer Route9Text3: ; 55764 (15:5764) db $8 ; asm ld hl, Route9TrainerHeader3 - jr asm_8be3d ; 0x55768 $22 + jr Route9TalkToTrainer Route9Text4: ; 5576a (15:576a) db $8 ; asm ld hl, Route9TrainerHeader4 - jr asm_8be3d ; 0x5576e $1c + jr Route9TalkToTrainer Route9Text5: ; 55770 (15:5770) db $8 ; asm ld hl, Route9TrainerHeader5 - jr asm_8be3d ; 0x55774 $16 + jr Route9TalkToTrainer Route9Text6: ; 55776 (15:5776) db $8 ; asm ld hl, Route9TrainerHeader6 - jr asm_8be3d ; 0x5577a $10 + jr Route9TalkToTrainer Route9Text7: ; 5577c (15:577c) db $8 ; asm ld hl, Route9TrainerHeader7 - jr asm_8be3d ; 0x55780 $a + jr Route9TalkToTrainer Route9Text8: ; 55782 (15:5782) db $8 ; asm ld hl, Route9TrainerHeader8 - jr asm_8be3d ; 0x55786 $4 + jr Route9TalkToTrainer Route9Text9: ; 55788 (15:5788) db $8 ; asm ld hl, Route9TrainerHeader9 -asm_8be3d: ; 5578c (15:578c) +Route9TalkToTrainer: ; 5578c (15:578c) call TalkToTrainer jp TextScriptEnd diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index 294dcf58..5d350abe 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -28,7 +28,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) ld [wSpriteStateData1 + 9], a ld a, [wWhichTrade] cp $1 - jr z, .asm_7520f ; 0x75207 $6 + jr z, .asm_7520f ld a, $2 ld [W_SAFARIZONEENTRANCECURSCRIPT], a ret @@ -77,7 +77,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) ld hl, wd790 bit 6, [hl] res 6, [hl] - jr z, .asm_7527f ; 0x7525a $23 + jr z, .asm_7527f res 7, [hl] call UpdateSprites ld a, $f0 @@ -92,7 +92,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) call SafariZoneEntranceAutoWalk ld a, $4 ld [W_SAFARIZONEENTRANCECURSCRIPT], a - jr .asm_75286 ; 0x7527d $7 + jr .asm_75286 .asm_7527f ld a, $5 ld [$ff8c], a @@ -145,7 +145,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) db "@" .SafariZoneEntranceText4 - TX_FAR SafariZoneEntranceText_9e6e4 ; 0x9e6e4 + TX_FAR SafariZoneEntranceText_9e6e4 db $8 ld a, $13 ld [wTextBoxID],a @@ -225,12 +225,12 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) db "@" .SafariZoneEntranceText5 - TX_FAR SafariZoneEntranceText_9e814 ; 0x9e814 + TX_FAR SafariZoneEntranceText_9e814 db $8 call YesNoChoice ld a,[wCurrentMenuItem] and a - jr nz, .asm_7539c ; 0x7537b $1f + jr nz, .asm_7539c ld hl, .SafariZoneEntranceText_753bb call PrintText xor a @@ -243,7 +243,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) res 7, [hl] ld a, $0 ld [wcf0d], a - jr .asm_753b3 ; 0x7539a $17 + jr .asm_753b3 .asm_7539c ld hl, .SafariZoneEntranceText_753c0 call PrintText diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index 28aae7c4..2a91a1bb 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -8,7 +8,7 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) db $08 ; asm ld a, [wd857] bit 0, a - jr nz, .asm_20a9b ; 0x4a322 + jr nz, .asm_20a9b ld hl, SafariZoneSecretHouseText_4a350 call PrintText ld bc, (HM_03 << 8) | 1 @@ -18,15 +18,15 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) call PrintText ld hl, wd857 set 0, [hl] - jr .asm_8f1fc ; 0x4a33d + jr .asm_8f1fc .BagFull ld hl, HM03NoRoomText call PrintText - jr .asm_8f1fc ; 0x4a345 -.asm_20a9b ; 0x4a347 + jr .asm_8f1fc +.asm_20a9b ld hl, HM03ExplanationText call PrintText -.asm_8f1fc ; 0x4a34d +.asm_8f1fc jp TextScriptEnd SafariZoneSecretHouseText_4a350: ; 4a350 (12:6350) diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index 7c2eb559..4739466e 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -12,8 +12,8 @@ SaffronGymScript: ; 5d00d (17:500d) ret .extra - ld hl, Gym6CityName ; $5033 - ld de, Gym6LeaderName ; $5040 + ld hl, Gym6CityName + ld de, Gym6LeaderName jp LoadGymLeaderAndCityName Gym6CityName: ; 5d033 (17:5033) @@ -36,7 +36,7 @@ SaffronGymScriptPointers: ; 5d053 (17:5053) dw SaffronGymScript3 SaffronGymScript3: ; 5d05b (17:505b) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, SaffronGymText_5d048 ld a, $f0 @@ -44,7 +44,7 @@ SaffronGymScript3: ; 5d05b (17:505b) SaffronGymText_5d068: ; 5d068 (17:5068) ld a, $a - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd7b3 set 1, [hl] @@ -52,14 +52,14 @@ SaffronGymText_5d068: ; 5d068 (17:5068) call GiveItem jr nc, .BagFull ld a, $b - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd7b3 set 0, [hl] jr .asm_5d091 .BagFull ld a, $c - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_5d091 ld hl, W_OBTAINEDBADGES @@ -95,64 +95,64 @@ SaffronGymTrainerHeader0: ; 5d0c3 (17:50c3) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b3 ; flag's byte - dw SaffronGymBattleText1 ; 0x51f0 TextBeforeBattle - dw SaffronGymAfterBattleText1 ; 0x51fa TextAfterBattle - dw SaffronGymEndBattleText1 ; 0x51f5 TextEndBattle - dw SaffronGymEndBattleText1 ; 0x51f5 TextEndBattle + dw SaffronGymBattleText1 ; TextBeforeBattle + dw SaffronGymAfterBattleText1 ; TextAfterBattle + dw SaffronGymEndBattleText1 ; TextEndBattle + dw SaffronGymEndBattleText1 ; TextEndBattle SaffronGymTrainerHeader1: ; 5d0cf (17:50cf) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b3 ; flag's byte - dw SaffronGymBattleText2 ; 0x51ff TextBeforeBattle - dw SaffronGymAfterBattleText2 ; 0x5209 TextAfterBattle - dw SaffronGymEndBattleText2 ; 0x5204 TextEndBattle - dw SaffronGymEndBattleText2 ; 0x5204 TextEndBattle + dw SaffronGymBattleText2 ; TextBeforeBattle + dw SaffronGymAfterBattleText2 ; TextAfterBattle + dw SaffronGymEndBattleText2 ; TextEndBattle + dw SaffronGymEndBattleText2 ; TextEndBattle SaffronGymTrainerHeader2: ; 5d0db (17:50db) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b3 ; flag's byte - dw SaffronGymBattleText3 ; 0x520e TextBeforeBattle - dw SaffronGymAfterBattleText3 ; 0x5218 TextAfterBattle - dw SaffronGymEndBattleText3 ; 0x5213 TextEndBattle - dw SaffronGymEndBattleText3 ; 0x5213 TextEndBattle + dw SaffronGymBattleText3 ; TextBeforeBattle + dw SaffronGymAfterBattleText3 ; TextAfterBattle + dw SaffronGymEndBattleText3 ; TextEndBattle + dw SaffronGymEndBattleText3 ; TextEndBattle SaffronGymTrainerHeader3: ; 5d0e7 (17:50e7) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b3 ; flag's byte - dw SaffronGymBattleText4 ; 0x521d TextBeforeBattle - dw SaffronGymAfterBattleText4 ; 0x5227 TextAfterBattle - dw SaffronGymEndBattleText4 ; 0x5222 TextEndBattle - dw SaffronGymEndBattleText4 ; 0x5222 TextEndBattle + dw SaffronGymBattleText4 ; TextBeforeBattle + dw SaffronGymAfterBattleText4 ; TextAfterBattle + dw SaffronGymEndBattleText4 ; TextEndBattle + dw SaffronGymEndBattleText4 ; TextEndBattle SaffronGymTrainerHeader4: ; 5d0f3 (17:50f3) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b3 ; flag's byte - dw SaffronGymBattleText5 ; 0x522c TextBeforeBattle - dw SaffronGymAfterBattleText5 ; 0x5236 TextAfterBattle - dw SaffronGymEndBattleText5 ; 0x5231 TextEndBattle - dw SaffronGymEndBattleText5 ; 0x5231 TextEndBattle + dw SaffronGymBattleText5 ; TextBeforeBattle + dw SaffronGymAfterBattleText5 ; TextAfterBattle + dw SaffronGymEndBattleText5 ; TextEndBattle + dw SaffronGymEndBattleText5 ; TextEndBattle SaffronGymTrainerHeader5: ; 5d0ff (17:50ff) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b3 ; flag's byte - dw SaffronGymBattleText6 ; 0x523b TextBeforeBattle - dw SaffronGymAfterBattleText6 ; 0x5245 TextAfterBattle - dw SaffronGymEndBattleText6 ; 0x5240 TextEndBattle - dw SaffronGymEndBattleText6 ; 0x5240 TextEndBattle + dw SaffronGymBattleText6 ; TextBeforeBattle + dw SaffronGymAfterBattleText6 ; TextAfterBattle + dw SaffronGymEndBattleText6 ; TextEndBattle + dw SaffronGymEndBattleText6 ; TextEndBattle SaffronGymTrainerHeader6: ; 5d10b (17:510b) db $8 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7b3 ; flag's byte - dw SaffronGymBattleText7 ; 0x524a TextBeforeBattle - dw SaffronGymAfterBattleText7 ; 0x5254 TextAfterBattle - dw SaffronGymEndBattleText7 ; 0x524f TextEndBattle - dw SaffronGymEndBattleText7 ; 0x524f TextEndBattle + dw SaffronGymBattleText7 ; TextBeforeBattle + dw SaffronGymAfterBattleText7 ; TextAfterBattle + dw SaffronGymEndBattleText7 ; TextEndBattle + dw SaffronGymEndBattleText7 ; TextEndBattle db $ff @@ -160,17 +160,17 @@ SaffronGymText1: ; 5d118 (17:5118) db $08 ; asm ld a, [wd7b3] bit 1, a - jr z, .asm_e3544 ; 0x5d11e + jr z, .asm_5d134 bit 0, a - jr nz, .asm_8d2f6 ; 0x5d122 + jr nz, .asm_5d12c call z, SaffronGymText_5d068 call DisableWaitingAfterTextDisplay - jr .asm_34c2c ; 0x5d12a -.asm_8d2f6 ; 0x5d12c + jr .asm_5d15f +.asm_5d12c ld hl, SaffronGymText_5d16e call PrintText - jr .asm_34c2c ; 0x5d132 -.asm_e3544 ; 0x5d134 + jr .asm_5d15f +.asm_5d134 ld hl, SaffronGymText_5d162 call PrintText ld hl, wd72d @@ -187,7 +187,7 @@ SaffronGymText1: ; 5d118 (17:5118) ld [W_GYMLEADERNO], a ld a, $3 ld [W_SAFFRONGYMCURSCRIPT], a -.asm_34c2c ; 0x5d15f +.asm_5d15f jp TextScriptEnd SaffronGymText_5d162: ; 5d162 (17:5162) @@ -195,7 +195,7 @@ SaffronGymText_5d162: ; 5d162 (17:5162) db "@" SaffronGymText_5d167: ; 5d167 (17:5167) - TX_FAR _SaffronGymText_5d167 ; 0xa1c73 + TX_FAR _SaffronGymText_5d167 db $11 ; play same sound as red giving oak parcel db $6 ; wait for keypress db "@" @@ -264,14 +264,14 @@ SaffronGymText9: ; 5d1cd (17:51cd) db $08 ; asm ld a, [wd7b3] bit 1, a - jr nz, .asm_13f3c ; 0x5d1d3 + jr nz, .asm_5d1dd ld hl, SaffronGymText_5d1e6 call PrintText - jr .asm_e9907 ; 0x5d1db -.asm_13f3c ; 0x5d1dd + jr .asm_5d1e3 +.asm_5d1dd ld hl, SaffronGymText_5d1eb call PrintText -.asm_e9907 ; 0x5d1e3 +.asm_5d1e3 jp TextScriptEnd SaffronGymText_5d1e6: ; 5d1e6 (17:51e6) diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index 727fd981..5c1e0e41 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -8,7 +8,7 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) db $08 ; asm ld a, [wd7bd] bit 0, a - jr nz, .asm_9e72b ; 0x1de47 + jr nz, .asm_9e72b ld hl, TM29PreReceiveText call PrintText ld bc,(TM_29 << 8) | 1 @@ -18,15 +18,15 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) call PrintText ld hl, wd7bd set 0, [hl] - jr .asm_fe4e1 ; 0x1de62 + jr .asm_fe4e1 .BagFull ld hl, TM29NoRoomText call PrintText - jr .asm_fe4e1 ; 0x1de6a -.asm_9e72b ; 0x1de6c + jr .asm_fe4e1 +.asm_9e72b ld hl, TM29ExplanationText call PrintText -.asm_fe4e1 ; 0x1de72 +.asm_fe4e1 jp TextScriptEnd TM29PreReceiveText: ; 1de75 (7:5e75) diff --git a/scripts/seafoamislands1.asm b/scripts/seafoamislands1.asm index 2e64c9d7..6a8b23ea 100755 --- a/scripts/seafoamislands1.asm +++ b/scripts/seafoamislands1.asm @@ -5,20 +5,20 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) ld hl, wFlags_0xcd60 bit 7, [hl] res 7, [hl] - jr z, .asm_4483b ; 0x447f8 $41 + jr z, .asm_4483b ld hl, Seafoam1HolesCoords call CheckBoulderCoords ret nc ld hl, wd7e8 ld a, [wWhichTrade] cp $1 - jr nz, .asm_44819 ; 0x44809 $e + jr nz, .asm_44819 set 6, [hl] ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd07a], a - jr .asm_44825 ; 0x44817 $c + jr .asm_44825 .asm_44819 set 7, [hl] ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_2 diff --git a/scripts/seafoamislands2.asm b/scripts/seafoamislands2.asm index 66fe9297..44e92bd0 100755 --- a/scripts/seafoamislands2.asm +++ b/scripts/seafoamislands2.asm @@ -3,20 +3,20 @@ SeafoamIslands2Script: ; 46315 (11:6315) ld hl, wFlags_0xcd60 bit 7, [hl] res 7, [hl] - jr z, .asm_46362 ; 0x4631f $41 + jr z, .asm_46362 ld hl, Seafoam2HolesCoords call CheckBoulderCoords ret nc ld hl, wd87f ld a, [wWhichTrade] cp $1 - jr nz, .asm_46340 ; 0x46330 $e + jr nz, .asm_46340 set 0, [hl] ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd07a], a - jr .asm_4634c ; 0x4633e $c + jr .asm_4634c .asm_46340 set 1, [hl] ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 diff --git a/scripts/seafoamislands3.asm b/scripts/seafoamislands3.asm index fb7d05ba..882553ab 100755 --- a/scripts/seafoamislands3.asm +++ b/scripts/seafoamislands3.asm @@ -3,20 +3,20 @@ SeafoamIslands3Script: ; 46451 (11:6451) ld hl, wFlags_0xcd60 bit 7, [hl] res 7, [hl] - jr z, .asm_4649e ; 0x4645b $41 + jr z, .asm_4649e ld hl, Seafoam3HolesCoords call CheckBoulderCoords ret nc ld hl, wd880 ld a, [wWhichTrade] cp $1 - jr nz, .asm_4647c ; 0x4646c $e + jr nz, .asm_4647c set 0, [hl] ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_3 ld [wd07a], a - jr .asm_46488 ; 0x4647a $c + jr .asm_46488 .asm_4647c set 1, [hl] ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 diff --git a/scripts/seafoamislands4.asm b/scripts/seafoamislands4.asm index 7e519f86..1eda0436 100755 --- a/scripts/seafoamislands4.asm +++ b/scripts/seafoamislands4.asm @@ -3,20 +3,20 @@ SeafoamIslands4Script: ; 4658d (11:658d) ld hl, wFlags_0xcd60 bit 7, [hl] res 7, [hl] - jr z, .asm_465dc ; 0x46597 $43 + jr z, .asm_465dc ld hl, Seafoam4HolesCoords call CheckBoulderCoords ret nc ld hl, wd881 ld a, [wWhichTrade] cp $1 - jr nz, .asm_465b8 ; 0x465a8 $e + jr nz, .asm_465b8 set 0, [hl] ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_1 ld [wd07a], a - jr .asm_465c4 ; 0x465b6 $c + jr .asm_465c4 .asm_465b8 set 1, [hl] ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_2 @@ -30,7 +30,7 @@ SeafoamIslands4Script: ; 4658d (11:658d) ld a, [wd07a] ld [wcc4d], a predef ShowObject - jr .asm_465ed ; 0x465da $11 + jr .asm_465ed .asm_465dc ld a, $a2 ld [wDungeonWarpDestinationMap], a diff --git a/scripts/seafoamislands5.asm b/scripts/seafoamislands5.asm index b554034b..eff92886 100755 --- a/scripts/seafoamislands5.asm +++ b/scripts/seafoamislands5.asm @@ -146,10 +146,10 @@ SeafoamIslands5TrainerHeader0: ; 46886 (11:6886) db $2 ; flag's bit db ($0 << 4) ; trainer's view range dw wd882 ; flag's byte - dw SeafoamIslands5BattleText2 ; 0x68a2 TextBeforeBattle - dw SeafoamIslands5BattleText2 ; 0x68a2 TextAfterBattle - dw SeafoamIslands5BattleText2 ; 0x68a2 TextEndBattle - dw SeafoamIslands5BattleText2 ; 0x68a2 TextEndBattle + dw SeafoamIslands5BattleText2 ; TextBeforeBattle + dw SeafoamIslands5BattleText2 ; TextAfterBattle + dw SeafoamIslands5BattleText2 ; TextEndBattle + dw SeafoamIslands5BattleText2 ; TextEndBattle db $ff diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index 7d044aca..2a4afe72 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -13,7 +13,7 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_5a173 ; $6173 + ld hl, DataTable_5a173 call SilphCo2Script_59d43 call SilphCo10Text_5a176 ld a, [wd836] @@ -53,19 +53,19 @@ SilphCo10TrainerHeader0: ; 5a192 (16:6192) db $1 ; flag's bit db ($3 << 4) ; trainer's view range dw wd835 ; flag's byte - dw SilphCo10BattleText1 ; 0x61dd TextBeforeBattle - dw SilphCo10AfterBattleText1 ; 0x61e7 TextAfterBattle - dw SilphCo10EndBattleText1 ; 0x61e2 TextEndBattle - dw SilphCo10EndBattleText1 ; 0x61e2 TextEndBattle + dw SilphCo10BattleText1 ; TextBeforeBattle + dw SilphCo10AfterBattleText1 ; TextAfterBattle + dw SilphCo10EndBattleText1 ; TextEndBattle + dw SilphCo10EndBattleText1 ; TextEndBattle SilphCo10TrainerHeader1: ; 5a19e (16:619e) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd835 ; flag's byte - dw SilphCo10BattleText2 ; 0x61ec TextBeforeBattle - dw SilphCo10AfterBattleText2 ; 0x61f6 TextAfterBattle - dw SilphCo10EndBattleText2 ; 0x61f1 TextEndBattle - dw SilphCo10EndBattleText2 ; 0x61f1 TextEndBattle + dw SilphCo10BattleText2 ; TextBeforeBattle + dw SilphCo10AfterBattleText2 ; TextAfterBattle + dw SilphCo10EndBattleText2 ; TextEndBattle + dw SilphCo10EndBattleText2 ; TextEndBattle db $ff diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index 7bb6e448..f625d419 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -13,7 +13,7 @@ SilphCo11Script_62110: ; 62110 (18:6110) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_62134 ; $6134 + ld hl, DataTable_62134 call SilphCo11Script_62137 call SilphCo11Script_62163 ld a, [wd838] @@ -72,7 +72,7 @@ SilphCo11Script_62163: ; 62163 (18:6163) ret SilphCo11Script_6216d: ; 6216d (18:616d) - ld hl, MissableObjectIDs_6219b ; $619b + ld hl, MissableObjectIDs_6219b .asm_62170 ld a, [hli] cp $ff @@ -83,7 +83,7 @@ SilphCo11Script_6216d: ; 6216d (18:616d) pop hl jr .asm_62170 .asm_62181 - ld hl, MissableObjectIDs_62194 ; $6194 + ld hl, MissableObjectIDs_62194 .asm_62184 ld a, [hli] cp $ff @@ -167,20 +167,20 @@ SilphCo11Script0: ; 621db (18:61db) ld a, [wd838] bit 7, a ret nz - ld hl, CoordsData_62211 ; $6211 + ld hl, CoordsData_62211 call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] ld [wcf0d], a xor a ld [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a ld a, $3 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, $3 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call SetSpriteMovementBytesToFF ld de, MovementData_62216 call MoveSprite @@ -198,13 +198,13 @@ MovementData_62216: ; 62216 (18:6216) SilphCo11Script_6221a: ; 6221a (18:621a) ld [wd528], a ld a, $3 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a ld a, b ld [$ff8d], a jp SetSpriteFacingDirectionAndDelay SilphCo11Script5: ; 62227 (18:6227) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, SilphCo11Script_621c4 ld a, [wcf0d] @@ -221,7 +221,7 @@ SilphCo11Script5: ; 62227 (18:6227) ld a, $f0 ld [wJoyIgnore], a ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID call GBFadeOutToBlack call SilphCo11Script_6216d @@ -239,7 +239,7 @@ SilphCo11Script3: ; 6226a (18:626a) bit 0, a ret nz ld a, $3 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call SetSpriteMovementBytesToFF ld a, [wcf0d] cp $1 @@ -260,10 +260,10 @@ SilphCo11Script4: ; 62293 (18:6293) ld hl, wd72d set 6, [hl] set 7, [hl] - ld hl, SilphCo10Text_62330 ; $6330 - ld de, SilphCo10Text_62330 ; $6330 + ld hl, SilphCo10Text_62330 + ld de, SilphCo10Text_62330 call SaveEndBattleTextPointers - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + ld a, [H_DOWNARROWBLINKCNT2] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters @@ -285,19 +285,19 @@ SilphCo11TrainerHeader0: ; 622c3 (18:62c3) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd837 ; flag's byte - dw SilphCo11BattleText1 ; 0x6344 TextBeforeBattle - dw SilphCo11AfterBattleText1 ; 0x634e TextAfterBattle - dw SilphCo11EndBattleText1 ; 0x6349 TextEndBattle - dw SilphCo11EndBattleText1 ; 0x6349 TextEndBattle + dw SilphCo11BattleText1 ; TextBeforeBattle + dw SilphCo11AfterBattleText1 ; TextAfterBattle + dw SilphCo11EndBattleText1 ; TextEndBattle + dw SilphCo11EndBattleText1 ; TextEndBattle SilphCo11TrainerHeader1: ; 622cf (18:62cf) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd837 ; flag's byte - dw SilphCo11BattleText2 ; 0x635d TextBeforeBattle - dw SilphCo11AfterBattleText2 ; 0x6367 TextAfterBattle - dw SilphCo11EndBattleText2 ; 0x6362 TextEndBattle - dw SilphCo11EndBattleText2 ; 0x6362 TextEndBattle + dw SilphCo11BattleText2 ; TextBeforeBattle + dw SilphCo11AfterBattleText2 ; TextAfterBattle + dw SilphCo11EndBattleText2 ; TextEndBattle + dw SilphCo11EndBattleText2 ; TextEndBattle db $ff @@ -315,15 +315,15 @@ SilphCo11Text1: ; 622dc (18:62dc) call PrintText ld hl, wd838 set 5, [hl] - jr .asm_fd405 ; 0x622fe + jr .asm_6230e .BagFull ld hl, SilphCoMasterBallNoRoomText call PrintText - jr .asm_fd405 ; 0x62306 -.asm_62308 ; 0x62308 + jr .asm_6230e +.asm_62308 ld hl, SilphCo10Text_6231c call PrintText -.asm_fd405 ; 0x6230e +.asm_6230e jp TextScriptEnd SilphCoPresidentText: ; 62311 (18:6311) diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index 63803acd..906e4d56 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -102,37 +102,37 @@ SilphCo2TrainerHeader0: ; 59d90 (16:5d90) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd825 ; flag's byte - dw SilphCo2BattleText1 ; 0x5e2a TextBeforeBattle - dw SilphCo2AfterBattleText1 ; 0x5e34 TextAfterBattle - dw SilphCo2EndBattleText1 ; 0x5e2f TextEndBattle - dw SilphCo2EndBattleText1 ; 0x5e2f TextEndBattle + dw SilphCo2BattleText1 ; TextBeforeBattle + dw SilphCo2AfterBattleText1 ; TextAfterBattle + dw SilphCo2EndBattleText1 ; TextEndBattle + dw SilphCo2EndBattleText1 ; TextEndBattle SilphCo2TrainerHeader1: ; 59d9c (16:5d9c) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd825 ; flag's byte - dw SilphCo2BattleText2 ; 0x5e39 TextBeforeBattle - dw SilphCo2AfterBattleText2 ; 0x5e43 TextAfterBattle - dw SilphCo2EndBattleText2 ; 0x5e3e TextEndBattle - dw SilphCo2EndBattleText2 ; 0x5e3e TextEndBattle + dw SilphCo2BattleText2 ; TextBeforeBattle + dw SilphCo2AfterBattleText2 ; TextAfterBattle + dw SilphCo2EndBattleText2 ; TextEndBattle + dw SilphCo2EndBattleText2 ; TextEndBattle SilphCo2TrainerHeader2: ; 59da8 (16:5da8) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd825 ; flag's byte - dw SilphCo2BattleText3 ; 0x5e48 TextBeforeBattle - dw SilphCo2AfterBattleText3 ; 0x5e52 TextAfterBattle - dw SilphCo2EndBattleText3 ; 0x5e4d TextEndBattle - dw SilphCo2EndBattleText3 ; 0x5e4d TextEndBattle + dw SilphCo2BattleText3 ; TextBeforeBattle + dw SilphCo2AfterBattleText3 ; TextAfterBattle + dw SilphCo2EndBattleText3 ; TextEndBattle + dw SilphCo2EndBattleText3 ; TextEndBattle SilphCo2TrainerHeader3: ; 59db4 (16:5db4) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd825 ; flag's byte - dw SilphCo2BattleText4 ; 0x5e57 TextBeforeBattle - dw SilphCo2AfterBattleText4 ; 0x5e61 TextAfterBattle - dw SilphCo2EndBattleText4 ; 0x5e5c TextEndBattle - dw SilphCo2EndBattleText4 ; 0x5e5c TextEndBattle + dw SilphCo2BattleText4 ; TextBeforeBattle + dw SilphCo2AfterBattleText4 ; TextAfterBattle + dw SilphCo2EndBattleText4 ; TextEndBattle + dw SilphCo2EndBattleText4 ; TextEndBattle db $ff @@ -140,20 +140,20 @@ SilphCo2Text1: ; 59dc1 (16:5dc1) db $08 ; asm ld a, [wd826] bit 7, a - jr nz, asm_b8a0d ; 0x59dc7 + jr nz, .asm_59de4 ld hl, SilphCo2Text_59ded call PrintText ld bc, (TM_36 << 8) | 1 call GiveItem ld hl, TM36NoRoomText - jr nc, asm_2c1e0 ; 0x59dd8 + jr nc, .asm_59de7 ld hl, wd826 set 7, [hl] ld hl, ReceivedTM36Text - jr asm_2c1e0 ; 0x59de2 -asm_b8a0d ; 0x59de4 + jr .asm_59de7 +.asm_59de4 ld hl, TM36ExplanationText -asm_2c1e0 ; 0x59de7 +.asm_59de7 call PrintText jp TextScriptEnd diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index 7b0c67c1..13eb9e84 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -13,7 +13,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_59fa8 ; $5fa8 + ld hl, DataTable_59fa8 call SilphCo2Script_59d43 call SilphCo3Script_59fad ld a, [wd828] @@ -65,19 +65,19 @@ SilphCo3TrainerHeader0: ; 59fcc (16:5fcc) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd827 ; flag's byte - dw SilphCo3BattleText1 ; 0x600d TextBeforeBattle - dw SilphCo3AfterBattleText1 ; 0x6017 TextAfterBattle - dw SilphCo3EndBattleText1 ; 0x6012 TextEndBattle - dw SilphCo3EndBattleText1 ; 0x6012 TextEndBattle + dw SilphCo3BattleText1 ; TextBeforeBattle + dw SilphCo3AfterBattleText1 ; TextAfterBattle + dw SilphCo3EndBattleText1 ; TextEndBattle + dw SilphCo3EndBattleText1 ; TextEndBattle SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd827 ; flag's byte - dw SilphCo3BattleText2 ; 0x6026 TextBeforeBattle - dw SilphCo3AfterBattleText2 ; 0x6030 TextAfterBattle - dw SilphCo3EndBattleText2 ; 0x602b TextEndBattle - dw SilphCo3EndBattleText2 ; 0x602b TextEndBattle + dw SilphCo3BattleText2 ; TextBeforeBattle + dw SilphCo3AfterBattleText2 ; TextAfterBattle + dw SilphCo3EndBattleText2 ; TextEndBattle + dw SilphCo3EndBattleText2 ; TextEndBattle db $ff @@ -86,9 +86,9 @@ SilphCo3Text1: ; 59fe5 (16:5fe5) ld a, [wd838] bit 7, a ld hl, SilphCo3Text_59ffe - jr nz, asm_8c56f ; 0x59fee + jr nz, .asm_59fee ld hl, SilphCo3Text_59ff9 -asm_8c56f ; 0x59ff3 +.asm_59fee call PrintText jp TextScriptEnd diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index 15a46dd3..18d56587 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -49,19 +49,19 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) .asm_19d69 ld a, [hli] cp $ff - jr z, .asm_19d85 ; 0x19d6c $17 + jr z, .asm_19d85 push hl ld hl, $ffe0 inc [hl] pop hl cp b - jr z, .asm_19d7a ; 0x19d75 $3 + jr z, .asm_19d7a inc hl - jr .asm_19d69 ; 0x19d78 $ef + jr .asm_19d69 .asm_19d7a ld a, [hli] cp c - jr nz, .asm_19d69 ; 0x19d7c $eb + jr nz, .asm_19d69 ld hl, wCardKeyDoorY xor a ld [hli], a @@ -78,7 +78,7 @@ SilphCo4Script_19d89: ; 19d89 (6:5d89) and a ret z cp $1 - jr nz, .asm_19d97 ; 0x19d92 $3 + jr nz, .asm_19d97 set 0, [hl] ret .asm_19d97 @@ -104,28 +104,28 @@ SilphCo4TrainerHeader0: ; 19dae (6:5dae) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd829 ; flag's byte - dw SilphCo4BattleText2 ; 0x5df4 TextBeforeBattle - dw SilphCo4AfterBattleText2 ; 0x5dfe TextAfterBattle - dw SilphCo4EndBattleText2 ; 0x5df9 TextEndBattle - dw SilphCo4EndBattleText2 ; 0x5df9 TextEndBattle + dw SilphCo4BattleText2 ; TextBeforeBattle + dw SilphCo4AfterBattleText2 ; TextAfterBattle + dw SilphCo4EndBattleText2 ; TextEndBattle + dw SilphCo4EndBattleText2 ; TextEndBattle SilphCo4TrainerHeader2: ; 19dba (6:5dba) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd829 ; flag's byte - dw SilphCo4BattleText3 ; 0x5e0d TextBeforeBattle - dw SilphCo4AfterBattleText3 ; 0x5e17 TextAfterBattle - dw SilphCo4EndBattleText3 ; 0x5e12 TextEndBattle - dw SilphCo4EndBattleText3 ; 0x5e12 TextEndBattle + dw SilphCo4BattleText3 ; TextBeforeBattle + dw SilphCo4AfterBattleText3 ; TextAfterBattle + dw SilphCo4EndBattleText3 ; TextEndBattle + dw SilphCo4EndBattleText3 ; TextEndBattle SilphCo4TrainerHeader3: ; 19dc6 (6:5dc6) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd829 ; flag's byte - dw SilphCo4BattleText4 ; 0x5e26 TextBeforeBattle - dw SilphCo4AfterBattleText4 ; 0x5e30 TextAfterBattle - dw SilphCo4EndBattleText4 ; 0x5e2b TextEndBattle - dw SilphCo4EndBattleText4 ; 0x5e2b TextEndBattle + dw SilphCo4BattleText4 ; TextBeforeBattle + dw SilphCo4AfterBattleText4 ; TextAfterBattle + dw SilphCo4EndBattleText4 ; TextEndBattle + dw SilphCo4EndBattleText4 ; TextEndBattle db $ff diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index 0b63708b..4417466d 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -18,7 +18,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) call SilphCo5Script_19f9e ld a, [wd82c] bit 0, a - jr nz, .asm_19f74 ; 0x19f63 $f + jr nz, .asm_19f74 push af ld a, $5f ld [wd09f], a @@ -27,7 +27,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) pop af .asm_19f74 bit 1, a - jr nz, .asm_19f87 ; 0x19f76 $f + jr nz, .asm_19f87 push af ld a, $5f ld [wd09f], a @@ -42,7 +42,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) ld bc, $0507 predef_jump ReplaceTileBlock -SilphCo5Coords: ; 19f97 (6:5f97) ; coords? +SilphCo5Coords: ; 19f97 (6:5f97) db $02, $03, $06, $03, $05, $07, $ff SilphCo5Script_19f9e: ; 19f9e (6:5f9e) @@ -51,12 +51,12 @@ SilphCo5Script_19f9e: ; 19f9e (6:5f9e) and a ret z cp $1 - jr nz, .asm_19fac ; 0x19fa7 $3 + jr nz, .asm_19fac set 0, [hl] ret .asm_19fac cp $2 - jr nz, .asm_19fb3 ; 0x19fae $3 + jr nz, .asm_19fb3 set 1, [hl] ret .asm_19fb3 @@ -86,37 +86,37 @@ Silphco5TrainerHeader0: ; 19fd2 (6:5fd2) db $2 ; flag's bit db ($1 << 4) ; trainer's view range dw wd82b ; flag's byte - dw SilphCo5BattleText2 ; 0x6024 TextBeforeBattle - dw SilphCo5AfterBattleText2 ; 0x602e TextAfterBattle - dw SilphCo5EndBattleText2 ; 0x6029 TextEndBattle - dw SilphCo5EndBattleText2 ; 0x6029 TextEndBattle + dw SilphCo5BattleText2 ; TextBeforeBattle + dw SilphCo5AfterBattleText2 ; TextAfterBattle + dw SilphCo5EndBattleText2 ; TextEndBattle + dw SilphCo5EndBattleText2 ; TextEndBattle Silphco5TrainerHeader2: ; 19fde (6:5fde) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd82b ; flag's byte - dw SilphCo5BattleText3 ; 0x603d TextBeforeBattle - dw SilphCo5AfterBattleText3 ; 0x6047 TextAfterBattle - dw SilphCo5EndBattleText3 ; 0x6042 TextEndBattle - dw SilphCo5EndBattleText3 ; 0x6042 TextEndBattle + dw SilphCo5BattleText3 ; TextBeforeBattle + dw SilphCo5AfterBattleText3 ; TextAfterBattle + dw SilphCo5EndBattleText3 ; TextEndBattle + dw SilphCo5EndBattleText3 ; TextEndBattle Silphco5TrainerHeader3: ; 19fea (6:5fea) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd82b ; flag's byte - dw SilphCo5BattleText4 ; 0x6056 TextBeforeBattle - dw SilphCo5AfterBattleText4 ; 0x6060 TextAfterBattle - dw SilphCo5EndBattleText4 ; 0x605b TextEndBattle - dw SilphCo5EndBattleText4 ; 0x605b TextEndBattle + dw SilphCo5BattleText4 ; TextBeforeBattle + dw SilphCo5AfterBattleText4 ; TextAfterBattle + dw SilphCo5EndBattleText4 ; TextEndBattle + dw SilphCo5EndBattleText4 ; TextEndBattle Silphco5TrainerHeader4: ; 19ff6 (6:5ff6) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd82b ; flag's byte - dw SilphCo5BattleText5 ; 0x606f TextBeforeBattle - dw SilphCo5AfterBattleText5 ; 0x6079 TextAfterBattle - dw SilphCo5EndBattleText5 ; 0x6074 TextEndBattle - dw SilphCo5EndBattleText5 ; 0x6074 TextEndBattle + dw SilphCo5BattleText5 ; TextBeforeBattle + dw SilphCo5AfterBattleText5 ; TextAfterBattle + dw SilphCo5EndBattleText5 ; TextEndBattle + dw SilphCo5EndBattleText5 ; TextEndBattle db $ff diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index 137e31be..63179fbb 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -58,36 +58,36 @@ SilphCo6TrainerHeader0: ; 1a20a (6:620a) db $6 ; flag's bit db ($2 << 4) ; trainer's view range dw wd82d ; flag's byte - dw SilphCo6BattleText2 ; 0x62ba TextBeforeBattle - dw SilphCo6AfterBattleText2 ; 0x62c4 TextAfterBattle - dw SilphCo6EndBattleText2 ; 0x62bf TextEndBattle - dw SilphCo6EndBattleText2 ; 0x62bf TextEndBattle + dw SilphCo6BattleText2 ; TextBeforeBattle + dw SilphCo6AfterBattleText2 ; TextAfterBattle + dw SilphCo6EndBattleText2 ; TextEndBattle + dw SilphCo6EndBattleText2 ; TextEndBattle SilphCo6TrainerHeader2: ; 1a216 (6:6216) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd82d ; flag's byte - dw SilphCo6BattleText3 ; 0x62d3 TextBeforeBattle - dw SilphCo6AfterBattleText3 ; 0x62dd TextAfterBattle - dw SilphCo6EndBattleText3 ; 0x62d8 TextEndBattle - dw SilphCo6EndBattleText3 ; 0x62d8 TextEndBattle + dw SilphCo6BattleText3 ; TextBeforeBattle + dw SilphCo6AfterBattleText3 ; TextAfterBattle + dw SilphCo6EndBattleText3 ; TextEndBattle + dw SilphCo6EndBattleText3 ; TextEndBattle SilphCo6TrainerHeader3: ; 1a222 (6:6222) db $8 ; flag's bit db ($2 << 4) ; trainer's view range dw wd82d ; flag's byte - dw SilphCo6BattleText4 ; 0x62ec TextBeforeBattle - dw SilphCo6AfterBattleText4 ; 0x62f6 TextAfterBattle - dw SilphCo6EndBattleText4 ; 0x62f1 TextEndBattle - dw SilphCo6EndBattleText4 ; 0x62f1 TextEndBattle + dw SilphCo6BattleText4 ; TextBeforeBattle + dw SilphCo6AfterBattleText4 ; TextAfterBattle + dw SilphCo6EndBattleText4 ; TextEndBattle + dw SilphCo6EndBattleText4 ; TextEndBattle db $ff SilphCo6Script_1a22f: ; 1a22f (6:622f) ld a, [wd838] bit 7, a - jr nz, .asm_1a238 ; 0x1a234 $2 - jr .asm_1a23a ; 0x1a236 $2 + jr nz, .asm_1a238 + jr .asm_1a23a .asm_1a238 ld h, d ld l, e diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 23eb795c..e6d9bcac 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -13,7 +13,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_51bc1 ; $5bc1 + ld hl, DataTable_51bc1 call SilphCo7Text_51bc8 call SilphCo7Text_51bf4 ld a, [wd830] @@ -136,20 +136,20 @@ SilphCo7Script0: ; 51c23 (14:5c23) ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call SetSpriteMovementBytesToFF ld de, MovementData_51c7d - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] ld [wcf0d], a cp $1 jr z, .asm_51c6c inc de .asm_51c6c ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call MoveSprite ld a, $3 jp SilphCo7Text_51c10 @@ -169,18 +169,18 @@ SilphCo7Script3: ; 51c82 (14:5c82) xor a ld [wJoyIgnore], a ld a, $d - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID call Delay3 ld hl, wd72d set 6, [hl] set 7, [hl] - ld hl, SilphCo7Text14 ; $5ec8 - ld de, SilphCo7Text_51ecd ; $5ecd + ld hl, SilphCo7Text14 + ld de, SilphCo7Text_51ecd call SaveEndBattleTextPointers ld a, SONY2 + $c8 - ld [W_CUROPPONENT], a ; wd059 - ld a, [W_RIVALSTARTER] ; wd715 + ld [W_CUROPPONENT], a + ld a, [W_RIVALSTARTER] cp STARTER2 jr nz, .asm_51cb6 ld a, $7 @@ -193,12 +193,12 @@ SilphCo7Script3: ; 51c82 (14:5c82) .asm_51cbe ld a, $9 .asm_51cc0 - ld [W_TRAINERNO], a ; wd05d + ld [W_TRAINERNO], a ld a, $4 jp SilphCo7Text_51c10 SilphCo7Script4: ; 51cc8 (14:5cc8) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, SilphCo7Text_51c0c ld a, $f0 @@ -208,12 +208,12 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) ld a, $4 ld [wd528], a ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a ld a, $4 ld [$ff8d], a call SetSpriteFacingDirectionAndDelay ld a, $f - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, $ff ld [wc0ee], a @@ -226,7 +226,7 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) ld de, MovementData_51d1a .asm_51d0e ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call MoveSprite ld a, $5 jp SilphCo7Text_51c10 @@ -271,37 +271,37 @@ SilphCo7TrainerHeader0: ; 51d5d (14:5d5d) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd82f ; flag's byte - dw SilphCo7BattleText1 ; 0x5e5a TextBeforeBattle - dw SilphCo7AfterBattleText1 ; 0x5e64 TextAfterBattle - dw SilphCo7EndBattleText1 ; 0x5e5f TextEndBattle - dw SilphCo7EndBattleText1 ; 0x5e5f TextEndBattle + dw SilphCo7BattleText1 ; TextBeforeBattle + dw SilphCo7AfterBattleText1 ; TextAfterBattle + dw SilphCo7EndBattleText1 ; TextEndBattle + dw SilphCo7EndBattleText1 ; TextEndBattle SilphCo7TrainerHeader2: ; 51d69 (14:5d69) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd82f ; flag's byte - dw SilphCo7BattleText2 ; 0x5e73 TextBeforeBattle - dw SilphCo7AfterBattleText2 ; 0x5e7d TextAfterBattle - dw SilphCo7EndBattleText2 ; 0x5e78 TextEndBattle - dw SilphCo7EndBattleText2 ; 0x5e78 TextEndBattle + dw SilphCo7BattleText2 ; TextBeforeBattle + dw SilphCo7AfterBattleText2 ; TextAfterBattle + dw SilphCo7EndBattleText2 ; TextEndBattle + dw SilphCo7EndBattleText2 ; TextEndBattle SilphCo7TrainerHeader3: ; 51d75 (14:5d75) db $7 ; flag's bit db ($3 << 4) ; trainer's view range dw wd82f ; flag's byte - dw SilphCo7BattleText3 ; 0x5e8c TextBeforeBattle - dw SilphCo7AfterBattleText3 ; 0x5e96 TextAfterBattle - dw SilphCo7EndBattleText3 ; 0x5e91 TextEndBattle - dw SilphCo7EndBattleText3 ; 0x5e91 TextEndBattle + dw SilphCo7BattleText3 ; TextBeforeBattle + dw SilphCo7AfterBattleText3 ; TextAfterBattle + dw SilphCo7EndBattleText3 ; TextEndBattle + dw SilphCo7EndBattleText3 ; TextEndBattle SilphCo7TrainerHeader4: ; 51d81 (14:5d81) db $8 ; flag's bit db ($4 << 4) ; trainer's view range dw wd82f ; flag's byte - dw SilphCo7BattleText4 ; 0x5ea5 TextBeforeBattle - dw SilphCo7AfterBattleText4 ; 0x5eaf TextAfterBattle - dw SilphCo7EndBattleText4 ; 0x5eaa TextEndBattle - dw SilphCo7EndBattleText4 ; 0x5eaa TextEndBattle + dw SilphCo7BattleText4 ; TextBeforeBattle + dw SilphCo7AfterBattleText4 ; TextAfterBattle + dw SilphCo7EndBattleText4 ; TextEndBattle + dw SilphCo7EndBattleText4 ; TextEndBattle db $ff diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index ebca9b95..af7369b7 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -13,7 +13,7 @@ SilphCo8Script_5651a: ; 5651a (15:651a) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_5653e ; $653e + ld hl, DataTable_5653e call SilphCo8Script_56541 call SilphCo8Script_5656d ld a, [wd832] @@ -87,28 +87,28 @@ SilphCo8TrainerHeader0: ; 56585 (15:6585) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd831 ; flag's byte - dw SilphCo8BattleText1 ; 0x65e6 TextBeforeBattle - dw SilphCo8AfterBattleText1 ; 0x65f0 TextAfterBattle - dw SilphCo8EndBattleText1 ; 0x65eb TextEndBattle - dw SilphCo8EndBattleText1 ; 0x65eb TextEndBattle + dw SilphCo8BattleText1 ; TextBeforeBattle + dw SilphCo8AfterBattleText1 ; TextAfterBattle + dw SilphCo8EndBattleText1 ; TextEndBattle + dw SilphCo8EndBattleText1 ; TextEndBattle SilphCo8TrainerHeader1: ; 56591 (15:6591) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd831 ; flag's byte - dw SilphCo8BattleText2 ; 0x65f5 TextBeforeBattle - dw SilphCo8AfterBattleText2 ; 0x65ff TextAfterBattle - dw SilphCo8EndBattleText2 ; 0x65fa TextEndBattle - dw SilphCo8EndBattleText2 ; 0x65fa TextEndBattle + dw SilphCo8BattleText2 ; TextBeforeBattle + dw SilphCo8AfterBattleText2 ; TextAfterBattle + dw SilphCo8EndBattleText2 ; TextEndBattle + dw SilphCo8EndBattleText2 ; TextEndBattle SilphCo8TrainerHeader2: ; 5659d (15:659d) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd831 ; flag's byte - dw SilphCo8BattleText3 ; 0x6604 TextBeforeBattle - dw SilphCo8AfterBattleText3 ; 0x660e TextAfterBattle - dw SilphCo8EndBattleText3 ; 0x6609 TextEndBattle - dw SilphCo8EndBattleText3 ; 0x6609 TextEndBattle + dw SilphCo8BattleText3 ; TextBeforeBattle + dw SilphCo8AfterBattleText3 ; TextAfterBattle + dw SilphCo8EndBattleText3 ; TextEndBattle + dw SilphCo8EndBattleText3 ; TextEndBattle db $ff @@ -117,9 +117,9 @@ SilphCo8Text1: ; 565aa (15:65aa) ld a, [wd838] bit 7, a ld hl, SilphCo8Text_565c3 - jr nz, asm_a468f ; 0x565b3 + jr nz, .asm_565b8 ld hl, SilphCo8Text_565be -asm_a468f ; 0x565b8 +.asm_565b8 call PrintText jp TextScriptEnd diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index e8b16927..8f68b390 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -13,7 +13,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_5d82e ; $582e + ld hl, DataTable_5d82e call SilphCo9Script_5d837 call SilphCo9Script_5d863 ld a, [wd834] @@ -131,28 +131,28 @@ SilphCo9TrainerHeader0: ; 5d893 (17:5893) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd833 ; flag's byte - dw SilphCo9BattleText1 ; 0x5912 TextBeforeBattle - dw SilphCo9AfterBattleText1 ; 0x591c TextAfterBattle - dw SilphCo9EndBattleText1 ; 0x5917 TextEndBattle - dw SilphCo9EndBattleText1 ; 0x5917 TextEndBattle + dw SilphCo9BattleText1 ; TextBeforeBattle + dw SilphCo9AfterBattleText1 ; TextAfterBattle + dw SilphCo9EndBattleText1 ; TextEndBattle + dw SilphCo9EndBattleText1 ; TextEndBattle SilphCo9TrainerHeader1: ; 5d89f (17:589f) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd833 ; flag's byte - dw SilphCo9BattleText2 ; 0x5921 TextBeforeBattle - dw SilphCo9AfterBattleText2 ; 0x592b TextAfterBattle - dw SilphCo9EndBattleText2 ; 0x5926 TextEndBattle - dw SilphCo9EndBattleText2 ; 0x5926 TextEndBattle + dw SilphCo9BattleText2 ; TextBeforeBattle + dw SilphCo9AfterBattleText2 ; TextAfterBattle + dw SilphCo9EndBattleText2 ; TextEndBattle + dw SilphCo9EndBattleText2 ; TextEndBattle SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd833 ; flag's byte - dw SilphCo9BattleText3 ; 0x5930 TextBeforeBattle - dw SilphCo9AfterBattleText3 ; 0x593a TextAfterBattle - dw SilphCo9EndBattleText3 ; 0x5935 TextEndBattle - dw SilphCo9EndBattleText3 ; 0x5935 TextEndBattle + dw SilphCo9BattleText3 ; TextBeforeBattle + dw SilphCo9AfterBattleText3 ; TextAfterBattle + dw SilphCo9EndBattleText3 ; TextEndBattle + dw SilphCo9EndBattleText3 ; TextEndBattle db $ff @@ -160,7 +160,7 @@ SilphCo9Text1: ; 5d8b8 (17:58b8) db $08 ; asm ld a, [wd838] bit 7, a - jr nz, .asm_a14c3 ; 0x5d8be + jr nz, .asm_5d8dc ld hl, SilphCo9Text_5d8e5 call PrintText predef HealParty @@ -169,11 +169,11 @@ SilphCo9Text1: ; 5d8b8 (17:58b8) call GBFadeInFromWhite ld hl, SilphCo9Text_5d8ea call PrintText - jr .asm_b6e28 ; 0x5d8da -.asm_a14c3 ; 0x5d8dc + jr .asm_5d8e2 +.asm_5d8dc ld hl, SilphCo9Text_5d8ef call PrintText -.asm_b6e28 ; 0x5d8e2 +.asm_5d8e2 jp TextScriptEnd SilphCo9Text_5d8e5: ; 5d8e5 (17:58e5) diff --git a/scripts/silphcoelevator.asm b/scripts/silphcoelevator.asm index 48d406cc..746ad15d 100755 --- a/scripts/silphcoelevator.asm +++ b/scripts/silphcoelevator.asm @@ -32,9 +32,9 @@ SilphCoElevatorScript_457ea: ; 457ea (11:57ea) ret SilphCoElevatorScript_457f1: ; 457f1 (11:57f1) - ld hl, SilphCoElavatorFloors ; $5804 + ld hl, SilphCoElavatorFloors call LoadItemList - ld hl, SilphCoElevatorWarpMaps ; $5811 + ld hl, SilphCoElevatorWarpMaps ld de, wcc5b ld bc, $16 call CopyData @@ -72,6 +72,6 @@ SilphCoElevatorTextPointers: ; 45833 (11:5833) SilphCoElevatorText1: ; 45835 (11:5835) db $08 ; asm call SilphCoElevatorScript_457f1 - ld hl, SilphCoElevatorWarpMaps ; $5811 + ld hl, SilphCoElevatorWarpMaps predef Func_1c9c6 jp TextScriptEnd diff --git a/scripts/ssanne10.asm b/scripts/ssanne10.asm index 8f3ff9a4..3a14f04d 100755 --- a/scripts/ssanne10.asm +++ b/scripts/ssanne10.asm @@ -30,55 +30,55 @@ SSAnne10TrainerHeader0: ; 61d84 (18:5d84) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd809 ; flag's byte - dw SSAnne10BattleText1 ; 0x5e16 TextBeforeBattle - dw SSAnne10AfterBattleText1 ; 0x5e20 TextAfterBattle - dw SSAnne10EndBattleText1 ; 0x5e1b TextEndBattle - dw SSAnne10EndBattleText1 ; 0x5e1b TextEndBattle + dw SSAnne10BattleText1 ; TextBeforeBattle + dw SSAnne10AfterBattleText1 ; TextAfterBattle + dw SSAnne10EndBattleText1 ; TextEndBattle + dw SSAnne10EndBattleText1 ; TextEndBattle SSAnne10TrainerHeader1: ; 61d90 (18:5d90) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd809 ; flag's byte - dw SSAnne10BattleText2 ; 0x5e25 TextBeforeBattle - dw SSAnne10AfterBattleText2 ; 0x5e2f TextAfterBattle - dw SSAnne10EndBattleText2 ; 0x5e2a TextEndBattle - dw SSAnne10EndBattleText2 ; 0x5e2a TextEndBattle + dw SSAnne10BattleText2 ; TextBeforeBattle + dw SSAnne10AfterBattleText2 ; TextAfterBattle + dw SSAnne10EndBattleText2 ; TextEndBattle + dw SSAnne10EndBattleText2 ; TextEndBattle SSAnne10TrainerHeader2: ; 61d9c (18:5d9c) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd809 ; flag's byte - dw SSAnne10BattleText3 ; 0x5e34 TextBeforeBattle - dw SSAnne10AfterBattleText3 ; 0x5e3e TextAfterBattle - dw SSAnne10EndBattleText3 ; 0x5e39 TextEndBattle - dw SSAnne10EndBattleText3 ; 0x5e39 TextEndBattle + dw SSAnne10BattleText3 ; TextBeforeBattle + dw SSAnne10AfterBattleText3 ; TextAfterBattle + dw SSAnne10EndBattleText3 ; TextEndBattle + dw SSAnne10EndBattleText3 ; TextEndBattle SSAnne10TrainerHeader3: ; 61da8 (18:5da8) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd809 ; flag's byte - dw SSAnne10BattleText4 ; 0x5e43 TextBeforeBattle - dw SSAnne10AfterBattleText4 ; 0x5e4d TextAfterBattle - dw SSAnne10EndBattleText4 ; 0x5e48 TextEndBattle - dw SSAnne10EndBattleText4 ; 0x5e48 TextEndBattle + dw SSAnne10BattleText4 ; TextBeforeBattle + dw SSAnne10AfterBattleText4 ; TextAfterBattle + dw SSAnne10EndBattleText4 ; TextEndBattle + dw SSAnne10EndBattleText4 ; TextEndBattle SSAnne10TrainerHeader4: ; 61db4 (18:5db4) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd809 ; flag's byte - dw SSAnne10BattleText5 ; 0x5e52 TextBeforeBattle - dw SSAnne10AfterBattleText5 ; 0x5e5c TextAfterBattle - dw SSAnne10EndBattleText5 ; 0x5e57 TextEndBattle - dw SSAnne10EndBattleText5 ; 0x5e57 TextEndBattle + dw SSAnne10BattleText5 ; TextBeforeBattle + dw SSAnne10AfterBattleText5 ; TextAfterBattle + dw SSAnne10EndBattleText5 ; TextEndBattle + dw SSAnne10EndBattleText5 ; TextEndBattle SSAnne10TrainerHeader5: ; 61dc0 (18:5dc0) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd809 ; flag's byte - dw SSAnne10BattleText6 ; 0x5e61 TextBeforeBattle - dw SSAnne10AfterBattleText6 ; 0x5e6b TextAfterBattle - dw SSAnne10EndBattleText6 ; 0x5e66 TextEndBattle - dw SSAnne10EndBattleText6 ; 0x5e66 TextEndBattle + dw SSAnne10BattleText6 ; TextBeforeBattle + dw SSAnne10AfterBattleText6 ; TextAfterBattle + dw SSAnne10EndBattleText6 ; TextEndBattle + dw SSAnne10EndBattleText6 ; TextEndBattle db $ff @@ -120,7 +120,7 @@ SSAnne10Text6: ; 61dff (18:5dff) SSAnne10Text8: ; 61e09 (18:5e09) TX_FAR _SSAnne10Text8 - db $8 ; 0x61e0d + db $08 ; asm ld a, MACHOKE call PlayCry jp TextScriptEnd diff --git a/scripts/ssanne2.asm b/scripts/ssanne2.asm index 474aaa60..c00c56f7 100755 --- a/scripts/ssanne2.asm +++ b/scripts/ssanne2.asm @@ -21,7 +21,7 @@ SSAnne2Script4: ; 613bd (18:53bd) ret SSAnne2Script0: ; 613be (18:53be) - ld hl, CoordsData_61411 ; $5411 + ld hl, CoordsData_61411 call ArePlayerCoordsInArray ret nc ld a, $ff @@ -45,9 +45,9 @@ SSAnne2Script0: ; 613be (18:53be) ld [wJoyIgnore], a ld a, [$ffdb] cp $2 - jr nz, .asm_61400 ; 0x613f9 $5 + jr nz, .asm_61400 ld de, MovementData_6140c - jr .asm_61403 ; 0x613fe $3 + jr .asm_61403 .asm_61400 ld de, MovementData_6140d .asm_61403 @@ -66,7 +66,7 @@ CoordsData_61411: ; 61411 (18:5411) db $08,$24,$08,$25,$FF SSAnne2Script_61416: ; 61416 (18:5416) - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] cp $25 jr nz, .asm_61426 ld a, $2 @@ -78,7 +78,7 @@ SSAnne2Script_61416: ; 61416 (18:5416) .asm_61427 ld [$ff8d], a ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp SetSpriteFacingDirectionAndDelay SSAnne2Script1: ; 61430 (18:5430) @@ -98,12 +98,12 @@ SSAnne2Script1: ; 61430 (18:5430) ; select which team to use during the encounter ld a, [W_RIVALSTARTER] cp STARTER2 - jr nz, .NotSquirtle ; 0x61451 $4 + jr nz, .NotSquirtle ld a, $1 jr .done .NotSquirtle cp STARTER3 - jr nz, .Charmander ; 0x61459 $4 + jr nz, .Charmander ld a, $2 jr .done .Charmander @@ -131,9 +131,9 @@ SSAnne2Script2: ; 6146d (18:546d) call SetSpriteMovementBytesToFF ld a, [W_XCOORD] cp $25 - jr nz, .asm_61497 ; 0x61490 $5 + jr nz, .asm_61497 ld de, MovementData_614b9 - jr .asm_6149a ; 0x61495 $3 + jr .asm_6149a .asm_61497 ld de, MovementData_614b7 .asm_6149a diff --git a/scripts/ssanne5.asm b/scripts/ssanne5.asm index 96b94c52..206eadde 100755 --- a/scripts/ssanne5.asm +++ b/scripts/ssanne5.asm @@ -1,6 +1,6 @@ SSAnne5Script: ; 616ae (18:56ae) call EnableAutoTextBoxDrawing - ld hl, SSAnne5TrainerHeader0 ; $56d1 + ld hl, SSAnne5TrainerHeader0 ld de, SSAnne5ScriptPointers ld a, [W_SSANNE5CURSCRIPT] call ExecuteCurMapScriptInTable @@ -24,19 +24,19 @@ SSAnne5TrainerHeader0: ; 616d1 (18:56d1) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7ff ; flag's byte - dw SSAnne5BattleText1 ; 0x5703 TextBeforeBattle - dw SSAnne5AfterBattleText1 ; 0x570d TextAfterBattle - dw SSAnne5EndBattleText1 ; 0x5708 TextEndBattle - dw SSAnne5EndBattleText1 ; 0x5708 TextEndBattle + dw SSAnne5BattleText1 ; TextBeforeBattle + dw SSAnne5AfterBattleText1 ; TextAfterBattle + dw SSAnne5EndBattleText1 ; TextEndBattle + dw SSAnne5EndBattleText1 ; TextEndBattle SSAnne5TrainerHeader1: ; 616dd (18:56dd) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7ff ; flag's byte - dw SSAnne5BattleText2 ; 0x571c TextBeforeBattle - dw SSAnne5AfterBattleText2 ; 0x5726 TextAfterBattle - dw SSAnne5EndBattleText2 ; 0x5721 TextEndBattle - dw SSAnne5EndBattleText2 ; 0x5721 TextEndBattle + dw SSAnne5BattleText2 ; TextBeforeBattle + dw SSAnne5AfterBattleText2 ; TextAfterBattle + dw SSAnne5EndBattleText2 ; TextEndBattle + dw SSAnne5EndBattleText2 ; TextEndBattle db $ff diff --git a/scripts/ssanne6.asm b/scripts/ssanne6.asm index d3ec191f..822e5e38 100755 --- a/scripts/ssanne6.asm +++ b/scripts/ssanne6.asm @@ -41,17 +41,17 @@ SSAnne6Text7: ; 617e3 (18:57e3) call PrintText ldh a, [$d3] bit 7, a - jr z, .asm_93eb1 ; 0x617ee + jr z, .asm_93eb1 ld hl, SSAnne6Text_6180c - jr .asm_63292 ; 0x617f3 -.asm_93eb1 ; 0x617f5 + jr .asm_63292 +.asm_93eb1 bit 4, a - jr z, .asm_7436c ; 0x617f7 + jr z, .asm_7436c ld hl, SSAnne6Text_61811 - jr .asm_63292 ; 0x617fc -.asm_7436c ; 0x617fe + jr .asm_63292 +.asm_7436c ld hl, SSAnne6Text_61816 -.asm_63292 ; 0x61801 +.asm_63292 call PrintText jp TextScriptEnd diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index f4d60d4d..278f8e21 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -19,7 +19,7 @@ SSAnne7Text1: ; 618ad (18:58ad) db $08 ; asm ld a, [wd803] bit 0, a - jr nz, .asm_797c4 ; 0x618b3 + jr nz, .asm_797c4 ld hl, SSAnne7RubText call PrintText ld hl, ReceivingHM01Text @@ -31,17 +31,17 @@ SSAnne7Text1: ; 618ad (18:58ad) call PrintText ld hl, wd803 set 0, [hl] - jr .asm_0faf5 ; 0x618d4 + jr .asm_0faf5 .BagFull ld hl, HM01NoRoomText call PrintText ld hl, wd72d set 5, [hl] - jr .asm_0faf5 ; 0x618e1 -.asm_797c4 ; 0x618e3 + jr .asm_0faf5 +.asm_797c4 ld hl, SSAnne7Text_61932 call PrintText -.asm_0faf5 ; 0x618e9 +.asm_0faf5 jp TextScriptEnd SSAnne7RubText: ; 618ec (18:58ec) @@ -50,7 +50,7 @@ SSAnne7RubText: ; 618ec (18:58ec) ld a, [wc0ef] cp BANK(Music1f_UpdateMusic) ld [wc0f0], a - jr nz, .asm_61908 ; 0x618f9 $d + jr nz, .asm_61908 ld a, $ff ld [wc0ee], a call PlaySound @@ -63,7 +63,7 @@ SSAnne7RubText: ; 618ec (18:58ec) .asm_61910 ld a, [wc026] cp MUSIC_PKMN_HEALED - jr z, .asm_61910 ; 0x61915 $f9 + jr z, .asm_61910 call PlayDefaultMusic ld hl, wd803 set 1, [hl] diff --git a/scripts/ssanne8.asm b/scripts/ssanne8.asm index ff7fc57b..a01c81b4 100755 --- a/scripts/ssanne8.asm +++ b/scripts/ssanne8.asm @@ -30,37 +30,37 @@ SSAnne8TrainerHeader0: ; 619a5 (18:59a5) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd805 ; flag's byte - dw SSAnne8BattleText1 ; 0x5a0b TextBeforeBattle - dw SSAnne8AfterBattleText1 ; 0x5a15 TextAfterBattle - dw SSAnne8EndBattleText1 ; 0x5a10 TextEndBattle - dw SSAnne8EndBattleText1 ; 0x5a10 TextEndBattle + dw SSAnne8BattleText1 ; TextBeforeBattle + dw SSAnne8AfterBattleText1 ; TextAfterBattle + dw SSAnne8EndBattleText1 ; TextEndBattle + dw SSAnne8EndBattleText1 ; TextEndBattle SSAnne8TrainerHeader1: ; 619b1 (18:59b1) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd805 ; flag's byte - dw SSAnne8BattleText2 ; 0x5a1a TextBeforeBattle - dw SSAnne8AfterBattleText2 ; 0x5a24 TextAfterBattle - dw SSAnne8EndBattleText2 ; 0x5a1f TextEndBattle - dw SSAnne8EndBattleText2 ; 0x5a1f TextEndBattle + dw SSAnne8BattleText2 ; TextBeforeBattle + dw SSAnne8AfterBattleText2 ; TextAfterBattle + dw SSAnne8EndBattleText2 ; TextEndBattle + dw SSAnne8EndBattleText2 ; TextEndBattle SSAnne8TrainerHeader2: ; 619bd (18:59bd) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd805 ; flag's byte - dw SSAnne8BattleText3 ; 0x5a29 TextBeforeBattle - dw SSAnne8AfterBattleText3 ; 0x5a33 TextAfterBattle - dw SSAnne8EndBattleText3 ; 0x5a2e TextEndBattle - dw SSAnne8EndBattleText3 ; 0x5a2e TextEndBattle + dw SSAnne8BattleText3 ; TextBeforeBattle + dw SSAnne8AfterBattleText3 ; TextAfterBattle + dw SSAnne8EndBattleText3 ; TextEndBattle + dw SSAnne8EndBattleText3 ; TextEndBattle SSAnne8TrainerHeader3: ; 619c9 (18:59c9) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd805 ; flag's byte - dw SSAnne8BattleText4 ; 0x5a38 TextBeforeBattle - dw SSAnne8AfterBattleText4 ; 0x5a42 TextAfterBattle - dw SSAnne8EndBattleText4 ; 0x5a3d TextEndBattle - dw SSAnne8EndBattleText4 ; 0x5a3d TextEndBattle + dw SSAnne8BattleText4 ; TextBeforeBattle + dw SSAnne8AfterBattleText4 ; TextAfterBattle + dw SSAnne8EndBattleText4 ; TextEndBattle + dw SSAnne8EndBattleText4 ; TextEndBattle db $ff diff --git a/scripts/ssanne9.asm b/scripts/ssanne9.asm index db34fcf2..25118b27 100755 --- a/scripts/ssanne9.asm +++ b/scripts/ssanne9.asm @@ -35,37 +35,37 @@ SSAnne9TrainerHeader0: ; 61b84 (18:5b84) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd807 ; flag's byte - dw SSAnne9BattleText1 ; 0x5c51 TextBeforeBattle - dw SSAnne9AfterBattleText1 ; 0x5c5b TextAfterBattle - dw SSAnne9EndBattleText1 ; 0x5c56 TextEndBattle - dw SSAnne9EndBattleText1 ; 0x5c56 TextEndBattle + dw SSAnne9BattleText1 ; TextBeforeBattle + dw SSAnne9AfterBattleText1 ; TextAfterBattle + dw SSAnne9EndBattleText1 ; TextEndBattle + dw SSAnne9EndBattleText1 ; TextEndBattle SSAnne9TrainerHeader1: ; 61b90 (18:5b90) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd807 ; flag's byte - dw SSAnne9BattleText2 ; 0x5c60 TextBeforeBattle - dw SSAnne9AfterBattleText2 ; 0x5c6a TextAfterBattle - dw SSAnne9EndBattleText2 ; 0x5c65 TextEndBattle - dw SSAnne9EndBattleText2 ; 0x5c65 TextEndBattle + dw SSAnne9BattleText2 ; TextBeforeBattle + dw SSAnne9AfterBattleText2 ; TextAfterBattle + dw SSAnne9EndBattleText2 ; TextEndBattle + dw SSAnne9EndBattleText2 ; TextEndBattle SSAnne9TrainerHeader2: ; 61b9c (18:5b9c) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd807 ; flag's byte - dw SSAnne9BattleText3 ; 0x5c6f TextBeforeBattle - dw SSAnne9AfterBattleText3 ; 0x5c79 TextAfterBattle - dw SSAnne9EndBattleText3 ; 0x5c74 TextEndBattle - dw SSAnne9EndBattleText3 ; 0x5c74 TextEndBattle + dw SSAnne9BattleText3 ; TextBeforeBattle + dw SSAnne9AfterBattleText3 ; TextAfterBattle + dw SSAnne9EndBattleText3 ; TextEndBattle + dw SSAnne9EndBattleText3 ; TextEndBattle SSAnne9TrainerHeader3: ; 61ba8 (18:5ba8) db $4 ; flag's bit db ($2 << 4) ; trainer's view range dw wd807 ; flag's byte - dw SSAnne9BattleText4 ; 0x5c7e TextBeforeBattle - dw SSAnne9AfterBattleText4 ; 0x5c88 TextAfterBattle - dw SSAnne9EndBattleText4 ; 0x5c83 TextEndBattle - dw SSAnne9EndBattleText4 ; 0x5c83 TextEndBattle + dw SSAnne9BattleText4 ; TextBeforeBattle + dw SSAnne9AfterBattleText4 ; TextAfterBattle + dw SSAnne9EndBattleText4 ; TextEndBattle + dw SSAnne9EndBattleText4 ; TextEndBattle db $ff diff --git a/scripts/unknowndungeon3.asm b/scripts/unknowndungeon3.asm index d2078916..f21e0c7f 100755 --- a/scripts/unknowndungeon3.asm +++ b/scripts/unknowndungeon3.asm @@ -22,10 +22,10 @@ UnknownDungeon3TrainerHeader0: ; 45f0f (11:5f0f) db $1 ; flag's bit db ($0 << 4) ; trainer's view range dw wd85f ; flag's byte - dw UnknownDungeon3MewtwoText ; 0x5f26 TextBeforeBattle - dw UnknownDungeon3MewtwoText ; 0x5f26 TextAfterBattle - dw UnknownDungeon3MewtwoText ; 0x5f26 TextEndBattle - dw UnknownDungeon3MewtwoText ; 0x5f26 TextEndBattle + dw UnknownDungeon3MewtwoText ; TextBeforeBattle + dw UnknownDungeon3MewtwoText ; TextAfterBattle + dw UnknownDungeon3MewtwoText ; TextEndBattle + dw UnknownDungeon3MewtwoText ; TextEndBattle db $ff diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 1214b27c..e11a5846 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -53,7 +53,7 @@ VermilionCityScript0: ; 197e6 (6:57e6) call DisplayTextID ld a, [wd803] bit 2, a - jr nz, .asm_19810 ; 0x19804 $a + jr nz, .asm_19810 ld b, $3f predef IsItemInBag_ ld a, b @@ -109,7 +109,7 @@ VermilionCityScript1: ; 1985f (6:585f) ld a, [wSimulatedJoypadStatesIndex] and a ret nz - ld c, $a + ld c, 10 call DelayFrames ld a, $0 ld [W_VERMILIONCITYCURSCRIPT], a @@ -138,14 +138,14 @@ VermilionCityText2: ; 1988e (6:588e) db $08 ; asm ld a, [wd803] bit 2, a - jr nz, .asm_359bd ; 0x19894 + jr nz, .asm_1989e ld hl, VermilionCityText_198a7 call PrintText - jr .asm_735d9 ; 0x1989c -.asm_359bd ; 0x1989e + jr .asm_198a4 +.asm_1989e ld hl, VermilionCityText_198ac call PrintText -.asm_735d9 ; 0x198a4 +.asm_198a4 jp TextScriptEnd VermilionCityText_198a7: ; 198a7 (6:58a7) @@ -160,38 +160,38 @@ VermilionCityText3: ; 198b1 (6:58b1) db $08 ; asm ld a, [wd803] bit 2, a - jr nz, .asm_3e0e9 ; 0x198b7 + jr nz, .asm_198f6 ld a, [wSpriteStateData1 + 9] cp $c - jr z, .asm_07af3 ; 0x198be + jr z, .asm_198c8 ld hl, VermilionCityCoords1 call ArePlayerCoordsInArray - jr nc, .asm_57b73 ; 0x198c6 -.asm_07af3 ; 0x198c8 + jr nc, .asm_198d0 +.asm_198c8 ld hl, SSAnneWelcomeText4 call PrintText - jr .asm_79bd1 ; 0x198ce -.asm_57b73 ; 0x198d0 + jr .asm_198fc +.asm_198d0 ld hl, SSAnneWelcomeText9 call PrintText ld b, S_S__TICKET predef IsItemInBag_ ld a, b and a - jr nz, .asm_0419b ; 0x198df + jr nz, .asm_198e9 ld hl, SSAnneNoTicketText call PrintText - jr .asm_79bd1 ; 0x198e7 -.asm_0419b ; 0x198e9 + jr .asm_198fc +.asm_198e9 ld hl, SSAnneFlashedTicketText call PrintText ld a, $4 ld [W_VERMILIONCITYCURSCRIPT], a - jr .asm_79bd1 ; 0x198f4 -.asm_3e0e9 ; 0x198f6 + jr .asm_198fc +.asm_198f6 ld hl, SSAnneNotHereText call PrintText -.asm_79bd1 ; 0x198fc +.asm_198fc jp TextScriptEnd VermilionCityCoords1: ; 198ff (6:58ff) @@ -229,7 +229,7 @@ VermilionCityText5: ; 19922 (6:5922) ld a, MACHOP call PlayCry call WaitForSoundToFinish - ld hl, VermilionCityText14 ; $5933 + ld hl, VermilionCityText14 ret VermilionCityText14: ; 19933 (6:5933) diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index 7b23c41e..f070d377 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -2,7 +2,7 @@ VermilionDockScript: ; 1db52 (7:5b52) call EnableAutoTextBoxDrawing ld hl, wd803 bit 4, [hl] - jr nz, .asm_1db8d ; 0x1db5a $31 + jr nz, .asm_1db8d bit 0, [hl] ret z ld a, [wDestinationWarpID] @@ -49,7 +49,7 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) callba LoadSmokeTileFourTimes xor a ld [wSpriteStateData1 + 2], a - ld c, $78 + ld c, 120 call DelayFrames ld b, $9c call CopyScreenTileBufferToVRAM @@ -97,13 +97,13 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) .asm_1dc16 call VermilionDock_1dc7c dec c - jr nz, .asm_1dc16 ; 0x1dc1a $fa + jr nz, .asm_1dc16 inc d dec b - jr nz, .asm_1dc11 ; 0x1dc1e $f1 + jr nz, .asm_1dc11 pop bc dec e - jr nz, .asm_1dbfa ; 0x1dc22 $d6 + jr nz, .asm_1dbfa xor a ld [$ff4a], a ld [hWY], a @@ -135,7 +135,7 @@ VermilionDock_1dc42: ; 1dc42 (7:5c42) inc [hl] add hl, de dec c - jr nz, .asm_1dc50 ; 0x1dc54 $fa + jr nz, .asm_1dc50 pop de pop bc ret @@ -169,13 +169,13 @@ VermilionDock_1dc7c: ; 1dc7c (7:5c7c) .asm_1dc86 ld a, [$ff44] cp l - jr nz, .asm_1dc86 ; 0x1dc89 $fb + jr nz, .asm_1dc86 ld a, h ld [$ff43], a .asm_1dc8e ld a, [$ff44] cp h - jr z, .asm_1dc8e ; 0x1dc91 $fb + jr z, .asm_1dc8e ret VermilionDock_1dc94: ; 1dc94 (7:5c94) @@ -195,7 +195,7 @@ VermilionDock_1dc94: ; 1dc94 (7:5c94) ld [hl], a ld a, (SFX_02_54 - SFX_Headers_02) / 3 call PlaySound - ld c, $78 + ld c, 120 call DelayFrames ret diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index 6178dafb..8c136314 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -17,8 +17,8 @@ VermilionGymScript: ; 5ca26 (17:4a26) ret VermilionGymScript_5ca4c: ; 5ca4c (17:4a4c) - ld hl, Gym3CityName ; $4a55 - ld de, Gym3LeaderName ; $4a64 + ld hl, Gym3CityName + ld de, Gym3LeaderName jp LoadGymLeaderAndCityName Gym3CityName: ; 5ca55 (17:4a55) @@ -56,7 +56,7 @@ VermilionGymScriptPointers: ; 5ca95 (17:4a95) dw VermilionGymScript3 VermilionGymScript3: ; 5ca9d (17:4a9d) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, VermilionGymScript_5ca8a ld a, $f0 @@ -64,7 +64,7 @@ VermilionGymScript3: ; 5ca9d (17:4a9d) VermilionGymScript_5caaa: ; 5caaa (17:4aaa) ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd773 set 7, [hl] @@ -72,14 +72,14 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) call GiveItem jr nc, .BagFull ld a, $7 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd773 set 6, [hl] jr .asm_5cad3 .BagFull ld a, $8 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_5cad3 ld hl, W_OBTAINEDBADGES @@ -109,28 +109,28 @@ VermilionGymTrainerHeader0: ; 5caf8 (17:4af8) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd773 ; flag's byte - dw VermilionGymBattleText1 ; 0x4b9a TextBeforeBattle - dw VermilionGymAfterBattleText1 ; 0x4ba4 TextAfterBattle - dw VermilionGymEndBattleText1 ; 0x4b9f TextEndBattle - dw VermilionGymEndBattleText1 ; 0x4b9f TextEndBattle + dw VermilionGymBattleText1 ; TextBeforeBattle + dw VermilionGymAfterBattleText1 ; TextAfterBattle + dw VermilionGymEndBattleText1 ; TextEndBattle + dw VermilionGymEndBattleText1 ; TextEndBattle VermilionGymTrainerHeader1: ; 5cb04 (17:4b04) db $3 ; flag's bit db ($2 << 4) ; trainer's view range dw wd773 ; flag's byte - dw VermilionGymBattleText2 ; 0x4bb3 TextBeforeBattle - dw VermilionGymAfterBattleText2 ; 0x4bbd TextAfterBattle - dw VermilionGymEndBattleText2 ; 0x4bb8 TextEndBattle - dw VermilionGymEndBattleText2 ; 0x4bb8 TextEndBattle + dw VermilionGymBattleText2 ; TextBeforeBattle + dw VermilionGymAfterBattleText2 ; TextAfterBattle + dw VermilionGymEndBattleText2 ; TextEndBattle + dw VermilionGymEndBattleText2 ; TextEndBattle VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) db $4 ; flag's bit db ($3 << 4) ; trainer's view range dw wd773 ; flag's byte - dw VermilionGymBattleText3 ; 0x4bcc TextBeforeBattle - dw VermilionGymAfterBattleText3 ; 0x4bd6 TextAfterBattle - dw VermilionGymEndBattleText3 ; 0x4bd1 TextEndBattle - dw VermilionGymEndBattleText3 ; 0x4bd1 TextEndBattle + dw VermilionGymBattleText3 ; TextBeforeBattle + dw VermilionGymAfterBattleText3 ; TextAfterBattle + dw VermilionGymEndBattleText3 ; TextEndBattle + dw VermilionGymEndBattleText3 ; TextEndBattle db $ff @@ -138,17 +138,17 @@ VermilionGymText1: ; 5cb1d (17:4b1d) db $08 ; asm ld a, [wd773] bit 7, a - jr z, .asm_7cc29 ; 0x5cb23 + jr z, .asm_5cb39 bit 6, a - jr nz, .asm_41203 ; 0x5cb27 + jr nz, .asm_5cb31 call z, VermilionGymScript_5caaa call DisableWaitingAfterTextDisplay - jr .asm_23621 ; 0x5cb2f -.asm_41203 ; 0x5cb31 + jr .asm_5cb6a +.asm_5cb31 ld hl, VermilionGymText_5cb72 call PrintText - jr .asm_23621 ; 0x5cb37 -.asm_7cc29 ; 0x5cb39 + jr .asm_5cb6a +.asm_5cb39 ld hl, VermilionGymText_5cb6d call PrintText ld hl, wd72d @@ -168,7 +168,7 @@ VermilionGymText1: ; 5cb1d (17:4b1d) ld a, $3 ld [W_VERMILIONGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a -.asm_23621 ; 0x5cb6a +.asm_5cb6a jp TextScriptEnd VermilionGymText_5cb6d: ; 5cb6d (17:4b6d) @@ -255,14 +255,14 @@ VermilionGymText5: ; 5cbdb (17:4bdb) db $08 ; asm ld a, [wd72a] bit 2, a - jr nz, .asm_13b67 ; 0x5cbe1 + jr nz, .asm_5cbeb ld hl, VermilionGymText_5cbf4 call PrintText - jr .asm_c2b38 ; 0x5cbe9 -.asm_13b67 ; 0x5cbeb + jr .asm_5cbf1 +.asm_5cbeb ld hl, VermilionGymText_5cbf9 call PrintText -.asm_c2b38 ; 0x5cbf1 +.asm_5cbf1 jp TextScriptEnd VermilionGymText_5cbf4: ; 5cbf4 (17:4bf4) diff --git a/scripts/vermilionhouse2.asm b/scripts/vermilionhouse2.asm index 7c06c6e9..7fc5fbfc 100755 --- a/scripts/vermilionhouse2.asm +++ b/scripts/vermilionhouse2.asm @@ -39,9 +39,9 @@ VermilionHouse2Text_560b1: ; 560b1 (15:60b1) db "@" VermilionHouse2Text_560b6: ; 560b6 (15:60b6) - TX_FAR _VermilionHouse2Text_560b6 ; 0x9c554 + TX_FAR _VermilionHouse2Text_560b6 db $0B - TX_FAR _VermilionHouse2Text_560bb ; 0x9c5a4 + TX_FAR _VermilionHouse2Text_560bb db "@" VermilionHouse2Text_560c0: ; 560c0 (15:60c0) diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index b6d2bf3e..fccdf208 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -28,7 +28,7 @@ VictoryRoad1Script0: ; 5da40 (17:5a40) ld a, [wd869] bit 7, a jp nz, CheckFightingMapTrainers - ld hl, CoordsData_5da5c ; $5a5c + ld hl, CoordsData_5da5c call CheckBoulderCoords jp nc, CheckFightingMapTrainers ld hl, wd126 @@ -54,19 +54,19 @@ VictoryRoad1TrainerHeader0: ; 5da6d (17:5a6d) db $1 ; flag's bit db ($2 << 4) ; trainer's view range dw wd869 ; flag's byte - dw VictoryRoad1BattleText1 ; 0x5a9a TextBeforeBattle - dw VictoryRoad1AfterBattleText1 ; 0x5aa4 TextAfterBattle - dw VictoryRoad1EndBattleText1 ; 0x5a9f TextEndBattle - dw VictoryRoad1EndBattleText1 ; 0x5a9f TextEndBattle + dw VictoryRoad1BattleText1 ; TextBeforeBattle + dw VictoryRoad1AfterBattleText1 ; TextAfterBattle + dw VictoryRoad1EndBattleText1 ; TextEndBattle + dw VictoryRoad1EndBattleText1 ; TextEndBattle VictoryRoad1TrainerHeader1: ; 5da79 (17:5a79) db $2 ; flag's bit db ($2 << 4) ; trainer's view range dw wd869 ; flag's byte - dw VictoryRoad1BattleText2 ; 0x5aa9 TextBeforeBattle - dw VictoryRoad1AfterBattleText2 ; 0x5ab3 TextAfterBattle - dw VictoryRoad1EndBattleText2 ; 0x5aae TextEndBattle - dw VictoryRoad1EndBattleText2 ; 0x5aae TextEndBattle + dw VictoryRoad1BattleText2 ; TextBeforeBattle + dw VictoryRoad1AfterBattleText2 ; TextAfterBattle + dw VictoryRoad1EndBattleText2 ; TextEndBattle + dw VictoryRoad1EndBattleText2 ; TextEndBattle db $ff diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index 4aab61ca..45196f74 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -45,11 +45,11 @@ VictoryRoad2ScriptPointers: ; 517eb (14:57eb) dw EndTrainerBattle VictoryRoad2Script0: ; 517f1 (14:57f1) - ld hl, CoordsData_51816 ; $5816 + ld hl, CoordsData_51816 call CheckBoulderCoords jp nc, CheckFightingMapTrainers ld hl, wd7ee - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] cp $2 jr z, .asm_5180b bit 0, [hl] @@ -90,55 +90,55 @@ VictoryRoad2TrainerHeader0: ; 51835 (14:5835) db $1 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7ee ; flag's byte - dw VictoryRoad2BattleText1 ; 0x58ca TextBeforeBattle - dw VictoryRoad2AfterBattleText1 ; 0x58d4 TextAfterBattle - dw VictoryRoad2EndBattleText1 ; 0x58cf TextEndBattle - dw VictoryRoad2EndBattleText1 ; 0x58cf TextEndBattle + dw VictoryRoad2BattleText1 ; TextBeforeBattle + dw VictoryRoad2AfterBattleText1 ; TextAfterBattle + dw VictoryRoad2EndBattleText1 ; TextEndBattle + dw VictoryRoad2EndBattleText1 ; TextEndBattle VictoryRoad2TrainerHeader2: ; 51841 (14:5841) db $2 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7ee ; flag's byte - dw VictoryRoad2BattleText2 ; 0x58d9 TextBeforeBattle - dw VictoryRoad2AfterBattleText2 ; 0x58e3 TextAfterBattle - dw VictoryRoad2EndBattleText2 ; 0x58de TextEndBattle - dw VictoryRoad2EndBattleText2 ; 0x58de TextEndBattle + dw VictoryRoad2BattleText2 ; TextBeforeBattle + dw VictoryRoad2AfterBattleText2 ; TextAfterBattle + dw VictoryRoad2EndBattleText2 ; TextEndBattle + dw VictoryRoad2EndBattleText2 ; TextEndBattle VictoryRoad2TrainerHeader3: ; 5184d (14:584d) db $3 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7ee ; flag's byte - dw VictoryRoad2BattleText3 ; 0x58e8 TextBeforeBattle - dw VictoryRoad2AfterBattleText3 ; 0x58f2 TextAfterBattle - dw VictoryRoad2EndBattleText3 ; 0x58ed TextEndBattle - dw VictoryRoad2EndBattleText3 ; 0x58ed TextEndBattle + dw VictoryRoad2BattleText3 ; TextBeforeBattle + dw VictoryRoad2AfterBattleText3 ; TextAfterBattle + dw VictoryRoad2EndBattleText3 ; TextEndBattle + dw VictoryRoad2EndBattleText3 ; TextEndBattle VictoryRoad2TrainerHeader4: ; 51859 (14:5859) db $4 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7ee ; flag's byte - dw VictoryRoad2BattleText4 ; 0x58f7 TextBeforeBattle - dw VictoryRoad2AfterBattleText4 ; 0x5901 TextAfterBattle - dw VictoryRoad2EndBattleText4 ; 0x58fc TextEndBattle - dw VictoryRoad2EndBattleText4 ; 0x58fc TextEndBattle + dw VictoryRoad2BattleText4 ; TextBeforeBattle + dw VictoryRoad2AfterBattleText4 ; TextAfterBattle + dw VictoryRoad2EndBattleText4 ; TextEndBattle + dw VictoryRoad2EndBattleText4 ; TextEndBattle VictoryRoad2TrainerHeader5: ; 51865 (14:5865) db $5 ; flag's bit db ($3 << 4) ; trainer's view range dw wd7ee ; flag's byte - dw VictoryRoad2BattleText5 ; 0x5906 TextBeforeBattle - dw VictoryRoad2AfterBattleText5 ; 0x5910 TextAfterBattle - dw VictoryRoad2EndBattleText5 ; 0x590b TextEndBattle - dw VictoryRoad2EndBattleText5 ; 0x590b TextEndBattle + dw VictoryRoad2BattleText5 ; TextBeforeBattle + dw VictoryRoad2AfterBattleText5 ; TextAfterBattle + dw VictoryRoad2EndBattleText5 ; TextEndBattle + dw VictoryRoad2EndBattleText5 ; TextEndBattle VictoryRoad2TrainerHeader6: ; 51871 (14:5871) db $6 ; flag's bit db ($0 << 4) ; trainer's view range dw wd7ee ; flag's byte - dw VictoryRoad2BattleText6 ; 0x58ba TextBeforeBattle - dw VictoryRoad2BattleText6 ; 0x58ba TextAfterBattle - dw VictoryRoad2BattleText6 ; 0x58ba TextEndBattle - dw VictoryRoad2BattleText6 ; 0x58ba TextEndBattle + dw VictoryRoad2BattleText6 ; TextBeforeBattle + dw VictoryRoad2BattleText6 ; TextAfterBattle + dw VictoryRoad2BattleText6 ; TextEndBattle + dw VictoryRoad2BattleText6 ; TextEndBattle db $ff diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index 01269a3f..43767f48 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -31,10 +31,10 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) bit 7, [hl] res 7, [hl] jp z, .asm_449fe - ld hl, .coordsData_449f9 ; $49f9 + ld hl, .coordsData_449f9 call CheckBoulderCoords jp nc, .asm_449fe - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] cp $1 jr nz, .asm_449dc ld hl, wd126 @@ -62,9 +62,9 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) .asm_449fe ld a, $c2 ld [wDungeonWarpDestinationMap], a - ld hl, .coordsData_449f9 ; $49f9 + ld hl, .coordsData_449f9 call Func_46981 - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] cp $1 jr nz, .asm_44a1b ld hl, wd72d @@ -95,37 +95,37 @@ VictoryRoad3TrainerHeader0: ; 44a38 (11:4a38) db $1 ; flag's bit db ($1 << 4) ; trainer's view range dw wd813 ; flag's byte - dw VictoryRoad3BattleText2 ; 0x4a91 TextBeforeBattle - dw VictoryRoad3AfterBattleText2 ; 0x4a9b TextAfterBattle - dw VictoryRoad3EndBattleText2 ; 0x4a96 TextEndBattle - dw VictoryRoad3EndBattleText2 ; 0x4a96 TextEndBattle + dw VictoryRoad3BattleText2 ; TextBeforeBattle + dw VictoryRoad3AfterBattleText2 ; TextAfterBattle + dw VictoryRoad3EndBattleText2 ; TextEndBattle + dw VictoryRoad3EndBattleText2 ; TextEndBattle VictoryRoad3TrainerHeader2: ; 44a44 (11:4a44) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd813 ; flag's byte - dw VictoryRoad3BattleText3 ; 0x4aa0 TextBeforeBattle - dw VictoryRoad3AfterBattleText3 ; 0x4aaa TextAfterBattle - dw VictoryRoad3EndBattleText3 ; 0x4aa5 TextEndBattle - dw VictoryRoad3EndBattleText3 ; 0x4aa5 TextEndBattle + dw VictoryRoad3BattleText3 ; TextBeforeBattle + dw VictoryRoad3AfterBattleText3 ; TextAfterBattle + dw VictoryRoad3EndBattleText3 ; TextEndBattle + dw VictoryRoad3EndBattleText3 ; TextEndBattle VictoryRoad3TrainerHeader3: ; 44a50 (11:4a50) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd813 ; flag's byte - dw VictoryRoad3BattleText4 ; 0x4aaf TextBeforeBattle - dw VictoryRoad3AfterBattleText4 ; 0x4ab9 TextAfterBattle - dw VictoryRoad3EndBattleText4 ; 0x4ab4 TextEndBattle - dw VictoryRoad3EndBattleText4 ; 0x4ab4 TextEndBattle + dw VictoryRoad3BattleText4 ; TextBeforeBattle + dw VictoryRoad3AfterBattleText4 ; TextAfterBattle + dw VictoryRoad3EndBattleText4 ; TextEndBattle + dw VictoryRoad3EndBattleText4 ; TextEndBattle VictoryRoad3TrainerHeader4: ; 44a5c (11:4a5c) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd813 ; flag's byte - dw VictoryRoad3BattleText5 ; 0x4abe TextBeforeBattle - dw VictoryRoad3AfterBattleText5 ; 0x4ac8 TextAfterBattle - dw VictoryRoad3EndBattleText5 ; 0x4ac3 TextEndBattle - dw VictoryRoad3EndBattleText5 ; 0x4ac3 TextEndBattle + dw VictoryRoad3BattleText5 ; TextBeforeBattle + dw VictoryRoad3AfterBattleText5 ; TextAfterBattle + dw VictoryRoad3EndBattleText5 ; TextEndBattle + dw VictoryRoad3EndBattleText5 ; TextEndBattle db $ff diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index d0b2b4ae..90212f4a 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -20,7 +20,7 @@ ViridianCityScript_1900b: ; 1900b (6:500b) ret nz ld a, [W_OBTAINEDBADGES] cp %01111111 - jr nz, .asm_1901e ; 0x19016 $6 + jr nz, .asm_1901e ld hl, wd74c set 0, [hl] ret @@ -153,12 +153,12 @@ ViridianCityText2: ; 19107 (6:5107) ld a, [W_OBTAINEDBADGES] cp %01111111 ld hl, ViridianCityText_19127 - jr z, .asm_ae9fe ; 0x19110 + jr z, .asm_ae9fe ld a, [wd751] bit 1, a - jr nz, .asm_ae9fe ; 0x19117 + jr nz, .asm_ae9fe ld hl, ViridianCityText_19122 -.asm_ae9fe ; 0x1911c +.asm_ae9fe call PrintText jp TextScriptEnd @@ -177,14 +177,14 @@ ViridianCityText3: ; 1912c (6:512c) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_6dfea ; 0x1913a + jr nz, .asm_6dfea ld hl, ViridianCityText_19157 call PrintText - jr .asm_d611f ; 0x19142 -.asm_6dfea ; 0x19144 + jr .asm_d611f +.asm_6dfea ld hl, ViridianCityText_19152 call PrintText -.asm_d611f ; 0x1914a +.asm_d611f jp TextScriptEnd ViridianCityText_1914d: ; 1914d (6:514d) @@ -203,14 +203,14 @@ ViridianCityText4: ; 1915c (6:515c) db $08 ; asm ld a, [wd74b] bit 5, a - jr nz, .asm_83894 ; 0x19162 + jr nz, .asm_83894 ld hl, ViridianCityText_19175 call PrintText - jr .asm_700a6 ; 0x1916a -.asm_83894 ; 0x1916c + jr .asm_700a6 +.asm_83894 ld hl, ViridianCityText_1917a call PrintText -.asm_700a6 ; 0x19172 +.asm_700a6 jp TextScriptEnd ViridianCityText_19175: ; 19175 (6:5175) @@ -238,7 +238,7 @@ ViridianCityText6: ; 19196 (6:5196) db $08 ; asm ld a, [wd74c] bit 1, a - jr nz, .asm_4e5a0 ; 0x1919c + jr nz, .asm_4e5a0 ld hl, ViridianCityText_191ca call PrintText ld bc, (TM_42 << 8) | 1 @@ -248,15 +248,15 @@ ViridianCityText6: ; 19196 (6:5196) call PrintText ld hl, wd74c set 1, [hl] - jr .asm_3c73c ; 0x191b7 + jr .asm_3c73c .BagFull ld hl, TM42NoRoomText call PrintText - jr .asm_3c73c ; 0x191bf -.asm_4e5a0 ; 0x191c1 + jr .asm_3c73c +.asm_4e5a0 ld hl, TM42Explanation call PrintText -.asm_3c73c ; 0x191c7 +.asm_3c73c jp TextScriptEnd ViridianCityText_191ca: ; 191ca (6:51ca) @@ -279,21 +279,21 @@ ViridianCityText7: ; 191df (6:51df) db $08 ; asm ld hl, ViridianCityText_1920a call PrintText - ld c, $2 + ld c, 2 call DelayFrames call YesNoChoice ld a, [wCurrentMenuItem] and a - jr z, .asm_42f68 ; 0x191f2 + jr z, .asm_42f68 ld hl, ViridianCityText_1920f call PrintText ld a, $1 ld [W_VIRIDIANCITYCURSCRIPT], a - jr .asm_2413a ; 0x191ff -.asm_42f68 ; 0x19201 + jr .asm_2413a +.asm_42f68 ld hl, ViridianCityText_19214 call PrintText -.asm_2413a ; 0x19207 +.asm_2413a jp TextScriptEnd ViridianCityText_1920a: ; 1920a (6:520a) diff --git a/scripts/viridianforest.asm b/scripts/viridianforest.asm index 4ec1c0aa..e0feb75f 100755 --- a/scripts/viridianforest.asm +++ b/scripts/viridianforest.asm @@ -33,28 +33,28 @@ ViridianForestTrainerHeader0: ; 61142 (18:5142) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7f3 ; flag's byte - dw ViridianForestBattleText1 ; 0x518a TextBeforeBattle - dw ViridianForestAfterBattleText1 ; 0x5194 TextAfterBattle - dw ViridianForestEndBattleText1 ; 0x518f TextEndBattle - dw ViridianForestEndBattleText1 ; 0x518f TextEndBattle + dw ViridianForestBattleText1 ; TextBeforeBattle + dw ViridianForestAfterBattleText1 ; TextAfterBattle + dw ViridianForestEndBattleText1 ; TextEndBattle + dw ViridianForestEndBattleText1 ; TextEndBattle ViridianForestTrainerHeader1: ; 6114e (18:514e) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd7f3 ; flag's byte - dw ViridianForestBattleText2 ; 0x5199 TextBeforeBattle - dw ViridianForestAfterBattleText2 ; 0x51a3 TextAfterBattle - dw ViridianForestEndBattleText2 ; 0x519e TextEndBattle - dw ViridianForestEndBattleText2 ; 0x519e TextEndBattle + dw ViridianForestBattleText2 ; TextBeforeBattle + dw ViridianForestAfterBattleText2 ; TextAfterBattle + dw ViridianForestEndBattleText2 ; TextEndBattle + dw ViridianForestEndBattleText2 ; TextEndBattle ViridianForestTrainerHeader2: ; 6115a (18:515a) db $4 ; flag's bit db ($1 << 4) ; trainer's view range dw wd7f3 ; flag's byte - dw ViridianForestBattleText3 ; 0x51a8 TextBeforeBattle - dw ViridianForestAfterBattleText3 ; 0x51b2 TextAfterBattle - dw ViridianForestEndBattleText3 ; 0x51ad TextEndBattle - dw ViridianForestEndBattleText3 ; 0x51ad TextEndBattle + dw ViridianForestBattleText3 ; TextBeforeBattle + dw ViridianForestAfterBattleText3 ; TextAfterBattle + dw ViridianForestEndBattleText3 ; TextEndBattle + dw ViridianForestEndBattleText3 ; TextEndBattle db $ff diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 6ced7d82..a05cff93 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -30,9 +30,9 @@ ViridianGymScriptPointers: ; 748e1 (1d:48e1) dw ViridianGymScript4 ViridianGymScript0: ; 748eb (1d:48eb) - ld a, [W_YCOORD] ; wd361 + ld a, [W_YCOORD] ld b, a - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] ld c, a ld hl, ViridianGymArrowTilePlayerMovement call DecodeArrowMovementRLE @@ -137,14 +137,14 @@ ViridianGymScript4: ; 7496b (1d:496b) jp Bankswitch ViridianGymScript3: ; 74988 (1d:4988) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, ViridianGymScript_748d6 ld a, $f0 ld [wJoyIgnore], a ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, $c - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd751 set 1, [hl] @@ -152,14 +152,14 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) call GiveItem jr nc, .BagFull ld a, $d - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd751 set 0, [hl] jr .asm_749be .BagFull ld a, $e - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID .asm_749be ld hl, W_OBTAINEDBADGES @@ -204,73 +204,73 @@ ViridianGymTrainerHeader0: ; 74a08 (1d:4a08) db $2 ; flag's bit db ($4 << 4) ; trainer's view range dw wd751 ; flag's byte - dw ViridianGymBattleText1 ; 0x4afd TextBeforeBattle - dw ViridianGymAfterBattleText1 ; 0x4b07 TextAfterBattle - dw ViridianGymEndBattleText1 ; 0x4b02 TextEndBattle - dw ViridianGymEndBattleText1 ; 0x4b02 TextEndBattle + dw ViridianGymBattleText1 ; TextBeforeBattle + dw ViridianGymAfterBattleText1 ; TextAfterBattle + dw ViridianGymEndBattleText1 ; TextEndBattle + dw ViridianGymEndBattleText1 ; TextEndBattle ViridianGymTrainerHeader1: ; 74a14 (1d:4a14) db $3 ; flag's bit db ($4 << 4) ; trainer's view range dw wd751 ; flag's byte - dw ViridianGymBattleText2 ; 0x4b16 TextBeforeBattle - dw ViridianGymAfterBattleText2 ; 0x4b20 TextAfterBattle - dw ViridianGymEndBattleText2 ; 0x4b1b TextEndBattle - dw ViridianGymEndBattleText2 ; 0x4b1b TextEndBattle + dw ViridianGymBattleText2 ; TextBeforeBattle + dw ViridianGymAfterBattleText2 ; TextAfterBattle + dw ViridianGymEndBattleText2 ; TextEndBattle + dw ViridianGymEndBattleText2 ; TextEndBattle ViridianGymTrainerHeader2: ; 74a20 (1d:4a20) db $4 ; flag's bit db ($4 << 4) ; trainer's view range dw wd751 ; flag's byte - dw ViridianGymBattleText3 ; 0x4b2f TextBeforeBattle - dw ViridianGymAfterBattleText3 ; 0x4b39 TextAfterBattle - dw ViridianGymEndBattleText3 ; 0x4b34 TextEndBattle - dw ViridianGymEndBattleText3 ; 0x4b34 TextEndBattle + dw ViridianGymBattleText3 ; TextBeforeBattle + dw ViridianGymAfterBattleText3 ; TextAfterBattle + dw ViridianGymEndBattleText3 ; TextEndBattle + dw ViridianGymEndBattleText3 ; TextEndBattle ViridianGymTrainerHeader3: ; 74a2c (1d:4a2c) db $5 ; flag's bit db ($2 << 4) ; trainer's view range dw wd751 ; flag's byte - dw ViridianGymBattleText4 ; 0x4b48 TextBeforeBattle - dw ViridianGymAfterBattleText4 ; 0x4b52 TextAfterBattle - dw ViridianGymEndBattleText4 ; 0x4b4d TextEndBattle - dw ViridianGymEndBattleText4 ; 0x4b4d TextEndBattle + dw ViridianGymBattleText4 ; TextBeforeBattle + dw ViridianGymAfterBattleText4 ; TextAfterBattle + dw ViridianGymEndBattleText4 ; TextEndBattle + dw ViridianGymEndBattleText4 ; TextEndBattle ViridianGymTrainerHeader4: ; 74a38 (1d:4a38) db $6 ; flag's bit db ($3 << 4) ; trainer's view range dw wd751 ; flag's byte - dw ViridianGymBattleText5 ; 0x4b61 TextBeforeBattle - dw ViridianGymAfterBattleText5 ; 0x4b6b TextAfterBattle - dw ViridianGymEndBattleText5 ; 0x4b66 TextEndBattle - dw ViridianGymEndBattleText5 ; 0x4b66 TextEndBattle + dw ViridianGymBattleText5 ; TextBeforeBattle + dw ViridianGymAfterBattleText5 ; TextAfterBattle + dw ViridianGymEndBattleText5 ; TextEndBattle + dw ViridianGymEndBattleText5 ; TextEndBattle ViridianGymTrainerHeader5: ; 74a44 (1d:4a44) db $7 ; flag's bit db ($4 << 4) ; trainer's view range dw wd751 ; flag's byte - dw ViridianGymBattleText6 ; 0x4b7a TextBeforeBattle - dw ViridianGymAfterBattleText6 ; 0x4b84 TextAfterBattle - dw ViridianGymEndBattleText6 ; 0x4b7f TextEndBattle - dw ViridianGymEndBattleText6 ; 0x4b7f TextEndBattle + dw ViridianGymBattleText6 ; TextBeforeBattle + dw ViridianGymAfterBattleText6 ; TextAfterBattle + dw ViridianGymEndBattleText6 ; TextEndBattle + dw ViridianGymEndBattleText6 ; TextEndBattle ViridianGymTrainerHeader6: ; 74a50 (1d:4a50) db $8 ; flag's bit db ($3 << 4) ; trainer's view range dw wd751 ; flag's byte - dw ViridianGymBattleText7 ; 0x4b93 TextBeforeBattle - dw ViridianGymAfterBattleText7 ; 0x4b9d TextAfterBattle - dw ViridianGymEndBattleText7 ; 0x4b98 TextEndBattle - dw ViridianGymEndBattleText7 ; 0x4b98 TextEndBattle + dw ViridianGymBattleText7 ; TextBeforeBattle + dw ViridianGymAfterBattleText7 ; TextAfterBattle + dw ViridianGymEndBattleText7 ; TextEndBattle + dw ViridianGymEndBattleText7 ; TextEndBattle ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) db $9 ; flag's bit db ($4 << 4) ; trainer's view range dw wd751 ; flag's byte - dw ViridianGymBattleText8 ; 0x4bac TextBeforeBattle - dw ViridianGymAfterBattleText8 ; 0x4bb6 TextAfterBattle - dw ViridianGymEndBattleText8 ; 0x4bb1 TextEndBattle - dw ViridianGymEndBattleText8 ; 0x4bb1 TextEndBattle + dw ViridianGymBattleText8 ; TextBeforeBattle + dw ViridianGymAfterBattleText8 ; TextAfterBattle + dw ViridianGymEndBattleText8 ; TextEndBattle + dw ViridianGymEndBattleText8 ; TextEndBattle db $ff @@ -278,13 +278,13 @@ ViridianGymText1: ; 74a69 (1d:4a69) db $08 ; asm ld a, [wd751] bit 1, a - jr z, .asm_6de66 ; 0x74a6f + jr z, .asm_6de66 bit 0, a - jr nz, .asm_9fc95 ; 0x74a73 + jr nz, .asm_9fc95 call z, ViridianGymScript3_74995 call DisableWaitingAfterTextDisplay - jr .asm_6dff7 ; 0x74a7b -.asm_9fc95 ; 0x74a7d + jr .asm_6dff7 +.asm_9fc95 ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, ViridianGymText_74ad9 @@ -296,8 +296,8 @@ ViridianGymText1: ; 74a69 (1d:4a69) call UpdateSprites call Delay3 call GBFadeInFromBlack - jr .asm_6dff7 ; 0x74a9e -.asm_6de66 ; 0x74aa0 + jr .asm_6dff7 +.asm_6de66 ld hl, ViridianGymText_74ace call PrintText ld hl, wd72d @@ -314,7 +314,7 @@ ViridianGymText1: ; 74a69 (1d:4a69) ld [W_GYMLEADERNO], a ld a, $3 ld [W_VIRIDIANGYMCURSCRIPT], a -.asm_6dff7 ; 0x74acb +.asm_6dff7 jp TextScriptEnd ViridianGymText_74ace: ; 74ace (1d:4ace) @@ -493,14 +493,14 @@ ViridianGymText10: ; 74bbb (1d:4bbb) db $08 ; asm ld a, [wd751] bit 1, a - jr nz, .asm_1abd1 ; 0x74bc1 + jr nz, .asm_1abd1 ld hl, ViridianGymText_74bd4 call PrintText - jr .asm_6064d ; 0x74bc9 -.asm_1abd1 ; 0x74bcb + jr .asm_6064d +.asm_1abd1 ld hl, ViridianGymText_74bd9 call PrintText -.asm_6064d ; 0x74bd1 +.asm_6064d jp TextScriptEnd ViridianGymText_74bd4: ; 74bd4 (1d:4bd4) diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index d33dfe81..e6e120fe 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -8,11 +8,11 @@ ViridianMartScript: ; 1d46e (7:546e) ViridianMartScript_1d47d: ; 1d47d (7:547d) ld a, [wd74e] bit 0, a - jr nz, .asm_1d489 ; 0x1d482 $5 - ld hl, ViridianMartTextPointers ; $54e0 - jr .asm_1d48c ; 0x1d487 $3 + jr nz, .asm_1d489 + ld hl, ViridianMartTextPointers + jr .asm_1d48c .asm_1d489 - ld hl, ViridianMartTextPointers + $a ; $54ea ; starts at ViridianMartText6 + ld hl, ViridianMartTextPointers + $a ; starts at ViridianMartText6 .asm_1d48c ld a, l ld [W_MAPTEXTPTR], a -- cgit v1.3.1-sl0p From 8431fa7756dace97413f4c35aaa44cd92cf5b6df Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 3 Jul 2015 14:58:50 -0500 Subject: TX_ASM --- engine/battle/common_text.asm | 16 +++++++-------- engine/battle/core.asm | 16 +++++++-------- engine/battle/experience.asm | 4 ++-- engine/hidden_object_functions14.asm | 2 +- engine/hidden_object_functions17.asm | 12 +++++------ engine/hidden_object_functions18.asm | 2 +- engine/hidden_object_functions3.asm | 6 +++--- engine/hidden_object_functions7.asm | 8 ++++---- engine/learn_move.asm | 2 +- engine/overworld/hidden_items.asm | 2 +- engine/slot_machine.asm | 2 +- home.asm | 4 ++-- macros.asm | 4 ++++ main.asm | 2 +- scripts/agatha.asm | 2 +- scripts/bikeshop.asm | 6 +++--- scripts/billshouse.asm | 6 +++--- scripts/bruno.asm | 2 +- scripts/celadoncity.asm | 4 ++-- scripts/celadondiner.asm | 2 +- scripts/celadongamecorner.asm | 16 +++++++-------- scripts/celadongym.asm | 16 +++++++-------- scripts/celadonmansion1.asm | 6 +++--- scripts/celadonmansion3.asm | 4 ++-- scripts/celadonmansion5.asm | 2 +- scripts/celadonmart3.asm | 2 +- scripts/celadonmartelevator.asm | 2 +- scripts/celadonmartroof.asm | 2 +- scripts/ceruleancity.asm | 8 ++++---- scripts/ceruleangym.asm | 8 ++++---- scripts/ceruleanhouse1.asm | 2 +- scripts/ceruleanhouse2.asm | 2 +- scripts/ceruleanhousetrashed.asm | 2 +- scripts/cinnabargym.asm | 18 ++++++++-------- scripts/copycatshouse1f.asm | 2 +- scripts/copycatshouse2f.asm | 4 ++-- scripts/daycarem.asm | 2 +- scripts/fanclub.asm | 10 ++++----- scripts/fightingdojo.asm | 14 ++++++------- scripts/fuchsiacity.asm | 12 +++++------ scripts/fuchsiagym.asm | 16 +++++++-------- scripts/fuchsiahouse2.asm | 4 ++-- scripts/fuchsiahouse3.asm | 2 +- scripts/gary.asm | 4 ++-- scripts/lab2.asm | 4 ++-- scripts/lab3.asm | 2 +- scripts/lab4.asm | 4 ++-- scripts/lance.asm | 4 ++-- scripts/lavenderhouse1.asm | 10 ++++----- scripts/lavenderhouse2.asm | 4 ++-- scripts/lavendermart.asm | 2 +- scripts/lavendertown.asm | 2 +- scripts/lorelei.asm | 2 +- scripts/mansion1.asm | 4 ++-- scripts/mansion2.asm | 4 ++-- scripts/mansion3.asm | 4 ++-- scripts/mansion4.asm | 4 ++-- scripts/mtmoon1.asm | 14 ++++++------- scripts/mtmoon3.asm | 14 ++++++------- scripts/mtmoonpokecenter.asm | 2 +- scripts/museum1f.asm | 10 ++++----- scripts/namerater.asm | 2 +- scripts/oakslab.asm | 34 +++++++++++++++---------------- scripts/pewtercity.asm | 6 +++--- scripts/pewtergym.asm | 6 +++--- scripts/pewterhouse1.asm | 2 +- scripts/pewtermart.asm | 4 ++-- scripts/pewterpokecenter.asm | 2 +- scripts/pokemontower2.asm | 2 +- scripts/pokemontower3.asm | 6 +++--- scripts/pokemontower4.asm | 6 +++--- scripts/pokemontower5.asm | 8 ++++---- scripts/pokemontower6.asm | 8 ++++---- scripts/pokemontower7.asm | 6 +++--- scripts/powerplant.asm | 20 +++++++++--------- scripts/rockethideout1.asm | 12 +++++------ scripts/rockethideout2.asm | 2 +- scripts/rockethideout3.asm | 4 ++-- scripts/rockethideout4.asm | 10 ++++----- scripts/rockethideoutelevator.asm | 2 +- scripts/rocktunnel1.asm | 14 ++++++------- scripts/rocktunnel2.asm | 16 +++++++-------- scripts/route1.asm | 2 +- scripts/route10.asm | 12 +++++------ scripts/route11.asm | 20 +++++++++--------- scripts/route11gateupstairs.asm | 8 ++++---- scripts/route12.asm | 14 ++++++------- scripts/route12gateupstairs.asm | 6 +++--- scripts/route12house.asm | 2 +- scripts/route13.asm | 20 +++++++++--------- scripts/route14.asm | 20 +++++++++--------- scripts/route15.asm | 20 +++++++++--------- scripts/route15gateupstairs.asm | 4 ++-- scripts/route16.asm | 12 +++++------ scripts/route16gate.asm | 2 +- scripts/route16gateupstairs.asm | 8 ++++---- scripts/route16house.asm | 4 ++-- scripts/route17.asm | 20 +++++++++--------- scripts/route18.asm | 6 +++--- scripts/route18gate.asm | 2 +- scripts/route18gateupstairs.asm | 6 +++--- scripts/route19.asm | 20 +++++++++--------- scripts/route20.asm | 20 +++++++++--------- scripts/route21.asm | 18 ++++++++-------- scripts/route22.asm | 4 ++-- scripts/route22gate.asm | 4 ++-- scripts/route23.asm | 16 +++++++-------- scripts/route24.asm | 14 ++++++------- scripts/route25.asm | 18 ++++++++-------- scripts/route2gate.asm | 2 +- scripts/route2house.asm | 2 +- scripts/route3.asm | 16 +++++++-------- scripts/route4.asm | 2 +- scripts/route5gate.asm | 2 +- scripts/route6.asm | 12 +++++------ scripts/route8.asm | 18 ++++++++-------- scripts/route9.asm | 18 ++++++++-------- scripts/safarizoneentrance.asm | 6 +++--- scripts/safarizonesecrethouse.asm | 2 +- scripts/saffrongym.asm | 18 ++++++++-------- scripts/saffronhouse1.asm | 2 +- scripts/saffronhouse2.asm | 2 +- scripts/seafoamislands5.asm | 4 ++-- scripts/silphco10.asm | 6 +++--- scripts/silphco11.asm | 8 ++++---- scripts/silphco2.asm | 10 ++++----- scripts/silphco3.asm | 6 +++--- scripts/silphco4.asm | 8 ++++---- scripts/silphco5.asm | 10 ++++----- scripts/silphco6.asm | 16 +++++++-------- scripts/silphco7.asm | 18 ++++++++-------- scripts/silphco8.asm | 8 ++++---- scripts/silphco9.asm | 8 ++++---- scripts/silphcoelevator.asm | 2 +- scripts/ssanne10.asm | 14 ++++++------- scripts/ssanne2.asm | 2 +- scripts/ssanne5.asm | 4 ++-- scripts/ssanne6.asm | 2 +- scripts/ssanne7.asm | 4 ++-- scripts/ssanne8.asm | 10 ++++----- scripts/ssanne9.asm | 22 ++++++++++---------- scripts/undergroundpathentranceroute5.asm | 2 +- scripts/unknowndungeon3.asm | 4 ++-- scripts/vermilioncity.asm | 6 +++--- scripts/vermiliongym.asm | 10 ++++----- scripts/vermilionhouse1.asm | 2 +- scripts/vermilionhouse2.asm | 2 +- scripts/vermilionhouse3.asm | 2 +- scripts/victoryroad1.asm | 4 ++-- scripts/victoryroad2.asm | 14 ++++++------- scripts/victoryroad3.asm | 8 ++++---- scripts/viridiancity.asm | 12 +++++------ scripts/viridianforest.asm | 6 +++--- scripts/viridiangym.asm | 20 +++++++++--------- scripts/viridianhouse.asm | 2 +- 155 files changed, 595 insertions(+), 591 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm index 6ba978b3..11309a86 100644 --- a/engine/battle/common_text.asm +++ b/engine/battle/common_text.asm @@ -139,22 +139,22 @@ PrintSendOutMonMessage: ; 58e59 (16:4e59) GoText: ; 58eae (16:4eae) TX_FAR _GoText - db $08 ; asm + TX_ASM jr PrintPlayerMon1Text DoItText: ; 58eb5 (16:4eb5) TX_FAR _DoItText - db $08 ; asm + TX_ASM jr PrintPlayerMon1Text GetmText: ; 58ebc (16:4ebc) TX_FAR _GetmText - db $08 ; asm + TX_ASM jr PrintPlayerMon1Text EnemysWeakText: ; 58ec3 (16:4ec3) TX_FAR _EnemysWeakText - db $08 ; asm + TX_ASM PrintPlayerMon1Text: ld hl, PlayerMon1Text @@ -170,7 +170,7 @@ RetreatMon: ; 58ed1 (16:4ed1) PlayerMon2Text: ; 58ed7 (16:4ed7) TX_FAR _PlayerMon2Text - db $08 ; asm + TX_ASM push de push bc ld hl, wEnemyMonHP + 1 @@ -216,17 +216,17 @@ PlayerMon2Text: ; 58ed7 (16:4ed7) EnoughText: ; 58f25 (16:4f25) TX_FAR _EnoughText - db $08 ; asm + TX_ASM jr PrintComeBackText OKExclamationText: ; 58f2c (16:4f2c) TX_FAR _OKExclamationText - db $08 ; asm + TX_ASM jr PrintComeBackText GoodText: ; 58f33 (16:4f33) TX_FAR _GoodText - db $08 ; asm + TX_ASM jr PrintComeBackText PrintComeBackText: ; 58f3a (16:4f3a) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 352a4677..ec67d094 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -3773,7 +3773,7 @@ PrintMonName1Text: ; 3daf5 (f:5af5) ; but the functionality didn't get removed MonName1Text: ; 3dafb (f:5afb) TX_FAR _MonName1Text - db $08 ; asm + TX_ASM ld a, [H_WHOSETURN] and a ld a, [W_PLAYERMOVENUM] @@ -3798,12 +3798,12 @@ MonName1Text: ; 3dafb (f:5afb) Used1Text: ; 3db2d (f:5b2d) TX_FAR _Used1Text - db $08 ; asm + TX_ASM jr PrintInsteadText Used2Text: ; 3db34 (f:5b34) TX_FAR _Used2Text - db $08 ; asm + TX_ASM ; fall through PrintInsteadText: ; 3db39 (f:5b39) @@ -3815,7 +3815,7 @@ PrintInsteadText: ; 3db39 (f:5b39) InsteadText: ; 3db43 (f:5b43) TX_FAR _InsteadText - db $08 ; asm + TX_ASM ; fall through PrintMoveName: ; 3db48 (f:5b48) @@ -3824,7 +3824,7 @@ PrintMoveName: ; 3db48 (f:5b48) _PrintMoveName: ; 3db4c (f:5b4c) TX_FAR _CF4BText - db $08 ; asm + TX_ASM ld hl, ExclamationPointPointerTable ld a, [wd11e] ; exclamation point num add a @@ -7710,7 +7710,7 @@ PrintNothingHappenedText: ; 3f522 (f:7522) MonsStatsRoseText: ; 3f528 (f:7528) TX_FAR _MonsStatsRoseText - db $08 ; asm + TX_ASM ld hl, GreatlyRoseText ld a, [H_WHOSETURN] and a @@ -7912,7 +7912,7 @@ MoveMissed: ; 3f65a (f:765a) MonsStatsFellText: ; 3f661 (f:7661) TX_FAR _MonsStatsFellText - db $08 ; asm + TX_ASM ld hl, FellText ld a, [H_WHOSETURN] and a @@ -8246,7 +8246,7 @@ ChargeEffect: ; 3f88c (f:788c) ChargeMoveEffectText: ; 3f8c8 (f:78c8) TX_FAR _ChargeMoveEffectText - db $08 ; asm + TX_ASM ld a, [wWhichTrade] cp RAZOR_WIND ld hl, MadeWhirlwindText diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm index 9bd67654..4e4d0f3c 100644 --- a/engine/battle/experience.asm +++ b/engine/battle/experience.asm @@ -341,7 +341,7 @@ BoostExp: ; 5549f (15:549f) GainedText: ; 554b2 (15:54b2) TX_FAR _GainedText - db $08 ; asm + TX_ASM ld a, [wBoostExpByExpAll] ld hl, WithExpAllText and a @@ -355,7 +355,7 @@ GainedText: ; 554b2 (15:54b2) WithExpAllText: ; 554cb (15:54cb) TX_FAR _WithExpAllText - db $08 ; asm + TX_ASM ld hl, ExpPointsText ret diff --git a/engine/hidden_object_functions14.asm b/engine/hidden_object_functions14.asm index a162c905..5b97b815 100755 --- a/engine/hidden_object_functions14.asm +++ b/engine/hidden_object_functions14.asm @@ -11,7 +11,7 @@ TMNotebook: ; 529a4 (14:69a4) db "@" ViridianSchoolNotebook: ; 529aa (14:69aa) - db $08 ; asm + TX_ASM ld hl, ViridianSchoolNotebookText1 call PrintText call TurnPageSchoolNotebook diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 822f59a5..b7b2fa00 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -95,7 +95,7 @@ PrintBlackboardLinkCableText: ; 5dc1a (17:5c1a) ret LinkCableHelp: ; 5dc29 (17:5c29) - db $08 ; asm + TX_ASM call SaveScreenTilesToBuffer1 ld hl, LinkCableHelpText1 call PrintText @@ -179,7 +179,7 @@ LinkCableInfoText3: ; 5dce8 (17:5ce8) db "@" ViridianSchoolBlackboard: ; 5dced (17:5ced) - db $08 ; asm + TX_ASM call SaveScreenTilesToBuffer1 ld hl, ViridianSchoolBlackboardText1 call PrintText @@ -428,7 +428,7 @@ GymTrashCans: ; 5de7d (17:5e7d) VermilionGymTrashSuccesText1: ; 5dec8 (17:5ec8) TX_FAR _VermilionGymTrashSuccesText1 - db $08 ; asm + TX_ASM call WaitForSoundToFinish ld a, (SFX_02_49 - SFX_Headers_02) / 3 call PlaySound @@ -442,7 +442,7 @@ VermilionGymTrashSuccesText2: ; 5dedb (17:5edb) ; unused VermilionGymTrashSuccesPlaySfx: ; 5dee0 (17:5ee0) - db $08 ; asm + TX_ASM call WaitForSoundToFinish ld a, (SFX_02_49 - SFX_Headers_02) / 3 call PlaySound @@ -451,7 +451,7 @@ VermilionGymTrashSuccesPlaySfx: ; 5dee0 (17:5ee0) VermilionGymTrashSuccesText3: ; 5deef (17:5eef) TX_FAR _VermilionGymTrashSuccesText3 - db $08 ; asm + TX_ASM call WaitForSoundToFinish ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound @@ -460,7 +460,7 @@ VermilionGymTrashSuccesText3: ; 5deef (17:5eef) VermilionGymTrashFailText: ; 5df02 (17:5f02) TX_FAR _VermilionGymTrashFailText - db $08 ; asm + TX_ASM call WaitForSoundToFinish ld a, (SFX_02_51 - SFX_Headers_02) / 3 call PlaySound diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index a378adcc..44be4c31 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -139,7 +139,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) db "@" SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) - db $8 ; asm + TX_ASM ld a, [wd838] bit 7, a ld hl, SaffronCityPokecenterBenchGuyText2 diff --git a/engine/hidden_object_functions3.asm b/engine/hidden_object_functions3.asm index c471c7bb..23254c11 100755 --- a/engine/hidden_object_functions3.asm +++ b/engine/hidden_object_functions3.asm @@ -60,7 +60,7 @@ BookshelfTileIDs: ; fb8b (3:7b8b) db $FF IndigoPlateauStatues: ; fbbf (3:7bbf) - db $08 ; asm + TX_ASM ld hl, IndigoPlateauStatuesText1 call PrintText ld a, [W_XCOORD] @@ -85,7 +85,7 @@ IndigoPlateauStatuesText3: ; fbe3 (3:7be3) db "@" BookOrSculptureText: ; fbe8 (3:7be8) - db $08 ; asm + TX_ASM ld hl, PokemonBooksText ld a, [W_CURMAPTILESET] cp MANSION ; Celadon Mansion tileset @@ -113,7 +113,7 @@ ElevatorText: ; fc0d (3:7c0d) TownMapText: ; fc12 (3:7c12) TX_FAR _TownMapText db $06 - db $08 ; asm + TX_ASM ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, wd730 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index ce6d901f..b06f11ca 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -99,7 +99,7 @@ PrintSafariGameOverText: ; 1e9ed (7:69ed) jp PrintText SafariGameOverText: ; 1e9f7 (7:69f7) - db $08 ; asm + TX_ASM ld a, [W_NUMSAFARIBALLS] and a jr z, .asm_1ea04 @@ -127,7 +127,7 @@ PrintCinnabarQuiz: ; 1ea17 (7:6a17) jp PrintPredefTextID CinnabarGymQuiz: ; 1ea25 (7:6a25) - db $08 ; asm + TX_ASM xor a ld [wda38], a ld a, [wWhichTrade] @@ -375,7 +375,7 @@ BillsHouseMonitorText: ; 1ebdd (7:6bdd) BillsHouseInitiatedText: ; 1ebe2 (7:6be2) TX_FAR _BillsHouseInitiatedText db $06 - db $08 ; asm + TX_ASM ld a, $ff ld [wc0ee], a call PlaySound @@ -389,7 +389,7 @@ BillsHouseInitiatedText: ; 1ebe2 (7:6be2) jp TextScriptEnd BillsHousePokemonList: ; 1ec05 (7:6c05) - db $08 ; asm + TX_ASM call SaveScreenTilesToBuffer1 ld hl, BillsHousePokemonListText1 call PrintText diff --git a/engine/learn_move.asm b/engine/learn_move.asm index 75056edb..3c7663b2 100755 --- a/engine/learn_move.asm +++ b/engine/learn_move.asm @@ -206,7 +206,7 @@ TryingToLearnText: ; 6fc3 (1:6fc3) OneTwoAndText: ; 6fc8 (1:6fc8) TX_FAR _OneTwoAndText db $a - db $8 + TX_ASM ld a, (SFX_02_58 - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent ld hl, PoofText diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm index 0b9e316e..afe9e3c3 100755 --- a/engine/overworld/hidden_items.asm +++ b/engine/overworld/hidden_items.asm @@ -23,7 +23,7 @@ INCLUDE "data/hidden_item_coords.asm" FoundHiddenItemText: ; 7675b (1d:675b) TX_FAR _FoundHiddenItemText - db $8 + TX_ASM ld a, [wWhichTrade] ; item ID ld b, a ld c, 1 diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index 7198f289..0b9f8bc9 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -456,7 +456,7 @@ SlotMachine_37588: ; 37588 (d:7588) jp .loop SlotsMachineText_37665: ; 37665 (d:7665) - db $08 ; asm + TX_ASM push bc call SlotMachine_37728 ld hl, LinedUpText diff --git a/home.asm b/home.asm index 07811175..3b8dab1b 100644 --- a/home.asm +++ b/home.asm @@ -971,7 +971,7 @@ PokeCenterSignText:: ; 24ef (0:24ef) Predef5CText:: ; 24f4 (0:24f4) ; XXX better label (what does predef $5C do?) - db $08 ; asm + TX_ASM predef PickupItem jp TextScriptEnd @@ -2584,7 +2584,7 @@ GetSavedEndBattleTextPointer:: ; 33b7 (0:33b7) TrainerEndBattleText:: ; 33cf (0:33cf) TX_FAR _TrainerNameText - db $08 + TX_ASM call GetSavedEndBattleTextPointer call TextCommandProcessor jp TextScriptEnd diff --git a/macros.asm b/macros.asm index b80f1442..a3ff2815 100644 --- a/macros.asm +++ b/macros.asm @@ -195,6 +195,10 @@ TX_BCD: MACRO db \2 ENDM +TX_ASM: MACRO + db $08 + ENDM + ; Predef macro. add_predef: MACRO \1Predef:: diff --git a/main.asm b/main.asm index bc1c5f15..5ed4dacc 100755 --- a/main.asm +++ b/main.asm @@ -2726,7 +2726,7 @@ PrintStrengthTxt: ; cd99 (3:4d99) UsedStrengthText: ; cdaa (3:4daa) TX_FAR _UsedStrengthText - db $08 ; asm + TX_ASM ld a, [wcf91] call PlayCry call Delay3 diff --git a/scripts/agatha.asm b/scripts/agatha.asm index dd83b22f..cc209553 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -135,7 +135,7 @@ AgathaTrainerHeader0: ; 76509 (1d:6509) db $ff AgathaText1: ; 76516 (1d:6516) - db $08 ; asm + TX_ASM ld hl, AgathaTrainerHeader0 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index 2bf6b7e3..45c030d5 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -7,7 +7,7 @@ BikeShopTextPointers: ; 1d73f (7:573f) dw BikeShopText3 BikeShopText1: ; 1d745 (7:5745) - db $08 ; asm + TX_ASM ld a, [wd75f] bit 0, a jr z, .asm_260d4 @@ -120,7 +120,7 @@ BikeShopText_1d834: ; 1d834 (7:5834) db "@" BikeShopText2: ; 1d839 (7:5839) - db $08 ; asm + TX_ASM ld hl, BikeShopText_1d843 call PrintText jp TextScriptEnd @@ -130,7 +130,7 @@ BikeShopText_1d843: ; 1d843 (7:5843) db "@" BikeShopText3: ; 1d848 (7:5848) - db $08 ; asm + TX_ASM ld a, [wd75f] bit 0, a ld hl, BikeShopText_1d861 diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index 321e8808..df608de3 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -115,7 +115,7 @@ BillsHouseText4: ; 1e83c (7:683c) db $fd BillsHouseText1: ; 1e83d (7:683d) - db $8 + TX_ASM ld hl, BillsHouseText_1e865 call PrintText call YesNoChoice @@ -148,7 +148,7 @@ BillsHouseText_1e86f: ; 1e86f (7:686f) db "@" BillsHouseText2: ; 1e874 (7:6874) - db $08 ; asm + TX_ASM ld a, [wd7f2] bit 4, a jr nz, .asm_1e8a9 @@ -194,7 +194,7 @@ BillsHouseText_1e8cb: ; 1e8cb (7:68cb) db "@" BillsHouseText3: ; 1e8d0 (7:68d0) - db $08 ; asm + TX_ASM ld hl, BillsHouseText_1e8da call PrintText jp TextScriptEnd diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 0e21fe7b..257a830b 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -132,7 +132,7 @@ BrunoTrainerHeader0: ; 763ac (1d:63ac) db $ff BrunoText1: ; 763b9 (1d:63b9) - db $08 ; asm + TX_ASM ld hl, BrunoTrainerHeader0 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index 40834a3e..9107d254 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -44,7 +44,7 @@ CeladonCityText4: ; 19999 (6:5999) db "@" CeladonCityText5: ; 1999e (6:599e) - db $08 ; asm + TX_ASM ld a, [wd777] bit 0, a jr nz, .asm_7053f @@ -90,7 +90,7 @@ CeladonCityText6: ; 199e7 (6:59e7) CeladonCityText7: ; 199ec (6:59ec) TX_FAR _CeladonCityText7 - db $08 ; asm + TX_ASM ld a, POLIWRATH call PlayCry jp TextScriptEnd diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index 0c1dd4a0..f6db1606 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -26,7 +26,7 @@ CeladonDinerText4: ; 4916e (12:516e) db "@" CeladonDinerText5: ; 49173 (12:5173) - db $08 ; asm + TX_ASM ld a, [wd783] bit 0, a jr nz, .asm_eb14d diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index d1ee9951..1c80c458 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -124,7 +124,7 @@ CeladonGameCornerText1: ; 48ca4 (12:4ca4) db "@" CeladonGameCornerText2: ; 48ca9 (12:4ca9) - db $08 ; asm + TX_ASM call CeladonGameCornerScript_48f1e ld hl, CeladonGameCornerText_48d22 call PrintText @@ -213,7 +213,7 @@ CeladonGameCornerText4: ; 48d45 (12:4d45) db "@" CeladonGameCornerText5: ; 48d4a (12:4d4a) - db $08 ; asm + TX_ASM ld a, [wd77e] bit 2, a jr nz, .asm_48d89 @@ -272,7 +272,7 @@ CeladonGameCornerText6: ; 48db1 (12:4db1) db "@" CeladonGameCornerText7: ; 48db6 (12:4db6) - db $08 ; asm + TX_ASM ld a, [wd77c] bit 1, a ld hl, CeladonGameCornerText_48dca @@ -295,7 +295,7 @@ CeladonGameCornerText8: ; 48dd4 (12:4dd4) db "@" CeladonGameCornerText9: ; 48dd9 (12:4dd9) - db $08 ; asm + TX_ASM ld a, [wd77e] bit 4, a jr nz, .asm_48e13 @@ -348,7 +348,7 @@ CeladonGameCornerText_48e36: ; 48e36 (12:4e36) db "@" CeladonGameCornerText10: ; 48e3b (12:4e3b) - db $08 ; asm + TX_ASM ld a, [wd77e] bit 3, a jr nz, .asm_48e75 @@ -401,7 +401,7 @@ CeladonGameCornerText_48e98: ; 48e98 (12:4e98) db "@" CeladonGameCornerText11: ; 48e9d (12:4e9d) - db $08 ; asm + TX_ASM ld hl, CeladonGameCornerText_48ece call PrintText ld hl, wd72d @@ -435,7 +435,7 @@ CeladonGameCornerText13: ; 48ed8 (12:4ed8) db "@" CeladonGameCornerText12: ; 48edd (12:4edd) - db $08 ; asm + TX_ASM ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, CeladonGameCornerText_48f09 @@ -454,7 +454,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) CeladonGameCornerText_48f09: ; 48f09 (12:4f09) TX_FAR _CeladonGameCornerText_48f09 - db $8 + TX_ASM ld a, (SFX_02_49 - SFX_Headers_02) / 3 call PlaySound call WaitForSoundToFinish diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index fab2063f..99c96110 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -156,7 +156,7 @@ CeladonGymTrainerHeader7: ; 48a04 (12:4a04) db $ff CeladonGymText1: ; 48a11 (12:4a11) - db $08 ; asm + TX_ASM ld a, [wd77c] bit 1, a jr z, .asm_48a2d @@ -217,7 +217,7 @@ TM21NoRoomText: ; 48a7c (12:4a7c) db "@" CeladonGymText2: ; 48a81 (12:4a81) - db $08 ; asm + TX_ASM ld hl, CeladonGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -235,7 +235,7 @@ CeladonGymAfterBattleText2: ; 48a95 (12:4a95) db "@" CeladonGymText3: ; 48a9a (12:4a9a) - db $08 ; asm + TX_ASM ld hl, CeladonGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -253,7 +253,7 @@ CeladonGymAfterBattleText3: ; 48aae (12:4aae) db "@" CeladonGymText4: ; 48ab3 (12:4ab3) - db $08 ; asm + TX_ASM ld hl, CeladonGymTrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -271,7 +271,7 @@ CeladonGymAfterBattleText4: ; 48ac7 (12:4ac7) db "@" CeladonGymText5: ; 48acc (12:4acc) - db $08 ; asm + TX_ASM ld hl, CeladonGymTrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -289,7 +289,7 @@ CeladonGymAfterBattleText5: ; 48ae0 (12:4ae0) db "@" CeladonGymText6: ; 48ae5 (12:4ae5) - db $08 ; asm + TX_ASM ld hl, CeladonGymTrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -307,7 +307,7 @@ CeladonGymAfterBattleText6: ; 48af9 (12:4af9) db "@" CeladonGymText7: ; 48afe (12:4afe) - db $08 ; asm + TX_ASM ld hl, CeladonGymTrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -325,7 +325,7 @@ CeladonGymAfterBattleText7: ; 48b12 (12:4b12) db "@" CeladonGymText8: ; 48b17 (12:4b17) - db $08 ; asm + TX_ASM ld hl, CeladonGymTrainerHeader7 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/celadonmansion1.asm b/scripts/celadonmansion1.asm index 14832dbe..857c2e42 100755 --- a/scripts/celadonmansion1.asm +++ b/scripts/celadonmansion1.asm @@ -14,7 +14,7 @@ CeladonMansion1_486a1: ; 486a1 (12:46a1) CeladonMansion1Text1: ; 486a7 (12:46a7) TX_FAR _CeladonMansion1Text1 - db $08 ; asm + TX_ASM ld a, MEOWTH jp CeladonMansion1_486a1 @@ -24,13 +24,13 @@ CeladonMansion1Text2: ; 486b1 (12:46b1) CeladonMansion1Text3: ; 486b6 (12:46b6) TX_FAR _CeladonMansion1Text3 - db $8 + TX_ASM ld a, CLEFAIRY jp CeladonMansion1_486a1 CeladonMansion1Text4: ; 486c0 (12:46c0) TX_FAR _CeladonMansion1Text4 - db $8 + TX_ASM ld a, NIDORAN_F jp CeladonMansion1_486a1 diff --git a/scripts/celadonmansion3.asm b/scripts/celadonmansion3.asm index 47190c92..0dadd20a 100755 --- a/scripts/celadonmansion3.asm +++ b/scripts/celadonmansion3.asm @@ -24,7 +24,7 @@ WriterText: ; 487ad (12:47ad) db "@" DirectorText: ; 487b2 (12:47b2) - db $08 ; asm + TX_ASM ; check pokédex ld hl, wPokedexOwned @@ -48,7 +48,7 @@ DirectorText: ; 487b2 (12:47b2) .CompletedDexText TX_FAR _CompletedDexText db $6 - db $8 ; asm + TX_ASM callab DisplayDiploma ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a diff --git a/scripts/celadonmansion5.asm b/scripts/celadonmansion5.asm index 7b2bb58d..f847759b 100755 --- a/scripts/celadonmansion5.asm +++ b/scripts/celadonmansion5.asm @@ -10,7 +10,7 @@ CeladonMansion5Text1: ; 1dd41 (7:5d41) db "@" CeladonMansion5Text2: ; 1dd46 (7:5d46) - db $08 ; asm + TX_ASM ld bc,(EEVEE << 8) | 25 call GivePokemon jr nc, .asm_24365 diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index 50496c85..46e58d8c 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -21,7 +21,7 @@ CeladonMart3TextPointers: ; 48228 (12:4228) dw CeladonMart3Text17 CeladonMart3Text1: ; 4824a (12:424a) - db $08 ; asm + TX_ASM ld a, [wd778] bit 7, a jr nz, .asm_a5463 diff --git a/scripts/celadonmartelevator.asm b/scripts/celadonmartelevator.asm index 049931e1..a0aa576d 100755 --- a/scripts/celadonmartelevator.asm +++ b/scripts/celadonmartelevator.asm @@ -63,7 +63,7 @@ CeladonMartElevatorTextPointers: ; 4865c (12:465c) dw CeladonMartElevatorText1 CeladonMartElevatorText1: ; 4865e (12:465e) - db $08 ; asm + TX_ASM call CeladonMartElevatorScript_48631 ld hl, CeldaonMartElevatorWarpMaps predef Func_1c9c6 diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index c656630c..07b26788 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -224,7 +224,7 @@ CeladonMartRoofText1: ; 48567 (12:4567) db "@" CeladonMartRoofText2: ; 4856c (12:456c) - db $08 ; asm + TX_ASM call CeladonMartRoofScript_483d8 ld a, [wcd37] and a diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index 32c4868a..81302a92 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -234,7 +234,7 @@ CeruleanCityTextPointers: ; 1962d (6:562d) dw CeruleanCityText17 CeruleanCityText1: ; 1964f (6:564f) - db $08 ; asm + TX_ASM ld a, [wd75a] ; rival battle flag bit 0, a ; do pre-battle text @@ -266,7 +266,7 @@ CeruleanCityText_19677: ; 19677 (6:5677) db "@" CeruleanCityText2: ; 1967c (6:567c) - db $8 + TX_ASM ld a, [wd75b] bit 7, a jr nz, .asm_4ca20 @@ -343,7 +343,7 @@ CeruleanCityText6: ; 19707 (6:5707) db "@" CeruleanCityText7: ; 1970c (6:570c) - db $08 ; asm + TX_ASM ldh a, [$d3] cp $b4 jr c, .asm_e9fc9 @@ -375,7 +375,7 @@ CeruleanCityText_1973a: ; 1973a (6:573a) db "@" CeruleanCityText8: ; 1973f (6:573f) - db $08 ; asm + TX_ASM ld a, [hRandomAdd] cp $b4 jr c, .asm_e28da diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index ba9d270d..2d158e96 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -105,7 +105,7 @@ CeruleanGymTrainerHeader1: ; 5c764 (17:4764) db $ff CeruleanGymText1: ; 5c771 (17:4771) - db $08 ; asm + TX_ASM ld a, [wd75e] bit 7, a jr z, .asm_5c78d @@ -166,7 +166,7 @@ CeruleanGymText_5c7d8: ; 5c7d8 (17:47d8) db $11, $6, "@" CeruleanGymText2: ; 5c7df (17:47df) - db $08 ; asm + TX_ASM ld hl, CeruleanGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -184,7 +184,7 @@ CeruleanGymAfterBattleText1: ; 5c7f3 (17:47f3) db "@" CeruleanGymText3: ; 5c7f8 (17:47f8) - db $08 ; asm + TX_ASM ld hl, CeruleanGymTrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -202,7 +202,7 @@ CeruleanGymAfterBattleText2: ; 5c80c (17:480c) db "@" CeruleanGymText4: ; 5c811 (17:4811) - db $08 ; asm + TX_ASM ld a, [wd75e] bit 7, a jr nz, .asm_5c821 diff --git a/scripts/ceruleanhouse1.asm b/scripts/ceruleanhouse1.asm index 4b6a240a..e703d830 100755 --- a/scripts/ceruleanhouse1.asm +++ b/scripts/ceruleanhouse1.asm @@ -10,7 +10,7 @@ CeruleanHouse1Text1: ; 1d6fd (7:56fd) db "@" CeruleanHouse1Text2: ; 1d702 (7:5702) - db $08 ; asm + TX_ASM ld a, $6 ld [wWhichTrade], a predef DoInGameTradeDialogue diff --git a/scripts/ceruleanhouse2.asm b/scripts/ceruleanhouse2.asm index 9f7e4ddd..423c0209 100755 --- a/scripts/ceruleanhouse2.asm +++ b/scripts/ceruleanhouse2.asm @@ -9,7 +9,7 @@ CeruleanHouse2TextPointers: ; 74e13 (1d:4e13) dw CeruleanHouse2Text1 CeruleanHouse2Text1: ; 74e15 (1d:4e15) - db $8 + TX_ASM ld hl, CeruleanHouse2Text_74e77 call PrintText xor a diff --git a/scripts/ceruleanhousetrashed.asm b/scripts/ceruleanhousetrashed.asm index a78b3bb6..e0a194fe 100755 --- a/scripts/ceruleanhousetrashed.asm +++ b/scripts/ceruleanhousetrashed.asm @@ -8,7 +8,7 @@ CeruleanHouseTrashedTextPointers: ; 1d689 (7:5689) dw CeruleanHouseTrashedText3 CeruleanHouseTrashedText1: ; 1d68f (7:568f) - db $08 ; asm + TX_ASM ld b, $e4 predef IsItemInBag_ and b diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index b4955786..32043121 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -206,7 +206,7 @@ CinnabarGymScript_758b7: ; 758b7 (1d:58b7) jp TextScriptEnd CinnabarGymText1: ; 758df (1d:58df) - db $8 + TX_ASM ld a, [wd79a] bit 1, a jr z, .asm_d9332 @@ -258,7 +258,7 @@ TM38NoRoomText: ; 75934 (1d:5934) db "@" CinnabarGymText2: ; 75939 (1d:5939) - db $08 ; asm + TX_ASM call CinnabarGymScript_757a0 ld a, [wd79a] bit 2, a @@ -287,7 +287,7 @@ CinnabarGymText_75969: ; 75969 (1d:5969) db "@" CinnabarGymText3: ; 7596e (1d:596e) - db $08 ; asm + TX_ASM call CinnabarGymScript_757a0 ld a, [wd79a] bit 3, a @@ -316,7 +316,7 @@ CinnabarGymText_7599e: ; 7599e (1d:599e) db "@" CinnabarGymText4: ; 759a3 (1d:59a3) - db $08 ; asm + TX_ASM call CinnabarGymScript_757a0 ld a, [wd79a] bit 4, a @@ -345,7 +345,7 @@ CinnabarGymText_759d3: ; 759d3 (1d:59d3) db "@" CinnabarGymText5: ; 759d8 (1d:59d8) - db $08 ; asm + TX_ASM call CinnabarGymScript_757a0 ld a, [wd79a] bit 5, a @@ -374,7 +374,7 @@ CinnabarGymText_75a08: ; 75a08 (1d:5a08) db "@" CinnabarGymText6: ; 75a0d (1d:5a0d) - db $08 ; asm + TX_ASM call CinnabarGymScript_757a0 ld a, [wd79a] bit 6, a @@ -403,7 +403,7 @@ CinnabarGymText_75a3d: ; 75a3d (1d:5a3d) db "@" CinnabarGymText7: ; 75a42 (1d:5a42) - db $08 ; asm + TX_ASM call CinnabarGymScript_757a0 ld a, [wd79a] bit 7, a @@ -432,7 +432,7 @@ CinnabarGymText_75a72: ; 75a72 (1d:5a72) db "@" CinnabarGymText8: ; 75a77 (1d:5a77) - db $08 ; asm + TX_ASM call CinnabarGymScript_757a0 ld a, [wd79b] bit 0, a @@ -461,7 +461,7 @@ CinnabarGymText_75aa7: ; 75aa7 (1d:5aa7) db "@" CinnabarGymText9: ; 75aac (1d:5aac) - db $08 ; asm + TX_ASM ld a, [wd79a] bit 1, a jr nz, .asm_627d9 diff --git a/scripts/copycatshouse1f.asm b/scripts/copycatshouse1f.asm index 230a3ca3..bc76da1a 100755 --- a/scripts/copycatshouse1f.asm +++ b/scripts/copycatshouse1f.asm @@ -16,7 +16,7 @@ CopycatsHouse1FText2: ; 75ed1 (1d:5ed1) CopycatsHouse1FText3: ; 75ed6 (1d:5ed6) TX_FAR _CopycatsHouse1FText3 - db $8 + TX_ASM ld a, CHANSEY call PlayCry jp TextScriptEnd diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index 5bdb98b2..16b64e64 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -11,7 +11,7 @@ CopycatsHouse2FTextPointers: ; 5cc74 (17:4c74) dw CopycatsHouse2FText7 CopycatsHouse2FText1: ; 5cc82 (17:4c82) - db $08 ; asm + TX_ASM ld a, [wd7af] bit 0, a jr nz, .asm_7ccf3 @@ -83,7 +83,7 @@ CopycatsHouse2FText6: ; 5ccfe (17:4cfe) db "@" CopycatsHouse2FText7: ; 5cd03 (17:4d03) - db $08 ; asm + TX_ASM ld a, [wSpriteStateData1 + 9] cp $4 ld hl, CopycatsHouse2FText_5cd1c diff --git a/scripts/daycarem.asm b/scripts/daycarem.asm index fdfca235..3fa2d3b9 100755 --- a/scripts/daycarem.asm +++ b/scripts/daycarem.asm @@ -5,7 +5,7 @@ DayCareMTextPointers: ; 56252 (15:6252) dw DayCareMText1 DayCareMText1: ; 56254 (15:6254) - db $8 + TX_ASM call SaveScreenTilesToBuffer2 ld a, [W_DAYCARE_IN_USE] and a diff --git a/scripts/fanclub.asm b/scripts/fanclub.asm index f9a839fa..79621fce 100755 --- a/scripts/fanclub.asm +++ b/scripts/fanclub.asm @@ -24,7 +24,7 @@ FanClubTextPointers: ; 59b84 (16:5b84) FanClubText1: ; pikachu fan - db $08 ; asm + TX_ASM ld a, [wd771] bit 7, a jr nz, .mineisbetter @@ -51,7 +51,7 @@ FanClubText1: FanClubText2: ; seel fan - db $08 ; asm + TX_ASM ld a, [wd771] bit 6, a jr nz, .mineisbetter @@ -78,7 +78,7 @@ FanClubText2: FanClubText3: ; pikachu - db $8 + TX_ASM ld hl, .text call PrintText ld a, PIKACHU @@ -92,7 +92,7 @@ FanClubText3: FanClubText4: ; seel - db $08 ; asm + TX_ASM ld hl, .text call PrintText ld a, SEEL @@ -106,7 +106,7 @@ FanClubText4: FanClubText5: ; chair - db $08 ; asm + TX_ASM call FanClubBikeInBag jr nz, .nothingleft diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index 79647fe3..5ba6b150 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -134,7 +134,7 @@ FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) db $ff FightingDojoText1: ; 5ce44 (17:4e44) - db $08 ; asm + TX_ASM ld a, [wd7b1] bit 0, a jp nz, .continue1 @@ -183,7 +183,7 @@ FightingDojoText_5ce9d: ; 5ce9d (17:4e9d) db "@" FightingDojoText2: ; 5cea2 (17:4ea2) - db $08 ; asm + TX_ASM ld hl, FightingDojoTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -201,7 +201,7 @@ FightingDojoAfterBattleText1: ; 5ceb6 (17:4eb6) db "@" FightingDojoText3: ; 5cebb (17:4ebb) - db $08 ; asm + TX_ASM ld hl, FightingDojoTrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -219,7 +219,7 @@ FightingDojoAfterBattleText2: ; 5cecf (17:4ecf) db "@" FightingDojoText4: ; 5ced4 (17:4ed4) - db $08 ; asm + TX_ASM ld hl, FightingDojoTrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -237,7 +237,7 @@ FightingDojoAfterBattleText3: ; 5cee8 (17:4ee8) db "@" FightingDojoText5: ; 5ceed (17:4eed) - db $08 ; asm + TX_ASM ld hl, FightingDojoTrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -256,7 +256,7 @@ FightingDojoAfterBattleText4: ; 5cf01 (17:4f01) FightingDojoText6: ; 5cf06 (17:4f06) ; Hitmonlee Poké Ball - db $08 ; asm + TX_ASM ld a, [wd7b1] and %11000000 jr z, .GetMon @@ -294,7 +294,7 @@ WantHitmonleeText: ; 5cf49 (17:4f49) FightingDojoText7: ; 5cf4e (17:4f4e) ; Hitmonchan Poké Ball - db $08 ; asm + TX_ASM ld a, [wd7b1] and %11000000 jr z, .GetMon diff --git a/scripts/fuchsiacity.asm b/scripts/fuchsiacity.asm index 62372c9c..462e6084 100755 --- a/scripts/fuchsiacity.asm +++ b/scripts/fuchsiacity.asm @@ -74,7 +74,7 @@ FuchsiaCityText18: ; 19a8b (6:5a8b) db "@" FuchsiaCityText19: ; 19a90 (6:5a90) - db $08 ; asm + TX_ASM ld hl, FuchsiaCityChanseyText call PrintText ld a, CHANSEY @@ -86,7 +86,7 @@ FuchsiaCityChanseyText: ; 19a9f (6:5a9f) db "@" FuchsiaCityText20: ; 19aa4 (6:5aa4) - db $08 ; asm + TX_ASM ld hl, FuchsiaCityVoltorbText call PrintText ld a, VOLTORB @@ -98,7 +98,7 @@ FuchsiaCityVoltorbText: ; 19ab3 (6:5ab3) db "@" FuchsiaCityText21: ; 19ab8 (6:5ab8) - db $08 ; asm + TX_ASM ld hl, FuchsiaCityKangaskhanText call PrintText ld a, KANGASKHAN @@ -110,7 +110,7 @@ FuchsiaCityKangaskhanText: ; 19ac7 (6:5ac7) db "@" FuchsiaCityText22: ; 19acc (6:5acc) - db $08 ; asm + TX_ASM ld hl, FuchsiaCitySlowpokeText call PrintText ld a, SLOWPOKE @@ -122,7 +122,7 @@ FuchsiaCitySlowpokeText: ; 19adb (6:5adb) db "@" FuchsiaCityText23: ; 19ae0 (6:5ae0) - db $08 ; asm + TX_ASM ld hl, FuchsiaCityLaprasText call PrintText ld a, LAPRAS @@ -134,7 +134,7 @@ FuchsiaCityLaprasText: ; 19aef (6:5aef) db "@" FuchsiaCityText24: ; 19af4 (6:5af4) - db $08 ; asm + TX_ASM ld a, [wd7f6] bit 6, a jr nz, .asm_3b4e8 diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index 729192c6..e3c51015 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -145,7 +145,7 @@ FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) db $ff FuchsiaGymText1: ; 75534 (1d:5534) - db $08 ; asm + TX_ASM ld a, [wd792] bit 1, a jr z, .asm_181b6 @@ -209,7 +209,7 @@ FuchsiaGymText11: ; 7559f (1d:559f) db "@" FuchsiaGymText2: ; 755a4 (1d:55a4) - db $08 ; asm + TX_ASM ld hl, FuchsiaGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -227,7 +227,7 @@ FuchsiaGymAfterBattleText1: ; 755b8 (1d:55b8) db "@" FuchsiaGymText3: ; 755bd (1d:55bd) - db $08 ; asm + TX_ASM ld hl, FuchsiaGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -245,7 +245,7 @@ FuchsiaGymAfterBattleText2: ; 755d1 (1d:55d1) db "@" FuchsiaGymText4: ; 755d6 (1d:55d6) - db $08 ; asm + TX_ASM ld hl, FuchsiaGymTrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -263,7 +263,7 @@ FuchsiaGymAfterBattleText3: ; 755ea (1d:55ea) db "@" FuchsiaGymText5: ; 755ef (1d:55ef) - db $08 ; asm + TX_ASM ld hl, FuchsiaGymTrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -281,7 +281,7 @@ FuchsiaGymAfterBattleText4: ; 75603 (1d:5603) db "@" FuchsiaGymText6: ; 75608 (1d:5608) - db $08 ; asm + TX_ASM ld hl, FuchsiaGymTrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -299,7 +299,7 @@ FuchsiaGymAfterBattleText5: ; 7561c (1d:561c) db "@" FuchsiaGymText7: ; 75621 (1d:5621) - db $08 ; asm + TX_ASM ld hl, FuchsiaGymTrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -317,7 +317,7 @@ FuchsiaGymAfterBattleText6: ; 75635 (1d:5635) db "@" FuchsiaGymText8: ; 7563a (1d:563a) - db $08 ; asm + TX_ASM ld a, [wd792] bit 1, a ld hl, FuchsiaGymText_75653 diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index 73ad188d..0eb0b990 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -9,7 +9,7 @@ FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8) dw FuchsiaHouse2Text5 FuchsiaHouse2Text1: ; 750c2 (1d:50c2) - db $08 ; asm + TX_ASM ld a, [wd78e] bit 0, a jr nz, .subtract @@ -97,7 +97,7 @@ HM04NoRoomText: ; 7515e (1d:515e) FuchsiaHouse2Text5: ; 75163 (1d:5163) FuchsiaHouse2Text4: ; 75163 (1d:5163) - db $08 ; asm + TX_ASM ldh a, [$8c] cp $4 ld hl, FuchsiaHouse2Text_7517b diff --git a/scripts/fuchsiahouse3.asm b/scripts/fuchsiahouse3.asm index 31e5f76c..8c83b779 100755 --- a/scripts/fuchsiahouse3.asm +++ b/scripts/fuchsiahouse3.asm @@ -5,7 +5,7 @@ FuchsiaHouse3TextPointers: ; 5617f (15:617f) dw FuchsiaHouse3Text1 FuchsiaHouse3Text1: ; 56181 (15:6181) - db $08 ; asm + TX_ASM ld a, [wd728] bit 4, a jr nz, .after diff --git a/scripts/gary.asm b/scripts/gary.asm index f5d30528..c7766d5d 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -241,7 +241,7 @@ GaryTextPointers: ; 760d6 (1d:60d6) dw GaryText5 GaryText1: ; 760e0 (1d:60e0) - db $08 ; asm + TX_ASM ld a, [wd867] bit 1, a ld hl, GaryText_760f4 @@ -272,7 +272,7 @@ GaryText2: ; 76108 (1d:6108) db "@" GaryText3: ; 7610d (1d:610d) - db $8 + TX_ASM ld a, [W_PLAYERSTARTER] ld [wd11e], a call GetMonName diff --git a/scripts/lab2.asm b/scripts/lab2.asm index 8e490b14..4c3ab344 100755 --- a/scripts/lab2.asm +++ b/scripts/lab2.asm @@ -11,13 +11,13 @@ Lab2Text1: ; 75c2a (1d:5c2a) db "@" Lab2Text2: ; 75c2f (1d:5c2f) - db $8 + TX_ASM ld a, $7 ld [wWhichTrade], a jr Lab2DoTrade Lab2Text3: ; 75c37 (1d:5c37) - db $8 + TX_ASM ld a, $8 ld [wWhichTrade], a Lab2DoTrade: ; 75c3d (1d:5c3d) diff --git a/scripts/lab3.asm b/scripts/lab3.asm index 80a103ca..e91d36f3 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -9,7 +9,7 @@ Lab3TextPointers: ; 75c8a (1d:5c8a) dw Lab3Text5 Lab3Text1: ; 75c94 (1d:5c94) - db $08 ; asm + TX_ASM ld a, [wd7a1] bit 7, a jr nz, .asm_e551a diff --git a/scripts/lab4.asm b/scripts/lab4.asm index ee252cc1..6d4bd923 100755 --- a/scripts/lab4.asm +++ b/scripts/lab4.asm @@ -48,7 +48,7 @@ FossilsList: ; 75d68 (1d:5d68) db $00 Lab4Text1: ; 75d6c (1d:5d6c) - db $8 + TX_ASM ld a, [wd7a3] bit 0, a jr nz, .asm_75d96 @@ -105,7 +105,7 @@ Lab4Text_75dd5: ; 75dd5 (1d:5dd5) db "@" Lab4Text2: ; 75dda (1d:5dda) - db $08 ; asm + TX_ASM ld a, $3 ld [wWhichTrade], a predef DoInGameTradeDialogue diff --git a/scripts/lance.asm b/scripts/lance.asm index ce8c6cd7..8d1c790d 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -144,7 +144,7 @@ LanceTrainerHeader0: ; 5a397 (16:6397) db $ff LanceText1: ; 5a3a4 (16:63a4) - db $08 ; asm + TX_ASM ld hl, LanceTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -159,7 +159,7 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText - db $8 + TX_ASM ld hl, wd866 set 6, [hl] jp TextScriptEnd diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index ab6d13fd..9c812c71 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -11,7 +11,7 @@ LavenderHouse1TextPointers: ; 1d8ac (7:58ac) dw LavenderHouse1Text6 LavenderHouse1Text1: ; 1d8b8 (7:58b8) - db $08 ; asm + TX_ASM ld a, [wd7e0] bit 7, a jr nz, .asm_72e5d @@ -33,7 +33,7 @@ LavenderHouse1Text_1d8d6: ; 1d8d6 (7:58d6) db "@" LavenderHouse1Text2: ; 1d8db (7:58db) - db $08 ; asm + TX_ASM ld a, [wd7e0] bit 7, a jr nz, .asm_06470 @@ -56,20 +56,20 @@ LavenderHouse1Text_1d8f9: ; 1d8f9 (7:58f9) LavenderHouse1Text3: ; 1d8fe (7:58fe) TX_FAR _LavenderHouse1Text3 - db $8 + TX_ASM ld a, PSYDUCK call PlayCry jp TextScriptEnd LavenderHouse1Text4: ; 1d90b (7:590b) TX_FAR _LavenderHouse1Text4 - db $8 + TX_ASM ld a, NIDORINO call PlayCry jp TextScriptEnd LavenderHouse1Text5: ; 1d918 (7:5918) - db $08 ; asm + TX_ASM ld a, [wd76c] bit 0, a jr nz, .asm_15ac2 diff --git a/scripts/lavenderhouse2.asm b/scripts/lavenderhouse2.asm index b9de2663..4dc5c7b7 100755 --- a/scripts/lavenderhouse2.asm +++ b/scripts/lavenderhouse2.asm @@ -8,13 +8,13 @@ LavenderHouse2TextPointers: ; 1d9b2 (7:59b2) LavenderHouse2Text1: ; 1d9b6 (7:59b6) TX_FAR _LavenderHouse2Text1 - db $8 + TX_ASM ld a, CUBONE call PlayCry jp TextScriptEnd LavenderHouse2Text2: ; 1d9c3 (7:59c3) - db $08 ; asm + TX_ASM ld a, [wd7e0] bit 7, a jr nz, .asm_65711 diff --git a/scripts/lavendermart.asm b/scripts/lavendermart.asm index 1d60a127..53967cf2 100755 --- a/scripts/lavendermart.asm +++ b/scripts/lavendermart.asm @@ -11,7 +11,7 @@ LavenderMartText2: ; 5c935 (17:4935) db "@" LavenderMartText3: ; 5c93a (17:493a) - db $08 ; asm + TX_ASM ld a, [wd7e0] bit 7, a jr nz, .asm_c88d4 diff --git a/scripts/lavendertown.asm b/scripts/lavendertown.asm index 6ac56ba0..30c6d4e5 100755 --- a/scripts/lavendertown.asm +++ b/scripts/lavendertown.asm @@ -13,7 +13,7 @@ LavenderTownTextPointers: ; 4410e (11:410e) dw LavenderTownText9 LavenderTownText1: ; 44120 (11:4120) - db $08 ; asm + TX_ASM ld hl, LavenderTownText_4413c call PrintText call YesNoChoice diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index ee50849b..7e800467 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -132,7 +132,7 @@ LoreleiTrainerHeader0: ; 76255 (1d:6255) db $ff LoreleiText1: ; 76262 (1d:6262) - db $08 ; asm + TX_ASM ld hl, LoreleiTrainerHeader0 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index 22a87366..e5c7eb0a 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -80,7 +80,7 @@ Mansion1TrainerHeader0: ; 44334 (11:4334) db $ff Mansion1Text1: ; 44341 (11:4341) - db $08 ; asm + TX_ASM ld hl, Mansion1TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -98,7 +98,7 @@ Mansion1AfterBattleText2: ; 44355 (11:4355) db "@" Mansion1Text4: ; 4435a (11:435a) - db $8 + TX_ASM ld hl, MansionSwitchText call PrintText call YesNoChoice diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index fdc1ec18..334753df 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -77,7 +77,7 @@ Mansion2TrainerHeader0: ; 52057 (14:6057) db $ff Mansion2Text1: ; 52064 (14:6064) - db $08 ; asm + TX_ASM ld hl, Mansion2TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -104,7 +104,7 @@ Mansion2Text4: ; 52082 (14:6082) Mansion3Text6: ; 52087 (14:6087) Mansion2Text5: ; 52087 (14:6087) - db $8 + TX_ASM ld hl, Mansion2Text_520c2 call PrintText call YesNoChoice diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index b0f82b88..d7c0d6ef 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -113,13 +113,13 @@ Mansion3TrainerHeader2: ; 522a2 (14:62a2) db $ff Mansion3Text1: ; 522af (14:62af) - db $08 ; asm + TX_ASM ld hl, Mansion3TrainerHeader0 call TalkToTrainer jp TextScriptEnd Mansion3Text2: ; 522b9 (14:62b9) - db $08 ; asm + TX_ASM ld hl, Mansion3TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index 765571d0..4f1bd742 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -92,13 +92,13 @@ Mansion4TrainerHeader2: ; 52454 (14:6454) db $ff Mansion4Text1: ; 52461 (14:6461) - db $08 ; asm + TX_ASM ld hl, Mansion4TrainerHeader0 call TalkToTrainer jp TextScriptEnd Mansion4Text2: ; 5246b (14:646b) - db $08 ; asm + TX_ASM ld hl, Mansion4TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/mtmoon1.asm b/scripts/mtmoon1.asm index be46f624..6c9fcd88 100755 --- a/scripts/mtmoon1.asm +++ b/scripts/mtmoon1.asm @@ -95,43 +95,43 @@ MtMoon1TrainerHeader7: ; 49a45 (12:5a45) db $ff MtMoon1Text1: ; 49a52 (12:5a52) - db $08 ; asm + TX_ASM ld hl, MtMoon1TrainerHeader0 call TalkToTrainer jp TextScriptEnd MtMoon1Text2: ; 49a5c (12:5a5c) - db $08 ; asm + TX_ASM ld hl, MtMoon1TrainerHeader2 call TalkToTrainer jp TextScriptEnd MtMoon1Text3: ; 49a66 (12:5a66) - db $08 ; asm + TX_ASM ld hl, MtMoon1TrainerHeader3 call TalkToTrainer jp TextScriptEnd MtMoon1Text4: ; 49a70 (12:5a70) - db $08 ; asm + TX_ASM ld hl, MtMoon1TrainerHeader4 call TalkToTrainer jp TextScriptEnd MtMoon1Text5: ; 49a7a (12:5a7a) - db $08 ; asm + TX_ASM ld hl, MtMoon1TrainerHeader5 call TalkToTrainer jp TextScriptEnd MtMoon1Text6: ; 49a84 (12:5a84) - db $08 ; asm + TX_ASM ld hl, MtMoon1TrainerHeader6 call TalkToTrainer jp TextScriptEnd MtMoon1Text7: ; 49a8e (12:5a8e) - db $08 ; asm + TX_ASM ld hl, MtMoon1TrainerHeader7 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index 0d9acb8a..5682a703 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -211,7 +211,7 @@ MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) db $ff MtMoon3Text1: ; 49e79 (12:5e79) - db $08 ; asm + TX_ASM ld a, [wd7f6] bit 1, a jr z, .asm_49e8d @@ -244,31 +244,31 @@ MtMoon3Text1: ; 49e79 (12:5e79) jp TextScriptEnd MtMoon3Text2: ; 49ec1 (12:5ec1) - db $08 ; asm + TX_ASM ld hl, MtMoon3TrainerHeader0 call TalkToTrainer jp TextScriptEnd MtMoon3Text3: ; 49ecb (12:5ecb) - db $08 ; asm + TX_ASM ld hl, MtMoon3TrainerHeader2 call TalkToTrainer jp TextScriptEnd MtMoon3Text4: ; 49ed5 (12:5ed5) - db $08 ; asm + TX_ASM ld hl, MtMoon3TrainerHeader3 call TalkToTrainer jp TextScriptEnd MtMoon3Text5: ; 49edf (12:5edf) - db $08 ; asm + TX_ASM ld hl, MtMoon3TrainerHeader4 call TalkToTrainer jp TextScriptEnd MtMoon3Text6: ; 49ee9 (12:5ee9) - db $08 ; asm + TX_ASM ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, MtMoon3Text_49f24 @@ -297,7 +297,7 @@ MtMoon3Text_49f24: ; 49f24 (12:5f24) db "@" MtMoon3Text7: ; 49f29 (12:5f29) - db $08 ; asm + TX_ASM ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, MtMoon3Text_49f64 diff --git a/scripts/mtmoonpokecenter.asm b/scripts/mtmoonpokecenter.asm index 23e1b082..0920ecf3 100755 --- a/scripts/mtmoonpokecenter.asm +++ b/scripts/mtmoonpokecenter.asm @@ -22,7 +22,7 @@ MtMoonPokecenterText3: ; 492e7 (12:52e7) db "@" MtMoonPokecenterText4: ; 492ec (12:52ec) - db $08 ; asm + TX_ASM ld a, [wd7c6] add a jp c, .asm_49353 diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 3b953c84..2e5835d0 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -39,7 +39,7 @@ Museum1FTextPointers: ; 5c12b (17:412b) dw Museum1FText5 Museum1FText1: ; 5c135 (17:4135) - db $8 + TX_ASM ld a, [W_YCOORD] cp $4 jr nz, .asm_8774b @@ -179,7 +179,7 @@ Museum1FText_5c242: ; 5c242 (17:4242) db "@" Museum1FText2: ; 5c247 (17:4247) - db $08 ; asm + TX_ASM ld hl, Museum1FText_5c251 call PrintText jp TextScriptEnd @@ -189,7 +189,7 @@ Museum1FText_5c251: ; 5c251 (17:4251) db "@" Museum1FText3: ; 5c256 (17:4256) - db $08 ; asm + TX_ASM ld a, [wd754] bit 1, a jr nz, .asm_5c285 @@ -231,7 +231,7 @@ Museum1FText_5c29e: ; 5c29e (17:429e) db "@" Museum1FText4: ; 5c2a3 (17:42a3) - db $08 ; asm + TX_ASM ld hl, Museum1FText_5c2ad call PrintText jp TextScriptEnd @@ -241,7 +241,7 @@ Museum1FText_5c2ad: ; 5c2ad (17:42ad) db "@" Museum1FText5: ; 5c2b2 (17:42b2) - db $08 ; asm + TX_ASM ld hl, Museum1FText_5c2bc call PrintText jp TextScriptEnd diff --git a/scripts/namerater.asm b/scripts/namerater.asm index e71db6ed..010dc0cd 100755 --- a/scripts/namerater.asm +++ b/scripts/namerater.asm @@ -41,7 +41,7 @@ NameRaterTextPointers: ; 1da54 (7:5a54) dw NameRaterText1 NameRaterText1: ; 1da56 (7:5a56) - db $8 + TX_ASM call SaveScreenTilesToBuffer2 ld hl, NameRaterText_1dab3 call NameRaterScript_1da15 diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 464cd755..ceb8a761 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -734,7 +734,7 @@ OaksLabTextPointers: ; 1d082 (7:5082) OaksLabText28: ; 1d0ce (7:50ce) OaksLabText1: ; 1d0ce (7:50ce) - db $08 ; asm + TX_ASM ld a, [wd74b] bit 0, a jr nz, .asm_1d0de @@ -767,7 +767,7 @@ OaksLabText41: ; 1d0fd (7:50fd) OaksLabText29: ; 1d102 (7:5102) OaksLabText2: ; 1d102 (7:5102) - db $8 + TX_ASM ld a, STARTER2 ld [wWhichTrade], a ld a, $3 @@ -778,7 +778,7 @@ OaksLabText2: ; 1d102 (7:5102) OaksLabText30: ; 1d113 (7:5113) OaksLabText3: ; 1d113 (7:5113) - db $8 + TX_ASM ld a, STARTER3 ld [wWhichTrade], a ld a, $4 @@ -789,7 +789,7 @@ OaksLabText3: ; 1d113 (7:5113) OaksLabText31: ; 1d124 (7:5124) OaksLabText4: ; 1d124 (7:5124) - db $8 + TX_ASM ld a, STARTER1 ld [wWhichTrade], a ld a, $2 @@ -938,7 +938,7 @@ OaksLabLastMonText: ; 1d243 (7:5243) OaksLabText32: ; 1d248 (7:5248) OaksLabText5: ; 1d248 (7:5248) - db $08 ; asm + TX_ASM ld a, [wd747] bit 6, a jr nz, .asm_1d266 @@ -1054,7 +1054,7 @@ OaksLabText34: ; 1d322 (7:5322) OaksLabText33: ; 1d322 (7:5322) OaksLabText7: ; 1d322 (7:5322) OaksLabText6: ; 1d322 (7:5322) - db $08 ; asm + TX_ASM ld hl, OaksLabText_1d32c call PrintText jp TextScriptEnd @@ -1070,7 +1070,7 @@ OaksLabText8: ; 1d331 (7:5331) OaksLabText36: ; 1d336 (7:5336) OaksLabText9: ; 1d336 (7:5336) - db $08 ; asm + TX_ASM ld hl, OaksLabText_1d340 call PrintText jp TextScriptEnd @@ -1080,7 +1080,7 @@ OaksLabText_1d340: ; 1d340 (7:5340) db "@" OaksLabText17: ; 1d345 (7:5345) - db $8 + TX_ASM ld hl, OaksLabRivalWaitingText call PrintText jp TextScriptEnd @@ -1090,7 +1090,7 @@ OaksLabRivalWaitingText: ; 1d34f (7:534f) db "@" OaksLabText18: ; 1d354 (7:5354) - db $8 + TX_ASM ld hl, OaksLabChooseMonText call PrintText jp TextScriptEnd @@ -1100,7 +1100,7 @@ OaksLabChooseMonText: ; 1d35e (7:535e) db "@" OaksLabText19: ; 1d363 (7:5363) - db $8 + TX_ASM ld hl, OaksLabRivalInterjectionText call PrintText jp TextScriptEnd @@ -1110,7 +1110,7 @@ OaksLabRivalInterjectionText: ; 1d36d (7:536d) db "@" OaksLabText20: ; 1d372 (7:5372) - db $8 + TX_ASM ld hl, OaksLabBePatientText call PrintText jp TextScriptEnd @@ -1120,7 +1120,7 @@ OaksLabBePatientText: ; 1d37c (7:537c) db "@" OaksLabText12: ; 1d381 (7:5381) - db $8 + TX_ASM ld hl, OaksLabLeavingText call PrintText jp TextScriptEnd @@ -1130,7 +1130,7 @@ OaksLabLeavingText: ; 1d38b (7:538b) db "@" OaksLabText13: ; 1d390 (7:5390) - db $8 + TX_ASM ld hl, OaksLabRivalPickingMonText call PrintText jp TextScriptEnd @@ -1140,7 +1140,7 @@ OaksLabRivalPickingMonText: ; 1d39a (7:539a) db "@" OaksLabText14: ; 1d39f (7:539f) - db $8 + TX_ASM ld hl, OaksLabRivalReceivedMonText call PrintText jp TextScriptEnd @@ -1150,7 +1150,7 @@ OaksLabRivalReceivedMonText: ; 1d3a9 (7:53a9) db $11, "@" OaksLabText15: ; 1d3af (7:53af) - db $8 + TX_ASM ld hl, OaksLabRivalChallengeText call PrintText jp TextScriptEnd @@ -1168,7 +1168,7 @@ OaksLabText_1d3c3: ; 1d3c3 (7:53c3) db "@" OaksLabText16: ; 1d3c8 (7:53c8) - db $8 + TX_ASM ld hl, OaksLabRivalToughenUpText call PrintText jp TextScriptEnd @@ -1209,7 +1209,7 @@ OaksLabText38: ; 1d3fb (7:53fb) OaksLabText37: ; 1d3fb (7:53fb) OaksLabText11: ; 1d3fb (7:53fb) OaksLabText10: ; 1d3fb (7:53fb) - db $08 ; asm + TX_ASM ld hl, OaksLabText_1d405 call PrintText jp TextScriptEnd diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index 21d1c643..09447d9e 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -194,7 +194,7 @@ PewterCityText2: ; 193ac (6:53ac) db "@" PewterCityText3: ; 193b1 (6:53b1) - db $08 ; asm + TX_ASM ld hl, PewterCityText_193f1 call PrintText call YesNoChoice @@ -240,7 +240,7 @@ PewterCityText13: ; 19400 (6:5400) db "@" PewterCityText4: ; 19405 (6:5405) - db $8 + TX_ASM ld hl, PewterCityText_19427 call PrintText call YesNoChoice @@ -269,7 +269,7 @@ PewterCityText_19431: ; 19431 (6:5431) db "@" PewterCityText5: ; 19436 (6:5436) - db $08 ; asm + TX_ASM ld hl, PewterCityText_1945d call PrintText xor a diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 39adaa32..aa7f9153 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -105,7 +105,7 @@ PewterGymTrainerHeader0: ; 5c441 (17:4441) db $ff PewterGymText1: ; 5c44e (17:444e) - db $08 ; asm + TX_ASM ld a, [wd755] bit 7, a jr z, .asm_5c46a @@ -170,7 +170,7 @@ PewterGymText_5c4bc: ; 5c4bc (17:44bc) db "@" PewterGymText2: ; 5c4c6 (17:44c6) - db $08 ; asm + TX_ASM ld hl, PewterGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -188,7 +188,7 @@ PewterGymAfterBattleText1: ; 5c4da (17:44da) db "@" PewterGymText3: ; 5c4df (17:44df) - db $08 ; asm + TX_ASM ld a, [wd72a] bit 0, a jr nz, .asm_5c50c diff --git a/scripts/pewterhouse1.asm b/scripts/pewterhouse1.asm index 05d27a14..a670f23c 100755 --- a/scripts/pewterhouse1.asm +++ b/scripts/pewterhouse1.asm @@ -8,7 +8,7 @@ PewterHouse1TextPointers: ; 1d5f6 (7:55f6) PewterHouse1Text1: ; 1d5fc (7:55fc) TX_FAR _PewterHouse1Text1 - db $08 ; asm + TX_ASM ld a, NIDORAN_M call PlayCry call WaitForSoundToFinish diff --git a/scripts/pewtermart.asm b/scripts/pewtermart.asm index 8fe99d94..62831d1b 100755 --- a/scripts/pewtermart.asm +++ b/scripts/pewtermart.asm @@ -10,7 +10,7 @@ PewterMartTextPointers: ; 74cb6 (1d:4cb6) dw PewterMartText3 PewterMartText2: ; 74cbc (1d:4cbc) - db $08 ; asm + TX_ASM ld hl, PewterMartText_74cc6 call PrintText jp TextScriptEnd @@ -20,7 +20,7 @@ PewterMartText_74cc6: ; 74cc6 (1d:4cc6) db "@" PewterMartText3: ; 74ccb (1d:4ccb) - db $08 ; asm + TX_ASM ld hl, PewterMartText_74cd5 call PrintText jp TextScriptEnd diff --git a/scripts/pewterpokecenter.asm b/scripts/pewterpokecenter.asm index 8b2ac8f9..42bc3086 100755 --- a/scripts/pewterpokecenter.asm +++ b/scripts/pewterpokecenter.asm @@ -16,7 +16,7 @@ PewterPokecenterText2: ; 5c596 (17:4596) db "@" PewterPokecenterText3: ; 5c59b (17:459b) - db $8 + TX_ASM ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, PewterPokecenterText5 diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index 1bde3ba6..cd86a494 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -115,7 +115,7 @@ PokemonTower2TextPointers: ; 605db (18:45db) dw PokemonTower2Text2 PokemonTower2Text1: ; 605df (18:45df) - db $08 ; asm + TX_ASM ld a, [wd764] bit 7, a jr z, .asm_16f24 diff --git a/scripts/pokemontower3.asm b/scripts/pokemontower3.asm index 78c53c2f..2cf58381 100755 --- a/scripts/pokemontower3.asm +++ b/scripts/pokemontower3.asm @@ -48,19 +48,19 @@ PokemonTower3TrainerHeader2: ; 60705 (18:4705) db $ff PokemonTower3Text1: ; 60712 (18:4712) - db $08 ; asm + TX_ASM ld hl, PokemonTower3TrainerHeader0 call TalkToTrainer jp TextScriptEnd PokemonTower3Text2: ; 6071c (18:471c) - db $08 ; asm + TX_ASM ld hl, PokemonTower3TrainerHeader1 call TalkToTrainer jp TextScriptEnd PokemonTower3Text3: ; 60726 (18:4726) - db $08 ; asm + TX_ASM ld hl, PokemonTower3TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/pokemontower4.asm b/scripts/pokemontower4.asm index 3c48fdca..4f375657 100755 --- a/scripts/pokemontower4.asm +++ b/scripts/pokemontower4.asm @@ -51,19 +51,19 @@ PokemonTower4TrainerHeader2: ; 60833 (18:4833) db $ff PokemonTower4Text1: ; 60840 (18:4840) - db $08 ; asm + TX_ASM ld hl, PokemonTower4TrainerHeader0 call TalkToTrainer jp TextScriptEnd PokemonTower4Text2: ; 6084a (18:484a) - db $08 ; asm + TX_ASM ld hl, PokemonTower4TrainerHeader1 call TalkToTrainer jp TextScriptEnd PokemonTower4Text3: ; 60854 (18:4854) - db $08 ; asm + TX_ASM ld hl, PokemonTower4TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index 1c5e6c1e..34dd3204 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -104,7 +104,7 @@ PokemonTower5Text1: ; 609da (18:49da) db "@" PokemonTower5Text2: ; 609df (18:49df) - db $08 ; asm + TX_ASM ld hl, PokemonTower5TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -122,7 +122,7 @@ PokemonTower5AfterBattleText1: ; 609f3 (18:49f3) db "@" PokemonTower5Text3: ; 609f8 (18:49f8) - db $08 ; asm + TX_ASM ld hl, PokemonTower5TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -140,7 +140,7 @@ PokemonTower5AfterBattleText2: ; 60a0c (18:4a0c) db "@" PokemonTower5Text4: ; 60a11 (18:4a11) - db $08 ; asm + TX_ASM ld hl, PokemonTower5TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -158,7 +158,7 @@ PokemonTower5AfterBattleText3: ; 60a25 (18:4a25) db "@" PokemonTower5Text5: ; 60a2a (18:4a2a) - db $08 ; asm + TX_ASM ld hl, PokemonTower5TrainerHeader3 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index 54171ddc..e0e75cb1 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -136,25 +136,25 @@ PokemonTower6TrainerHeader2: ; 60bd7 (18:4bd7) db $ff PokemonTower6Text1: ; 60be4 (18:4be4) - db $08 ; asm + TX_ASM ld hl, PokemonTower6TrainerHeader0 call TalkToTrainer jp TextScriptEnd PokemonTower6Text2: ; 60bee (18:4bee) - db $08 ; asm + TX_ASM ld hl, PokemonTower6TrainerHeader1 call TalkToTrainer jp TextScriptEnd PokemonTower6Text3: ; 60bf8 (18:4bf8) - db $08 ; asm + TX_ASM ld hl, PokemonTower6TrainerHeader2 call TalkToTrainer jp TextScriptEnd PokemonTower6Text7: ; 60c02 (18:4c02) - db $8 + TX_ASM ld hl, PokemonTower2Text_60c1f call PrintText ld a, MAROWAK diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index 32cd0e83..a5d10ca8 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -197,19 +197,19 @@ PokemonTower7TrainerHeader2: ; 60e5f (18:4e5f) db $ff PokemonTower7Text1: ; 60e6c (18:4e6c) - db $08 ; asm + TX_ASM ld hl, PokemonTower7TrainerHeader0 call TalkToTrainer jp TextScriptEnd PokemonTower7Text2: ; 60e76 (18:4e76) - db $08 ; asm + TX_ASM ld hl, PokemonTower7TrainerHeader1 call TalkToTrainer jp TextScriptEnd PokemonTower7Text3: ; 60e80 (18:4e80) - db $08 ; asm + TX_ASM ld hl, PokemonTower7TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/powerplant.asm b/scripts/powerplant.asm index 4355c039..25597654 100755 --- a/scripts/powerplant.asm +++ b/scripts/powerplant.asm @@ -119,47 +119,47 @@ InitVoltorbBattle: ; 1e368 (7:6368) jp TextScriptEnd PowerPlantText1: ; 1e374 (7:6374) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader0 jr InitVoltorbBattle PowerPlantText2: ; 1e37a (7:637a) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader1 jr InitVoltorbBattle PowerPlantText3: ; 1e380 (7:6380) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader2 jr InitVoltorbBattle PowerPlantText4: ; 1e386 (7:6386) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader3 jr InitVoltorbBattle PowerPlantText5: ; 1e38c (7:638c) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader4 jr InitVoltorbBattle PowerPlantText6: ; 1e392 (7:6392) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader5 jr InitVoltorbBattle PowerPlantText7: ; 1e398 (7:6398) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader6 jr InitVoltorbBattle PowerPlantText8: ; 1e39e (7:639e) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader7 jr InitVoltorbBattle PowerPlantText9: ; 1e3a4 (7:63a4) - db $8 ; asm + TX_ASM ld hl, PowerPlantTrainerHeader8 jr InitVoltorbBattle @@ -169,7 +169,7 @@ VoltorbBattleText: ; 1e3aa (7:63aa) ZapdosBattleText: ; 1e3af (7:63af) TX_FAR _ZapdosBattleText - db $8 + TX_ASM ld a, ZAPDOS call PlayCry call WaitForSoundToFinish diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index f8b911fe..fe5a47e6 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -95,38 +95,38 @@ RocketHideout1TrainerHeader5: ; 44c52 (11:4c52) db $ff RocketHideout1Text1: ; 44c5f (11:4c5f) - db $08 ; asm + TX_ASM ld hl, RocketHideout1TrainerHeader0 call TalkToTrainer jp TextScriptEnd RocketHideout1Text2: ; 44c69 (11:4c69) - db $08 ; asm + TX_ASM ld hl, RocketHideout1TrainerHeader2 call TalkToTrainer jp TextScriptEnd RocketHideout1Text3: ; 44c73 (11:4c73) - db $08 ; asm + TX_ASM ld hl, RocketHideout1TrainerHeader3 call TalkToTrainer jp TextScriptEnd RocketHideout1Text4: ; 44c7d (11:4c7d) - db $08 ; asm + TX_ASM ld hl, RocketHideout1TrainerHeader4 call TalkToTrainer jp TextScriptEnd RocketHideout1Text5: ; 44c87 (11:4c87) - db $08 ; asm + TX_ASM ld hl, RocketHideout1TrainerHeader5 call TalkToTrainer jp TextScriptEnd RocketHideout1EndBattleText6: ; 44c91 (11:4c91) TX_FAR _RocketHideout1EndBattleText6 - db $8 + TX_ASM ld hl, wd815 set 5, [hl] ld hl, RocketHideout1Text_44c9f diff --git a/scripts/rockethideout2.asm b/scripts/rockethideout2.asm index 05bdc9b6..04e2c5d3 100755 --- a/scripts/rockethideout2.asm +++ b/scripts/rockethideout2.asm @@ -437,7 +437,7 @@ RocketHideout2TrainerHeader0: ; 450d1 (11:50d1) db $ff RocketHideout2Text1: ; 450de (11:50de) - db $08 ; asm + TX_ASM ld hl, RocketHideout2TrainerHeader0 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/rockethideout3.asm b/scripts/rockethideout3.asm index f94438e9..e7a7b63b 100755 --- a/scripts/rockethideout3.asm +++ b/scripts/rockethideout3.asm @@ -175,7 +175,7 @@ RocketHideout3TrainerHeader2: ; 4530e (11:530e) db $ff RocketHideout3Text1: ; 4531b (11:531b) - db $08 ; asm + TX_ASM ld hl, RocketHideout3TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -193,7 +193,7 @@ RocketHideout3AfterBattleTxt2: ; 4532f (11:532f) db "@" RocketHideout3Text2: ; 45334 (11:5334) - db $08 ; asm + TX_ASM ld hl, RocketHideout3TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index 98132f99..ff35aa5f 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -119,7 +119,7 @@ RocketHideout4TrainerHeader3: ; 4552d (11:552d) db $ff RocketHideout4Text1: ; 4553a (11:553a) - db $08 ; asm + TX_ASM ld a, [wd81b] bit 7, a jp nz, .asm_545571 @@ -160,7 +160,7 @@ RocketHideout4Text10: ; 45584 (11:5584) db "@" RocketHideout4Text2: ; 45589 (11:5589) - db $08 ; asm + TX_ASM ld hl, RocketHideout4TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -178,7 +178,7 @@ RocketHideout4AfterBattleText2: ; 4559d (11:559d) db "@" RocketHideout4Text3: ; 455a2 (11:55a2) - db $08 ; asm + TX_ASM ld hl, RocketHideout4TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -196,7 +196,7 @@ RocketHideout4AfterBattleText3: ; 455b6 (11:55b6) db "@" RocketHideout4Text4: ; 455bb (11:55bb) - db $08 ; asm + TX_ASM ld hl, RocketHideout4TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -210,7 +210,7 @@ RocketHideout4EndBattleText4: ; 455ca (11:55ca) db "@" RocketHideout4AfterBattleText4: ; 455cf (11:55cf) - db $8 + TX_ASM ld hl, RocketHideout4Text_455ec call PrintText ld hl, wd81b diff --git a/scripts/rockethideoutelevator.asm b/scripts/rockethideoutelevator.asm index 70564e7a..169b536b 100755 --- a/scripts/rockethideoutelevator.asm +++ b/scripts/rockethideoutelevator.asm @@ -62,7 +62,7 @@ RocketHideoutElevatorTextPointers: ; 4576b (11:576b) dw RocketHideoutElevatorText1 RocketHideoutElevatorText1: ; 4576d (11:576d) - db $08 ; asm + TX_ASM ld b, LIFT_KEY call IsItemInBag jr z, .asm_45782 diff --git a/scripts/rocktunnel1.asm b/scripts/rocktunnel1.asm index b5b840bf..72881e65 100755 --- a/scripts/rocktunnel1.asm +++ b/scripts/rocktunnel1.asm @@ -89,37 +89,37 @@ RockTunnel1TrainerHeader7: ; 4454d (11:454d) db $ff RockTunnel1Text1: ; 4455a (11:455a) - db $8 + TX_ASM ld hl, RockTunnel1TrainerHeader1 jr RockTunnel1TalkToTrainer RockTunnel1Text2: ; 44560 (11:4560) - db $8 + TX_ASM ld hl, RockTunnel1TrainerHeader2 jr RockTunnel1TalkToTrainer RockTunnel1Text3: ; 44566 (11:4566) - db $8 + TX_ASM ld hl, RockTunnel1TrainerHeader3 jr RockTunnel1TalkToTrainer RockTunnel1Text4: ; 4456c (11:456c) - db $8 + TX_ASM ld hl, RockTunnel1TrainerHeader4 jr RockTunnel1TalkToTrainer RockTunnel1Text5: ; 44572 (11:4572) - db $8 + TX_ASM ld hl, RockTunnel1TrainerHeader5 jr RockTunnel1TalkToTrainer RockTunnel1Text6: ; 44578 (11:4578) - db $8 + TX_ASM ld hl, RockTunnel1TrainerHeader6 jr RockTunnel1TalkToTrainer RockTunnel1Text7: ; 4457e (11:457e) - db $8 + TX_ASM ld hl, RockTunnel1TrainerHeader7 RockTunnel1TalkToTrainer: ; 44582 (11:4582) call TalkToTrainer diff --git a/scripts/rocktunnel2.asm b/scripts/rocktunnel2.asm index 173ede7c..832a244f 100755 --- a/scripts/rocktunnel2.asm +++ b/scripts/rocktunnel2.asm @@ -98,49 +98,49 @@ RockTunnel2TrainerHeader8: ; 46068 (11:6068) db $ff RockTunnel2Text1: ; 46075 (11:6075) - db $08 ; asm + TX_ASM ld hl, RockTunnel2TrainerHeader0 call TalkToTrainer jp TextScriptEnd RockTunnel2Text2: ; 4607f (11:607f) - db $08 ; asm + TX_ASM ld hl, RockTunnel2TrainerHeader2 call TalkToTrainer jp TextScriptEnd RockTunnel2Text3: ; 46089 (11:6089) - db $08 ; asm + TX_ASM ld hl, RockTunnel2TrainerHeader3 call TalkToTrainer jp TextScriptEnd RockTunnel2Text4: ; 46093 (11:6093) - db $08 ; asm + TX_ASM ld hl, RockTunnel2TrainerHeader4 call TalkToTrainer jp TextScriptEnd RockTunnel2Text5: ; 4609d (11:609d) - db $08 ; asm + TX_ASM ld hl, RockTunnel2TrainerHeader5 call TalkToTrainer jp TextScriptEnd RockTunnel2Text6: ; 460a7 (11:60a7) - db $08 ; asm + TX_ASM ld hl, RockTunnel2TrainerHeader6 call TalkToTrainer jp TextScriptEnd RockTunnel2Text7: ; 460b1 (11:60b1) - db $08 ; asm + TX_ASM ld hl, RockTunnel2TrainerHeader7 call TalkToTrainer jp TextScriptEnd RockTunnel2Text8: ; 460bb (11:60bb) - db $08 ; asm + TX_ASM ld hl, RockTunnel2TrainerHeader8 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route1.asm b/scripts/route1.asm index c5023134..74ac9605 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -7,7 +7,7 @@ Route1TextPointers: ; 1cab2 (7:4ab2) dw Route1Text3 Route1Text1: ; 1cab8 (7:4ab8) - db $08 ; asm + TX_ASM ld hl, wd7bf bit 0, [hl] set 0, [hl] diff --git a/scripts/route10.asm b/scripts/route10.asm index 3f7e99a3..fbc3b01a 100755 --- a/scripts/route10.asm +++ b/scripts/route10.asm @@ -82,7 +82,7 @@ Route10TrainerHeader5: ; 5939f (16:539f) db $ff Route10Text1: ; 593ac (16:53ac) - db $08 ; asm + TX_ASM ld hl, Route10TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -100,7 +100,7 @@ Route10AfterBattleText1: ; 593c0 (16:53c0) db "@" Route10Text2: ; 593c5 (16:53c5) - db $08 ; asm + TX_ASM ld hl, Route10TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -118,7 +118,7 @@ Route10AfterBattleText2: ; 593d9 (16:53d9) db "@" Route10Text3: ; 593de (16:53de) - db $08 ; asm + TX_ASM ld hl, Route10TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -136,7 +136,7 @@ Route10AfterBattleText3: ; 593f2 (16:53f2) db "@" Route10Text4: ; 593f7 (16:53f7) - db $08 ; asm + TX_ASM ld hl, Route10TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -154,7 +154,7 @@ Route10AfterBattleText4: ; 5940b (16:540b) db "@" Route10Text5: ; 59410 (16:5410) - db $08 ; asm + TX_ASM ld hl, Route10TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -172,7 +172,7 @@ Route10AfterBattleText5: ; 59424 (16:5424) db "@" Route10Text6: ; 59429 (16:5429) - db $08 ; asm + TX_ASM ld hl, Route10TrainerHeader5 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route11.asm b/scripts/route11.asm index 7607be9c..7a31232b 100755 --- a/scripts/route11.asm +++ b/scripts/route11.asm @@ -119,7 +119,7 @@ Route11TrainerHeader9: ; 594e7 (16:54e7) db $ff Route11Text1: ; 594f4 (16:54f4) - db $8 + TX_ASM ld hl, Route11TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -137,7 +137,7 @@ Route11AfterBattleText1: ; 59508 (16:5508) db "@" Route11Text2: ; 5950d (16:550d) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -155,7 +155,7 @@ Route11AfterBattleText2: ; 59521 (16:5521) db "@" Route11Text3: ; 59526 (16:5526) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -173,7 +173,7 @@ Route11AfterBattleText3: ; 5953a (16:553a) db "@" Route11Text4: ; 5953f (16:553f) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -191,7 +191,7 @@ Route11AfterBattleText4: ; 59553 (16:5553) db "@" Route11Text5: ; 59558 (16:5558) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -209,7 +209,7 @@ Route11AfterBattleText5: ; 5956c (16:556c) db "@" Route11Text6: ; 59571 (16:5571) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -227,7 +227,7 @@ Route11AfterBattleText6: ; 59585 (16:5585) db "@" Route11Text7: ; 5958a (16:558a) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -245,7 +245,7 @@ Route11AfterBattleText7: ; 5959e (16:559e) db "@" Route11Text8: ; 595a3 (16:55a3) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader7 call TalkToTrainer jp TextScriptEnd @@ -263,7 +263,7 @@ Route11AfterBattleText8: ; 595b7 (16:55b7) db "@" Route11Text9: ; 595bc (16:55bc) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader8 call TalkToTrainer jp TextScriptEnd @@ -281,7 +281,7 @@ Route11AfterBattleText9: ; 595d0 (16:55d0) db "@" Route11Text10: ; 595d5 (16:55d5) - db $08 ; asm + TX_ASM ld hl, Route11TrainerHeader9 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index 4fac2144..abea062c 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -8,7 +8,7 @@ Route11GateUpstairsTextPointers: ; 49457 (12:5457) dw Route11GateUpstairsText4 Route11GateUpstairsText1: ; 4945f (12:545f) - db $08 ; asm + TX_ASM xor a ld [wWhichTrade], a predef DoInGameTradeDialogue @@ -16,7 +16,7 @@ Route11GateUpstairsScriptEnd: ; 49469 (12:5469) jp TextScriptEnd Route11GateUpstairsText2: ; 4946c (12:546c) - db $8 + TX_ASM ld a, [wd7d6] add a jr c, .asm_4949b @@ -48,7 +48,7 @@ Route11GateUpstairsText_494a3: ; 494a3 (12:54a3) db "@" Route11GateUpstairsText3: ; 494a8 (12:54a8) - db $08 ; asm + TX_ASM ld a, [wSpriteStateData1 + 9] cp $4 jp nz, Route12GateUpstairsScript_495c9 @@ -70,7 +70,7 @@ BinocularsNoSnorlaxText: db "@" Route11GateUpstairsText4: ; 494ce (12:54ce) - db $8 + TX_ASM ld hl, Route11GateUpstairsText_494d5 jp Route12GateUpstairsScript_495c9 diff --git a/scripts/route12.asm b/scripts/route12.asm index af412d3a..eed676b3 100755 --- a/scripts/route12.asm +++ b/scripts/route12.asm @@ -157,7 +157,7 @@ Route12Text14: ; 596f0 (16:56f0) db "@" Route12Text2: ; 596f5 (16:56f5) - db $08 ; asm + TX_ASM ld hl, Route12TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -175,7 +175,7 @@ Route12AfterBattleText1: ; 59709 (16:5709) db "@" Route12Text3: ; 5970e (16:570e) - db $08 ; asm + TX_ASM ld hl, Route12TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -193,7 +193,7 @@ Route12AfterBattleText2: ; 59722 (16:5722) db "@" Route12Text4: ; 59727 (16:5727) - db $08 ; asm + TX_ASM ld hl, Route12TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -211,7 +211,7 @@ Route12AfterBattleText3: ; 5973b (16:573b) db "@" Route12Text5: ; 59740 (16:5740) - db $08 ; asm + TX_ASM ld hl, Route12TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -229,7 +229,7 @@ Route12AfterBattleText4: ; 59754 (16:5754) db "@" Route12Text6: ; 59759 (16:5759) - db $08 ; asm + TX_ASM ld hl, Route12TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -247,7 +247,7 @@ Route12AfterBattleText5: ; 5976d (16:576d) db "@" Route12Text7: ; 59772 (16:5772) - db $08 ; asm + TX_ASM ld hl, Route12TrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -265,7 +265,7 @@ Route12AfterBattleText6: ; 59786 (16:5786) db "@" Route12Text8: ; 5978b (16:578b) - db $08 ; asm + TX_ASM ld hl, Route12TrainerHeader6 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index 68f9cc68..6ec8cfe3 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -7,7 +7,7 @@ Route12GateUpstairsTextPointers: ; 49563 (12:5563) dw Route12GateUpstairsText3 Route12GateUpstairsText1: ; 49569 (12:5569) - db $08 ; asm + TX_ASM ld a, [wd7d7] rrca jr c, .asm_0ad3c @@ -48,7 +48,7 @@ TM39NoRoomText: ; 495ac (12:55ac) db "@" Route12GateUpstairsText2: ; 495b1 (12:55b1) - db $08 ; asm + TX_ASM ld hl, Route12GateUpstairsText_495b8 jp Route12GateUpstairsScript_495c9 @@ -57,7 +57,7 @@ Route12GateUpstairsText_495b8: ; 495b8 (12:55b8) db "@" Route12GateUpstairsText3: ; 495bd (12:55bd) - db $8 + TX_ASM ld hl, Route12GateUpstairsText_495c4 jp Route12GateUpstairsScript_495c9 diff --git a/scripts/route12house.asm b/scripts/route12house.asm index 733109da..6b3e17fc 100755 --- a/scripts/route12house.asm +++ b/scripts/route12house.asm @@ -5,7 +5,7 @@ Route12HouseTextPointers: ; 56482 (15:6482) dw Route12HouseText1 Route12HouseText1: ; 56484 (15:6484) - db $08 ; asm + TX_ASM ld a, [wd728] bit 5, a jr nz, .asm_b4cad diff --git a/scripts/route13.asm b/scripts/route13.asm index 38d80425..aed4745c 100755 --- a/scripts/route13.asm +++ b/scripts/route13.asm @@ -121,7 +121,7 @@ Route13TrainerHeader10: ; 558bd (15:58bd) db $ff Route13Text1: ; 558ca (15:58ca) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -139,7 +139,7 @@ Route13AfterBattleText2: ; 558de (15:58de) db "@" Route13Text2: ; 558e3 (15:58e3) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -157,7 +157,7 @@ Route13AfterBattleText3: ; 558f7 (15:58f7) db "@" Route13Text3: ; 558fc (15:58fc) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -175,7 +175,7 @@ Route13AfterBattleText4: ; 55910 (15:5910) db "@" Route13Text4: ; 55915 (15:5915) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -193,7 +193,7 @@ Route13AfterBattleText5: ; 55929 (15:5929) db "@" Route13Text5: ; 5592e (15:592e) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -211,7 +211,7 @@ Route13AfterBattleText6: ; 55942 (15:5942) db "@" Route13Text6: ; 55947 (15:5947) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -229,7 +229,7 @@ Route13AfterBattleText7: ; 5595b (15:595b) db "@" Route13Text7: ; 55960 (15:5960) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader7 call TalkToTrainer jp TextScriptEnd @@ -247,7 +247,7 @@ Route13AfterBattleText8: ; 55974 (15:5974) db "@" Route13Text8: ; 55979 (15:5979) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader8 call TalkToTrainer jp TextScriptEnd @@ -265,7 +265,7 @@ Route13AfterBattleText9: ; 5598d (15:598d) db "@" Route13Text9: ; 55992 (15:5992) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader9 call TalkToTrainer jp TextScriptEnd @@ -283,7 +283,7 @@ Route13AfterBattleText10: ; 559a6 (15:59a6) db "@" Route13Text10: ; 559ab (15:59ab) - db $08 ; asm + TX_ASM ld hl, Route13TrainerHeader10 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route14.asm b/scripts/route14.asm index 37b7df19..25a2cd85 100755 --- a/scripts/route14.asm +++ b/scripts/route14.asm @@ -119,7 +119,7 @@ Route14TrainerHeader9: ; 55a6e (15:5a6e) db $ff Route14Text1: ; 55a7b (15:5a7b) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -137,7 +137,7 @@ Route14AfterBattleText1: ; 55a8f (15:5a8f) db "@" Route14Text2: ; 55a94 (15:5a94) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -155,7 +155,7 @@ Route14AfterBattleText2: ; 55aa8 (15:5aa8) db "@" Route14Text3: ; 55aad (15:5aad) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -173,7 +173,7 @@ Route14AfterBattleText3: ; 55ac1 (15:5ac1) db "@" Route14Text4: ; 55ac6 (15:5ac6) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -191,7 +191,7 @@ Route14AfterBattleText4: ; 55ada (15:5ada) db "@" Route14Text5: ; 55adf (15:5adf) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -209,7 +209,7 @@ Route14AfterBattleText5: ; 55af3 (15:5af3) db "@" Route14Text6: ; 55af8 (15:5af8) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -227,7 +227,7 @@ Route14AfterBattleText6: ; 55b0c (15:5b0c) db "@" Route14Text7: ; 55b11 (15:5b11) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -245,7 +245,7 @@ Route14AfterBattleText7: ; 55b25 (15:5b25) db "@" Route14Text8: ; 55b2a (15:5b2a) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader7 call TalkToTrainer jp TextScriptEnd @@ -263,7 +263,7 @@ Route14AfterBattleText8: ; 55b3e (15:5b3e) db "@" Route14Text9: ; 55b43 (15:5b43) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader8 call TalkToTrainer jp TextScriptEnd @@ -281,7 +281,7 @@ Route14AfterBattleText9: ; 55b57 (15:5b57) db "@" Route14Text10: ; 55b5c (15:5b5c) - db $08 ; asm + TX_ASM ld hl, Route14TrainerHeader9 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route15.asm b/scripts/route15.asm index 8b2c38ec..3aa23bbb 100755 --- a/scripts/route15.asm +++ b/scripts/route15.asm @@ -120,52 +120,52 @@ Route15TrainerHeader9: ; 5984b (16:584b) db $ff Route15Text1: ; 59858 (16:5858) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader0 jr Route15TalkToTrainer Route15Text2: ; 5985e (16:585e) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader1 jr Route15TalkToTrainer Route15Text3: ; 59864 (16:5864) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader2 jr Route15TalkToTrainer Route15Text4: ; 5986a (16:586a) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader3 jr Route15TalkToTrainer Route15Text5: ; 59870 (16:5870) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader4 jr Route15TalkToTrainer Route15Text6: ; 59876 (16:5876) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader5 jr Route15TalkToTrainer Route15Text7: ; 5987c (16:587c) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader6 jr Route15TalkToTrainer Route15Text8: ; 59882 (16:5882) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader7 jr Route15TalkToTrainer Route15Text9: ; 59888 (16:5888) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader8 jr Route15TalkToTrainer Route15Text10: ; 5988e (16:588e) - db $8 ; asm + TX_ASM ld hl, Route15TrainerHeader9 Route15TalkToTrainer: ; 59892 (16:5892) call TalkToTrainer diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index 1e581cc3..05bcbeea 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -6,7 +6,7 @@ Route15GateUpstairsTextPointers: ; 4964d (12:564d) dw Route15GateUpstairsText2 Route15GateUpstairsText1: ; 49651 (12:5651) - db $8 + TX_ASM ld a, [wd7dd] bit 0, a jr nz, .asm_49683 @@ -37,7 +37,7 @@ Route15GateUpstairsText_4968c: ; 4968c (12:568c) db "@" Route15GateUpstairsText2: ; 49691 (12:5691) - db $8 + TX_ASM ld hl, Route15GateUpstairsText_49698 jp Route12GateUpstairsScript_495c9 diff --git a/scripts/route16.asm b/scripts/route16.asm index 6091e416..b6c49a96 100755 --- a/scripts/route16.asm +++ b/scripts/route16.asm @@ -134,7 +134,7 @@ Route16TrainerHeader5: ; 59a0b (16:5a0b) db $ff Route16Text1: ; 59a18 (16:5a18) - db $08 ; asm + TX_ASM ld hl, Route16TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -152,7 +152,7 @@ Route16AfterBattleText1: ; 59a2c (16:5a2c) db "@" Route16Text2: ; 59a31 (16:5a31) - db $08 ; asm + TX_ASM ld hl, Route16TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -170,7 +170,7 @@ Route16AfterBattleText2: ; 59a45 (16:5a45) db "@" Route16Text3: ; 59a4a (16:5a4a) - db $08 ; asm + TX_ASM ld hl, Route16TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -188,7 +188,7 @@ Route16AfterBattleText3: ; 59a5e (16:5a5e) db "@" Route16Text4: ; 59a63 (16:5a63) - db $08 ; asm + TX_ASM ld hl, Route16TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -206,7 +206,7 @@ Route16AfterBattleText4: ; 59a77 (16:5a77) db "@" Route16Text5: ; 59a7c (16:5a7c) - db $08 ; asm + TX_ASM ld hl, Route16TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -224,7 +224,7 @@ Route16AfterBattleText5: ; 59a90 (16:5a90) db "@" Route16Text6: ; 59a95 (16:5a95) - db $08 ; asm + TX_ASM ld hl, Route16TrainerHeader5 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route16gate.asm b/scripts/route16gate.asm index f631d0ec..d245e249 100755 --- a/scripts/route16gate.asm +++ b/scripts/route16gate.asm @@ -92,7 +92,7 @@ Route16GateTextPointers: ; 4975a (12:575a) dw Route16GateText3 Route16GateText1: ; 49760 (12:5760) - db $08 ; asm + TX_ASM call Route16GateScript_49755 jr z, .asm_0bdf3 ld hl, Route16GateText_4977c diff --git a/scripts/route16gateupstairs.asm b/scripts/route16gateupstairs.asm index 0515e8d9..6027d57b 100755 --- a/scripts/route16gateupstairs.asm +++ b/scripts/route16gateupstairs.asm @@ -8,7 +8,7 @@ Route16GateUpstairsTextPointers: ; 4980e (12:580e) dw Route16GateUpstairsText4 Route16GateUpstairsText1: ; 49816 (12:5816) - db $08 ; asm + TX_ASM ld hl, Route16GateUpstairsText_49820 call PrintText jp TextScriptEnd @@ -18,7 +18,7 @@ Route16GateUpstairsText_49820: ; 49820 (12:5820) db "@" Route16GateUpstairsText2: ; 49825 (12:5825) - db $08 ; asm + TX_ASM ld hl, Route16GateUpstairsText_4982f call PrintText jp TextScriptEnd @@ -28,7 +28,7 @@ Route16GateUpstairsText_4982f: ; 4982f (12:582f) db "@" Route16GateUpstairsText3: ; 49834 (12:5834) - db $8 + TX_ASM ld hl, Route16GateUpstairsText_4983b jp Route12GateUpstairsScript_495c9 @@ -37,7 +37,7 @@ Route16GateUpstairsText_4983b: ; 4983b (12:583b) db "@" Route16GateUpstairsText4: ; 49840 (12:5840) - db $8 + TX_ASM ld hl, Route16GateUpstairsText_49847 jp Route12GateUpstairsScript_495c9 diff --git a/scripts/route16house.asm b/scripts/route16house.asm index a3d61281..5035b190 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -6,7 +6,7 @@ Route16HouseTextPointers: ; 1e5fb (7:65fb) dw Route16HouseText2 Route16HouseText1: ; 1e5ff (7:65ff) - db $08 ; asm + TX_ASM ld a, [wd7e0] bit 6, a ld hl, HM02ExplanationText @@ -43,7 +43,7 @@ HM02NoRoomText: ; 1e63b (7:663b) db "@" Route16HouseText2: ; 1e640 (7:6640) - db $08 ; asm + TX_ASM ld hl, Route16HouseText_1e652 call PrintText ld a, FEAROW diff --git a/scripts/route17.asm b/scripts/route17.asm index f528f0d6..8de70c3b 100755 --- a/scripts/route17.asm +++ b/scripts/route17.asm @@ -124,7 +124,7 @@ Route17TrainerHeader9: ; 55c1f (15:5c1f) db $ff Route17Text1: ; 55c2c (15:5c2c) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -142,7 +142,7 @@ Route17AfterBattleText1: ; 55c40 (15:5c40) db "@" Route17Text2: ; 55c45 (15:5c45) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -160,7 +160,7 @@ Route17AfterBattleText2: ; 55c59 (15:5c59) db "@" Route17Text3: ; 55c5e (15:5c5e) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -178,7 +178,7 @@ Route17AfterBattleText3: ; 55c72 (15:5c72) db "@" Route17Text4: ; 55c77 (15:5c77) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -196,7 +196,7 @@ Route17AfterBattleText4: ; 55c8b (15:5c8b) db "@" Route17Text5: ; 55c90 (15:5c90) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -214,7 +214,7 @@ Route17AfterBattleText5: ; 55ca4 (15:5ca4) db "@" Route17Text6: ; 55ca9 (15:5ca9) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -232,7 +232,7 @@ Route17AfterBattleText6: ; 55cbd (15:5cbd) db "@" Route17Text7: ; 55cc2 (15:5cc2) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -250,7 +250,7 @@ Route17AfterBattleText7: ; 55cd6 (15:5cd6) db "@" Route17Text8: ; 55cdb (15:5cdb) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader7 call TalkToTrainer jp TextScriptEnd @@ -268,7 +268,7 @@ Route17AfterBattleText8: ; 55cef (15:5cef) db "@" Route17Text9: ; 55cf4 (15:5cf4) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader8 call TalkToTrainer jp TextScriptEnd @@ -286,7 +286,7 @@ Route17AfterBattleText9: ; 55d08 (15:5d08) db "@" Route17Text10: ; 55d0d (15:5d0d) - db $08 ; asm + TX_ASM ld hl, Route17TrainerHeader9 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route18.asm b/scripts/route18.asm index 85c58d4c..80242169 100755 --- a/scripts/route18.asm +++ b/scripts/route18.asm @@ -50,7 +50,7 @@ Route18TrainerHeader2: ; 59b02 (16:5b02) db $ff Route18Text1: ; 59b0f (16:5b0f) - db $08 ; asm + TX_ASM ld hl, Route18TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -68,7 +68,7 @@ Route18AfterBattleText1: ; 59b23 (16:5b23) db "@" Route18Text2: ; 59b28 (16:5b28) - db $08 ; asm + TX_ASM ld hl, Route18TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -86,7 +86,7 @@ Route18AfterBattleText2: ; 59b3c (16:5b3c) db "@" Route18Text3: ; 59b41 (16:5b41) - db $08 ; asm + TX_ASM ld hl, Route18TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route18gate.asm b/scripts/route18gate.asm index fae15e7b..02f7b68c 100755 --- a/scripts/route18gate.asm +++ b/scripts/route18gate.asm @@ -87,7 +87,7 @@ Route18GateTextPointers: ; 4990d (12:590d) dw Route18GateText2 Route18GateText1: ; 49911 (12:5911) - db $08 ; asm + TX_ASM call Route16GateScript_49755 jr z, .asm_3c84d ld hl, Route18GateText_4992d diff --git a/scripts/route18gateupstairs.asm b/scripts/route18gateupstairs.asm index 8d0c3638..7fc76eda 100755 --- a/scripts/route18gateupstairs.asm +++ b/scripts/route18gateupstairs.asm @@ -7,14 +7,14 @@ Route18GateUpstairsTextPointers: ; 49978 (12:5978) dw Route18GateUpstairsText3 Route18GateUpstairsText1: ; 4997e (12:597e) - db $08 ; asm + TX_ASM ld a, $5 ld [wWhichTrade], a predef DoInGameTradeDialogue jp TextScriptEnd Route18GateUpstairsText2: ; 4998c (12:598c) - db $8 + TX_ASM ld hl, Route18GateUpstairsText_49993 jp Route12GateUpstairsScript_495c9 @@ -23,7 +23,7 @@ Route18GateUpstairsText_49993: ; 49993 (12:5993) db "@" Route18GateUpstairsText3: ; 49998 (12:5998) - db $8 + TX_ASM ld hl, Route18GateUpstairsText_4999f jp Route12GateUpstairsScript_495c9 diff --git a/scripts/route19.asm b/scripts/route19.asm index 6f8781b3..0265d2a3 100755 --- a/scripts/route19.asm +++ b/scripts/route19.asm @@ -119,61 +119,61 @@ Route19TrainerHeader9: ; 55ddf (15:5ddf) db $ff Route19Text1: ; 55dec (15:5dec) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader0 call TalkToTrainer jp TextScriptEnd Route19Text2: ; 55df6 (15:5df6) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader1 call TalkToTrainer jp TextScriptEnd Route19Text3: ; 55e00 (15:5e00) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader2 call TalkToTrainer jp TextScriptEnd Route19Text4: ; 55e0a (15:5e0a) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader3 call TalkToTrainer jp TextScriptEnd Route19Text5: ; 55e14 (15:5e14) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader4 call TalkToTrainer jp TextScriptEnd Route19Text6: ; 55e1e (15:5e1e) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader5 call TalkToTrainer jp TextScriptEnd Route19Text7: ; 55e28 (15:5e28) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader6 call TalkToTrainer jp TextScriptEnd Route19Text8: ; 55e32 (15:5e32) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader7 call TalkToTrainer jp TextScriptEnd Route19Text9: ; 55e3c (15:5e3c) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader8 call TalkToTrainer jp TextScriptEnd Route19Text10: ; 55e46 (15:5e46) - db $08 ; asm + TX_ASM ld hl, Route19TrainerHeader9 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route20.asm b/scripts/route20.asm index 0f8b9eae..085a6c18 100755 --- a/scripts/route20.asm +++ b/scripts/route20.asm @@ -175,61 +175,61 @@ Route20TrainerHeader10: ; 50da6 (14:4da6) db $ff Route20Text1: ; 50db3 (14:4db3) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader0 call TalkToTrainer jp TextScriptEnd Route20Text2: ; 50dbd (14:4dbd) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader2 call TalkToTrainer jp TextScriptEnd Route20Text3: ; 50dc7 (14:4dc7) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader3 call TalkToTrainer jp TextScriptEnd Route20Text4: ; 50dd1 (14:4dd1) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader4 call TalkToTrainer jp TextScriptEnd Route20Text5: ; 50ddb (14:4ddb) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader5 call TalkToTrainer jp TextScriptEnd Route20Text6: ; 50de5 (14:4de5) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader6 call TalkToTrainer jp TextScriptEnd Route20Text7: ; 50def (14:4def) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader7 call TalkToTrainer jp TextScriptEnd Route20Text8: ; 50df9 (14:4df9) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader8 call TalkToTrainer jp TextScriptEnd Route20Text9: ; 50e03 (14:4e03) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader9 call TalkToTrainer jp TextScriptEnd Route20Text10: ; 50e0d (14:4e0d) - db $08 ; asm + TX_ASM ld hl, Route20TrainerHeader10 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route21.asm b/scripts/route21.asm index d98c38c4..cbb5ea7b 100755 --- a/scripts/route21.asm +++ b/scripts/route21.asm @@ -108,55 +108,55 @@ Route21TrainerHeader8: ; 55f76 (15:5f76) db $ff Route21Text1: ; 55f83 (15:5f83) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader0 call TalkToTrainer jp TextScriptEnd Route21Text2: ; 55f8d (15:5f8d) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader1 call TalkToTrainer jp TextScriptEnd Route21Text3: ; 55f97 (15:5f97) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader2 call TalkToTrainer jp TextScriptEnd Route21Text4: ; 55fa1 (15:5fa1) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader3 call TalkToTrainer jp TextScriptEnd Route21Text5: ; 55fab (15:5fab) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader4 call TalkToTrainer jp TextScriptEnd Route21Text6: ; 55fb5 (15:5fb5) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader5 call TalkToTrainer jp TextScriptEnd Route21Text7: ; 55fbf (15:5fbf) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader6 call TalkToTrainer jp TextScriptEnd Route21Text8: ; 55fc9 (15:5fc9) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader7 call TalkToTrainer jp TextScriptEnd Route21Text9: ; 55fd3 (15:5fd3) - db $08 ; asm + TX_ASM ld hl, Route21TrainerHeader8 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route22.asm b/scripts/route22.asm index 66df3bb2..88f69bea 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -367,7 +367,7 @@ Route22TextPointers: ; 51175 (14:5175) dw Route22FrontGateText Route22Text1: ; 5117b (14:517b) - db $08 ; asm + TX_ASM ld a, [wd7eb] bit 5, a jr z, .asm_5118b @@ -381,7 +381,7 @@ Route22Text1: ; 5117b (14:517b) jp TextScriptEnd Route22Text2: ; 51194 (14:5194) - db $08 ; asm + TX_ASM ld a, [wd7eb] bit 6, a jr z, .asm_511a4 diff --git a/scripts/route22gate.asm b/scripts/route22gate.asm index 0d3c3489..4b099bb2 100755 --- a/scripts/route22gate.asm +++ b/scripts/route22gate.asm @@ -57,7 +57,7 @@ Route22GateTextPointers: ; 1e6df (7:66df) dw Route22GateText1 Route22GateText1: ; 1e6e1 (7:66e1) - db $8 + TX_ASM ld a, [W_OBTAINEDBADGES] bit 0, a jr nz, .asm_1e6f6 @@ -76,7 +76,7 @@ Route22GateText1: ; 1e6e1 (7:66e1) Route22GateText_1e704: ; 1e704 (7:6704) TX_FAR _Route22GateText_1e704 - db $8 + TX_ASM ld a, (SFX_02_51 - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent call WaitForSoundToFinish diff --git a/scripts/route23.asm b/scripts/route23.asm index 937b5a26..aaa85822 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -146,43 +146,43 @@ Route23TextPointers: ; 512f7 (14:52f7) dw Route23Text8 Route23Text1: ; 51307 (14:5307) - db $08 ; asm + TX_ASM ld a, $6 call Route23Script_51346 jp TextScriptEnd Route23Text2: ; 51310 (14:5310) - db $08 ; asm + TX_ASM ld a, $5 call Route23Script_51346 jp TextScriptEnd Route23Text3: ; 51319 (14:5319) - db $08 ; asm + TX_ASM ld a, $4 call Route23Script_51346 jp TextScriptEnd Route23Text4: ; 51322 (14:5322) - db $08 ; asm + TX_ASM ld a, $3 call Route23Script_51346 jp TextScriptEnd Route23Text5: ; 5132b (14:532b) - db $08 ; asm + TX_ASM ld a, $2 call Route23Script_51346 jp TextScriptEnd Route23Text6: ; 51334 (14:5334) - db $08 ; asm + TX_ASM ld a, $1 call Route23Script_51346 jp TextScriptEnd Route23Text7: ; 5133d (14:533d) - db $8 + TX_ASM ld a, $0 call Route23Script_51346 jp TextScriptEnd @@ -223,7 +223,7 @@ Route23Script_51388: ; 51388 (14:5388) VictoryRoadGuardText1: ; 5138e (14:538e) TX_FAR _VictoryRoadGuardText1 - db $08 ; asm + TX_ASM ld a, (SFX_02_51 - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent call WaitForSoundToFinish diff --git a/scripts/route24.asm b/scripts/route24.asm index abfea174..24866ed7 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -147,7 +147,7 @@ Route24TrainerHeader6: ; 51497 (14:5497) db $ff Route24Text1: ; 514a4 (14:54a4) - db $8 + TX_ASM ld hl, wd7f0 res 1, [hl] ld a, [wd7ef] @@ -218,37 +218,37 @@ Route24Text_51530: ; 51530 (14:5530) db "@" Route24Text2: ; 51535 (14:5535) - db $08 ; asm + TX_ASM ld hl, Route24TrainerHeader0 call TalkToTrainer jp TextScriptEnd Route24Text3: ; 5153f (14:553f) - db $08 ; asm + TX_ASM ld hl, Route24TrainerHeader2 call TalkToTrainer jp TextScriptEnd Route24Text4: ; 51549 (14:5549) - db $08 ; asm + TX_ASM ld hl, Route24TrainerHeader3 call TalkToTrainer jp TextScriptEnd Route24Text5: ; 51553 (14:5553) - db $08 ; asm + TX_ASM ld hl, Route24TrainerHeader4 call TalkToTrainer jp TextScriptEnd Route24Text6: ; 5155d (14:555d) - db $08 ; asm + TX_ASM ld hl, Route24TrainerHeader5 call TalkToTrainer jp TextScriptEnd Route24Text7: ; 51567 (14:5567) - db $08 ; asm + TX_ASM ld hl, Route24TrainerHeader6 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route25.asm b/scripts/route25.asm index 0c827802..383652c8 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -139,55 +139,55 @@ Route25TrainerHeader9: ; 5169e (14:569e) db $ff Route25Text1: ; 516ab (14:56ab) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader0 call TalkToTrainer jp TextScriptEnd Route25Text2: ; 516b5 (14:56b5) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader2 call TalkToTrainer jp TextScriptEnd Route25Text3: ; 516bf (14:56bf) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader3 call TalkToTrainer jp TextScriptEnd Route25Text4: ; 516c9 (14:56c9) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader4 call TalkToTrainer jp TextScriptEnd Route25Text5: ; 516d3 (14:56d3) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader5 call TalkToTrainer jp TextScriptEnd Route25Text6: ; 516dd (14:56dd) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader6 call TalkToTrainer jp TextScriptEnd Route25Text7: ; 516e7 (14:56e7) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader7 call TalkToTrainer jp TextScriptEnd Route25Text8: ; 516f1 (14:56f1) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader8 call TalkToTrainer jp TextScriptEnd Route25Text9: ; 516fb (14:56fb) - db $08 ; asm + TX_ASM ld hl, Route25TrainerHeader9 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index 9d29a311..7850cbc9 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -6,7 +6,7 @@ Route2GateTextPointers: ; 5d5d7 (17:55d7) dw Route2GateText2 Route2GateText1: ; 5d5db (17:55db) - db $08 ; asm + TX_ASM ld a, [wd7c2] bit 0, a jr nz, .asm_5d60d diff --git a/scripts/route2house.asm b/scripts/route2house.asm index ba13605b..d1312c91 100755 --- a/scripts/route2house.asm +++ b/scripts/route2house.asm @@ -10,7 +10,7 @@ Route2HouseText1: ; 1def4 (7:5ef4) db "@" Route2HouseText2: ; 1def9 (7:5ef9) - db $08 ; asm + TX_ASM ld a, $1 ld [wWhichTrade], a predef DoInGameTradeDialogue diff --git a/scripts/route3.asm b/scripts/route3.asm index 6f9d0e2c..c39a5435 100755 --- a/scripts/route3.asm +++ b/scripts/route3.asm @@ -104,7 +104,7 @@ Route3Text1: ; 55586 (15:5586) db "@" Route3Text2: ; 5558b (15:558b) - db $08 ; asm + TX_ASM ld hl, Route3TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -122,7 +122,7 @@ Route3AfterBattleText1: ; 5559f (15:559f) db "@" Route3Text3: ; 555a4 (15:55a4) - db $08 ; asm + TX_ASM ld hl, Route3TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -140,7 +140,7 @@ Route3AfterBattleText2: ; 555b8 (15:55b8) db "@" Route3Text4: ; 555bd (15:55bd) - db $08 ; asm + TX_ASM ld hl, Route3TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -158,7 +158,7 @@ Route3AfterBattleText3: ; 555d1 (15:55d1) db "@" Route3Text5: ; 555d6 (15:55d6) - db $08 ; asm + TX_ASM ld hl, Route3TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -176,7 +176,7 @@ Route3AfterBattleText4: ; 555ea (15:55ea) db "@" Route3Text6: ; 555ef (15:55ef) - db $08 ; asm + TX_ASM ld hl, Route3TrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -194,7 +194,7 @@ Route3AfterBattleText5: ; 55603 (15:5603) db "@" Route3Text7: ; 55608 (15:5608) - db $08 ; asm + TX_ASM ld hl, Route3TrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -212,7 +212,7 @@ Route3AfterBattleText6: ; 5561c (15:561c) db "@" Route3Text8: ; 55621 (15:5621) - db $08 ; asm + TX_ASM ld hl, Route3TrainerHeader7 call TalkToTrainer jp TextScriptEnd @@ -230,7 +230,7 @@ Route3AfterBattleText7: ; 55635 (15:5635) db "@" Route3Text9: ; 5563a (15:563a) - db $08 ; asm + TX_ASM ld hl, Route3TrainerHeader8 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route4.asm b/scripts/route4.asm index f9031ad8..c4a1e956 100755 --- a/scripts/route4.asm +++ b/scripts/route4.asm @@ -37,7 +37,7 @@ Route4Text1: ; 5568a (15:568a) db "@" Route4Text2: ; 5568f (15:568f) - db $08 ; asm + TX_ASM ld hl, Route4TrainerHeader0 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route5gate.asm b/scripts/route5gate.asm index 1a1c6b9c..72f226e7 100755 --- a/scripts/route5gate.asm +++ b/scripts/route5gate.asm @@ -69,7 +69,7 @@ Route8GateText1: ; 1dfaa (7:5faa) Route7GateText1: ; 1dfaa (7:5faa) Route6GateText1: ; 1dfaa (7:5faa) Route5GateText1: ; 1dfaa (7:5faa) - db $8 + TX_ASM ld a, [wd728] bit 6, a jr nz, .asm_88856 diff --git a/scripts/route6.asm b/scripts/route6.asm index 733c5eac..51116390 100755 --- a/scripts/route6.asm +++ b/scripts/route6.asm @@ -79,7 +79,7 @@ Route6TrainerHeader5: ; 59113 (16:5113) db $ff Route6Text1: ; 59120 (16:5120) - db $8 + TX_ASM ld hl, Route6TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -97,7 +97,7 @@ Route6AfterBattleText1: ; 59134 (16:5134) db "@" Route6Text2: ; 59139 (16:5139) - db $08 ; asm + TX_ASM ld hl, Route6TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -111,7 +111,7 @@ Route6EndBattleText2: ; 59148 (16:5148) db "@" Route6Text3: ; 5914d (16:514d) - db $08 ; asm + TX_ASM ld hl, Route6TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -129,7 +129,7 @@ Route6AfterBattleText3: ; 59161 (16:5161) db "@" Route6Text4: ; 59166 (16:5166) - db $08 ; asm + TX_ASM ld hl, Route6TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -147,7 +147,7 @@ Route6AfterBattleText4: ; 5917a (16:517a) db "@" Route6Text5: ; 5917f (16:517f) - db $08 ; asm + TX_ASM ld hl, Route6TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -165,7 +165,7 @@ Route6AfterBattleText5: ; 59193 (16:5193) db "@" Route6Text6: ; 59198 (16:5198) - db $08 ; asm + TX_ASM ld hl, Route6TrainerHeader5 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route8.asm b/scripts/route8.asm index 143af7cd..8d589c90 100755 --- a/scripts/route8.asm +++ b/scripts/route8.asm @@ -109,7 +109,7 @@ Route8TrainerHeader8: ; 59243 (16:5243) db $ff Route8Text1: ; 59250 (16:5250) - db $8 + TX_ASM ld hl, Route8TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -127,7 +127,7 @@ Route8AfterBattleText1: ; 59264 (16:5264) db "@" Route8Text2: ; 59269 (16:5269) - db $08 ; asm + TX_ASM ld hl, Route8TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -145,7 +145,7 @@ Route8AfterBattleText2: ; 5927d (16:527d) db "@" Route8Text3: ; 59282 (16:5282) - db $08 ; asm + TX_ASM ld hl, Route8TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -163,7 +163,7 @@ Route8AfterBattleText3: ; 59296 (16:5296) db "@" Route8Text4: ; 5929b (16:529b) - db $08 ; asm + TX_ASM ld hl, Route8TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -181,7 +181,7 @@ Route8AfterBattleText4: ; 592af (16:52af) db "@" Route8Text5: ; 592b4 (16:52b4) - db $08 ; asm + TX_ASM ld hl, Route8TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -199,7 +199,7 @@ Route8AfterBattleText5: ; 592c8 (16:52c8) db "@" Route8Text6: ; 592cd (16:52cd) - db $08 ; asm + TX_ASM ld hl, Route8TrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -217,7 +217,7 @@ Route8AfterBattleText6: ; 592e1 (16:52e1) db "@" Route8Text7: ; 592e6 (16:52e6) - db $08 ; asm + TX_ASM ld hl, Route8TrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -235,7 +235,7 @@ Route8AfterBattleText7: ; 592fa (16:52fa) db "@" Route8Text8: ; 592ff (16:52ff) - db $08 ; asm + TX_ASM ld hl, Route8TrainerHeader7 call TalkToTrainer jp TextScriptEnd @@ -253,7 +253,7 @@ Route8AfterBattleText8: ; 59313 (16:5313) db "@" Route8Text9: ; 59318 (16:5318) - db $08 ; asm + TX_ASM ld hl, Route8TrainerHeader8 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/route9.asm b/scripts/route9.asm index 67b04e9a..539e1a3f 100755 --- a/scripts/route9.asm +++ b/scripts/route9.asm @@ -110,47 +110,47 @@ Route9TrainerHeader9: ; 5574b (15:574b) db $ff Route9Text1: ; 55758 (15:5758) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader0 jr Route9TalkToTrainer Route9Text2: ; 5575e (15:575e) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader2 jr Route9TalkToTrainer Route9Text3: ; 55764 (15:5764) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader3 jr Route9TalkToTrainer Route9Text4: ; 5576a (15:576a) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader4 jr Route9TalkToTrainer Route9Text5: ; 55770 (15:5770) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader5 jr Route9TalkToTrainer Route9Text6: ; 55776 (15:5776) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader6 jr Route9TalkToTrainer Route9Text7: ; 5577c (15:577c) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader7 jr Route9TalkToTrainer Route9Text8: ; 55782 (15:5782) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader8 jr Route9TalkToTrainer Route9Text9: ; 55788 (15:5788) - db $8 ; asm + TX_ASM ld hl, Route9TrainerHeader9 Route9TalkToTrainer: ; 5578c (15:578c) call TalkToTrainer diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index 5d350abe..6b9029f6 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -146,7 +146,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) .SafariZoneEntranceText4 TX_FAR SafariZoneEntranceText_9e6e4 - db $8 + TX_ASM ld a, $13 ld [wTextBoxID],a call DisplayTextBoxID @@ -226,7 +226,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) .SafariZoneEntranceText5 TX_FAR SafariZoneEntranceText_9e814 - db $8 + TX_ASM call YesNoChoice ld a,[wCurrentMenuItem] and a @@ -272,7 +272,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) db "@" .SafariZoneEntranceText2 - db $08 ; asm + TX_ASM ld hl,.FirstTimeQuestionText call PrintText call YesNoChoice diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index 2a91a1bb..b1dd95d3 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -5,7 +5,7 @@ SafariZoneSecretHouseTextPointers: ; 4a31a (12:631a) dw SafariZoneSecretHouseText1 SafariZoneSecretHouseText1: ; 4a31c (12:631c) - db $08 ; asm + TX_ASM ld a, [wd857] bit 0, a jr nz, .asm_20a9b diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index 4739466e..9c17a63c 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -157,7 +157,7 @@ SaffronGymTrainerHeader6: ; 5d10b (17:510b) db $ff SaffronGymText1: ; 5d118 (17:5118) - db $08 ; asm + TX_ASM ld a, [wd7b3] bit 1, a jr z, .asm_5d134 @@ -219,49 +219,49 @@ SaffronGymText12: ; 5d182 (17:5182) db "@" SaffronGymText2: ; 5d187 (17:5187) - db $08 ; asm + TX_ASM ld hl, SaffronGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd SaffronGymText3: ; 5d191 (17:5191) - db $08 ; asm + TX_ASM ld hl, SaffronGymTrainerHeader1 call TalkToTrainer jp TextScriptEnd SaffronGymText4: ; 5d19b (17:519b) - db $08 ; asm + TX_ASM ld hl, SaffronGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd SaffronGymText5: ; 5d1a5 (17:51a5) - db $08 ; asm + TX_ASM ld hl, SaffronGymTrainerHeader3 call TalkToTrainer jp TextScriptEnd SaffronGymText6: ; 5d1af (17:51af) - db $08 ; asm + TX_ASM ld hl, SaffronGymTrainerHeader4 call TalkToTrainer jp TextScriptEnd SaffronGymText7: ; 5d1b9 (17:51b9) - db $08 ; asm + TX_ASM ld hl, SaffronGymTrainerHeader5 call TalkToTrainer jp TextScriptEnd SaffronGymText8: ; 5d1c3 (17:51c3) - db $08 ; asm + TX_ASM ld hl, SaffronGymTrainerHeader6 call TalkToTrainer jp TextScriptEnd SaffronGymText9: ; 5d1cd (17:51cd) - db $08 ; asm + TX_ASM ld a, [wd7b3] bit 1, a jr nz, .asm_5d1dd diff --git a/scripts/saffronhouse1.asm b/scripts/saffronhouse1.asm index 39a70ebf..3aced3c5 100755 --- a/scripts/saffronhouse1.asm +++ b/scripts/saffronhouse1.asm @@ -13,7 +13,7 @@ SaffronHouse1Text1: ; 1dde8 (7:5de8) SaffronHouse1Text2: ; 1dded (7:5ded) TX_FAR _SaffronHouse1Text2 - db $8 + TX_ASM ld a, PIDGEY call PlayCry jp TextScriptEnd diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index 5c1e0e41..b7d8ed26 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -5,7 +5,7 @@ SaffronHouse2TextPointers: ; 1de3f (7:5e3f) dw SaffronHouse2Text1 SaffronHouse2Text1: ; 1de41 (7:5e41) - db $08 ; asm + TX_ASM ld a, [wd7bd] bit 0, a jr nz, .asm_9e72b diff --git a/scripts/seafoamislands5.asm b/scripts/seafoamislands5.asm index eff92886..cbed0276 100755 --- a/scripts/seafoamislands5.asm +++ b/scripts/seafoamislands5.asm @@ -154,7 +154,7 @@ SeafoamIslands5TrainerHeader0: ; 46886 (11:6886) db $ff SeafoamIslands5Text3: ; 46893 (11:6893) - db $08 ; asm + TX_ASM ld hl, SeafoamIslands5TrainerHeader0 call TalkToTrainer ld a, $4 @@ -163,7 +163,7 @@ SeafoamIslands5Text3: ; 46893 (11:6893) SeafoamIslands5BattleText2: ; 468a2 (11:68a2) TX_FAR _SeafoamIslands5BattleText2 - db $8 + TX_ASM ld a, ARTICUNO call PlayCry call WaitForSoundToFinish diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index 2a4afe72..46630014 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -70,19 +70,19 @@ SilphCo10TrainerHeader1: ; 5a19e (16:619e) db $ff SilphCo10Text1: ; 5a1ab (16:61ab) - db $08 ; asm + TX_ASM ld hl, SilphCo10TrainerHeader0 call TalkToTrainer jp TextScriptEnd SilphCo10Text2: ; 5a1b5 (16:61b5) - db $08 ; asm + TX_ASM ld hl, SilphCo10TrainerHeader1 call TalkToTrainer jp TextScriptEnd SilphCo10Text3: ; 5a1bf (16:61bf) - db $08 ; asm + TX_ASM ld a, [wd838] bit 7, a ld hl, SilphCo10Text_5a1d8 diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index f625d419..a0d85483 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -302,7 +302,7 @@ SilphCo11TrainerHeader1: ; 622cf (18:62cf) db $ff SilphCo11Text1: ; 622dc (18:62dc) - db $08 ; asm + TX_ASM ld a, [wd838] bit 5, a jp nz, .asm_62308 @@ -359,7 +359,7 @@ SilphCo11Text6: ; 62335 (18:6335) db "@" SilphCo11Text4: ; 6233a (18:633a) - db $08 ; asm + TX_ASM ld hl, SilphCo11TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -377,7 +377,7 @@ SilphCo11AfterBattleText1: ; 6234e (18:634e) db "@" SilphCo11Text5: ; 62353 (18:6353) - db $08 ; asm + TX_ASM ld hl, SilphCo11TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -395,7 +395,7 @@ SilphCo11AfterBattleText2: ; 62367 (18:6367) db "@" SilphCo10Text_6236c: ; 6236c (18:636c) - db $8 + TX_ASM ld hl, SilphCo10Text_6237b call PrintText ld a, PORYGON diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index 906e4d56..ee0bd150 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -137,7 +137,7 @@ SilphCo2TrainerHeader3: ; 59db4 (16:5db4) db $ff SilphCo2Text1: ; 59dc1 (16:5dc1) - db $08 ; asm + TX_ASM ld a, [wd826] bit 7, a jr nz, .asm_59de4 @@ -174,25 +174,25 @@ TM36NoRoomText: ; 59dfd (16:5dfd) db "@" SilphCo2Text2: ; 59e02 (16:5e02) - db $08 ; asm + TX_ASM ld hl, SilphCo2TrainerHeader0 call TalkToTrainer jp TextScriptEnd SilphCo2Text3: ; 59e0c (16:5e0c) - db $08 ; asm + TX_ASM ld hl, SilphCo2TrainerHeader1 call TalkToTrainer jp TextScriptEnd SilphCo2Text4: ; 59e16 (16:5e16) - db $08 ; asm + TX_ASM ld hl, SilphCo2TrainerHeader2 call TalkToTrainer jp TextScriptEnd SilphCo2Text5: ; 59e20 (16:5e20) - db $08 ; asm + TX_ASM ld hl, SilphCo2TrainerHeader3 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index 13eb9e84..bc36ed39 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -82,7 +82,7 @@ SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) db $ff SilphCo3Text1: ; 59fe5 (16:5fe5) - db $08 ; asm + TX_ASM ld a, [wd838] bit 7, a ld hl, SilphCo3Text_59ffe @@ -101,7 +101,7 @@ SilphCo3Text_59ffe: ; 59ffe (16:5ffe) db "@" SilphCo3Text2: ; 5a003 (16:6003) - db $08 ; asm + TX_ASM ld hl, SilphCo3TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -119,7 +119,7 @@ SilphCo3AfterBattleText1: ; 5a017 (16:6017) db "@" SilphCo3Text3: ; 5a01c (16:601c) - db $08 ; asm + TX_ASM ld hl, SilphCo3TrainerHeader1 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index 18d56587..866afd54 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -130,7 +130,7 @@ SilphCo4TrainerHeader3: ; 19dc6 (6:5dc6) db $ff SilphCo4Text1: ; 19dd3 (6:5dd3) - db $08 ; asm + TX_ASM ld hl, SilphCo4Text_19de0 ld de, SilphCo4Text_19de5 call SilphCo6Script_1a22f @@ -145,7 +145,7 @@ SilphCo4Text_19de5: ; 19de5 (6:5de5) db "@" SilphCo4Text2: ; 19dea (6:5dea) - db $08 ; asm + TX_ASM ld hl, SilphCo4TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -163,7 +163,7 @@ SilphCo4AfterBattleText2: ; 19dfe (6:5dfe) db "@" SilphCo4Text3: ; 19e03 (6:5e03) - db $08 ; asm + TX_ASM ld hl, SilphCo4TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -181,7 +181,7 @@ SilphCo4AfterBattleText3: ; 19e17 (6:5e17) db "@" SilphCo4Text4: ; 19e1c (6:5e1c) - db $08 ; asm + TX_ASM ld hl, SilphCo4TrainerHeader3 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index 4417466d..750072ab 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -121,7 +121,7 @@ Silphco5TrainerHeader4: ; 19ff6 (6:5ff6) db $ff SilphCo5Text1: ; 1a003 (6:6003) - db $08 ; asm + TX_ASM ld hl, SilphCo5Text_1a010 ld de, SilphCo5Text_1a015 call SilphCo6Script_1a22f @@ -136,7 +136,7 @@ SilphCo5Text_1a015: ; 1a015 (6:6015) db "@" SilphCo5Text2: ; 1a01a (6:601a) - db $08 ; asm + TX_ASM ld hl, Silphco5TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -154,7 +154,7 @@ SilphCo5AfterBattleText2: ; 1a02e (6:602e) db "@" SilphCo5Text3: ; 1a033 (6:6033) - db $08 ; asm + TX_ASM ld hl, Silphco5TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -172,7 +172,7 @@ SilphCo5AfterBattleText3: ; 1a047 (6:6047) db "@" SilphCo5Text4: ; 1a04c (6:604c) - db $08 ; asm + TX_ASM ld hl, Silphco5TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -190,7 +190,7 @@ SilphCo5AfterBattleText4: ; 1a060 (6:6060) db "@" SilphCo5Text5: ; 1a065 (6:6065) - db $08 ; asm + TX_ASM ld hl, Silphco5TrainerHeader4 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index 63179fbb..0ff5ee50 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -95,7 +95,7 @@ SilphCo6Script_1a22f: ; 1a22f (6:622f) jp PrintText SilphCo6Text1: ; 1a23d (6:623d) - db $08 ; asm + TX_ASM ld hl, SilphCo6Text_1a24a ld de, SilphCo6Text_1a24f call SilphCo6Script_1a22f @@ -110,7 +110,7 @@ SilphCo6Text_1a24f: ; 1a24f (6:624f) db "@" SilphCo6Text2: ; 1a254 (6:6254) - db $08 ; asm + TX_ASM ld hl, SilphCo6Text_1a261 ld de, SilphCo6Text_1a266 call SilphCo6Script_1a22f @@ -125,7 +125,7 @@ SilphCo6Text_1a266: ; 1a266 (6:6266) db "@" SilphCo6Text3: ; 1a26b (6:626b) - db $08 ; asm + TX_ASM ld hl, SilphCo6Text_1a278 ld de, SilphCo6Text_1a27d call SilphCo6Script_1a22f @@ -140,7 +140,7 @@ SilphCo6Text_1a27d: ; 1a27d (6:627d) db "@" SilphCo6Text4: ; 1a282 (6:6282) - db $08 ; asm + TX_ASM ld hl, SilphCo6Text_1a28f ld de, SilphCo6Text_1a294 call SilphCo6Script_1a22f @@ -155,7 +155,7 @@ SilphCo6Text_1a294: ; 1a294 (6:6294) db "@" SilphCo6Text5: ; 1a299 (6:6299) - db $08 ; asm + TX_ASM ld hl, SilphCo6Text_1a2a6 ld de, SilphCo6Text_1a2ab call SilphCo6Script_1a22f @@ -170,7 +170,7 @@ SilphCo6Text_1a2ab: ; 1a2ab (6:62ab) db "@" SilphCo6Text6: ; 1a2b0 (6:62b0) - db $08 ; asm + TX_ASM ld hl, SilphCo6TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -188,7 +188,7 @@ SilphCo6AfterBattleText2: ; 1a2c4 (6:62c4) db "@" SilphCo6Text7: ; 1a2c9 (6:62c9) - db $08 ; asm + TX_ASM ld hl, SilphCo6TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -206,7 +206,7 @@ SilphCo6AfterBattleText3: ; 1a2dd (6:62dd) db "@" SilphCo6Text8: ; 1a2e2 (6:62e2) - db $08 ; asm + TX_ASM ld hl, SilphCo6TrainerHeader3 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index e6d9bcac..1bb07824 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -307,7 +307,7 @@ SilphCo7TrainerHeader4: ; 51d81 (14:5d81) SilphCo7Text1: ; lapras guy - db $08 ; asm + TX_ASM ld a, [wd72e] bit 0, a ; got lapras? jr z, .givelapras @@ -355,7 +355,7 @@ SilphCo7Text1: db "@" SilphCo7Text2: - db $8 + TX_ASM ld a, [wd838] bit 7, a ; saved silph? jr nz, .savedsilph @@ -377,7 +377,7 @@ SilphCo7Text2: db "@" SilphCo7Text3: - db $08 ; asm + TX_ASM ld a, [wd838] bit 7, a ; saved silph? jr nz, .savedsilph @@ -399,7 +399,7 @@ SilphCo7Text3: db "@" SilphCo7Text4: - db $08 ; asm + TX_ASM ld a, [wd838] bit 7, a ; saved silph? jr nz, .savedsilph @@ -421,7 +421,7 @@ SilphCo7Text4: db "@" SilphCo7Text5: ; 51e50 (14:5e50) - db $08 ; asm + TX_ASM ld hl, SilphCo7TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -439,7 +439,7 @@ SilphCo7AfterBattleText1: ; 51e64 (14:5e64) db "@" SilphCo7Text6: ; 51e69 (14:5e69) - db $08 ; asm + TX_ASM ld hl, SilphCo7TrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -457,7 +457,7 @@ SilphCo7AfterBattleText2: ; 51e7d (14:5e7d) db "@" SilphCo7Text7: ; 51e82 (14:5e82) - db $08 ; asm + TX_ASM ld hl, SilphCo7TrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -475,7 +475,7 @@ SilphCo7AfterBattleText3: ; 51e96 (14:5e96) db "@" SilphCo7Text8: ; 51e9b (14:5e9b) - db $08 ; asm + TX_ASM ld hl, SilphCo7TrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -493,7 +493,7 @@ SilphCo7AfterBattleText4: ; 51eaf (14:5eaf) db "@" SilphCo7Text9: ; 51eb4 (14:5eb4) - db $08 ; asm + TX_ASM ld hl, SilphCo7Text_51ebe call PrintText jp TextScriptEnd diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index af7369b7..95a1096d 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -113,7 +113,7 @@ SilphCo8TrainerHeader2: ; 5659d (15:659d) db $ff SilphCo8Text1: ; 565aa (15:65aa) - db $08 ; asm + TX_ASM ld a, [wd838] bit 7, a ld hl, SilphCo8Text_565c3 @@ -132,19 +132,19 @@ SilphCo8Text_565c3: ; 565c3 (15:65c3) db "@" SilphCo8Text2: ; 565c8 (15:65c8) - db $08 ; asm + TX_ASM ld hl, SilphCo8TrainerHeader0 call TalkToTrainer jp TextScriptEnd SilphCo8Text3: ; 565d2 (15:65d2) - db $08 ; asm + TX_ASM ld hl, SilphCo8TrainerHeader1 call TalkToTrainer jp TextScriptEnd SilphCo8Text4: ; 565dc (15:65dc) - db $08 ; asm + TX_ASM ld hl, SilphCo8TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index 8f68b390..b19dbde4 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -157,7 +157,7 @@ SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) db $ff SilphCo9Text1: ; 5d8b8 (17:58b8) - db $08 ; asm + TX_ASM ld a, [wd838] bit 7, a jr nz, .asm_5d8dc @@ -189,19 +189,19 @@ SilphCo9Text_5d8ef: ; 5d8ef (17:58ef) db "@" SilphCo9Text2: ; 5d8f4 (17:58f4) - db $08 ; asm + TX_ASM ld hl, SilphCo9TrainerHeader0 call TalkToTrainer jp TextScriptEnd SilphCo9Text3: ; 5d8fe (17:58fe) - db $08 ; asm + TX_ASM ld hl, SilphCo9TrainerHeader1 call TalkToTrainer jp TextScriptEnd SilphCo9Text4: ; 5d908 (17:5908) - db $08 ; asm + TX_ASM ld hl, SilphCo9TrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/silphcoelevator.asm b/scripts/silphcoelevator.asm index 746ad15d..161b5ece 100755 --- a/scripts/silphcoelevator.asm +++ b/scripts/silphcoelevator.asm @@ -70,7 +70,7 @@ SilphCoElevatorTextPointers: ; 45833 (11:5833) dw SilphCoElevatorText1 SilphCoElevatorText1: ; 45835 (11:5835) - db $08 ; asm + TX_ASM call SilphCoElevatorScript_457f1 ld hl, SilphCoElevatorWarpMaps predef Func_1c9c6 diff --git a/scripts/ssanne10.asm b/scripts/ssanne10.asm index 3a14f04d..4dee3bb7 100755 --- a/scripts/ssanne10.asm +++ b/scripts/ssanne10.asm @@ -83,44 +83,44 @@ SSAnne10TrainerHeader5: ; 61dc0 (18:5dc0) db $ff SSAnne10Text1: ; 61dcd (18:5dcd) - db $08 ; asm + TX_ASM ld hl, SSAnne10TrainerHeader0 call TalkToTrainer jp TextScriptEnd SSAnne10Text2: ; 61dd7 (18:5dd7) - db $08 ; asm + TX_ASM ld hl, SSAnne10TrainerHeader1 call TalkToTrainer jp TextScriptEnd SSAnne10Text3: ; 61de1 (18:5de1) - db $08 ; asm + TX_ASM ld hl, SSAnne10TrainerHeader2 call TalkToTrainer jp TextScriptEnd SSAnne10Text4: ; 61deb (18:5deb) - db $08 ; asm + TX_ASM ld hl, SSAnne10TrainerHeader3 call TalkToTrainer jp TextScriptEnd SSAnne10Text5: ; 61df5 (18:5df5) - db $08 ; asm + TX_ASM ld hl, SSAnne10TrainerHeader4 call TalkToTrainer jp TextScriptEnd SSAnne10Text6: ; 61dff (18:5dff) - db $08 ; asm + TX_ASM ld hl, SSAnne10TrainerHeader5 call TalkToTrainer jp TextScriptEnd SSAnne10Text8: ; 61e09 (18:5e09) TX_FAR _SSAnne10Text8 - db $08 ; asm + TX_ASM ld a, MACHOKE call PlayCry jp TextScriptEnd diff --git a/scripts/ssanne2.asm b/scripts/ssanne2.asm index c00c56f7..d540f41b 100755 --- a/scripts/ssanne2.asm +++ b/scripts/ssanne2.asm @@ -178,7 +178,7 @@ SSAnne2Text1: ; 614e1 (18:54e1) db "@" SSAnne2Text2: ; 614e6 (18:54e6) - db $8 + TX_ASM ld hl, SSAnneRivalBeforeBattleText call PrintText ld hl, wd72d diff --git a/scripts/ssanne5.asm b/scripts/ssanne5.asm index 206eadde..063ccbb8 100755 --- a/scripts/ssanne5.asm +++ b/scripts/ssanne5.asm @@ -53,7 +53,7 @@ SSAnne5Text3: ; 616f4 (18:56f4) db "@" SSAnne5Text4: ; 616f9 (18:56f9) - db $08 ; asm + TX_ASM ld hl, SSAnne5TrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -71,7 +71,7 @@ SSAnne5AfterBattleText1: ; 6170d (18:570d) db "@" SSAnne5Text5: ; 61712 (18:5712) - db $08 ; asm + TX_ASM ld hl, SSAnne5TrainerHeader1 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/ssanne6.asm b/scripts/ssanne6.asm index 822e5e38..ee8b6e14 100755 --- a/scripts/ssanne6.asm +++ b/scripts/ssanne6.asm @@ -36,7 +36,7 @@ SSAnne6Text6: ; 617de (18:57de) db "@" SSAnne6Text7: ; 617e3 (18:57e3) - db $08 ; asm + TX_ASM ld hl, SSAnne6Text_61807 call PrintText ldh a, [$d3] diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index 278f8e21..a1fd791a 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -16,7 +16,7 @@ SSAnne7TextPointers: ; 618a7 (18:58a7) dw SSAnne7Text3 SSAnne7Text1: ; 618ad (18:58ad) - db $08 ; asm + TX_ASM ld a, [wd803] bit 0, a jr nz, .asm_797c4 @@ -46,7 +46,7 @@ SSAnne7Text1: ; 618ad (18:58ad) SSAnne7RubText: ; 618ec (18:58ec) TX_FAR _SSAnne7RubText - db $8 + TX_ASM ld a, [wc0ef] cp BANK(Music1f_UpdateMusic) ld [wc0f0], a diff --git a/scripts/ssanne8.asm b/scripts/ssanne8.asm index a01c81b4..27c76a2f 100755 --- a/scripts/ssanne8.asm +++ b/scripts/ssanne8.asm @@ -65,32 +65,32 @@ SSAnne8TrainerHeader3: ; 619c9 (18:59c9) db $ff SSAnne8Text1: ; 619d6 (18:59d6) - db $08 ; asm + TX_ASM ld hl, SSAnne8TrainerHeader0 call TalkToTrainer jp TextScriptEnd SSAnne8Text2: ; 619e0 (18:59e0) - db $08 ; asm + TX_ASM ld hl, SSAnne8TrainerHeader1 call TalkToTrainer jp TextScriptEnd SSAnne8Text3: ; 619ea (18:59ea) - db $08 ; asm + TX_ASM ld hl, SSAnne8TrainerHeader2 call TalkToTrainer jp TextScriptEnd SSAnne8Text4: ; 619f4 (18:59f4) - db $08 ; asm + TX_ASM ld hl, SSAnne8TrainerHeader3 call TalkToTrainer jp TextScriptEnd SSAnne8Text8: ; 619fe (18:59fe) TX_FAR _SSAnne8Text8 - db $08 ; asm + TX_ASM ld a, WIGGLYTUFF call PlayCry jp TextScriptEnd diff --git a/scripts/ssanne9.asm b/scripts/ssanne9.asm index 25118b27..6e8b86c6 100755 --- a/scripts/ssanne9.asm +++ b/scripts/ssanne9.asm @@ -70,31 +70,31 @@ SSAnne9TrainerHeader3: ; 61ba8 (18:5ba8) db $ff SSAnne9Text1: ; 61bb5 (18:5bb5) - db $08 ; asm + TX_ASM ld hl, SSAnne9TrainerHeader0 call TalkToTrainer jp TextScriptEnd SSAnne9Text2: ; 61bbf (18:5bbf) - db $08 ; asm + TX_ASM ld hl, SSAnne9TrainerHeader1 call TalkToTrainer jp TextScriptEnd SSAnne9Text3: ; 61bc9 (18:5bc9) - db $08 ; asm + TX_ASM ld hl, SSAnne9TrainerHeader2 call TalkToTrainer jp TextScriptEnd SSAnne9Text4: ; 61bd3 (18:5bd3) - db $08 ; asm + TX_ASM ld hl, SSAnne9TrainerHeader3 call TalkToTrainer jp TextScriptEnd SSAnne9Text5: ; 61bdd (18:5bdd) - db $08 ; asm + TX_ASM call SaveScreenTilesToBuffer1 ld hl, SSAnne9Text_61bf2 call PrintText @@ -108,7 +108,7 @@ SSAnne9Text_61bf2: ; 61bf2 (18:5bf2) db "@" SSAnne9Text7: ; 61bf7 (18:5bf7) - db $08 ; asm + TX_ASM ld hl, SSAnne9Text_61c01 call PrintText jp TextScriptEnd @@ -118,7 +118,7 @@ SSAnne9Text_61c01: ; 61c01 (18:5c01) db "@" SSAnne9Text8: ; 61c06 (18:5c06) - db $08 ; asm + TX_ASM ld hl, SSAnne9Text_61c10 call PrintText jp TextScriptEnd @@ -128,7 +128,7 @@ SSAnne9Text_61c10: ; 61c10 (18:5c10) db "@" SSAnne9Text10: ; 61c15 (18:5c15) - db $08 ; asm + TX_ASM ld hl, SSAnne9Text_61c1f call PrintText jp TextScriptEnd @@ -138,7 +138,7 @@ SSAnne9Text_61c1f: ; 61c1f (18:5c1f) db "@" SSAnne9Text11: ; 61c24 (18:5c24) - db $08 ; asm + TX_ASM ld hl, SSAnne9Text_61c2e call PrintText jp TextScriptEnd @@ -148,7 +148,7 @@ SSAnne9Text_61c2e: ; 61c2e (18:5c2e) db "@" SSAnne9Text12: ; 61c33 (18:5c33) - db $08 ; asm + TX_ASM ld hl, SSAnne9Text_61c3d call PrintText jp TextScriptEnd @@ -158,7 +158,7 @@ SSAnne9Text_61c3d: ; 61c3d (18:5c3d) db "@" SSAnne9Text13: ; 61c42 (18:5c42) - db $08 ; asm + TX_ASM ld hl, SSAnne9Text_61c4c call PrintText jp TextScriptEnd diff --git a/scripts/undergroundpathentranceroute5.asm b/scripts/undergroundpathentranceroute5.asm index 03f1c35d..c93ab7b5 100755 --- a/scripts/undergroundpathentranceroute5.asm +++ b/scripts/undergroundpathentranceroute5.asm @@ -10,7 +10,7 @@ UndergroundPathEntranceRoute5TextPointers: ; 5d6b0 (17:56b0) dw UndergroundPathEntranceRoute5Text1 UndergroundPathEntranceRoute5Text1: ; 5d6b2 (17:56b2) - db $08 ; asm + TX_ASM ld a, $9 ld [wWhichTrade], a predef DoInGameTradeDialogue diff --git a/scripts/unknowndungeon3.asm b/scripts/unknowndungeon3.asm index f21e0c7f..055c9d0f 100755 --- a/scripts/unknowndungeon3.asm +++ b/scripts/unknowndungeon3.asm @@ -30,14 +30,14 @@ UnknownDungeon3TrainerHeader0: ; 45f0f (11:5f0f) db $ff UnknownDungeon3Text1: ; 45f1c (11:5f1c) - db $08 ; asm + TX_ASM ld hl, UnknownDungeon3TrainerHeader0 call TalkToTrainer jp TextScriptEnd UnknownDungeon3MewtwoText: ; 45f26 (11:5f26) TX_FAR _UnknownDungeon3MewtwoText - db $8 + TX_ASM ld a, MEWTWO call PlayCry call WaitForSoundToFinish diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index e11a5846..9fd05776 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -135,7 +135,7 @@ VermilionCityText1: ; 19889 (6:5889) db "@" VermilionCityText2: ; 1988e (6:588e) - db $08 ; asm + TX_ASM ld a, [wd803] bit 2, a jr nz, .asm_1989e @@ -157,7 +157,7 @@ VermilionCityText_198ac: ; 198ac (6:58ac) db "@" VermilionCityText3: ; 198b1 (6:58b1) - db $08 ; asm + TX_ASM ld a, [wd803] bit 2, a jr nz, .asm_198f6 @@ -225,7 +225,7 @@ VermilionCityText4: ; 1991d (6:591d) VermilionCityText5: ; 19922 (6:5922) TX_FAR _VermilionCityText5 - db $08 ; asm + TX_ASM ld a, MACHOP call PlayCry call WaitForSoundToFinish diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index 8c136314..81bd1588 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -135,7 +135,7 @@ VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) db $ff VermilionGymText1: ; 5cb1d (17:4b1d) - db $08 ; asm + TX_ASM ld a, [wd773] bit 7, a jr z, .asm_5cb39 @@ -198,7 +198,7 @@ ReceivedThunderbadgeText: ; 5cb8b (17:4b8b) db "@" VermilionGymText2: ; 5cb90 (17:4b90) - db $08 ; asm + TX_ASM ld hl, VermilionGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -216,7 +216,7 @@ VermilionGymAfterBattleText1: ; 5cba4 (17:4ba4) db "@" VermilionGymText3: ; 5cba9 (17:4ba9) - db $08 ; asm + TX_ASM ld hl, VermilionGymTrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -234,7 +234,7 @@ VermilionGymAfterBattleText2: ; 5cbbd (17:4bbd) db "@" VermilionGymText4: ; 5cbc2 (17:4bc2) - db $08 ; asm + TX_ASM ld hl, VermilionGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -252,7 +252,7 @@ VermilionGymAfterBattleText3: ; 5cbd6 (17:4bd6) db "@" VermilionGymText5: ; 5cbdb (17:4bdb) - db $08 ; asm + TX_ASM ld a, [wd72a] bit 2, a jr nz, .asm_5cbeb diff --git a/scripts/vermilionhouse1.asm b/scripts/vermilionhouse1.asm index 4ead1af7..bfb3da5f 100755 --- a/scripts/vermilionhouse1.asm +++ b/scripts/vermilionhouse1.asm @@ -13,7 +13,7 @@ VermilionHouse1Text1: ; 1db06 (7:5b06) VermilionHouse1Text2: ; 1db0b (7:5b0b) TX_FAR _VermilionHouse1Text2 - db $08 ; asm + TX_ASM ld a, PIDGEY call PlayCry call WaitForSoundToFinish diff --git a/scripts/vermilionhouse2.asm b/scripts/vermilionhouse2.asm index 7fc5fbfc..775c32bb 100755 --- a/scripts/vermilionhouse2.asm +++ b/scripts/vermilionhouse2.asm @@ -5,7 +5,7 @@ VermilionHouse2TextPointers: ; 56073 (15:6073) dw VermilionHouse2Text1 VermilionHouse2Text1: ; 56075 (15:6075) - db $08 ; asm + TX_ASM ld a, [wd728] bit 3, a jr nz, .asm_03ef5 diff --git a/scripts/vermilionhouse3.asm b/scripts/vermilionhouse3.asm index 08e2e395..478979da 100755 --- a/scripts/vermilionhouse3.asm +++ b/scripts/vermilionhouse3.asm @@ -5,7 +5,7 @@ VermilionHouse3TextPointers: ; 19c15 (6:5c15) dw VermilionHouse3Text1 VermilionHouse3Text1: ; 19c17 (6:5c17) - db $08 ; asm + TX_ASM ld a, $4 ld [wWhichTrade], a predef DoInGameTradeDialogue diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index fccdf208..68a3502f 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -71,13 +71,13 @@ VictoryRoad1TrainerHeader1: ; 5da79 (17:5a79) db $ff VictoryRoad1Text1: ; 5da86 (17:5a86) - db $08 ; asm + TX_ASM ld hl, VictoryRoad1TrainerHeader0 call TalkToTrainer jp TextScriptEnd VictoryRoad1Text2: ; 5da90 (17:5a90) - db $08 ; asm + TX_ASM ld hl, VictoryRoad1TrainerHeader1 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index 45196f74..1fc2af7e 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -143,44 +143,44 @@ VictoryRoad2TrainerHeader6: ; 51871 (14:5871) db $ff VictoryRoad2Text1: ; 5187e (14:587e) - db $08 ; asm + TX_ASM ld hl, VictoryRoad2TrainerHeader0 call TalkToTrainer jp TextScriptEnd VictoryRoad2Text2: ; 51888 (14:5888) - db $08 ; asm + TX_ASM ld hl, VictoryRoad2TrainerHeader2 call TalkToTrainer jp TextScriptEnd VictoryRoad2Text3: ; 51892 (14:5892) - db $08 ; asm + TX_ASM ld hl, VictoryRoad2TrainerHeader3 call TalkToTrainer jp TextScriptEnd VictoryRoad2Text4: ; 5189c (14:589c) - db $08 ; asm + TX_ASM ld hl, VictoryRoad2TrainerHeader4 call TalkToTrainer jp TextScriptEnd VictoryRoad2Text5: ; 518a6 (14:58a6) - db $08 ; asm + TX_ASM ld hl, VictoryRoad2TrainerHeader5 call TalkToTrainer jp TextScriptEnd VictoryRoad2Text6: ; 518b0 (14:58b0) - db $08 ; asm + TX_ASM ld hl, VictoryRoad2TrainerHeader6 call TalkToTrainer jp TextScriptEnd VictoryRoad2BattleText6: ; 518ba (14:58ba) TX_FAR _VictoryRoad2BattleText6 - db $8 + TX_ASM ld a, MOLTRES call PlayCry call WaitForSoundToFinish diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index 43767f48..20b3df85 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -130,25 +130,25 @@ VictoryRoad3TrainerHeader4: ; 44a5c (11:4a5c) db $ff VictoryRoad3Text1: ; 44a69 (11:4a69) - db $08 ; asm + TX_ASM ld hl, VictoryRoad3TrainerHeader0 call TalkToTrainer jp TextScriptEnd VictoryRoad3Text2: ; 44a73 (11:4a73) - db $08 ; asm + TX_ASM ld hl, VictoryRoad3TrainerHeader2 call TalkToTrainer jp TextScriptEnd VictoryRoad3Text3: ; 44a7d (11:4a7d) - db $08 ; asm + TX_ASM ld hl, VictoryRoad3TrainerHeader3 call TalkToTrainer jp TextScriptEnd VictoryRoad3Text4: ; 44a87 (11:4a87) - db $08 ; asm + TX_ASM ld hl, VictoryRoad3TrainerHeader4 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index 90212f4a..ac7afb7c 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -149,7 +149,7 @@ ViridianCityText1: ; 19102 (6:5102) db "@" ViridianCityText2: ; 19107 (6:5107) - db $08 ; asm + TX_ASM ld a, [W_OBTAINEDBADGES] cp %01111111 ld hl, ViridianCityText_19127 @@ -171,7 +171,7 @@ ViridianCityText_19127: ; 19127 (6:5127) db "@" ViridianCityText3: ; 1912c (6:512c) - db $08 ; asm + TX_ASM ld hl, ViridianCityText_1914d call PrintText call YesNoChoice @@ -200,7 +200,7 @@ ViridianCityText_19157: ; 19157 (6:5157) db "@" ViridianCityText4: ; 1915c (6:515c) - db $08 ; asm + TX_ASM ld a, [wd74b] bit 5, a jr nz, .asm_83894 @@ -222,7 +222,7 @@ ViridianCityText_1917a: ; 1917a (6:517a) db "@" ViridianCityText5: ; 1917f (6:517f) - db $08 ; asm + TX_ASM ld hl, ViridianCityText_19191 call PrintText call ViridianCityScript_190cf @@ -235,7 +235,7 @@ ViridianCityText_19191: ; 19191 (6:5191) db "@" ViridianCityText6: ; 19196 (6:5196) - db $08 ; asm + TX_ASM ld a, [wd74c] bit 1, a jr nz, .asm_4e5a0 @@ -276,7 +276,7 @@ TM42NoRoomText: ; 191da (6:51da) db "@" ViridianCityText7: ; 191df (6:51df) - db $08 ; asm + TX_ASM ld hl, ViridianCityText_1920a call PrintText ld c, 2 diff --git a/scripts/viridianforest.asm b/scripts/viridianforest.asm index e0feb75f..124d3184 100755 --- a/scripts/viridianforest.asm +++ b/scripts/viridianforest.asm @@ -63,19 +63,19 @@ ViridianForestText1: ; 61167 (18:5167) db "@" ViridianForestText2: ; 6116c (18:516c) - db $08 ; asm + TX_ASM ld hl, ViridianForestTrainerHeader0 call TalkToTrainer jp TextScriptEnd ViridianForestText3: ; 61176 (18:5176) - db $08 ; asm + TX_ASM ld hl, ViridianForestTrainerHeader1 call TalkToTrainer jp TextScriptEnd ViridianForestText4: ; 61180 (18:5180) - db $08 ; asm + TX_ASM ld hl, ViridianForestTrainerHeader2 call TalkToTrainer jp TextScriptEnd diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index a05cff93..da797e87 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -275,7 +275,7 @@ ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) db $ff ViridianGymText1: ; 74a69 (1d:4a69) - db $08 ; asm + TX_ASM ld a, [wd751] bit 1, a jr z, .asm_6de66 @@ -346,7 +346,7 @@ ViridianGymText14: ; 74aee (1d:4aee) db "@" ViridianGymText2: ; 74af3 (1d:4af3) - db $08 ; asm + TX_ASM ld hl, ViridianGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -364,7 +364,7 @@ ViridianGymAfterBattleText1: ; 74b07 (1d:4b07) db "@" ViridianGymText3: ; 74b0c (1d:4b0c) - db $08 ; asm + TX_ASM ld hl, ViridianGymTrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -382,7 +382,7 @@ ViridianGymAfterBattleText2: ; 74b20 (1d:4b20) db "@" ViridianGymText4: ; 74b25 (1d:4b25) - db $08 ; asm + TX_ASM ld hl, ViridianGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd @@ -400,7 +400,7 @@ ViridianGymAfterBattleText3: ; 74b39 (1d:4b39) db "@" ViridianGymText5: ; 74b3e (1d:4b3e) - db $08 ; asm + TX_ASM ld hl, ViridianGymTrainerHeader3 call TalkToTrainer jp TextScriptEnd @@ -418,7 +418,7 @@ ViridianGymAfterBattleText4: ; 74b52 (1d:4b52) db "@" ViridianGymText6: ; 74b57 (1d:4b57) - db $08 ; asm + TX_ASM ld hl, ViridianGymTrainerHeader4 call TalkToTrainer jp TextScriptEnd @@ -436,7 +436,7 @@ ViridianGymAfterBattleText5: ; 74b6b (1d:4b6b) db "@" ViridianGymText7: ; 74b70 (1d:4b70) - db $08 ; asm + TX_ASM ld hl, ViridianGymTrainerHeader5 call TalkToTrainer jp TextScriptEnd @@ -454,7 +454,7 @@ ViridianGymAfterBattleText6: ; 74b84 (1d:4b84) db "@" ViridianGymText8: ; 74b89 (1d:4b89) - db $08 ; asm + TX_ASM ld hl, ViridianGymTrainerHeader6 call TalkToTrainer jp TextScriptEnd @@ -472,7 +472,7 @@ ViridianGymAfterBattleText7: ; 74b9d (1d:4b9d) db "@" ViridianGymText9: ; 74ba2 (1d:4ba2) - db $08 ; asm + TX_ASM ld hl, ViridianGymTrainerHeader7 call TalkToTrainer jp TextScriptEnd @@ -490,7 +490,7 @@ ViridianGymAfterBattleText8: ; 74bb6 (1d:4bb6) db "@" ViridianGymText10: ; 74bbb (1d:4bbb) - db $08 ; asm + TX_ASM ld a, [wd751] bit 1, a jr nz, .asm_1abd1 diff --git a/scripts/viridianhouse.asm b/scripts/viridianhouse.asm index ab8b6786..61920489 100755 --- a/scripts/viridianhouse.asm +++ b/scripts/viridianhouse.asm @@ -16,7 +16,7 @@ ViridianHouseText2: ; 1d59a (7:559a) db "@" ViridianHouseText3: ; 1d59f (7:559f) - db $08 ; asm + TX_ASM ld hl, ViridianHouseText_1d5b1 call PrintText ld a, SPEAROW -- cgit v1.3.1-sl0p From fc9af362ae65d24c66b39ea7759637cc9c1f9b0a Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 18 Jul 2015 08:17:29 -0700 Subject: fix variable naming --- engine/battle/animations.asm | 2 +- engine/battle/core.asm | 28 +++---- engine/battle/wild_encounters.asm | 2 +- engine/items/items.asm | 4 +- engine/items/tm_prices.asm | 9 +-- engine/menu/pokedex.asm | 22 +++--- engine/menu/prize_menu.asm | 4 +- engine/menu/start_sub_menus.asm | 2 +- engine/oak_speech.asm | 47 ++++++------ engine/oak_speech2.asm | 140 ++++++++++++++++++---------------- engine/overworld/item.asm | 6 +- engine/overworld/map_sprites.asm | 16 ++-- engine/predefs.asm | 4 +- home.asm | 36 ++++----- home/copy2.asm | 22 +++--- home/overworld.asm | 154 +++++++++++++++++++------------------- hram.asm | 55 ++++++++++++-- macros.asm | 6 +- main.asm | 16 ++-- scripts/agatha.asm | 4 +- scripts/billshouse.asm | 6 +- scripts/bruno.asm | 4 +- scripts/celadongamecorner.asm | 6 +- scripts/celadongym.asm | 6 +- scripts/ceruleancity.asm | 24 +++--- scripts/ceruleangym.asm | 6 +- scripts/cinnabargym.asm | 14 ++-- scripts/cinnabarisland.asm | 2 +- scripts/fightingdojo.asm | 14 ++-- scripts/fuchsiagym.asm | 6 +- scripts/fuchsiahouse2.asm | 2 +- scripts/gary.asm | 42 +++++------ scripts/halloffameroom.asm | 8 +- scripts/lance.asm | 4 +- scripts/lorelei.asm | 4 +- scripts/mansion1.asm | 6 +- scripts/mansion2.asm | 4 +- scripts/mansion3.asm | 6 +- scripts/mansion4.asm | 12 +-- scripts/mtmoon1.asm | 12 +-- scripts/mtmoon3.asm | 12 +-- scripts/museum1f.asm | 14 ++-- scripts/oakslab.asm | 68 ++++++++--------- scripts/pallettown.asm | 2 +- scripts/pewtercity.asm | 20 ++--- scripts/pewtergym.asm | 6 +- scripts/pokemontower2.asm | 12 +-- scripts/pokemontower3.asm | 2 +- scripts/pokemontower4.asm | 6 +- scripts/pokemontower5.asm | 4 +- scripts/pokemontower6.asm | 8 +- scripts/pokemontower7.asm | 6 +- scripts/powerplant.asm | 10 +-- scripts/rockethideout1.asm | 4 +- scripts/rockethideout2.asm | 8 +- scripts/rockethideout3.asm | 4 +- scripts/rockethideout4.asm | 12 +-- scripts/route12.asm | 8 +- scripts/route15.asm | 2 +- scripts/route16.asm | 4 +- scripts/route16gate.asm | 8 +- scripts/route18gate.asm | 10 +-- scripts/route2.asm | 4 +- scripts/route22.asm | 50 ++++++------- scripts/route22gate.asm | 2 +- scripts/route23.asm | 20 ++--- scripts/route24.asm | 8 +- scripts/route25.asm | 2 +- scripts/route4.asm | 2 +- scripts/route5gate.asm | 4 +- scripts/route6gate.asm | 4 +- scripts/route7gate.asm | 4 +- scripts/route8gate.asm | 4 +- scripts/route9.asm | 2 +- scripts/safarizonecenter.asm | 2 +- scripts/safarizoneeast.asm | 8 +- scripts/safarizoneentrance.asm | 8 +- scripts/safarizonenorth.asm | 4 +- scripts/safarizonewest.asm | 8 +- scripts/saffrongym.asm | 6 +- scripts/silphco10.asm | 6 +- scripts/silphco11.asm | 24 +++--- scripts/silphco3.asm | 2 +- scripts/silphco4.asm | 6 +- scripts/silphco5.asm | 6 +- scripts/silphco6.asm | 4 +- scripts/silphco7.asm | 24 +++--- scripts/ssanne10.asm | 6 +- scripts/ssanne2.asm | 18 ++--- scripts/ssanne8.asm | 2 +- scripts/ssanne9.asm | 4 +- scripts/tradecenter.asm | 12 +-- scripts/unknowndungeon1.asm | 6 +- scripts/unknowndungeon2.asm | 6 +- scripts/unknowndungeon3.asm | 4 +- scripts/vermilioncity.asm | 2 +- scripts/vermiliongym.asm | 6 +- scripts/victoryroad1.asm | 4 +- scripts/victoryroad2.asm | 8 +- scripts/victoryroad3.asm | 4 +- scripts/viridiancity.asm | 6 +- scripts/viridianforest.asm | 6 +- scripts/viridiangym.asm | 8 +- scripts/viridianmart.asm | 4 +- text.asm | 2 +- wram.asm | 125 +++++++++++++++++++++---------- 106 files changed, 773 insertions(+), 671 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 63ea170d..7764603d 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -163,7 +163,7 @@ DrawFrameBlock: ; 78000 (1e:4000) PlayAnimation: ; 780f1 (1e:40f1) xor a - ld [$FF8B],a + ld [$FF8B],a ; it looks like nothing reads this ld [W_SUBANIMTRANSFORM],a ld a,[W_ANIMATIONID] ; get animation number dec a diff --git a/engine/battle/core.asm b/engine/battle/core.asm index bdb20bb0..2f407290 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1310,7 +1310,7 @@ SevenSpacesText: ; 3c8d7 (f:48d7) ; if a is 8, the slide is to the right, else it is to the left ; bug: when this is called, [H_AUTOBGTRANSFERENABLED] is non-zero, so there is screen tearing SlideTrainerPicOffScreen: ; 3c8df (f:48df) - ld [$FF8B], a + ld [hSlideAmount], a ld c, a .slideStepLoop ; each iteration, the trainer pic is slid one tile left/right push bc @@ -1318,10 +1318,10 @@ SlideTrainerPicOffScreen: ; 3c8df (f:48df) ld b, 7 ; number of rows .rowLoop push hl - ld a, [$FF8B] + ld a, [hSlideAmount] ld c, a .columnLoop - ld a, [$FF8B] + ld a, [hSlideAmount] cp 8 jr z, .slideRight .slideLeft ; slide player sprite off screen @@ -1590,14 +1590,14 @@ TryRunningFromBattle: ; 3cab9 (f:4ab9) ld a, [hl] ld [H_MULTIPLICAND + 2], a ld a, [de] - ld [$ff8d], a + ld [hEnemySpeed], a inc de ld a, [de] - ld [$ff8e], a + ld [hEnemySpeed + 1], a call LoadScreenTilesFromBuffer1 ld de, H_MULTIPLICAND + 1 - ld hl, $ff8d - ld c, $2 + ld hl, hEnemySpeed + ld c, 2 call StringCmp jr nc, .canEscape ; jump if player speed greater than enemy speed xor a @@ -1609,9 +1609,9 @@ TryRunningFromBattle: ; 3cab9 (f:4ab9) ld [H_DIVIDEND], a ld a, [H_PRODUCT + 3] ld [H_DIVIDEND + 1], a - ld a, [$ff8d] + ld a, [hEnemySpeed] ld b, a - ld a, [$ff8e] + ld a, [hEnemySpeed + 1] ; divide enemy speed by 4 srl b rr a @@ -6411,7 +6411,7 @@ LoadPlayerBackPic: ; 3ec92 (f:6c92) predef ScaleSpriteByTwo ld hl, wOAMBuffer xor a - ld [$FF8B], a ; initial tile number + ld [hOAMTile], a ; initial tile number ld b, $7 ; 7 columns ld e, $a0 ; X for the left-most column .loop ; each loop iteration writes 3 OAM entries in a vertical column @@ -6425,16 +6425,16 @@ LoadPlayerBackPic: ; 3ec92 (f:6c92) add d ; increase Y by height of tile ld d, a inc hl - ld a, [$FF8B] + ld a, [hOAMTile] ld [hli], a ; OAM tile number inc a ; increment tile number - ld [$FF8B], a + ld [hOAMTile], a inc hl dec c jr nz, .innerLoop - ld a, [$FF8B] + ld a, [hOAMTile] add $4 ; increase tile number by 4 - ld [$FF8B], a + ld [hOAMTile], a ld a, $8 ; width of tile add e ; increase X by width of tile ld e, a diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 87512583..03dc6fb6 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -89,7 +89,7 @@ TryDoWildEncounter: ; 13870 (4:7870) jr .willEncounter .lastRepelStep ld [wRepelRemainingSteps], a - ld a, $d2 + ld a, 210 ld [H_DOWNARROWBLINKCNT2], a call EnableAutoTextBoxDrawing call DisplayTextID diff --git a/engine/items/items.asm b/engine/items/items.asm index b65e8f1e..7617ba6c 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -556,11 +556,11 @@ ItemUseSurfboard: ; d9b4 (3:59b4) jp PrintText .tryToStopSurfing xor a - ld [$ff8c],a + ld [hSpriteIndexOrTextID],a ld d,16 ; talking range in pixels (normal range) call IsSpriteInFrontOfPlayer2 res 7,[hl] - ld a,[$ff8c] + ld a,[hSpriteIndexOrTextID] and a ; is there a sprite in the way? jr nz,.cannotStopSurfing ld hl,TilePairCollisionsWater diff --git a/engine/items/tm_prices.asm b/engine/items/tm_prices.asm index 4decc82d..6bb7f711 100755 --- a/engine/items/tm_prices.asm +++ b/engine/items/tm_prices.asm @@ -1,7 +1,6 @@ GetMachinePrice: ; 7bf86 (1e:7f86) ; Input: [wcf91] = Item Id of a TM -; Output: Stores the 2-byte TM price in [H_DOWNARROWBLINKCNT1] and [H_DOWNARROWBLINKCNT2] -; as a BCD +; Output: Stores the TM price at hItemPrice ld a, [wcf91] ; a contains TM item id sub TM_01 ret c @@ -17,10 +16,10 @@ GetMachinePrice: ; 7bf86 (1e:7f86) swap a .highNybbleIsPrice and $f0 - ld [H_DOWNARROWBLINKCNT2], a + ld [hItemPrice + 1], a xor a - ld [H_DOWNARROWBLINKCNT1], a - ld [$ff8d], a + ld [hItemPrice], a + ld [hItemPrice + 2], a ret INCLUDE "data/tm_prices.asm" diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index 56543c91..80eedecd 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -512,25 +512,25 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) inc de inc de ; de = address of upper byte of weight push de -; put weight in big-endian order at $ff8b - ld hl,$ff8b - ld a,[hl] ; save existing value of [$ff8b] +; put weight in big-endian order at hDexWeight + ld hl,hDexWeight + ld a,[hl] ; save existing value of [hDexWeight] push af ld a,[de] ; a = upper byte of weight - ld [hli],a ; store upper byte of weight in [$ff8b] - ld a,[hl] ; save existing value of [$ff8c] + ld [hli],a ; store upper byte of weight in [hDexWeight] + ld a,[hl] ; save existing value of [hDexWeight + 1] push af dec de ld a,[de] ; a = lower byte of weight - ld [hl],a ; store lower byte of weight in [$ff8c] - ld de,$ff8b + ld [hl],a ; store lower byte of weight in [hDexWeight + 1] + ld de,hDexWeight hlCoord 11, 8 ld bc,$0205 ; no leading zeroes, right-aligned, 2 bytes, 5 digits call PrintNumber ; print weight hlCoord 14, 8 - ld a,[$ff8c] + ld a,[hDexWeight + 1] sub a,10 - ld a,[$ff8b] + ld a,[hDexWeight] sbc a,0 jr nc,.next ld [hl],"0" ; if the weight is less than 10, put a 0 before the decimal point @@ -540,9 +540,9 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) ld [hld],a ; make space for the decimal point by moving the last digit forward one tile ld [hl],$f2 ; decimal point tile pop af - ld [$ff8c],a ; restore original value of [$ff8c] + ld [hDexWeight + 1],a ; restore original value of [hDexWeight + 1] pop af - ld [$ff8b],a ; restore original value of [$ff8b] + ld [hDexWeight],a ; restore original value of [hDexWeight] pop hl inc hl ; hl = address of pokedex description text bcCoord 1, 11 diff --git a/engine/menu/prize_menu.asm b/engine/menu/prize_menu.asm index fff8e4c4..f7206a7f 100755 --- a/engine/menu/prize_menu.asm +++ b/engine/menu/prize_menu.asm @@ -58,13 +58,13 @@ WhichPrizeTextPtr: ; 52789 (14:6789) GetPrizeMenuId: ; 5278e (14:678e) ; determine which one among the three ; prize-texts has been selected -; using the text ID (stored in [$FF8C]) +; using the text ID (stored in [hSpriteIndexOrTextID]) ; load the three prizes at wd13d-wd13f ; load the three prices at wd141-wd146 ; display the three prizes' names ; (distinguishing between Pokemon names ; and Items (specifically TMs) names) - ld a,[$FF8C] + ld a,[hSpriteIndexOrTextID] sub a,$03 ; prize-texts' id are 3, 4 and 5 ld [wd12f],a ; prize-texts' id (relative, i.e. 0, 1 or 2) add a diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index 11b7fa90..2804ef7b 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -524,7 +524,7 @@ StartMenu_TrainerInfo: ; 13460 (4:7460) DrawTrainerInfo: ; 1349a (4:749a) ld de,RedPicFront ld bc,(BANK(RedPicFront) << 8) | $01 - predef Predef3B + predef DisplayPicCenteredOrUpperRight call DisableLCD hlCoord 0, 2 ld a," " diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm index df092d4c..bd7f672e 100755 --- a/engine/oak_speech.asm +++ b/engine/oak_speech.asm @@ -34,9 +34,9 @@ SetDefaultNames: ; 60ca (1:60ca) OakSpeech: ; 6115 (1:6115) ld a,$FF call PlaySound ; stop music - ld a, BANK(Music_Routes2) ; bank of song + ld a, BANK(Music_Routes2) ld c,a - ld a, MUSIC_ROUTES2 ; song # + ld a, MUSIC_ROUTES2 call PlayMusic call ClearScreen call LoadTextBoxTilePatterns @@ -54,50 +54,49 @@ OakSpeech: ; 6115 (1:6115) xor a ld [hTilesetType],a ld a,[wd732] - bit 1,a ; XXX when is bit 1 set? - jp nz,Func_61bc ; easter egg: skip the intro + bit 1,a ; possibly a debug mode bit + jp nz,.skipChoosingNames ld de,ProfOakPic ld bc, (Bank(ProfOakPic) << 8) | $00 - call IntroPredef3B ; displays Oak pic? + call IntroDisplayPicCenteredOrUpperRight call FadeInIntroPic ld hl,OakSpeechText1 - call PrintText ; prints text box + call PrintText call GBFadeOutToWhite call ClearScreen ld a,NIDORINO - ld [wd0b5],a ; pic displayed is stored at this location + ld [wd0b5],a ld [wcf91],a - call GetMonHeader ; this is also related to the pic - hlCoord 6, 4 ; position on tilemap the pic is displayed - call LoadFlippedFrontSpriteByMonIndex ; displays pic? + call GetMonHeader + hlCoord 6, 4 + call LoadFlippedFrontSpriteByMonIndex call MovePicLeft ld hl,OakSpeechText2 - call PrintText ; Prints text box + call PrintText call GBFadeOutToWhite call ClearScreen ld de,RedPicFront ld bc,(Bank(RedPicFront) << 8) | $00 - call IntroPredef3B ; displays player pic? + call IntroDisplayPicCenteredOrUpperRight call MovePicLeft ld hl,IntroducePlayerText call PrintText - call LoadDefaultNamesPlayer ; brings up NewName/Red/etc menu + call ChoosePlayerName call GBFadeOutToWhite call ClearScreen ld de,Rival1Pic ld bc,(Bank(Rival1Pic) << 8) | $00 - call IntroPredef3B ; displays rival pic + call IntroDisplayPicCenteredOrUpperRight call FadeInIntroPic ld hl,IntroduceRivalText call PrintText - call LoadDefaultNamesRival - -Func_61bc: ; 61bc (1:61bc) + call ChooseRivalName +.skipChoosingNames call GBFadeOutToWhite call ClearScreen ld de,RedPicFront ld bc,(Bank(RedPicFront) << 8) | $00 - call IntroPredef3B + call IntroDisplayPicCenteredOrUpperRight call GBFadeInFromWhite ld a,[wd72d] and a @@ -120,12 +119,12 @@ Func_61bc: ; 61bc (1:61bc) call CopyVideoData ld de,ShrinkPic1 ld bc,(BANK(ShrinkPic1) << 8) | $00 - call IntroPredef3B + call IntroDisplayPicCenteredOrUpperRight ld c,4 call DelayFrames ld de,ShrinkPic2 ld bc,(BANK(ShrinkPic2) << 8) | $00 - call IntroPredef3B + call IntroDisplayPicCenteredOrUpperRight call ResetPlayerSpriteData ld a,[H_LOADEDROMBANK] push af @@ -207,10 +206,12 @@ MovePicLeft: ; 6288 (1:6288) ld [rWX],a jr .next -Predef3B: ; 62a1 (1:62a1) +DisplayPicCenteredOrUpperRight: ; 62a1 (1:62a1) call GetPredefRegisters -IntroPredef3B: ; 62a4 (1:62a4) -; bank of sprite given in b +IntroDisplayPicCenteredOrUpperRight: ; 62a4 (1:62a4) +; b = bank +; de = address of compressed pic +; c: 0 = centred, non-zero = upper-right push bc ld a,b call UncompressSpriteFromDE diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm index b27a6987..f881b43b 100755 --- a/engine/oak_speech2.asm +++ b/engine/oak_speech2.asm @@ -1,29 +1,29 @@ -LoadDefaultNamesPlayer: ; 695d (1:695d) - call Func_6a12 +ChoosePlayerName: ; 695d (1:695d) + call OakSpeechSlidePicRight ld de, DefaultNamesPlayer call DisplayIntroNameTextBox ld a, [wCurrentMenuItem] and a - jr z, .asm_697a + jr z, .customName ld hl, DefaultNamesPlayerList - call Func_6ad6 + call GetDefaultName ld de, wPlayerName - call Func_69ec - jr .asm_6999 -.asm_697a + call OakSpeechSlidePicLeft + jr .done +.customName ld hl, wPlayerName xor a ; NAME_PLAYER_SCREEN ld [wNamingScreenType], a call DisplayNamingScreen ld a, [wcf4b] - cp $50 - jr z, .asm_697a + cp "@" + jr z, .customName call ClearScreen call Delay3 ld de, RedPicFront ld b, BANK(RedPicFront) - call IntroPredef3B -.asm_6999 + call IntroDisplayPicCenteredOrUpperRight +.done ld hl, YourNameIsText jp PrintText @@ -31,32 +31,32 @@ YourNameIsText: ; 699f (1:699f) TX_FAR _YourNameIsText db "@" -LoadDefaultNamesRival: ; 69a4 (1:69a4) - call Func_6a12 +ChooseRivalName: ; 69a4 (1:69a4) + call OakSpeechSlidePicRight ld de, DefaultNamesRival call DisplayIntroNameTextBox ld a, [wCurrentMenuItem] and a - jr z, .asm_69c1 + jr z, .customName ld hl, DefaultNamesRivalList - call Func_6ad6 + call GetDefaultName ld de, W_RIVALNAME - call Func_69ec - jr .asm_69e1 -.asm_69c1 + call OakSpeechSlidePicLeft + jr .done +.customName ld hl, W_RIVALNAME ld a, NAME_RIVAL_SCREEN ld [wNamingScreenType], a call DisplayNamingScreen ld a, [wcf4b] - cp $50 - jr z, .asm_69c1 + cp "@" + jr z, .customName call ClearScreen call Delay3 ld de, Rival1Pic ld b, $13 - call IntroPredef3B -.asm_69e1 + call IntroDisplayPicCenteredOrUpperRight +.done ld hl, HisNameIsText jp PrintText @@ -64,11 +64,11 @@ HisNameIsText: ; 69e7 (1:69e7) TX_FAR _HisNameIsText db "@" -Func_69ec: ; 69ec (1:69ec) +OakSpeechSlidePicLeft: ; 69ec (1:69ec) push de hlCoord 0, 0 - ld bc, $c0b - call ClearScreenArea + lb bc, 12, 11 + call ClearScreenArea ; clear the name list text box ld c, 10 call DelayFrames pop de @@ -77,77 +77,83 @@ Func_69ec: ; 69ec (1:69ec) call CopyData call Delay3 hlCoord 12, 4 - ld de, $67d + lb de, 6, 6 * SCREEN_WIDTH + 5 ld a, $ff - jr asm_6a19 + jr OakSpeechSlidePicCommon -Func_6a12: ; 6a12 (1:6a12) +OakSpeechSlidePicRight: ; 6a12 (1:6a12) hlCoord 5, 4 - ld de, $67d + lb de, 6, 6 * SCREEN_WIDTH + 5 xor a -asm_6a19: ; 6a19 (1:6a19) + +OakSpeechSlidePicCommon: ; 6a19 (1:6a19) push hl push de push bc - ld [$ff8d], a + ld [hSlideDirection], a ld a, d - ld [H_DOWNARROWBLINKCNT1], a + ld [hSlideAmount], a ld a, e - ld [H_DOWNARROWBLINKCNT2], a + ld [hSlidingRegionSize], a ld c, a - ld a, [$ff8d] + ld a, [hSlideDirection] and a - jr nz, .asm_6a2d - ld d, $0 + jr nz, .next +; If sliding right, point hl to the end of the pic's tiles. + ld d, 0 add hl, de -.asm_6a2d +.next ld d, h ld e, l -.asm_6a2f +.loop xor a ld [H_AUTOBGTRANSFERENABLED], a - ld a, [$ff8d] + ld a, [hSlideDirection] and a - jr nz, .asm_6a3c + jr nz, .slideLeft +; sliding right ld a, [hli] ld [hld], a dec hl - jr .asm_6a3f -.asm_6a3c + jr .next2 +.slideLeft ld a, [hld] ld [hli], a inc hl -.asm_6a3f +.next2 dec c - jr nz, .asm_6a2f - ld a, [$ff8d] + jr nz, .loop + ld a, [hSlideDirection] and a - jr z, .asm_6a4a + jr z, .next3 +; If sliding left, we need to zero the last tile in the pic (there is no need +; to take a corresponding action when sliding right because hl initially points +; to a 0 tile in that case). xor a dec hl ld [hl], a -.asm_6a4a - ld a, $1 +.next3 + ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 - ld a, [H_DOWNARROWBLINKCNT2] + ld a, [hSlidingRegionSize] ld c, a ld h, d ld l, e - ld a, [$ff8d] + ld a, [hSlideDirection] and a - jr nz, .asm_6a5e + jr nz, .slideLeft2 inc hl - jr .asm_6a5f -.asm_6a5e + jr .next4 +.slideLeft2 dec hl -.asm_6a5f +.next4 ld d, h ld e, l - ld a, [H_DOWNARROWBLINKCNT1] + ld a, [hSlideAmount] dec a - ld [H_DOWNARROWBLINKCNT1], a - jr nz, .asm_6a2f + ld [hSlideAmount], a + jr nz, .loop pop bc pop de pop hl @@ -229,22 +235,24 @@ DefaultNamesRival: db "@" ENDC -Func_6ad6: ; 6ad6 (1:6ad6) +GetDefaultName: ; 6ad6 (1:6ad6) +; a = name index +; hl = name list ld b, a - ld c, $0 -.asm_6ad9 + ld c, 0 +.loop ld d, h ld e, l -.asm_6adb +.innerLoop ld a, [hli] - cp $50 - jr nz, .asm_6adb + cp "@" + jr nz, .innerLoop ld a, b cp c - jr z, .asm_6ae7 + jr z, .foundName inc c - jr .asm_6ad9 -.asm_6ae7 + jr .loop +.foundName ld h, d ld l, e ld de, wcd6d diff --git a/engine/overworld/item.asm b/engine/overworld/item.asm index b00405bf..eb6d743a 100644 --- a/engine/overworld/item.asm +++ b/engine/overworld/item.asm @@ -1,7 +1,7 @@ -PickupItem: +PickUpItem: call EnableAutoTextBoxDrawing - ld a, [H_DOWNARROWBLINKCNT2] + ld a, [hSpriteIndexOrTextID] ld b, a ld hl, W_MISSABLEOBJECTLIST .missableObjectsListLoop @@ -18,7 +18,7 @@ PickupItem: ld [$ffdb], a ld hl, W_MAPSPRITEEXTRADATA - ld a, [H_DOWNARROWBLINKCNT2] + ld a, [hSpriteIndexOrTextID] dec a add a ld d, 0 diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index df39d112..33411dfc 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -39,7 +39,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) ld b,$10 ; number of sprite slots ld hl,wSpriteStateData2 + $0d xor a - ld [$ff8e],a ; 4-tile sprite counter + ld [hFourTileSpriteCount],a .copyPictureIDLoop ; loop to copy picture ID from $C2XD to $C2XE ld a,[hli] ; $C2XD (sprite picture ID) ld [hld],a ; $C2XE @@ -98,14 +98,14 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) cp a,SPRITE_BALL ; is it a 4-tile sprite? jr c,.notFourTileSprite pop af - ld a,[$ff8e] ; 4-tile sprite counter + ld a,[hFourTileSpriteCount] add a,11 jr .storeVRAMSlot .notFourTileSprite pop af .storeVRAMSlot ld [hl],a ; store VRAM slot at $C2XE - ld [$ff8d],a ; used to determine if it's 4-tile sprite later + ld [hVRAMSlot],a ; used to determine if it's 4-tile sprite later ld a,b ; a = current sprite picture ID dec a add a @@ -128,7 +128,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) push bc ld hl,vNPCSprites ; VRAM base address ld bc,$c0 ; number of bytes per VRAM slot - ld a,[$ff8d] + ld a,[hVRAMSlot] cp a,11 ; is it a 4-tile sprite? jr nc,.fourTileSpriteVRAMAddr ld d,a @@ -142,13 +142,13 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) jr .loadStillTilePattern .fourTileSpriteVRAMAddr ld hl,vSprites + $7c0 ; address for second 4-tile sprite - ld a,[$ff8e] ; 4-tile sprite counter - and a ; is it the first 4-tile sprite? + ld a,[hFourTileSpriteCount] + and a jr nz,.loadStillTilePattern ; if it's the first 4-tile sprite ld hl,vSprites + $780 ; address for first 4-tile sprite inc a - ld [$ff8e],a ; 4-tile sprite counter + ld [hFourTileSpriteCount],a .loadStillTilePattern pop bc pop de @@ -168,7 +168,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) .skipFirstLoad pop de pop hl - ld a,[$ff8d] + ld a,[hVRAMSlot] cp a,11 ; is it a 4-tile sprite? jr nc,.skipSecondLoad ; if so, there is no second block push de diff --git a/engine/predefs.asm b/engine/predefs.asm index 1af240ce..17f94b73 100755 --- a/engine/predefs.asm +++ b/engine/predefs.asm @@ -111,7 +111,7 @@ PredefPointers:: ; 4fe79 (13:7e79) add_predef InternalClockTradeAnim add_predef TrainerEngage add_predef IndexToPokedex - add_predef Predef3B; 3B display pic? + add_predef DisplayPicCenteredOrUpperRight; 3B display pic? add_predef UsedCut add_predef ShowPokedexData add_predef WriteMonMoves @@ -144,7 +144,7 @@ PredefPointers:: ; 4fe79 (13:7e79) add_predef GetTileTwoStepsInFrontOfPlayer add_predef CheckForCollisionWhenPushingBoulder add_predef PrintStrengthTxt - add_predef PickupItem + add_predef PickUpItem add_predef PrintMoveType add_predef LoadMovePPs add_predef DrawHP ; 5F diff --git a/home.asm b/home.asm index 38a95742..f9004e7e 100644 --- a/home.asm +++ b/home.asm @@ -969,10 +969,10 @@ PokeCenterSignText:: ; 24ef (0:24ef) TX_FAR _PokeCenterSignText db "@" -Predef5CText:: ; 24f4 (0:24f4) +PickUpItemText:: ; 24f4 (0:24f4) ; XXX better label (what does predef $5C do?) TX_ASM - predef PickupItem + predef PickUpItem jp TextScriptEnd @@ -1050,7 +1050,7 @@ Func_28cb:: ; 28cb (0:28cb) jp PlaySound ; this function is used to display sign messages, sprite dialog, etc. -; INPUT: [$ff8c] = sprite ID or text ID +; INPUT: [hSpriteIndexOrTextID] = sprite ID or text ID DisplayTextID:: ; 2920 (0:2920) ld a,[H_LOADEDROMBANK] push af @@ -1069,7 +1069,7 @@ DisplayTextID:: ; 2920 (0:2920) ld h,[hl] ld l,a ; hl = map text pointer ld d,$00 - ld a,[$ff8c] ; text ID + ld a,[hSpriteIndexOrTextID] ; text ID ld [wSpriteIndex],a and a jp z,DisplayStartMenu @@ -1083,7 +1083,7 @@ DisplayTextID:: ; 2920 (0:2920) jp z,DisplayRepelWoreOffText ld a,[W_NUMSPRITES] ld e,a - ld a,[$ff8c] ; sprite ID + ld a,[hSpriteIndexOrTextID] ; sprite ID cp e jr z,.spriteHandling jr nc,.skipSpriteHandling @@ -1096,7 +1096,7 @@ DisplayTextID:: ; 2920 (0:2920) pop bc pop de ld hl,W_MAPSPRITEDATA ; NPC text entries - ld a,[$ff8c] + ld a,[hSpriteIndexOrTextID] dec a add a add l @@ -1235,10 +1235,12 @@ LoadItemList:: ; 2a5a (0:2a5a) ret DisplayPokemonCenterDialogue:: ; 2a72 (0:2a72) +; zeroing these doesn't appear to serve any purpose xor a ld [$ff8b],a ld [$ff8c],a ld [$ff8d],a + inc hl ld a,[H_LOADEDROMBANK] push af @@ -2487,8 +2489,8 @@ CheckForEngagingTrainers:: ; 3306 (0:3306) ld c, a call TrainerFlagAction ; read trainer flag ld a, c - and a - jr nz, .trainerAlreadyFought + and a ; has the trainer already been defeated? + jr nz, .continue push hl push de push hl @@ -2507,7 +2509,7 @@ CheckForEngagingTrainers:: ; 3306 (0:3306) ld a, [wTrainerSpriteOffset] and a ret nz ; break if the trainer is engaging -.trainerAlreadyFought +.continue ld hl, $c add hl, de ld d, h @@ -2737,7 +2739,7 @@ SetSpriteFacingDirection:: ; 34ae (0:34ae) ld a, $9 ld [H_SPRITEDATAOFFSET], a call GetPointerWithinSpriteStateData1 - ld a, [$ff8d] + ld a, [hSpriteFacingDirection] ld [hl], a ret @@ -2858,18 +2860,18 @@ DecodeRLEList:: ; 350c (0:350c) inc a ; include sentinel in counting ret -; sets movement byte 1 for sprite [$FF8C] to $FE and byte 2 to [$FF8D] +; sets movement byte 1 for sprite [H_SPRITEINDEX] to $FE and byte 2 to [hSpriteMovementByte2] SetSpriteMovementBytesToFE:: ; 3533 (0:3533) push hl call GetSpriteMovementByte1Pointer ld [hl], $fe call GetSpriteMovementByte2Pointer - ld a, [$ff8d] + ld a, [hSpriteMovementByte2] ld [hl], a pop hl ret -; sets both movement bytes for sprite [$FF8C] to $FF +; sets both movement bytes for sprite [H_SPRITEINDEX] to $FF SetSpriteMovementBytesToFF:: ; 3541 (0:3541) push hl call GetSpriteMovementByte1Pointer @@ -2879,20 +2881,20 @@ SetSpriteMovementBytesToFF:: ; 3541 (0:3541) pop hl ret -; returns the sprite movement byte 1 pointer for sprite [$FF8C] in hl +; returns the sprite movement byte 1 pointer for sprite [H_SPRITEINDEX] in hl GetSpriteMovementByte1Pointer:: ; 354e (0:354e) ld h,$C2 - ld a,[H_SPRITEINDEX] ; the sprite to move + ld a,[H_SPRITEINDEX] swap a add a,6 ld l,a ret -; returns the sprite movement byte 2 pointer for sprite [$FF8C] in hl +; returns the sprite movement byte 2 pointer for sprite [H_SPRITEINDEX] in hl GetSpriteMovementByte2Pointer:: ; 3558 (0:3558) push de ld hl,W_MAPSPRITEDATA - ld a,[$FF8C] ; the sprite to move + ld a,[H_SPRITEINDEX] dec a add a ld d,0 diff --git a/home/copy2.asm b/home/copy2.asm index e5f28383..f872ebbc 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -1,10 +1,10 @@ FarCopyData2:: -; Identical to FarCopyData, but uses $ff8b +; Identical to FarCopyData, but uses hROMBankTemp ; as temp space instead of wBuffer. - ld [$ff8b],a + ld [hROMBankTemp],a ld a,[H_LOADEDROMBANK] push af - ld a,[$ff8b] + ld a,[hROMBankTemp] ld [H_LOADEDROMBANK],a ld [MBC1RomBank],a call CopyData @@ -15,10 +15,10 @@ FarCopyData2:: FarCopyData3:: ; Copy bc bytes from a:de to hl. - ld [$ff8b],a + ld [hROMBankTemp],a ld a,[H_LOADEDROMBANK] push af - ld a,[$ff8b] + ld a,[hROMBankTemp] ld [H_LOADEDROMBANK],a ld [MBC1RomBank],a push hl @@ -38,10 +38,10 @@ FarCopyData3:: FarCopyDataDouble:: ; Expand bc bytes of 1bpp image data ; from a:hl to 2bpp data at de. - ld [$ff8b],a + ld [hROMBankTemp],a ld a,[H_LOADEDROMBANK] push af - ld a,[$ff8b] + ld a,[hROMBankTemp] ld [H_LOADEDROMBANK],a ld [MBC1RomBank],a .loop @@ -70,7 +70,7 @@ CopyVideoData:: ld [H_AUTOBGTRANSFERENABLED], a ld a, [H_LOADEDROMBANK] - ld [$ff8b], a + ld [hROMBankTemp], a ld a, b ld [H_LOADEDROMBANK], a @@ -94,7 +94,7 @@ CopyVideoData:: .done ld [H_VBCOPYSIZE], a call DelayFrame - ld a, [$ff8b] + ld a, [hROMBankTemp] ld [H_LOADEDROMBANK], a ld [MBC1RomBank], a pop af @@ -119,7 +119,7 @@ CopyVideoDataDouble:: xor a ; disable auto-transfer while copying ld [H_AUTOBGTRANSFERENABLED], a ld a, [H_LOADEDROMBANK] - ld [$ff8b], a + ld [hROMBankTemp], a ld a, b ld [H_LOADEDROMBANK], a @@ -143,7 +143,7 @@ CopyVideoDataDouble:: .done ld [H_VBCOPYDOUBLESIZE], a call DelayFrame - ld a, [$ff8b] + ld a, [hROMBankTemp] ld [H_LOADEDROMBANK], a ld [MBC1RomBank], a pop af diff --git a/home/overworld.asm b/home/overworld.asm index f4d6d695..da514763 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -444,7 +444,7 @@ CheckWarpsCollision:: ; 0706 (0:0706) ld a,[hli] ld [wDestinationWarpID],a ld a,[hl] - ld [$ff8b],a ; save target map + ld [hWarpDestinationMap],a jr WarpFound2 .retry1 inc hl @@ -466,7 +466,7 @@ WarpFound1:: ; 0735 (0:0735) ld a,[hli] ld [wDestinationWarpID],a ld a,[hli] - ld [$ff8b],a ; save target map + ld [hWarpDestinationMap],a WarpFound2:: ; 073c (0:073c) ld a,[wNumberOfWarps] @@ -481,8 +481,8 @@ WarpFound2:: ; 073c (0:073c) ld [wLastMap],a ld a,[W_CURMAPWIDTH] ld [wd366],a - ld a,[$ff8b] ; destination map number - ld [W_CURMAP],a ; change current map to destination map + ld a,[hWarpDestinationMap] + ld [W_CURMAP],a cp a,ROCK_TUNNEL_1 jr nz,.notRockTunnel ld a,$06 @@ -493,11 +493,11 @@ WarpFound2:: ; 073c (0:073c) jr .done ; for maps that can have the 0xFF destination map, which means to return to the outside map; not all these maps are necessarily indoors, though .indoorMaps - ld a,[$ff8b] ; destination map + ld a,[hWarpDestinationMap] ; destination map cp a,$ff jr z,.goBackOutside ; if not going back to the previous map - ld [W_CURMAP],a ; current map number + ld [W_CURMAP],a callba IsPlayerStandingOnWarpPadOrHole ld a,[wcd5b] dec a ; is the player on a warp pad? @@ -539,22 +539,22 @@ CheckMapConnections:: ; 07ba (0:07ba) jr nz,.checkEastMap ld a,[W_MAPCONN3PTR] ld [W_CURMAP],a - ld a,[wd38f] ; new X coordinate upon entering west map + ld a,[wWestConnectedMapXAlignment] ; new X coordinate upon entering west map ld [W_XCOORD],a ld a,[W_YCOORD] ld c,a - ld a,[wd38e] ; Y adjustment upon entering west map + ld a,[wWestConnectedMapYAlignment] ; Y adjustment upon entering west map add c ld c,a ld [W_YCOORD],a - ld a,[wd390] ; pointer to upper left corner of map without adjustment for Y position + ld a,[wWestConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for Y position ld l,a - ld a,[wd391] + ld a,[wWestConnectedMapViewPointer + 1] ld h,a srl c jr z,.savePointer1 .pointerAdjustmentLoop1 - ld a,[wd38d] ; width of connected map + ld a,[wWestConnectedMapWidth] ; width of connected map add a,$06 ld e,a ld d,$00 @@ -575,22 +575,22 @@ CheckMapConnections:: ; 07ba (0:07ba) jr nz,.checkNorthMap ld a,[W_MAPCONN4PTR] ld [W_CURMAP],a - ld a,[wd39a] ; new X coordinate upon entering east map + ld a,[wEastConnectedMapXAlignment] ; new X coordinate upon entering east map ld [W_XCOORD],a ld a,[W_YCOORD] ld c,a - ld a,[wd399] ; Y adjustment upon entering east map + ld a,[wEastConnectedMapYAlignment] ; Y adjustment upon entering east map add c ld c,a ld [W_YCOORD],a - ld a,[wd39b] ; pointer to upper left corner of map without adjustment for Y position + ld a,[wEastConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for Y position ld l,a - ld a,[wd39c] + ld a,[wEastConnectedMapViewPointer + 1] ld h,a srl c jr z,.savePointer2 .pointerAdjustmentLoop2 - ld a,[wd398] + ld a,[wEastConnectedMapWidth] add a,$06 ld e,a ld d,$00 @@ -610,19 +610,19 @@ CheckMapConnections:: ; 07ba (0:07ba) jr nz,.checkSouthMap ld a,[W_MAPCONN1PTR] ld [W_CURMAP],a - ld a,[wd378] ; new Y coordinate upon entering north map + ld a,[wNorthConnectedMapYAlignment] ; new Y coordinate upon entering north map ld [W_YCOORD],a ld a,[W_XCOORD] ld c,a - ld a,[wd379] ; X adjustment upon entering north map + ld a,[wNorthConnectedMapXAlignment] ; X adjustment upon entering north map add c ld c,a ld [W_XCOORD],a - ld a,[wd37a] ; pointer to upper left corner of map without adjustment for X position + ld a,[wNorthConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for X position ld l,a - ld a,[wd37b] + ld a,[wNorthConnectedMapViewPointer + 1] ld h,a - ld b,$00 + ld b,0 srl c add hl,bc ld a,l @@ -637,19 +637,19 @@ CheckMapConnections:: ; 07ba (0:07ba) jr nz,.didNotEnterConnectedMap ld a,[W_MAPCONN2PTR] ld [W_CURMAP],a - ld a,[wd383] ; new Y coordinate upon entering south map + ld a,[wSouthConnectedMapYAlignment] ; new Y coordinate upon entering south map ld [W_YCOORD],a ld a,[W_XCOORD] ld c,a - ld a,[wd384] ; X adjustment upon entering south map + ld a,[wSouthConnectedMapXAlignment] ; X adjustment upon entering south map add c ld c,a ld [W_XCOORD],a - ld a,[wd385] ; pointer to upper left corner of map without adjustment for X position + ld a,[wSouthConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for X position ld l,a - ld a,[wd386] + ld a,[wSouthConnectedMapViewPointer + 1] ld h,a - ld b,$00 + ld b,0 srl c add hl,bc ld a,l @@ -884,9 +884,9 @@ LoadTileBlockMap:: ; 09fc (0:09fc) ; a 3-byte border at the edges of the map is kept so that there is space for map connections ld hl,wOverworldMap ld a,[W_CURMAPWIDTH] - ld [$ff8c],a + ld [hMapWidth],a add a,$06 ; border (east and west) - ld [$ff8b],a ; map width + border + ld [hMapStride],a ; map width + border ld b,$00 ld c,a ; make space for north border (next 3 lines) @@ -903,7 +903,7 @@ LoadTileBlockMap:: ; 09fc (0:09fc) ld b,a .rowLoop ; copy one row each iteration push hl - ld a,[$ff8c] ; map width (without border) + ld a,[hMapWidth] ; map width (without border) ld c,a .rowInnerLoop ld a,[de] @@ -913,7 +913,7 @@ LoadTileBlockMap:: ; 09fc (0:09fc) jr nz,.rowInnerLoop ; add the map width plus the border to the base address of the current row to get the next row's address pop hl - ld a,[$ff8b] ; map width + border + ld a,[hMapStride] ; map width + border add l ld l,a jr nc,.noCarry @@ -926,72 +926,72 @@ LoadTileBlockMap:: ; 09fc (0:09fc) cp a,$ff jr z,.southConnection call SwitchToMapRomBank - ld a,[wd372] + ld a,[wNorthConnectionStripSrc] ld l,a - ld a,[wd373] + ld a,[wNorthConnectionStripSrc + 1] ld h,a - ld a,[wd374] + ld a,[wNorthConnectionStripDest] ld e,a - ld a,[wd375] + ld a,[wNorthConnectionStripDest + 1] ld d,a - ld a,[wd376] - ld [$ff8b],a - ld a,[wd377] - ld [$ff8c],a + ld a,[wNorthConnectionStripWidth] + ld [hNorthSouthConnectionStripWidth],a + ld a,[wNorthConnectedMapWidth] + ld [hNorthSouthConnectedMapWidth],a call LoadNorthSouthConnectionsTileMap .southConnection ld a,[W_MAPCONN2PTR] cp a,$ff jr z,.westConnection call SwitchToMapRomBank - ld a,[wd37d] + ld a,[wSouthConnectionStripSrc] ld l,a - ld a,[wd37e] + ld a,[wSouthConnectionStripSrc + 1] ld h,a - ld a,[wd37f] + ld a,[wSouthConnectionStripDest] ld e,a - ld a,[wd380] + ld a,[wSouthConnectionStripDest + 1] ld d,a - ld a,[wd381] - ld [$ff8b],a - ld a,[wd382] - ld [$ff8c],a + ld a,[wSouthConnectionStripWidth] + ld [hNorthSouthConnectionStripWidth],a + ld a,[wSouthConnectedMapWidth] + ld [hNorthSouthConnectedMapWidth],a call LoadNorthSouthConnectionsTileMap .westConnection ld a,[W_MAPCONN3PTR] cp a,$ff jr z,.eastConnection call SwitchToMapRomBank - ld a,[wd388] + ld a,[wWestConnectionStripSrc] ld l,a - ld a,[wd389] + ld a,[wWestConnectionStripSrc + 1] ld h,a - ld a,[wd38a] + ld a,[wWestConnectionStripDest] ld e,a - ld a,[wd38b] + ld a,[wWestConnectionStripDest + 1] ld d,a - ld a,[wd38c] + ld a,[wWestConnectionStripHeight] ld b,a - ld a,[wd38d] - ld [$ff8b],a + ld a,[wWestConnectedMapWidth] + ld [hEastWestConnectedMapWidth],a call LoadEastWestConnectionsTileMap .eastConnection ld a,[W_MAPCONN4PTR] cp a,$ff jr z,.done call SwitchToMapRomBank - ld a,[wd393] + ld a,[wEastConnectionStripSrc] ld l,a - ld a,[wd394] + ld a,[wEastConnectionStripSrc + 1] ld h,a - ld a,[wd395] + ld a,[wEastConnectionStripDest] ld e,a - ld a,[wd396] + ld a,[wEastConnectionStripDest + 1] ld d,a - ld a,[wd397] + ld a,[wEastConnectionStripHeight] ld b,a - ld a,[wd398] - ld [$ff8b],a + ld a,[wEastConnectedMapWidth] + ld [hEastWestConnectedMapWidth],a call LoadEastWestConnectionsTileMap .done ret @@ -1001,7 +1001,7 @@ LoadNorthSouthConnectionsTileMap:: ; 0ade (0:0ade) .loop push de push hl - ld a,[$ff8b] ; width of connection + ld a,[hNorthSouthConnectionStripWidth] ld b,a .innerLoop ld a,[hli] @@ -1011,7 +1011,7 @@ LoadNorthSouthConnectionsTileMap:: ; 0ade (0:0ade) jr nz,.innerLoop pop hl pop de - ld a,[$ff8c] ; width of connected map + ld a,[hNorthSouthConnectedMapWidth] add l ld l,a jr nc,.noCarry1 @@ -1040,7 +1040,7 @@ LoadEastWestConnectionsTileMap:: ; 0b02 (0:0b02) jr nz,.innerLoop pop de pop hl - ld a,[$ff8b] ; width of connected map + ld a,[hEastWestConnectedMapWidth] add l ld l,a jr nc,.noCarry1 @@ -2022,7 +2022,7 @@ LoadMapHeader:: ; 107c (0:107c) ld b,a res 7,a ld [W_CURMAPTILESET],a - ld [$ff8b],a + ld [hPreviousTileset],a bit 7,b ret nz ld hl,MapHeaderPointers @@ -2191,24 +2191,24 @@ LoadMapHeader:: ; 107c (0:107c) ld a,[hli] ld [de],a ; store movement byte 1 at C2X6 ld a,[hli] - ld [$ff8d],a ; save movement byte 2 + ld [hLoadSpriteTemp1],a ; save movement byte 2 ld a,[hli] - ld [$ff8e],a ; save text ID and flags byte + ld [hLoadSpriteTemp2],a ; save text ID and flags byte push bc push hl ld b,$00 ld hl,W_MAPSPRITEDATA add hl,bc - ld a,[$ff8d] + ld a,[hLoadSpriteTemp1] ld [hli],a ; store movement byte 2 in byte 0 of sprite entry - ld a,[$ff8e] + ld a,[hLoadSpriteTemp2] ld [hl],a ; this appears pointless, since the value is overwritten immediately after - ld a,[$ff8e] - ld [$ff8d],a + ld a,[hLoadSpriteTemp2] + ld [hLoadSpriteTemp1],a and a,$3f ld [hl],a ; store text ID in byte 1 of sprite entry pop hl - ld a,[$ff8d] + ld a,[hLoadSpriteTemp1] bit 6,a jr nz,.trainerSprite bit 7,a @@ -2216,25 +2216,25 @@ LoadMapHeader:: ; 107c (0:107c) jr .regularSprite .trainerSprite ld a,[hli] - ld [$ff8d],a ; save trainer class + ld [hLoadSpriteTemp1],a ; save trainer class ld a,[hli] - ld [$ff8e],a ; save trainer number (within class) + ld [hLoadSpriteTemp2],a ; save trainer number (within class) push hl ld hl,W_MAPSPRITEEXTRADATA add hl,bc - ld a,[$ff8d] + ld a,[hLoadSpriteTemp1] ld [hli],a ; store trainer class in byte 0 of the entry - ld a,[$ff8e] + ld a,[hLoadSpriteTemp2] ld [hl],a ; store trainer number in byte 1 of the entry pop hl jr .nextSprite .itemBallSprite ld a,[hli] - ld [$ff8d],a ; save item number + ld [hLoadSpriteTemp1],a ; save item number push hl ld hl,W_MAPSPRITEEXTRADATA add hl,bc - ld a,[$ff8d] + ld a,[hLoadSpriteTemp1] ld [hli],a ; store item number in byte 0 of the entry xor a ld [hl],a ; zero byte 1, since it is not used diff --git a/hram.asm b/hram.asm index b0d5a942..a05f3d18 100644 --- a/hram.asm +++ b/hram.asm @@ -1,9 +1,3 @@ - -H_SPRITEWIDTH EQU $FF8B ; in tiles -H_SPRITEINTERLACECOUNTER EQU $FF8B -H_SPRITEHEIGHT EQU $FF8C ; in tiles -H_SPRITEOFFSET EQU $FF8D - hSoftReset EQU $FF8A ; Initialized to 16. ; Decremented each input iteration if the player @@ -12,8 +6,28 @@ hSoftReset EQU $FF8A hBaseTileID EQU $FF8B +; 3-byte BCD number hItemPrice EQU $FF8B +hDexWeight EQU $FF8B + +hWarpDestinationMap EQU $FF8B + +hOAMTile EQU $FF8B + +hROMBankTemp EQU $FF8B + +hPreviousTileset EQU $FF8B + +hEastWestConnectedMapWidth EQU $FF8B + +hSlideAmount EQU $FF8B + +H_SPRITEWIDTH EQU $FF8B ; in tiles +H_SPRITEINTERLACECOUNTER EQU $FF8B +H_SPRITEHEIGHT EQU $FF8C ; in tiles +H_SPRITEOFFSET EQU $FF8D + ; counters for blinking down arrow H_DOWNARROWBLINKCNT1 EQU $FF8B H_DOWNARROWBLINKCNT2 EQU $FF8C @@ -21,11 +35,40 @@ H_DOWNARROWBLINKCNT2 EQU $FF8C H_SPRITEDATAOFFSET EQU $FF8B H_SPRITEINDEX EQU $FF8C +hMapStride EQU $FF8B +hMapWidth EQU $FF8C + +hNorthSouthConnectionStripWidth EQU $FF8B +hNorthSouthConnectedMapWidth EQU $FF8C + ; DisplayTextID's argument hSpriteIndexOrTextID EQU $FF8C hPartyMonIndex EQU $FF8C +; the total number of tiles being shifted each time the pic slides by one tile +hSlidingRegionSize EQU $FF8C + +; 2 bytes +hEnemySpeed EQU $FF8D + +hVRAMSlot EQU $FF8D + +hFourTileSpriteCount EQU $FF8E + +; -1 = left +; 0 = right +hSlideDirection EQU $FF8D + +hSpriteFacingDirection EQU $FF8D + +hSpriteMovementByte2 EQU $FF8D + +hSpriteImageIndex EQU $FF8D + +hLoadSpriteTemp1 EQU $FF8D +hLoadSpriteTemp2 EQU $FF8E + hHalveItemPrices EQU $FF8E hSpriteOffset2 EQU $FF8F diff --git a/macros.asm b/macros.asm index 6a693a0b..9899ec29 100644 --- a/macros.asm +++ b/macros.asm @@ -13,6 +13,10 @@ dex EQUS "db $5f, $50" ; End a Pokedex entry. percent EQUS "* $ff / 100" +lb: MACRO ; r, hi, lo + ld \1, (\2) << 8 + (\3) + ENDM + ; Constant enumeration is useful for monsters, items, moves, etc. const_def: MACRO @@ -530,7 +534,7 @@ ENDM SOUTH_MAP_CONNECTION: MACRO db \1 ; map id dw \6 + \4 ; "Conection Strip" location - dw wOverworldMap + 3 + (\8 + 3) * (\7 + 6) + \3 ; current map positoin + dw wOverworldMap + 3 + (\8 + 3) * (\7 + 6) + \3 ; current map position db \5 ; width of connection strip db \2 ; map width db 0 ; y alignment (y coordinate of player when entering map) diff --git a/main.asm b/main.asm index 3bc5989a..9ceb5f81 100755 --- a/main.asm +++ b/main.asm @@ -996,7 +996,7 @@ DisplayTextIDInit: ; 7096 (1:7096) ld a,[wAutoTextBoxDrawingControl] bit 0,a jr nz,.skipDrawingTextBoxBorder - ld a,[$ff8c] ; text ID (or sprite ID) + ld a,[hSpriteIndexOrTextID] ; text ID (or sprite ID) and a jr nz,.notStartMenu ; if text ID is 0 (i.e. the start menu) @@ -2094,7 +2094,7 @@ IsPlayerStandingOnWarp: ; c35f (3:435f) ld a, [hli] ; target warp ld [wDestinationWarpID], a ld a, [hl] ; target map - ld [$ff8b], a + ld [hWarpDestinationMap], a ld hl, wd736 set 2, [hl] ; standing on warp flag ret @@ -2593,7 +2593,7 @@ ApplyOutOfBattlePoisonDamage: ; c69c (3:469c) ld [wJoyIgnore], a call EnableAutoTextBoxDrawing ld a, $d0 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID pop de pop hl @@ -2640,7 +2640,7 @@ ApplyOutOfBattlePoisonDamage: ; c69c (3:469c) jr nz, .noBlackOut call EnableAutoTextBoxDrawing ld a, $d1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72e set 5, [hl] @@ -2692,7 +2692,7 @@ LoadTilesetHeader: ; c754 (3:4754) jr c, .asm_c797 ld a, [W_CURMAPTILESET] ld b, a - ld a, [$ff8b] + ld a, [hPreviousTileset] cp b jr z, .done .asm_c797 @@ -3454,15 +3454,15 @@ TryPushingBoulder: ; f225 (3:7225) bit 1, a ; has boulder dust animation from previous push played yet? ret nz xor a - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call IsSpriteInFrontOfPlayer - ld a, [$ff8c] + ld a, [hSpriteIndexOrTextID] ld [wBoulderSpriteIndex], a and a jp z, ResetBoulderPushFlags ld hl, wSpriteStateData1 + 1 ld d, $0 - ld a, [$ff8c] + ld a, [hSpriteIndexOrTextID] swap a ld e, a add hl, de diff --git a/scripts/agatha.asm b/scripts/agatha.asm index cc209553..e65b1fa2 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -76,7 +76,7 @@ AgathaScript0: ; 76490 (1d:6490) jr z, AgathaScript_76474 .asm_764b4 ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -112,7 +112,7 @@ AgathaScript2: ; 764ed (1d:64ed) cp $ff jp z, AgathaScript_76464 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [W_GARYCURSCRIPT], a diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index 5de02d83..115b3b19 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -23,7 +23,7 @@ BillsHouseScript1: ; 1e783 (7:6783) ld de, MovementData_1e7a0 .notDown ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $2 ld [W_BILLSHOUSECURSCRIPT], a @@ -82,7 +82,7 @@ BillsHouseScript3: ; 1e7c5 (7:67c5) ld c, 8 call DelayFrames ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld de, MovementData_1e807 call MoveSprite ld a, $4 @@ -113,7 +113,7 @@ BillsHouseScript4: ; 1e80d (7:680d) BillsHouseScript5: ; 1e827 (7:6827) ld a, $4 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $0 ld [W_BILLSHOUSECURSCRIPT], a diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 257a830b..bd28917c 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -76,7 +76,7 @@ BrunoScript0: ; 76339 (1d:6339) jr z, BrunoScript_7631d .asm_7635d ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -112,7 +112,7 @@ BrunoScript2: ; 76396 (1d:6396) cp $ff jp z, BrunoScript_7630d ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID BrunoTextPointers: ; 763a8 (1d:63a8) diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index 3bcdf3a3..b9c006d1 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -58,10 +58,10 @@ CeladonGameCornerScript1: ; 48c19 (12:4c19) ld a, $f0 ld [wJoyIgnore], a ld a, $d - ld [H_SPRITEHEIGHT], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $b - ld [H_SPRITEHEIGHT], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld de, MovementData_48c5a ld a, [W_YCOORD] @@ -76,7 +76,7 @@ CeladonGameCornerScript1: ; 48c19 (12:4c19) ld de, MovementData_48c63 .asm_48c4d ld a, $b - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $2 ld [W_CELADONGAMECORNERCURSCRIPT], a diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index 4793bf14..b978b272 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -44,7 +44,7 @@ CeladonGymScript3: ; 48956 (12:4956) CeladonGymText_48963: ; 48963 (12:4963) ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd77c set 1, [hl] @@ -52,14 +52,14 @@ CeladonGymText_48963: ; 48963 (12:4963) call GiveItem jr nc, .BagFull ld a, $a - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd77c set 0, [hl] jr .asm_4898c .BagFull ld a, $b - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_4898c ld hl, W_OBTAINEDBADGES diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index 3565b809..20873a81 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -28,7 +28,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) ld hl, wd75b set 7, [hl] ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -55,7 +55,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld [wSpriteStateData1 + $29], a call Delay3 ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID .asm_194f7 ld a, [wd75a] @@ -82,9 +82,9 @@ CeruleanCityScript0: ; 194c8 (6:54c8) cp $14 jr z, .asm_19535 ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld a, $5 - ld [$ff8b], a + ld [H_SPRITEDATAOFFSET], a call GetPointerWithinSpriteStateData2 ld [hl], $19 .asm_19535 @@ -93,7 +93,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) predef ShowObject ld de, CeruleanCityMovement1 ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $1 ld [W_CERULEANCITYCURSCRIPT], a @@ -117,9 +117,9 @@ CeruleanCityMovement1: ; 19559 (6:5559) CeruleanCityScript_1955d: ; 1955d (6:555d) ld a,1 - ld [$ff8c],a + ld [H_SPRITEINDEX],a xor a ; SPRITE_FACING_DOWN - ld [$ff8d],a + ld [hSpriteFacingDirection],a jp SetSpriteFacingDirectionAndDelay ; face object CeruleanCityScript1: ; 19567 (6:5567) @@ -129,7 +129,7 @@ CeruleanCityScript1: ; 19567 (6:5567) xor a ld [wJoyIgnore], a ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72d set 6, [hl] @@ -173,14 +173,14 @@ CeruleanCityScript2: ; 195b1 (6:55b1) ld hl, wd75a set 0, [hl] ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wc0ee], a call PlaySound callba Music_RivalAlternateStart ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld a, [W_XCOORD] cp $14 @@ -191,7 +191,7 @@ CeruleanCityScript2: ; 195b1 (6:55b1) ld de, CeruleanCityMovement3 .asm_195f3 ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $3 ld [W_CERULEANCITYCURSCRIPT], a @@ -295,7 +295,7 @@ CeruleanCityText2: ; 1967c (6:567c) ld hl, CeruleanCityText_196ee ld de, CeruleanCityText_196ee call SaveEndBattleTextPointers - ld a, [$ff8c] + ld a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index a6cb4c64..2343af03 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -44,7 +44,7 @@ CeruleanGymScript3: ; 5c700 (17:4700) CeruleanGymScript_5c70d: ; 5c70d (17:470d) ld a, $5 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd75e set 7, [hl] @@ -52,14 +52,14 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) call GiveItem jr nc, .BagFull ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd75e set 6, [hl] jr .asm_5c736 .BagFull ld a, $7 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_5c736 ld hl, W_OBTAINEDBADGES diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index b3d6def6..dbede0d3 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -37,7 +37,7 @@ CinnabarGymScript_75792: ; 75792 (1d:5792) ret CinnabarGymScript_757a0: ; 757a0 (1d:57a0) - ld a, [H_DOWNARROWBLINKCNT2] + ld a, [hSpriteIndexOrTextID] ld [wTrainerHeaderFlagBit], a ret @@ -51,7 +51,7 @@ CinnabarGymScript0: ; 757ae (1d:57ae) ld a, [wda38] and a ret z - ld [$ff8c], a + ld [H_SPRITEINDEX], a cp $4 jr nz, .asm_757c3 ld a, $4 @@ -86,7 +86,7 @@ CinnabarGymScript1: ; 757dc (1d:57dc) ld [wJoyIgnore], a ld a, [wda38] ld [wTrainerHeaderFlagBit], a - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID CinnabarGymScript_757f1: ; 757f1 (1d:57f1) @@ -139,7 +139,7 @@ CinnabarGymScript3: ; 7584a (1d:584a) ld [wJoyIgnore], a CinnabarGymScript3_75857: ; 75857 (1d:5857) ld a, $a - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd79a set 1, [hl] @@ -147,14 +147,14 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) call GiveItem jr nc, .BagFull ld a, $b - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd79a set 0, [hl] jr .asm_75880 .BagFull ld a, $c - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_75880 ld hl, W_OBTAINEDBADGES @@ -189,7 +189,7 @@ CinnabarGymTextPointers: ; 7589f (1d:589f) dw TM38NoRoomText CinnabarGymScript_758b7: ; 758b7 (1d:58b7) - ld a, [H_DOWNARROWBLINKCNT2] + ld a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/cinnabarisland.asm b/scripts/cinnabarisland.asm index 33a497c4..70ea25a5 100755 --- a/scripts/cinnabarisland.asm +++ b/scripts/cinnabarisland.asm @@ -27,7 +27,7 @@ CinnabarIslandScript0: ; 1ca38 (7:4a38) ld a, $8 ld [wd528], a ld a, $8 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [hJoyHeld], a diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index 1b118f55..8a4a0464 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -45,12 +45,12 @@ FightingDojoScript1: ; 5cd83 (17:4d83) ld a, $1 ld [wd528], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_LEFT - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ret @@ -64,9 +64,9 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6) ld a, $1 ld [wd528], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_LEFT - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay .asm_5cde4 @@ -76,7 +76,7 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6) or $3e ld [wd7b1], a ld a, $8 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -148,7 +148,7 @@ FightingDojoText1: ; 5ce44 (17:4e44) ld hl, FightingDojoText_5ce93 ld de, FightingDojoText_5ce93 call SaveEndBattleTextPointers - ld a, [H_SPRITEINDEX] + ld a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index f88f0055..843e7293 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -44,7 +44,7 @@ FuchsiaGymScript3: ; 7548a (1d:548a) ld [wJoyIgnore], a FuchsiaGymScript3_75497: ; 75497 (1d:5497) ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd792 set 1, [hl] @@ -52,14 +52,14 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) call GiveItem jr nc, .BagFull ld a, $a - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd792 set 0, [hl] jr .asm_754c0 .BagFull ld a, $b - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_754c0 ld hl, W_OBTAINEDBADGES diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index 12b49297..f758b49e 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -3,7 +3,7 @@ FuchsiaHouse2Script: ; 750b5 (1d:50b5) FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8) dw FuchsiaHouse2Text1 - dw Predef5CText + dw PickUpItemText dw BoulderText dw FuchsiaHouse2Text4 dw FuchsiaHouse2Text5 diff --git a/scripts/gary.asm b/scripts/gary.asm index 59989b5f..476a59b0 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -55,7 +55,7 @@ GaryScript2: ; 75f6a (1d:5f6a) ld hl, W_OPTIONS res 7, [hl] ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld hl, wd72d @@ -99,10 +99,10 @@ GaryScript3: ; 75fbb (1d:5fbb) ld a, $f0 ld [wJoyIgnore], a ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call GaryScript_760c8 ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld a, $4 ld [W_GARYCURSCRIPT], a @@ -111,14 +111,14 @@ GaryScript3: ; 75fbb (1d:5fbb) GaryScript4: ; 75fe4 (1d:5fe4) callba Music_Cities1AlternateTempo ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call GaryScript_760c8 ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld de, MovementData_76014 ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, HS_CHAMPIONS_ROOM_OAK ld [wcc4d], a @@ -142,17 +142,17 @@ GaryScript5: ; 7601a (1d:601a) ld a, $2 ld [wd528], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_LEFT - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a xor a ; SPRITE_FACING_DOWN - ld [$ff8d], a - call SetSpriteFacingDirectionAndDelay ; face object + ld [hSpriteFacingDirection], a + call SetSpriteFacingDirectionAndDelay ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call GaryScript_760c8 ld a, $6 ld [W_GARYCURSCRIPT], a @@ -160,12 +160,12 @@ GaryScript5: ; 7601a (1d:601a) GaryScript6: ; 76047 (1d:6047) ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_RIGHT - ld [$ff8d], a - call SetSpriteFacingDirectionAndDelay ; face object + ld [hSpriteFacingDirection], a + call SetSpriteFacingDirectionAndDelay ld a, $4 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call GaryScript_760c8 ld a, $7 ld [W_GARYCURSCRIPT], a @@ -173,16 +173,16 @@ GaryScript6: ; 76047 (1d:6047) GaryScript7: ; 7605f (1d:605f) ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a xor a ; SPRITE_FACING_DOWN - ld [$ff8d], a - call SetSpriteFacingDirectionAndDelay ; face object + ld [hSpriteFacingDirection], a + call SetSpriteFacingDirectionAndDelay ld a, $5 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call GaryScript_760c8 ld de, MovementData_76080 ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $8 ld [W_GARYCURSCRIPT], a diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index cb2c1fad..680ebdd9 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -83,10 +83,10 @@ HallofFameRoomScript1: ; 5a52b (16:652b) ld a, $1 ld [wd528], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF - ld a, SPRITE_FACING_LEFT - ld [$ff8d], a + ld a, $8 + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call Delay3 xor a @@ -94,7 +94,7 @@ HallofFameRoomScript1: ; 5a52b (16:652b) inc a ld [wd528], a ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wJoyIgnore], a diff --git a/scripts/lance.asm b/scripts/lance.asm index c11bec2f..e335914b 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -64,7 +64,7 @@ LanceScript0: ; 5a305 (16:6305) cp $3 jr nc, .asm_5a325 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID .asm_5a325 cp $5 @@ -93,7 +93,7 @@ LanceScript2: ; 5a349 (16:6349) cp $ff jp z, LanceScript_5a2f5 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID LanceScript_5a35b: ; 5a35b (16:635b) diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index 7e800467..1f1fcde0 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -77,7 +77,7 @@ LoreleiScript0: ; 761e2 (1d:61e2) jr z, LoreleiScript_761c6 .asm_76206 ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -112,7 +112,7 @@ LoreleiScript2: ; 7623f (1d:623f) cp $ff jp z, LoreleiScript_761b6 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID LoreleiTextPointers: ; 76251 (1d:6251) diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index d658b425..6673e03b 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -53,7 +53,7 @@ Mansion1Script_Switches: ; 44316 (11:4316) xor a ld [hJoyHeld], a ld a, $4 - ld [H_SPRITEHEIGHT], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID Mansion1ScriptPointers: ; 44326 (11:4326) @@ -63,8 +63,8 @@ Mansion1ScriptPointers: ; 44326 (11:4326) Mansion1TextPointers: ; 4432c (11:432c) dw Mansion1Text1 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw Mansion1Text4 Mansion1TrainerHeaders: ; 44334 (11:4334) diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index 40827be1..27ccbdfb 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -49,7 +49,7 @@ Mansion2Script_Switches: ; 52037 (14:6037) xor a ld [hJoyHeld], a ld a, $5 - ld [H_SPRITEHEIGHT], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID Mansion2ScriptPointers: ; 52047 (14:6047) @@ -59,7 +59,7 @@ Mansion2ScriptPointers: ; 52047 (14:6047) Mansion2TextPointers: ; 5204d (14:604d) dw Mansion2Text1 - dw Predef5CText + dw PickUpItemText dw Mansion2Text3 dw Mansion2Text4 dw Mansion2Text5 diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index dfecde99..fa31718f 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -80,14 +80,14 @@ Mansion3Script_Switches: ; 5227a (14:627a) xor a ld [hJoyHeld], a ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID Mansion3TextPointers: ; 5228a (14:628a) dw Mansion3Text1 dw Mansion3Text2 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw Mansion3Text5 dw Mansion3Text6 diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index c23cb2d7..68e74fd5 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -51,7 +51,7 @@ Mansion4Script_Switches: ; 52420 (14:6420) xor a ld [hJoyHeld], a ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID Mansion4ScriptPointers: ; 52430 (14:6430) @@ -62,12 +62,12 @@ Mansion4ScriptPointers: ; 52430 (14:6430) Mansion4TextPointers: ; 52436 (14:6436) dw Mansion4Text1 dw Mansion4Text2 - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw Mansion4Text7 - dw Predef5CText + dw PickUpItemText dw Mansion3Text6 Mansion4TrainerHeaders: ; 52448 (14:6448) diff --git a/scripts/mtmoon1.asm b/scripts/mtmoon1.asm index 6c9fcd88..868b70d1 100755 --- a/scripts/mtmoon1.asm +++ b/scripts/mtmoon1.asm @@ -20,12 +20,12 @@ MtMoon1TextPointers: ; 499e1 (12:59e1) dw MtMoon1Text5 dw MtMoon1Text6 dw MtMoon1Text7 - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw MtMoon1Text14 MtMoon1TrainerHeaders: ; 499fd (12:59fd) diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index 7c6e987e..ee163738 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -66,7 +66,7 @@ MtMoon3Script0: ; 49d6f (12:5d6f) xor a ld [hJoyHeld], a ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID MtMoon3Script_49d91: ; 49d91 (12:5d91) @@ -92,7 +92,7 @@ MtMoon3Script3: ; 49d9a (12:5d9a) MtMoon3Script4: ; 49dba (12:5dba) ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld hl, CoordsData_49dea call ArePlayerCoordsInArray @@ -106,7 +106,7 @@ MtMoon3Script4: ; 49dba (12:5dba) ld de, MovementData_49df8 .asm_49dda ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $5 ld [W_MTMOON3CURSCRIPT], a @@ -140,7 +140,7 @@ MtMoon3Script5: ; 49dfb (12:5dfb) ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld a, $a - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, [wd7f6] bit 6, a @@ -167,8 +167,8 @@ MtMoon3TextPointers: ; 49e34 (12:5e34) dw MtMoon3Text5 dw MtMoon3Text6 dw MtMoon3Text7 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw MtMoon3Text_49f99 MtMoon3TrainerHeaders: ; 49e48 (12:5e48) diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 26c7f02d..38c3f717 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -25,7 +25,7 @@ Museum1FScript0: ; 5c10d (17:410d) xor a ld [hJoyHeld], a ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID Museum1FScript1: ; 5c12a (17:412a) @@ -69,7 +69,7 @@ Museum1FText1: ; 5c135 (17:4135) call PrintText jp Museum1FScriptEnd .asm_3ded4 - ld a, $13 + ld a, MONEY_BOX ld [wTextBoxID], a call DisplayTextBoxID xor a @@ -96,15 +96,15 @@ Museum1FText1: ; 5c135 (17:4135) ld hl, wd754 set 0, [hl] xor a - ld [wWhichTrade], a - ld [wTrainerEngageDistance], a + ld [wMuseumPriceTemp], a + ld [wMuseumPriceTemp + 1], a ld a, $50 - ld [wTrainerFacingDirection], a - ld hl, wTrainerFacingDirection + ld [wMuseumPriceTemp + 2], a + ld hl, wMuseumPriceTemp + 2 ld de, wPlayerMoney + 2 ld c, $3 predef SubBCDPredef - ld a, $13 + ld a, MONEY_BOX ld [wTextBoxID], a call DisplayTextBoxID ld a, (SFX_02_5a - SFX_Headers_02) / 3 diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 992b6887..5463b879 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -89,13 +89,13 @@ OaksLabScript3: ; 1cba2 (7:4ba2) call StartSimulatingJoypadStates ld a, $1 ld [H_SPRITEINDEX], a - xor a ; SPRITE_FACING_DOWN - ld [$ff8d], a + xor a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $5 ld [H_SPRITEINDEX], a - xor a ; SPRITE_FACING_DOWN - ld [$ff8d], a + xor a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $4 @@ -117,7 +117,7 @@ OaksLabScript4: ; 1cbd2 (7:4bd2) ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call UpdateSprites ld hl, W_FLAGS_D733 @@ -132,19 +132,19 @@ OaksLabScript5: ; 1cbfd (7:4bfd) ld a, $fc ld [wJoyIgnore], a ld a, $11 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, $12 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, $13 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, $14 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd74b set 1, [hl] @@ -162,16 +162,16 @@ OaksLabScript6: ; 1cc36 (7:4c36) ld a, $5 ld [H_SPRITEINDEX], a xor a ; SPRITE_FACING_DOWN - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $1 ld [H_SPRITEINDEX], a xor a - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call UpdateSprites ld a, $c - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a @@ -261,7 +261,7 @@ OaksLabScript8: ; 1cc80 (7:4c80) ld a, $1 ld [H_SPRITEINDEX], a ld a, $4 - ld [$ff8b], a + ld [H_SPRITEDATAOFFSET], a call GetPointerWithinSpriteStateData1 push hl ld [hl], $4c @@ -302,10 +302,10 @@ OaksLabScript9: ; 1cd00 (7:4d00) ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $d - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, [wTrainerEngageDistance] cp $2 @@ -331,10 +331,10 @@ OaksLabScript9: ; 1cd00 (7:4d00) ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $e - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd74b set 2, [hl] @@ -352,7 +352,7 @@ OaksLabScript10: ; 1cd6d (7:4d6d) ld a, $1 ld [H_SPRITEINDEX], a xor a ; SPRITE_FACING_DOWN - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $8 ld [wd528], a @@ -360,7 +360,7 @@ OaksLabScript10: ; 1cd6d (7:4d6d) ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, $f - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [hNPCPlayerRelativePosPerspective], a @@ -432,7 +432,7 @@ OaksLabScript12: ; 1ce03 (7:4e03) ld a, $1 ld [H_SPRITEINDEX], a xor a ; SPRITE_FACING_DOWN - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay predef HealParty ld hl, wd74b @@ -446,7 +446,7 @@ OaksLabScript13: ; 1ce32 (7:4e32) ld c, 20 call DelayFrames ld a, $10 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID callba Music_RivalAlternateStart ld a, $1 @@ -522,7 +522,7 @@ OaksLabScript15: ; 1ceb0 (7:4eb0) call PlaySound callba Music_RivalAlternateStart ld a, $15 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call OaksLabScript_1d02b ld a, HS_OAKS_LAB_RIVAL @@ -549,12 +549,12 @@ OaksLabScript_1cefd: ; 1cefd (7:4efd) ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $8 ld [H_SPRITEINDEX], a xor a ; SPRITE_FACING_DOWN - ld [$ff8d], a + ld [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay OaksLabScript16: ; 1cf12 (7:4f12) @@ -567,21 +567,21 @@ OaksLabScript16: ; 1cf12 (7:4f12) ld [wJoyIgnore], a call OaksLabScript_1cefd ld a, $16 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame call OaksLabScript_1cefd ld a, $17 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame call OaksLabScript_1cefd ld a, $18 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame ld a, $19 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, HS_POKEDEX_1 @@ -592,16 +592,16 @@ OaksLabScript16: ; 1cf12 (7:4f12) predef HideObject call OaksLabScript_1cefd ld a, $1a - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_RIGHT - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call Delay3 ld a, $1b - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd74b set 5, [hl] @@ -856,13 +856,13 @@ OaksLabScript_1d157: ; 1d157 (7:5157) ld a, $5 ld [H_SPRITEINDEX], a ld a, $9 - ld [$ff8b], a + ld [H_SPRITEDATAOFFSET], a call GetPointerWithinSpriteStateData1 ld [hl], $0 ld a, $1 ld [H_SPRITEINDEX], a ld a, $9 - ld [$ff8b], a + ld [H_SPRITEDATAOFFSET], a call GetPointerWithinSpriteStateData1 ld [hl], $c ld hl, wd730 @@ -962,7 +962,7 @@ OaksLabScript_1d22d: ; 1d22d (7:522d) ld a, $5 ld [H_SPRITEINDEX], a ld a, $9 - ld [$ff8b], a + ld [H_SPRITEDATAOFFSET], a call GetPointerWithinSpriteStateData1 ld [hl], $0 ld hl, OaksLabLastMonText diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index 5b042066..327a32ff 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -67,7 +67,7 @@ PalletTownScript2: ; 18ed2 (6:4ed2) ld a,1 ld [H_SPRITEINDEX],a ld a,SPRITE_FACING_UP - ld [$FF8D],a + ld [hSpriteFacingDirection],a call SetSpriteFacingDirectionAndDelay call Delay3 ld a,1 diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index 460eab5c..94d23caa 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -31,7 +31,7 @@ PewterCityScript_1925e: ; 1925e (6:525e) ld a, $f0 ld [wJoyIgnore], a ld a, $5 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID CoordsData_19277: ; 19277 (6:5277) @@ -48,16 +48,16 @@ PewterCityScript1: ; 19280 (6:5280) ld a, $3 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, ($3 << 4) | SPRITE_FACING_UP - ld [$ff8d], a + ld [hSpriteImageIndex], a call SetSpriteImageIndexAfterSettingFacingDirection call PlayDefaultMusic ld hl, wFlags_0xcd60 set 4, [hl] ld a, $d - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $3c ld [$ffeb], a @@ -71,7 +71,7 @@ PewterCityScript1: ; 19280 (6:5280) ld [wSpriteIndex], a call SetSpritePosition1 ld a, $3 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld de, MovementData_PewterMuseumGuyExit call MoveSprite ld a, $2 @@ -114,18 +114,18 @@ PewterCityScript4: ; 19305 (6:5305) and a ret nz ld a, $5 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_LEFT - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, ($1 << 4) | SPRITE_FACING_LEFT - ld [$ff8d], a + ld [hSpriteImageIndex], a call SetSpriteImageIndexAfterSettingFacingDirection call PlayDefaultMusic ld hl, wFlags_0xcd60 set 4, [hl] ld a, $e - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $3c ld [$ffeb], a @@ -139,7 +139,7 @@ PewterCityScript4: ; 19305 (6:5305) ld [wSpriteIndex], a call SetSpritePosition1 ld a, $5 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld de, MovementData_PewterGymGuyExit call MoveSprite ld a, $5 diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index f4b2ad28..9f1493d4 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -44,7 +44,7 @@ PewterGymScript3: ; 5c3d2 (17:43d2) PewterGymScript_5c3df: ; 5c3df (17:43df) ld a, $4 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd755 set 7, [hl] @@ -52,14 +52,14 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) call GiveItem jr nc, .BagFull ld a, $5 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd755 set 6, [hl] jr .asm_5c408 .BagFull ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_5c408 ld hl, W_OBTAINEDBADGES diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index 286b8202..8520b10b 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -31,7 +31,7 @@ PokemonTower2Script0: ; 6050f (18:450f) call PlayMusic ld hl, wd764 res 6, [hl] - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 ld a, $8 ld b, SPRITE_FACING_DOWN @@ -43,12 +43,12 @@ PokemonTower2Script0: ; 6050f (18:450f) .asm_60544 ld [wd528], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a ld a, b - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [hJoyHeld], a @@ -69,7 +69,7 @@ PokemonTower2Script1: ; 60563 (18:4563) ld hl, wd764 set 7, [hl] ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld de, MovementData_605b2 ld a, [wd764] @@ -78,7 +78,7 @@ PokemonTower2Script1: ; 60563 (18:4563) ld de, MovementData_605a9 .asm_60589 ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $ff ld [wc0ee], a diff --git a/scripts/pokemontower3.asm b/scripts/pokemontower3.asm index 2cf58381..9d08aec4 100755 --- a/scripts/pokemontower3.asm +++ b/scripts/pokemontower3.asm @@ -16,7 +16,7 @@ PokemonTower3TextPointers: ; 606e5 (18:46e5) dw PokemonTower3Text1 dw PokemonTower3Text2 dw PokemonTower3Text3 - dw Predef5CText + dw PickUpItemText PokemonTower3TrainerHeaders: ; 606ed (18:46ed) PokemonTower3TrainerHeader0: ; 606ed (18:46ed) diff --git a/scripts/pokemontower4.asm b/scripts/pokemontower4.asm index 4f375657..c4732397 100755 --- a/scripts/pokemontower4.asm +++ b/scripts/pokemontower4.asm @@ -16,9 +16,9 @@ PokemonTower4TextPointers: ; 6080f (18:480f) dw PokemonTower4Text1 dw PokemonTower4Text2 dw PokemonTower4Text3 - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText PokemonTower4TrainerHeaders: ; 6081b (18:481b) PokemonTower4TrainerHeader0: ; 6081b (18:481b) diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index 34dd3204..9ef5d419 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -38,7 +38,7 @@ PokemonTower5Script0: ; 6094b (18:494b) call Delay3 call GBFadeInFromWhite ld a, $7 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -57,7 +57,7 @@ PokemonTower5TextPointers: ; 6099b (18:499b) dw PokemonTower5Text3 dw PokemonTower5Text4 dw PokemonTower5Text5 - dw Predef5CText + dw PickUpItemText dw PokemonTower5Text7 PokemonTower5TrainerHeaders: ; 609a9 (18:49a9) diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index e0e75cb1..e9412fb0 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -31,7 +31,7 @@ PokemonTower6Script0: ; 60b17 (18:4b17) xor a ld [hJoyHeld], a ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, MAROWAK ld [W_CUROPPONENT], a @@ -63,7 +63,7 @@ PokemonTower6Script4: ; 60b48 (18:4b48) ld hl, wd768 set 7, [hl] ld a, $7 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -100,8 +100,8 @@ PokemonTower6TextPointers: ; 60bb1 (18:4bb1) dw PokemonTower6Text1 dw PokemonTower6Text2 dw PokemonTower6Text3 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw PokemonTower6Text6 dw PokemonTower6Text7 diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index 0f9741ab..60635f20 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -31,7 +31,7 @@ PokemonTower7Script2: ; 60d23 (18:4d23) ld a, $f0 ld [wJoyIgnore], a ld a, [wSpriteIndex] - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call PokemonTower7Script_60db6 ld a, $3 @@ -72,7 +72,7 @@ PokemonTower7Script4: ; 60d86 (18:4d86) ld a, SPRITE_FACING_UP ld [wSpriteStateData1 + 9], a ld a, LAVENDER_HOUSE_1 - ld [H_DOWNARROWBLINKCNT1], a + ld [hWarpDestinationMap], a ld a, $1 ld [wDestinationWarpID], a ld a, LAVENDER_TOWN @@ -107,7 +107,7 @@ PokemonTower7Script_60db6: ; 60db6 (18:4db6) ld d, [hl] ld e, a ld a, [wSpriteIndex] - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a jp MoveSprite .asm_60dde inc hl diff --git a/scripts/powerplant.asm b/scripts/powerplant.asm index 25597654..0026d525 100755 --- a/scripts/powerplant.asm +++ b/scripts/powerplant.asm @@ -22,11 +22,11 @@ PowerPlantTextPointers: ; 1e2df (7:62df) dw PowerPlantText7 dw PowerPlantText8 dw PowerPlantText9 - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText PowerPlantTrainerHeaders: ; 1e2fb (7:62fb) PowerPlantTrainerHeader0: ; 1e2fb (7:62fb) diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index fe5a47e6..967ab77b 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -43,8 +43,8 @@ RocketHideout1TextPointers: ; 44c14 (11:4c14) dw RocketHideout1Text3 dw RocketHideout1Text4 dw RocketHideout1Text5 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText RocketHideout1TrainerHeaders: ; 44c22 (11:4c22) RocketHideout1TrainerHeader0: ; 44c22 (11:4c22) diff --git a/scripts/rockethideout2.asm b/scripts/rockethideout2.asm index bb4dd3ec..c2184bdb 100755 --- a/scripts/rockethideout2.asm +++ b/scripts/rockethideout2.asm @@ -415,10 +415,10 @@ SpinnerArrowAnimTiles: ; 45087 (11:5087) RocketHideout2TextPointers: ; 450c7 (11:50c7) dw RocketHideout2Text1 - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText RocketHideout2TrainerHeaders: ; 450d1 (11:50d1) RocketHideout2TrainerHeader0: ; 450d1 (11:50d1) diff --git a/scripts/rockethideout3.asm b/scripts/rockethideout3.asm index f2f7ed91..b025acd0 100755 --- a/scripts/rockethideout3.asm +++ b/scripts/rockethideout3.asm @@ -146,8 +146,8 @@ RocketHideout3Script3: ; 452e4 (11:452e4) RocketHideout3TextPointers: ; 452fa (11:52fa) dw RocketHideout3Text1 dw RocketHideout3Text2 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText RocketHideout3TrainerHeaders: ; 45302 (11:5302) RocketHideout3TrainerHeader0: ; 45302 (11:5302) diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index 613e2476..635c6095 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -56,7 +56,7 @@ RocketHideout4Script3: ; 454b6 (11:54b6) ld hl, wd81b set 7, [hl] ld a, $a - ld [H_SPRITEHEIGHT], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call GBFadeOutToBlack ld a, HS_ROCKET_HIDEOUT_4_GIOVANNI @@ -81,11 +81,11 @@ RocketHideout4TextPointers: ; 45501 (11:5501) dw RocketHideout4Text2 dw RocketHideout4Text3 dw RocketHideout4Text4 - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw RocketHideout4Text10 RocketHideout4TrainerHeaders: ; 45515 (11:5515) diff --git a/scripts/route12.asm b/scripts/route12.asm index eed676b3..8fe9d8f7 100755 --- a/scripts/route12.asm +++ b/scripts/route12.asm @@ -28,7 +28,7 @@ Route12Script0: ; 59619 (16:5619) res 6, [hl] jp z, CheckFightingMapTrainers ld a, $d - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, SNORLAX ld [W_CUROPPONENT], a @@ -51,7 +51,7 @@ Route12Script3: ; 5964c (16:564c) cp $2 jr z, .asm_59664 ld a, $e - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_59664 ld hl, wd7d8 @@ -71,8 +71,8 @@ Route12TextPointers: ; 59675 (16:5675) dw Route12Text6 dw Route12Text7 dw Route12Text8 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw Route12Text11 dw Route12Text12 dw Route12Text13 diff --git a/scripts/route15.asm b/scripts/route15.asm index 3aa23bbb..fe70d2b4 100755 --- a/scripts/route15.asm +++ b/scripts/route15.asm @@ -23,7 +23,7 @@ Route15TextPointers: ; 597c7 (16:57c7) dw Route15Text8 dw Route15Text9 dw Route15Text10 - dw Predef5CText + dw PickUpItemText dw Route15Text12 Route15TrainerHeaders: ; 597df (16:57df) diff --git a/scripts/route16.asm b/scripts/route16.asm index b6c49a96..cdf436a5 100755 --- a/scripts/route16.asm +++ b/scripts/route16.asm @@ -28,7 +28,7 @@ Route16Script0: ; 59959 (16:5959) res 0, [hl] jp z, CheckFightingMapTrainers ld a, $a - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, SNORLAX ld [W_CUROPPONENT], a @@ -52,7 +52,7 @@ Route16Script3: ; 5998f (16:598f) cp $2 jr z, .asm_599a8 ld a, $b - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_599a8 ld hl, wd7e0 diff --git a/scripts/route16gate.asm b/scripts/route16gate.asm index 8e3d8e5b..801e577e 100755 --- a/scripts/route16gate.asm +++ b/scripts/route16gate.asm @@ -19,14 +19,14 @@ Route16GateScript0: ; 496d7 (12:56d7) call ArePlayerCoordsInArray ret nc ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [hJoyHeld], a - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr z, .asm_4970e - ld a, [wWhichTrade] + ld a, [wCoordIndex] dec a ld [wSimulatedJoypadStatesIndex], a ld b, $0 @@ -59,7 +59,7 @@ Route16GateScript1: ; 4971d (12:571d) Route16GateScript2: ; 49727 (12:5727) ld a, $1 - ld [H_SPRITEHEIGHT], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a diff --git a/scripts/route18gate.asm b/scripts/route18gate.asm index 0301327b..060a6bbf 100755 --- a/scripts/route18gate.asm +++ b/scripts/route18gate.asm @@ -19,17 +19,17 @@ Route18GateScript0: ; 4988f (12:588f) call ArePlayerCoordsInArray ret nc ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [hJoyHeld], a - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr z, .asm_498c6 - ld a, [wWhichTrade] + ld a, [wCoordIndex] dec a ld [wSimulatedJoypadStatesIndex], a - ld b, $0 + ld b, 0 ld c, a ld a, D_UP ld hl, wSimulatedJoypadStatesEnd @@ -59,7 +59,7 @@ Route18GateScript1: ; 498d5 (12:58d5) Route18GateScript2: ; 498df (12:58df) ld a, $1 - ld [H_SPRITEHEIGHT], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a diff --git a/scripts/route2.asm b/scripts/route2.asm index fdc5eb6c..62ef3050 100755 --- a/scripts/route2.asm +++ b/scripts/route2.asm @@ -2,8 +2,8 @@ Route2Script: ; 554e3 (15:54e3) jp EnableAutoTextBoxDrawing Route2TextPointers: ; 554e6 (15:54e6) - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw Route2Text3 dw Route2Text4 diff --git a/scripts/route22.asm b/scripts/route22.asm index 84fb5634..f125030e 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -43,8 +43,8 @@ Route22MoveRivalSprite: ; 50ee6 (14:4ee6) inc de .asm_50ef1 call MoveSprite - ld a, $c - ld [$ff8d], a + ld a, SPRITE_FACING_RIGHT + ld [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay Route22RivalMovementData: ; 50efb (14:4efb) @@ -61,7 +61,7 @@ Route22Script0: ; 50f00 (14:4f00) ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray ret nc - ld a, [wWhichTrade] + ld a, [wCoordIndex] ld [wcf0d], a xor a ld [hJoyHeld], a @@ -98,7 +98,7 @@ Route22Script0: ; 50f00 (14:4f00) ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call Route22MoveRivalSprite ld a, $1 ld [W_ROUTE22CURSCRIPT], a @@ -113,19 +113,19 @@ Route22Script1: ; 50f62 (14:4f62) jr nz, .asm_50f78 ld a, $4 ld [wd528], a - ld a, $4 + ld a, SPRITE_FACING_UP jr .asm_50f7a .asm_50f78 - ld a, $c + ld a, SPRITE_FACING_RIGHT .asm_50f7a - ld [$ff8d], a + ld [hSpriteFacingDirection], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteFacingDirectionAndDelay xor a ld [wJoyIgnore], a ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72d set 6, [hl] @@ -159,16 +159,16 @@ Route22Script2: ; 50fb5 (14:4fb5) .notDown ld a, SPRITE_FACING_RIGHT .done - ld [$ff8d], a + ld [hSpriteFacingDirection], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a ld hl, wd7eb set 5, [hl] ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wc0ee], a @@ -194,7 +194,7 @@ Route22Script_5100d: ; 5100d (14:500d) ld de, Route22RivalExitMovementData2 Route22MoveRival1: ; 51010 (14:5010) ld a, $1 - ld [H_SPRITEHEIGHT], a + ld [H_SPRITEINDEX], a jp MoveSprite Route22RivalExitMovementData1: ; 51017 (14:5017) @@ -255,7 +255,7 @@ Route22Script_5104e: ; 5104e (14:504e) call PlaySound callba Music_RivalAlternateTempo ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call Route22MoveRivalSprite ld a, $4 ld [W_ROUTE22CURSCRIPT], a @@ -266,25 +266,25 @@ Route22Script4: ; 51087 (14:5087) bit 0, a ret nz ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a ld a, [wcf0d] cp $1 jr nz, .asm_510a1 ld a, $4 ld [wd528], a - ld a, $4 + ld a, SPRITE_FACING_UP jr .asm_510a8 .asm_510a1 ld a, $2 ld [wd528], a - ld a, $c + ld a, SPRITE_FACING_RIGHT .asm_510a8 - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay xor a ld [wJoyIgnore], a ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72d set 6, [hl] @@ -310,27 +310,27 @@ Route22Script5: ; 510df (14:50df) cp $ff jp z, Route22Script_50ece ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a ld a, [wcf0d] cp $1 jr nz, .asm_510fb ld a, $4 ld [wd528], a - ld a, $4 + ld a, SPRITE_FACING_UP jr .asm_51102 .asm_510fb ld a, $2 ld [wd528], a - ld a, $c + ld a, SPRITE_FACING_RIGHT .asm_51102 - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a ld hl, wd7eb set 6, [hl] ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wc0ee], a @@ -356,7 +356,7 @@ Route22Script_51142: ; 51142 (14:5142) ld de, MovementData_5114d Route22MoveRival2: ; 51145 (14:5145) ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a jp MoveSprite MovementData_5114c: ; 5114c (14:514c) diff --git a/scripts/route22gate.asm b/scripts/route22gate.asm index 513a106b..8b24c820 100755 --- a/scripts/route22gate.asm +++ b/scripts/route22gate.asm @@ -24,7 +24,7 @@ Route22GateScript0: ; 1e6a4 (7:66a4) xor a ld [hJoyHeld], a ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID Route22GateScriptCoords: ; 1e6b5 (7:66b5) diff --git a/scripts/route23.asm b/scripts/route23.asm index 5ed038c2..eeaf2a2b 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -49,9 +49,9 @@ Route23Script0: ; 51219 (14:5219) ret nc .asm_51237 ld a, e - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a ld a, c - ld [wWhichTrade], a + ld [wWhichBadge], a ld b, $2 ld hl, wd7ed predef FlagActionPredef @@ -69,21 +69,21 @@ YCoordsData_51255: ; 51255 (14:5255) Route23Script_5125d: ; 5125d (14:525d) ld hl, BadgeTextPointers - ld a, [wWhichTrade] + ld a, [wWhichBadge] ld c, a - ld b, $0 + ld b, 0 add hl, bc add hl, bc ld a, [hli] ld h, [hl] ld l, a ld de, wcd6d -.asm_5126e +.copyTextLoop ld a, [hli] ld [de], a inc de - cp $50 - jr nz, .asm_5126e + cp "@" + jr nz, .copyTextLoop ret BadgeTextPointers: ; 51276 (14:5276) @@ -188,9 +188,9 @@ Route23Text7: ; 5133d (14:533d) jp TextScriptEnd Route23Script_51346: ; 51346 (14:5346) - ld [wWhichTrade], a + ld [wWhichBadge], a call Route23Script_5125d - ld a, [wWhichTrade] + ld a, [wWhichBadge] inc a ld c, a ld b, $2 @@ -208,7 +208,7 @@ Route23Script_51346: ; 51346 (14:5346) .asm_5136e ld hl, VictoryRoadGuardText2 call PrintText - ld a, [wWhichTrade] + ld a, [wWhichBadge] ld c, a ld b, $1 ld hl, wd7ed diff --git a/scripts/route24.asm b/scripts/route24.asm index 7bb9f3cd..f6822a35 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -31,7 +31,7 @@ Route24Script0: ; 513d5 (14:53d5) xor a ld [hJoyHeld], a ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd7f0 bit 1, [hl] @@ -70,7 +70,7 @@ Route24Script3: ; 51422 (14:5422) ld hl, wd7ef set 1, [hl] ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -87,7 +87,7 @@ Route24TextPointers: ; 5144b (14:544b) dw Route24Text5 dw Route24Text6 dw Route24Text7 - dw Predef5CText + dw PickUpItemText Route24TrainerHeaders: ; 5145b (14:545b) Route24TrainerHeader0: ; 5145b (14:545b) @@ -170,7 +170,7 @@ Route24Text1: ; 514a4 (14:54a4) ld hl, Route24Text_5152b ld de, Route24Text_5152b call SaveEndBattleTextPointers - ld a, [$ff8c] + ld a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/route25.asm b/scripts/route25.asm index 383652c8..5f544365 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -51,7 +51,7 @@ Route25TextPointers: ; 51628 (14:5628) dw Route25Text7 dw Route25Text8 dw Route25Text9 - dw Predef5CText + dw PickUpItemText dw Route25Text11 Route25TrainerHeaders: ; 5163e (14:563e) diff --git a/scripts/route4.asm b/scripts/route4.asm index c4a1e956..10d3882d 100755 --- a/scripts/route4.asm +++ b/scripts/route4.asm @@ -15,7 +15,7 @@ Route4ScriptPointers: ; 5566b (15:566b) Route4TextPointers: ; 55671 (15:5671) dw Route4Text1 dw Route4Text2 - dw Predef5CText + dw PickUpItemText dw PokeCenterSignText dw Route4Text5 dw Route4Text6 diff --git a/scripts/route5gate.asm b/scripts/route5gate.asm index 2c751fa8..1ccf27af 100755 --- a/scripts/route5gate.asm +++ b/scripts/route5gate.asm @@ -31,7 +31,7 @@ Route5GateScript0: ; 1df50 (7:5f50) and a jr nz, .asm_1df82 ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Route5GateScript_1df43 ld a, $1 @@ -39,7 +39,7 @@ Route5GateScript0: ; 1df50 (7:5f50) ret .asm_1df82 ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd728 set 6, [hl] diff --git a/scripts/route6gate.asm b/scripts/route6gate.asm index 82e2414a..d1aed2df 100755 --- a/scripts/route6gate.asm +++ b/scripts/route6gate.asm @@ -25,7 +25,7 @@ Route6GateScript0: ; 1e04e (7:604e) and a jr nz, .asm_1e080 ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Route6GateScript_1e0a1 ld a, $1 @@ -35,7 +35,7 @@ Route6GateScript0: ; 1e04e (7:604e) ld hl, wd728 set 6, [hl] ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID CoordsData_1e08c: ; 1e08c (7:608c) diff --git a/scripts/route7gate.asm b/scripts/route7gate.asm index 4a05acc3..d73dc566 100755 --- a/scripts/route7gate.asm +++ b/scripts/route7gate.asm @@ -37,7 +37,7 @@ Route7GateScript0: ; 1e128 (7:6128) and a jr nz, .asm_1e15a ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Route7GateScript_1e111 ld a, $1 @@ -45,7 +45,7 @@ Route7GateScript0: ; 1e128 (7:6128) ret .asm_1e15a ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd728 set 6, [hl] diff --git a/scripts/route8gate.asm b/scripts/route8gate.asm index de0a856f..261a7a1e 100755 --- a/scripts/route8gate.asm +++ b/scripts/route8gate.asm @@ -36,7 +36,7 @@ Route8GateScript0: ; 1e1ee (7:61ee) and a jr nz, .asm_1e220 ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Route8GateScript_1e1d7 ld a, $1 @@ -46,7 +46,7 @@ Route8GateScript0: ; 1e1ee (7:61ee) ld hl, wd728 set 6, [hl] ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a jp DisplayTextID CoordsData_1e22c: ; 1e22c (7:622c) diff --git a/scripts/route9.asm b/scripts/route9.asm index 539e1a3f..d6050970 100755 --- a/scripts/route9.asm +++ b/scripts/route9.asm @@ -22,7 +22,7 @@ Route9TextPointers: ; 556d5 (15:56d5) dw Route9Text7 dw Route9Text8 dw Route9Text9 - dw Predef5CText + dw PickUpItemText dw Route9Text11 Route9TrainerHeaders: ; 556eb (15:56eb) diff --git a/scripts/safarizonecenter.asm b/scripts/safarizonecenter.asm index 6ff60ec6..40042038 100755 --- a/scripts/safarizonecenter.asm +++ b/scripts/safarizonecenter.asm @@ -2,7 +2,7 @@ SafariZoneCenterScript: ; 45bb2 (11:5bb2) jp EnableAutoTextBoxDrawing SafariZoneCenterTextPointers: ; 45bb5 (11:5bb5) - dw Predef5CText + dw PickUpItemText dw SafariZoneCenterText2 dw SafariZoneCenterText3 diff --git a/scripts/safarizoneeast.asm b/scripts/safarizoneeast.asm index 3e6df139..55ea5aa6 100755 --- a/scripts/safarizoneeast.asm +++ b/scripts/safarizoneeast.asm @@ -2,10 +2,10 @@ SafariZoneEastScript: ; 4586b (11:586b) jp EnableAutoTextBoxDrawing SafariZoneEastTextPointers: ; 4586e (11:586e) - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw SafariZoneEastText5 dw SafariZoneEastText6 dw SafariZoneEastText7 diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index 2edbe61b..e89630fc 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -18,7 +18,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) call ArePlayerCoordsInArray ret nc ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wJoyIgnore], a @@ -56,7 +56,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) ld [wJoyIgnore], a call UpdateSprites ld a, $4 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wJoyIgnore], a @@ -83,7 +83,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) ld a, $f0 ld [wJoyIgnore], a ld a, $6 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [W_NUMSAFARIBALLS], a @@ -95,7 +95,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) jr .asm_75286 .asm_7527f ld a, $5 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_75286 ret diff --git a/scripts/safarizonenorth.asm b/scripts/safarizonenorth.asm index 74790e76..6ea5f902 100755 --- a/scripts/safarizonenorth.asm +++ b/scripts/safarizonenorth.asm @@ -2,8 +2,8 @@ SafariZoneNorthScript: ; 459ab (11:59ab) jp EnableAutoTextBoxDrawing SafariZoneNorthTextPointers: ; 459ae (11:59ae) - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw SafariZoneNorthText3 dw SafariZoneNorthText4 dw SafariZoneNorthText5 diff --git a/scripts/safarizonewest.asm b/scripts/safarizonewest.asm index 1465af56..db2c6427 100755 --- a/scripts/safarizonewest.asm +++ b/scripts/safarizonewest.asm @@ -2,10 +2,10 @@ SafariZoneWestScript: ; 4a1b5 (12:61b5) jp EnableAutoTextBoxDrawing SafariZoneWestTextPointers: ; 4a1b8 (12:61b8) - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw SafariZoneWestText5 dw SafariZoneWestText6 dw SafariZoneWestText7 diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index 7e4f4447..349eda5e 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -44,7 +44,7 @@ SaffronGymScript3: ; 5d05b (17:505b) SaffronGymText_5d068: ; 5d068 (17:5068) ld a, $a - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd7b3 set 1, [hl] @@ -52,14 +52,14 @@ SaffronGymText_5d068: ; 5d068 (17:5068) call GiveItem jr nc, .BagFull ld a, $b - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd7b3 set 0, [hl] jr .asm_5d091 .BagFull ld a, $c - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_5d091 ld hl, W_OBTAINEDBADGES diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index 46630014..47700664 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -44,9 +44,9 @@ SilphCo10TextPointers: ; 5a186 (16:6186) dw SilphCo10Text1 dw SilphCo10Text2 dw SilphCo10Text3 - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText SilphCo10TrainerHeaders: ; 5a192 (16:6192) SilphCo10TrainerHeader0: ; 5a192 (16:6192) diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index 473c9d11..b4f94b13 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -170,17 +170,17 @@ SilphCo11Script0: ; 621db (18:61db) ld hl, CoordsData_62211 call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers - ld a, [wWhichTrade] + ld a, [wCoordIndex] ld [wcf0d], a xor a ld [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a ld a, $3 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $3 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld de, MovementData_62216 call MoveSprite @@ -201,9 +201,9 @@ MovementData_62216: ; 62216 (18:6216) SilphCo11Script_6221a: ; 6221a (18:621a) ld [wd528], a ld a, $3 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a ld a, b - ld [$ff8d], a + ld [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay SilphCo11Script5: ; 62227 (18:6227) @@ -214,17 +214,17 @@ SilphCo11Script5: ; 62227 (18:6227) cp $1 jr z, .asm_6223c ld a, $2 - ld b, $c + ld b, SPRITE_FACING_RIGHT jr .asm_62240 .asm_6223c ld a, $8 - ld b, $0 + ld b, SPRITE_FACING_DOWN .asm_62240 call SilphCo11Script_6221a ld a, $f0 ld [wJoyIgnore], a ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call GBFadeOutToBlack call SilphCo11Script_6216d @@ -242,17 +242,17 @@ SilphCo11Script3: ; 6226a (18:626a) bit 0, a ret nz ld a, $3 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld a, [wcf0d] cp $1 jr z, .asm_62284 ld a, $2 - ld b, $c + ld b, SPRITE_FACING_RIGHT jr .asm_62288 .asm_62284 ld a, $8 - ld b, $0 + ld b, SPRITE_FACING_DOWN .asm_62288 call SilphCo11Script_6221a call Delay3 @@ -266,7 +266,7 @@ SilphCo11Script4: ; 62293 (18:6293) ld hl, SilphCo10Text_62330 ld de, SilphCo10Text_62330 call SaveEndBattleTextPointers - ld a, [H_DOWNARROWBLINKCNT2] + ld a, [H_SPRITEINDEX] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index bc36ed39..4bd1edd1 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -58,7 +58,7 @@ SilphCo3TextPointers: ; 59fc4 (16:5fc4) dw SilphCo3Text1 dw SilphCo3Text2 dw SilphCo3Text3 - dw Predef5CText + dw PickUpItemText SilphCo3TrainerHeaders: ; 59fcc (16:5fcc) SilphCo3TrainerHeader0: ; 59fcc (16:5fcc) diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index 866afd54..a3953e27 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -95,9 +95,9 @@ SilphCo4TextPointers: ; 19da0 (6:5da0) dw SilphCo4Text2 dw SilphCo4Text3 dw SilphCo4Text4 - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText SilphCo4TrainerHeaders: ; 19dae (6:5dae) SilphCo4TrainerHeader0: ; 19dae (6:5dae) diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index 750072ab..1ed6006f 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -74,9 +74,9 @@ SilphCo5TextPointers: ; 19fbc (6:5fbc) dw SilphCo5Text3 dw SilphCo5Text4 dw SilphCo5Text5 - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw SilphCo5Text9 dw SilphCo5Text10 dw SilphCo5Text11 diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index 0ff5ee50..fe1e6224 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -50,8 +50,8 @@ SilphCo6TextPointers: ; 1a1f6 (6:61f6) dw SilphCo6Text6 dw SilphCo6Text7 dw SilphCo6Text8 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText SilphCo6TrainerHeaders: ; 1a20a (6:620a) SilphCo6TrainerHeader0: ; 1a20a (6:620a) diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 483429c0..8538d37f 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -136,10 +136,10 @@ SilphCo7Script0: ; 51c23 (14:5c23) ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld de, MovementData_51c7d ld a, [wWhichTrade] @@ -149,7 +149,7 @@ SilphCo7Script0: ; 51c23 (14:5c23) inc de .asm_51c6c ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $3 jp SilphCo7Text_51c10 @@ -173,7 +173,7 @@ SilphCo7Script3: ; 51c82 (14:5c82) xor a ld [wJoyIgnore], a ld a, $d - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld hl, wd72d @@ -212,12 +212,12 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) ld a, $4 ld [wd528], a ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a - ld a, $4 - ld [$ff8d], a + ld [H_SPRITEINDEX], a + ld a, SPRITE_FACING_UP + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $f - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wc0ee], a @@ -230,7 +230,7 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) ld de, MovementData_51d1a .asm_51d0e ld a, $9 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $5 jp SilphCo7Text_51c10 @@ -272,9 +272,9 @@ SilphCo7TextPointers: ; 51d3f (14:5d3f) dw SilphCo7Text7 dw SilphCo7Text8 dw SilphCo7Text9 - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw SilphCo7Text13 dw SilphCo7Text14 dw SilphCo7Text15 diff --git a/scripts/ssanne10.asm b/scripts/ssanne10.asm index 4dee3bb7..031315c3 100755 --- a/scripts/ssanne10.asm +++ b/scripts/ssanne10.asm @@ -21,9 +21,9 @@ SSAnne10TextPointers: ; 61d6e (18:5d6e) dw SSAnne10Text6 dw SSAnne10Text7 dw SSAnne10Text8 - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText SSAnne10TrainerHeaders: ; 61d84 (18:5d84) SSAnne10TrainerHeader0: ; 61d84 (18:5d84) diff --git a/scripts/ssanne2.asm b/scripts/ssanne2.asm index 16d560b5..d4651a22 100755 --- a/scripts/ssanne2.asm +++ b/scripts/ssanne2.asm @@ -30,14 +30,14 @@ SSAnne2Script0: ; 613be (18:53be) ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ld a, [wWhichTrade] + ld a, [wCoordIndex] ld [$ffdb], a ld a, HS_SS_ANNE_2_RIVAL ld [wcc4d], a predef ShowObject call Delay3 ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF xor a ld [hJoyHeld], a @@ -79,11 +79,11 @@ SSAnne2Script_61416: ; 61416 (18:5416) ld a, SPRITE_FACING_RIGHT jr .asm_61427 .asm_61426 - xor a + xor a ; SPRITE_FACING_DOWN .asm_61427 - ld [$ff8d], a + ld [hSpriteFacingDirection], a ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a jp SetSpriteFacingDirectionAndDelay SSAnne2Script1: ; 61430 (18:5430) @@ -94,7 +94,7 @@ SSAnne2Script1: ; 61430 (18:5430) xor a ld [wJoyIgnore], a ld a, $2 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, SONY2 + $c8 @@ -129,10 +129,10 @@ SSAnne2Script2: ; 6146d (18:546d) ld a, $f0 ld [wJoyIgnore], a ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld a, [W_XCOORD] cp $25 @@ -143,7 +143,7 @@ SSAnne2Script2: ; 6146d (18:546d) ld de, MovementData_614b7 .asm_6149a ld a, $2 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call MoveSprite ld a, $ff ld [wc0ee], a diff --git a/scripts/ssanne8.asm b/scripts/ssanne8.asm index 27c76a2f..7885135b 100755 --- a/scripts/ssanne8.asm +++ b/scripts/ssanne8.asm @@ -22,7 +22,7 @@ SSAnne8TextPointers: ; 6198f (18:598f) dw SSAnne8Text7 dw SSAnne8Text8 dw SSAnne8Text9 - dw Predef5CText + dw PickUpItemText dw SSAnne8Text11 SSAnne8TrainerHeaders: ; 619a5 (18:59a5) diff --git a/scripts/ssanne9.asm b/scripts/ssanne9.asm index 6e8b86c6..0cee1e08 100755 --- a/scripts/ssanne9.asm +++ b/scripts/ssanne9.asm @@ -21,10 +21,10 @@ SSAnne9TextPointers: ; 61b6a (18:5b6a) dw SSAnne9Text3 dw SSAnne9Text4 dw SSAnne9Text5 - dw Predef5CText + dw PickUpItemText dw SSAnne9Text7 dw SSAnne9Text8 - dw Predef5CText + dw PickUpItemText dw SSAnne9Text10 dw SSAnne9Text11 dw SSAnne9Text12 diff --git a/scripts/tradecenter.asm b/scripts/tradecenter.asm index 0a5cc100..22a61095 100755 --- a/scripts/tradecenter.asm +++ b/scripts/tradecenter.asm @@ -2,13 +2,13 @@ TradeCenterScript: ; 4fd10 (13:7d10) call EnableAutoTextBoxDrawing ld a, [$ffaa] cp $2 - ld a, $8 - jr z, .asm_4fd1d - ld a, $c -.asm_4fd1d - ld [$ff8d], a + ld a, SPRITE_FACING_LEFT + jr z, .next + ld a, SPRITE_FACING_RIGHT +.next + ld [hSpriteFacingDirection], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteFacingDirection ld hl, wd72d bit 0, [hl] diff --git a/scripts/unknowndungeon1.asm b/scripts/unknowndungeon1.asm index 008a7bd7..696ddafa 100755 --- a/scripts/unknowndungeon1.asm +++ b/scripts/unknowndungeon1.asm @@ -2,6 +2,6 @@ UnknownDungeon1Script: ; 74d0c (1d:4d0c) jp EnableAutoTextBoxDrawing UnknownDungeon1TextPointers: ; 74d0f (1d:4d0f) - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText diff --git a/scripts/unknowndungeon2.asm b/scripts/unknowndungeon2.asm index c8249b27..f3cbb6a5 100755 --- a/scripts/unknowndungeon2.asm +++ b/scripts/unknowndungeon2.asm @@ -2,6 +2,6 @@ UnknownDungeon2Script: ; 45e0b (11:5e0b) jp EnableAutoTextBoxDrawing UnknownDungeon2TextPointers: ; 45e0e (11:5e0e) - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText diff --git a/scripts/unknowndungeon3.asm b/scripts/unknowndungeon3.asm index 055c9d0f..1c87aa39 100755 --- a/scripts/unknowndungeon3.asm +++ b/scripts/unknowndungeon3.asm @@ -14,8 +14,8 @@ UnknownDungeon3ScriptPointers: ; 45f03 (11:5f03) UnknownDungeon3TextPointers: ; 45f09 (11:5f09) dw UnknownDungeon3Text1 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText UnknownDungeon3TrainerHeaders: ; 45f0f (11:5f0f) UnknownDungeon3TrainerHeader0: ; 45f0f (11:5f0f) diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 83fe2a8c..6b9f94f7 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -49,7 +49,7 @@ VermilionCityScript0: ; 197e6 (6:57e6) ld [hJoyHeld], a ld [wcf0d], a ld a, $3 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, [wd803] bit 2, a diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index 3515c29c..193b3a06 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -64,7 +64,7 @@ VermilionGymScript3: ; 5ca9d (17:4a9d) VermilionGymScript_5caaa: ; 5caaa (17:4aaa) ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd773 set 7, [hl] @@ -72,14 +72,14 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) call GiveItem jr nc, .BagFull ld a, $7 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd773 set 6, [hl] jr .asm_5cad3 .BagFull ld a, $8 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_5cad3 ld hl, W_OBTAINEDBADGES diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index 68a3502f..4f1df52f 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -43,8 +43,8 @@ CoordsData_5da5c: ; 5da5c (17:5a5c) VictoryRoad1TextPointers: ; 5da5f (17:5a5f) dw VictoryRoad1Text1 dw VictoryRoad1Text2 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw BoulderText dw BoulderText dw BoulderText diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index 1fc2af7e..51346032 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -77,10 +77,10 @@ VictoryRoad2TextPointers: ; 5181b (14:581b) dw VictoryRoad2Text4 dw VictoryRoad2Text5 dw VictoryRoad2Text6 - dw Predef5CText - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw BoulderText dw BoulderText dw BoulderText diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index 20b3df85..9aeb1d18 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -83,8 +83,8 @@ VictoryRoad3TextPointers: ; 44a24 (11:4a24) dw VictoryRoad3Text2 dw VictoryRoad3Text3 dw VictoryRoad3Text4 - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText dw BoulderText dw BoulderText dw BoulderText diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index 05f5f495..c358e961 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -32,7 +32,7 @@ ViridianCityScript_1900b: ; 1900b (6:500b) cp $20 ret nz ld a, $e - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [hJoyHeld], a @@ -52,7 +52,7 @@ ViridianCityScript_1903d: ; 1903d (6:503d) cp $13 ret nz ld a, $5 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [hJoyHeld], a @@ -98,7 +98,7 @@ ViridianCityScript2: ; 1908f (6:508f) xor a ld [wJoyIgnore], a ld a, $f - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [W_BATTLETYPE], a diff --git a/scripts/viridianforest.asm b/scripts/viridianforest.asm index 124d3184..554c2125 100755 --- a/scripts/viridianforest.asm +++ b/scripts/viridianforest.asm @@ -17,9 +17,9 @@ ViridianForestTextPointers: ; 61126 (18:5126) dw ViridianForestText2 dw ViridianForestText3 dw ViridianForestText4 - dw Predef5CText - dw Predef5CText - dw Predef5CText + dw PickUpItemText + dw PickUpItemText + dw PickUpItemText dw ViridianForestText8 dw ViridianForestText9 dw ViridianForestText10 diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 9e5e0e5f..9a0ce855 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -140,7 +140,7 @@ ViridianGymScript3: ; 74988 (1d:4988) ld [wJoyIgnore], a ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, $c - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd751 set 1, [hl] @@ -148,14 +148,14 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) call GiveItem jr nc, .BagFull ld a, $d - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd751 set 0, [hl] jr .asm_749be .BagFull ld a, $e - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_749be ld hl, W_OBTAINEDBADGES @@ -190,7 +190,7 @@ ViridianGymTextPointers: ; 749ec (1d:49ec) dw ViridianGymText8 dw ViridianGymText9 dw ViridianGymText10 - dw Predef5CText + dw PickUpItemText dw ViridianGymText12 dw ViridianGymText13 dw ViridianGymText14 diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index 9725e275..b6621684 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -28,7 +28,7 @@ ViridianMartScriptPointers: ; 1d495 (7:5495) ViridianMartScript0: ; 1d49b (7:549b) call UpdateSprites ld a, $4 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wSimulatedJoypadStatesEnd ld de, RLEMovement1d4bb @@ -51,7 +51,7 @@ ViridianMartScript1: ; 1d4c0 (7:54c0) ret nz call Delay3 ld a, $5 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld bc, (OAKS_PARCEL << 8) + 1 call GiveItem diff --git a/text.asm b/text.asm index ecc3beea..db3e57c5 100644 --- a/text.asm +++ b/text.asm @@ -2087,7 +2087,7 @@ _ColosseumVersionText:: ENDC _Char00Text:: ; 8a696 (22:6696) - TX_NUM $FF8C,1,2 + TX_NUM hSpriteIndexOrTextID,1,2 text " ERROR." done diff --git a/wram.asm b/wram.asm index 6eef4ea8..8633e732 100755 --- a/wram.asm +++ b/wram.asm @@ -634,6 +634,11 @@ wOverrideSimulatedJoypadStatesMask:: ; cd3b ds 1 +wWhichBadge:: ; cd3d + +wMuseumPriceTemp:: ; cd3d +; 3-byte BCD number + wTitleMonSpecies:: ; cd3d wPlayerCharacterOAMTile:: ; cd3d @@ -1891,58 +1896,98 @@ W_MAPCONNECTIONS:: ; d370 W_MAPCONN1PTR:: ; d371 ds 1 -wd372:: ds 1 ; some connection stuff, too bothered to label it -wd373:: ds 1 -wd374:: ds 1 -wd375:: ds 1 -wd376:: ds 1 -wd377:: ds 1 -wd378:: ds 1 -wd379:: ds 1 -wd37a:: ds 1 -wd37b:: ds 1 +wNorthConnectionStripSrc:: ; d372 + ds 2 + +wNorthConnectionStripDest:: ; d374 + ds 2 + +wNorthConnectionStripWidth:: ; d376 + ds 1 + +wNorthConnectedMapWidth:: ; d377 + ds 1 + +wNorthConnectedMapYAlignment:: ; d378 + ds 1 + +wNorthConnectedMapXAlignment:: ; d379 + ds 1 + +wNorthConnectedMapViewPointer:: ; d37a + ds 2 W_MAPCONN2PTR:: ; d37c ds 1 -wd37d:: ds 1 -wd37e:: ds 1 -wd37f:: ds 1 -wd380:: ds 1 -wd381:: ds 1 -wd382:: ds 1 -wd383:: ds 1 -wd384:: ds 1 -wd385:: ds 1 -wd386:: ds 1 +wSouthConnectionStripSrc:: ; d37d + ds 2 + +wSouthConnectionStripDest:: ; d37f: + ds 2 + +wSouthConnectionStripWidth:: ; d381 + ds 1 + +wSouthConnectedMapWidth:: ; d382 + ds 1 + +wSouthConnectedMapYAlignment:: ; d383 + ds 1 + +wSouthConnectedMapXAlignment:: ; d384 + ds 1 + +wSouthConnectedMapViewPointer:: ; d385 + ds 2 W_MAPCONN3PTR:: ; d387 ds 1 -wd388:: ds 1 -wd389:: ds 1 -wd38a:: ds 1 -wd38b:: ds 1 -wd38c:: ds 1 -wd38d:: ds 1 -wd38e:: ds 1 -wd38f:: ds 1 -wd390:: ds 1 -wd391:: ds 1 +wWestConnectionStripSrc:: ; d388 + ds 2 + +wWestConnectionStripDest:: ; d38a + ds 2 + +wWestConnectionStripHeight:: ; d38c + ds 1 + +wWestConnectedMapWidth:: ; d38d + ds 1 + +wWestConnectedMapYAlignment:: ; d38e + ds 1 + +wWestConnectedMapXAlignment:: ; d38f + ds 1 + +wWestConnectedMapViewPointer:: ; d390 + ds 2 W_MAPCONN4PTR:: ; d392 ds 1 -wd393:: ds 1 -wd394:: ds 1 -wd395:: ds 1 -wd396:: ds 1 -wd397:: ds 1 -wd398:: ds 1 -wd399:: ds 1 -wd39a:: ds 1 -wd39b:: ds 1 -wd39c:: ds 1 +wEastConnectionStripSrc:: ; d393 + ds 2 + +wEastConnectionStripDest:: ; d395 + ds 2 + +wEastConnectionStripHeight:: ; d397 + ds 1 + +wEastConnectedMapWidth:: ; d398 + ds 1 + +wEastConnectedMapYAlignment:: ; d399 + ds 1 + +wEastConnectedMapXAlignment:: ; d39a + ds 1 + +wEastConnectedMapViewPointer:: ; d39b + ds 2 W_SPRITESET:: ; d39d ; sprite set for the current map (11 sprite picture ID's) -- cgit v1.3.1-sl0p From c169073eed4f0362ef42170098a141a2fcbd71d0 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 18 Jul 2015 20:49:52 -0700 Subject: misc --- constants/misc_constants.asm | 1 - engine/HoF_room_pc.asm | 2 +- engine/battle/animations.asm | 10 +- engine/battle/core.asm | 2 +- engine/battle/experience.asm | 2 +- engine/battle/init_battle_variables.asm | 2 +- engine/cable_club.asm | 2 +- engine/evolution.asm | 67 ++++++------ engine/evos_moves.asm | 68 +++++++----- engine/experience.asm | 84 ++++++++------- engine/game_corner_slots.asm | 2 +- engine/game_corner_slots2.asm | 4 +- engine/give_pokemon.asm | 25 +++-- engine/hidden_object_functions17.asm | 6 +- engine/hidden_object_functions7.asm | 2 +- engine/items/itemfinder.asm | 32 +++--- engine/items/items.asm | 36 +++---- engine/menu/league_pc.asm | 8 +- engine/menu/main_menu.asm | 120 +++++++++++---------- engine/menu/pokedex.asm | 18 ++-- engine/menu/prize_menu.asm | 10 +- engine/menu/status_screen.asm | 43 ++++---- engine/oak_speech.asm | 4 +- engine/oam_dma.asm | 2 +- engine/overworld/hidden_items.asm | 44 ++++---- engine/overworld/hidden_objects.asm | 10 +- engine/overworld/movement.asm | 17 ++- engine/palettes.asm | 46 ++++---- engine/predefs.asm | 8 +- engine/save.asm | 181 +++++++++++++++++--------------- engine/slot_machine.asm | 2 +- engine/titlescreen.asm | 2 +- home/init.asm | 16 +-- hram.asm | 4 + macros.asm | 2 +- main.asm | 8 +- scripts/agatha.asm | 2 +- scripts/bruno.asm | 2 +- scripts/ceruleancity.asm | 2 +- scripts/daycarem.asm | 144 +++++++++++++------------ scripts/lance.asm | 2 +- scripts/lorelei.asm | 2 +- scripts/mansion3.asm | 2 +- scripts/mtmoonpokecenter.asm | 36 +++---- scripts/museum1f.asm | 8 +- scripts/oakslab.asm | 20 ++-- scripts/pewterpokecenter.asm | 34 +++--- scripts/safarizoneentrance.asm | 2 +- scripts/seafoamislands1.asm | 4 +- scripts/seafoamislands2.asm | 4 +- scripts/seafoamislands3.asm | 4 +- scripts/seafoamislands4.asm | 4 +- scripts/seafoamislands5.asm | 4 +- scripts/silphco7.asm | 2 +- scripts/vermiliondock.asm | 47 +++++---- scripts/victoryroad2.asm | 2 +- scripts/victoryroad3.asm | 8 +- sram.asm | 8 +- text/maps/daycare_1.asm | 20 ++-- text/maps/daycare_2.asm | 14 +-- wram.asm | 86 +++++++++++++-- 61 files changed, 743 insertions(+), 612 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm index 5eecb38f..c06e7a65 100644 --- a/constants/misc_constants.asm +++ b/constants/misc_constants.asm @@ -10,7 +10,6 @@ HOF_MON EQU $10 HOF_TEAM EQU PARTY_LENGTH * HOF_MON HOF_TEAM_CAPACITY EQU 50 - A_BUTTON EQU %00000001 B_BUTTON EQU %00000010 SELECT EQU %00000100 diff --git a/engine/HoF_room_pc.asm b/engine/HoF_room_pc.asm index dc05814a..06c926db 100755 --- a/engine/HoF_room_pc.asm +++ b/engine/HoF_room_pc.asm @@ -29,7 +29,7 @@ HallOfFamePC: ; 7405c (1d:405c) ld c, 128 call DelayFrames xor a - ld [wWhichTrade], a + ld [wNumCreditsMonsDisplayed - 1], a ; not read ld [wNumCreditsMonsDisplayed], a jp Credits diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 6803c38b..d21e07e5 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -796,9 +796,9 @@ DoBallShakeSpecialEffects: ; 78f96 (1e:4f96) dec a ret nz ; if it's the end of the ball shaking subanimation, check if more shakes are left and restart the subanimation - ld a,[wWhichTrade] ; number of shakes + ld a,[wNumShakes] ; number of shakes dec a ; decrement number of shakes - ld [wWhichTrade],a + ld [wNumShakes],a ret z ; if there are shakes left, restart the subanimation ld a,[W_SUBANIMSUBENTRYADDR] @@ -1998,11 +1998,11 @@ AnimationWavyScreen: ; 79666 (1e:5666) ret Func_796ae: ; 796ae (1e:56ae) - ld a, [$ff41] + ld a, [rSTAT] and $3 jr nz, Func_796ae ld a, [hl] - ld [$ff43], a + ld [rSCX], a inc hl ld a, [hl] cp d @@ -2895,7 +2895,7 @@ TossBallAnimation: ; 79e16 (1e:5e16) ; store these for later ld a,b and a,$F - ld [wWhichTrade],a + ld [wNumShakes],a ld hl,.PokeBallAnimations ; choose which toss animation to use diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 5deeb4dc..3cf3c9e9 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6298,7 +6298,7 @@ LoadEnemyMonData: ; 3eb01 (f:6b01) dec de dec de xor a - ld [wHPBarMaxHP], a + ld [wLearningMovesFromDayCare], a predef WriteMonMoves ; get moves based on current level .loadMovePPs ld hl, wEnemyMonMoves diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm index 11a1e87c..6ec8c463 100644 --- a/engine/battle/experience.asm +++ b/engine/battle/experience.asm @@ -254,7 +254,7 @@ GainExperience: ; 5524f (15:524f) ld a, [wd0b5] ld [wd11e], a predef LearnMoveFromLevelUp - ld hl, wccd3 + ld hl, wCanEvolveFlags ld a, [wWhichPokemon] ld c, a ld b, $1 diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 74df62aa..f10e9f5e 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -19,7 +19,7 @@ InitBattleVariables: ; 525af (14:65af) ld hl, wcf1d ld [hli], a ld [hl], a - ld hl, wccd3 + ld hl, wCanEvolveFlags ld b, $3c .loop ld [hli], a diff --git a/engine/cable_club.asm b/engine/cable_club.asm index fbdb6260..9ccffdbb 100755 --- a/engine/cable_club.asm +++ b/engine/cable_club.asm @@ -297,7 +297,7 @@ CallCurrentTradeCenterFunction: ld b, 0 ld a, [wTradeCenterPointerTableIndex] cp $ff - jp z, LoadTitlescreenGraphics + jp z, DisplayTitleScreen add a ld c, a add hl, bc diff --git a/engine/evolution.asm b/engine/evolution.asm index 9ed38c21..d110110a 100755 --- a/engine/evolution.asm +++ b/engine/evolution.asm @@ -20,11 +20,11 @@ EvolveMon: ; 7bde9 (1e:7de9) xor a ld [H_AUTOBGTRANSFERENABLED], a ld [hTilesetType], a - ld a, [wHPBarMaxHP] + ld a, [wEvoOldSpecies] ld [wcf1d], a ld c, $0 call EvolutionSetWholeScreenPalette - ld a, [wHPBarMaxHP + 1] + ld a, [wEvoNewSpecies] ld [wcf91], a ld [wd0b5], a call Evolution_LoadPic @@ -32,13 +32,13 @@ EvolveMon: ; 7bde9 (1e:7de9) ld hl, vBackPic ld bc, 7 * 7 call CopyVideoData - ld a, [wHPBarMaxHP] + ld a, [wEvoOldSpecies] ld [wcf91], a ld [wd0b5], a call Evolution_LoadPic ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a - ld a, [wHPBarMaxHP] + ld a, [wEvoOldSpecies] call PlayCry call WaitForSoundToFinish ld c, BANK(Music_SafariZone) @@ -49,23 +49,23 @@ EvolveMon: ; 7bde9 (1e:7de9) ld c, $1 call EvolutionSetWholeScreenPalette ld bc, $110 -.asm_7be63 +.animLoop push bc call Evolution_CheckForCancel jr c, .evolutionCancelled - call Func_7bec2 + call Evolution_BackAndForthAnim pop bc inc b dec c dec c - jr nz, .asm_7be63 + jr nz, .animLoop xor a - ld [wHPBarOldHP + 1], a + ld [wEvoCancelled], a ld a, $31 - ld [wHPBarOldHP], a - call Func_7bed6 - ld a, [wHPBarMaxHP + 1] -.afterCancellation + ld [wEvoMonTileOffset], a + call Evolution_ChangeMonPic ; show the new species pic + ld a, [wEvoNewSpecies] +.done ld [wcf1d], a ld a, $ff ld [wc0ee], a @@ -81,17 +81,17 @@ EvolveMon: ; 7bde9 (1e:7de9) pop bc pop de pop hl - ld a, [wHPBarOldHP + 1] + ld a, [wEvoCancelled] and a ret z scf ret .evolutionCancelled pop bc - ld a, $1 - ld [wHPBarOldHP + 1], a - ld a, [wHPBarMaxHP] - jr .afterCancellation + ld a, 1 + ld [wEvoCancelled], a + ld a, [wEvoOldSpecies] + jr .done EvolutionSetWholeScreenPalette: ; 7beb4 (1e:7eb4) ld b, $b @@ -102,37 +102,38 @@ Evolution_LoadPic: ; 7beb9 (1e:7eb9) coord hl, 7, 2 jp LoadFlippedFrontSpriteByMonIndex -Func_7bec2: ; 7bec2 (1e:7ec2) +Evolution_BackAndForthAnim: ; 7bec2 (1e:7ec2) +; show the mon change back and forth between the new and old species b times ld a, $31 - ld [wHPBarOldHP], a - call Func_7bed6 - ld a, $cf - ld [wHPBarOldHP], a - call Func_7bed6 + ld [wEvoMonTileOffset], a + call Evolution_ChangeMonPic + ld a, -$31 + ld [wEvoMonTileOffset], a + call Evolution_ChangeMonPic dec b - jr nz, Func_7bec2 + jr nz, Evolution_BackAndForthAnim ret -Func_7bed6: ; 7bed6 (1e:7ed6) +Evolution_ChangeMonPic: ; 7bed6 (1e:7ed6) push bc xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 7, 2 - ld bc, $707 - ld de, $d -.asm_7bee3 + lb bc, 7, 7 + ld de, SCREEN_WIDTH - 7 +.loop push bc -.asm_7bee4 - ld a, [wHPBarOldHP] +.innerLoop + ld a, [wEvoMonTileOffset] add [hl] ld [hli], a dec c - jr nz, .asm_7bee4 + jr nz, .innerLoop pop bc add hl, de dec b - jr nz, .asm_7bee3 - ld a, $1 + jr nz, .loop + ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 pop bc diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm index 4a253c68..9a0f2d84 100755 --- a/engine/evos_moves.asm +++ b/engine/evos_moves.asm @@ -1,6 +1,6 @@ ; try to evolve the mon in [wWhichPokemon] TryEvolvingMon: ; 3ad0e (e:6d0e) - ld hl, wccd3 + ld hl, wCanEvolveFlags xor a ld [hl], a ld a, [wWhichPokemon] @@ -31,17 +31,17 @@ Evolution_PartyMonLoop: ; loop over party mons ld a, [hl] cp $ff ; have we reached the end of the party? jp z, .done - ld [wHPBarMaxHP], a + ld [wEvoOldSpecies], a push hl ld a, [wWhichPokemon] ld c, a - ld hl, wccd3 + ld hl, wCanEvolveFlags ld b, $2 call Evolution_FlagAction ld a, c and a ; is the mon's bit set? jp z, Evolution_PartyMonLoop ; if not, go to the next mon - ld a, [wHPBarMaxHP] + ld a, [wEvoOldSpecies] dec a ld b, 0 ld hl, EvosMovesPointerTable @@ -110,7 +110,7 @@ Evolution_PartyMonLoop: ; loop over party mons ld [wd121], a push hl ld a, [hl] - ld [wHPBarMaxHP + 1], a + ld [wEvoNewSpecies], a ld a, [wWhichPokemon] ld hl, wPartyMonNicks call GetPartyMonName @@ -122,7 +122,7 @@ Evolution_PartyMonLoop: ; loop over party mons xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 0, 0 - ld bc, $c14 + lb bc, 12, 20 call ClearScreenArea ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a @@ -137,7 +137,7 @@ Evolution_PartyMonLoop: ; loop over party mons ld a, [hl] ld [wd0b5], a ld [wLoadedMonSpecies], a - ld [wHPBarMaxHP + 1], a + ld [wEvoNewSpecies], a ld a, MONSTER_NAME ld [wNameListType], a ld a, BANK(TrainerNames) ; bank is not used for monster names @@ -357,7 +357,7 @@ LearnMoveFromLevelUp: ; 3af5b (e:6f5b) ld bc, wPartyMon2 - wPartyMon1 call AddNTimes .next - ld b, $4 + ld b, NUM_MOVES .checkCurrentMovesLoop ; check if the move to learn is already known ld a, [hli] cp d @@ -377,14 +377,13 @@ LearnMoveFromLevelUp: ; 3af5b (e:6f5b) ; writes the moves a mon has at level [W_CURENEMYLVL] to [de] ; move slots are being filled up sequentially and shifted if all slots are full -; [wHPBarMaxHP]: (?) WriteMonMoves: ; 3afb8 (e:6fb8) call GetPredefRegisters push hl push de push bc ld hl, EvosMovesPointerTable - ld b, $0 + ld b, 0 ld a, [wcf91] ; cur mon ID dec a add a @@ -411,25 +410,30 @@ WriteMonMoves: ; 3afb8 (e:6fb8) ld a, [W_CURENEMYLVL] cp b jp c, .done ; mon level < move level (assumption: learnset is sorted by level) - ld a, [wHPBarMaxHP] + ld a, [wLearningMovesFromDayCare] and a jr z, .skipMinLevelCheck - ld a, [wWhichTrade] ; min move level) + ld a, [wDayCareStartLevel] cp b jr nc, .nextMove2 ; min level >= move level + .skipMinLevelCheck + +; check if the move is already known push de - ld c, $4 -.moveAlreadyLearnedCheckLoop + ld c, NUM_MOVES +.alreadyKnowsCheckLoop ld a, [de] inc de cp [hl] jr z, .nextMove dec c - jr nz, .moveAlreadyLearnedCheckLoop + jr nz, .alreadyKnowsCheckLoop + +; try to find an empty move slot pop de push de - ld c, $4 + ld c, NUM_MOVES .findEmptySlotLoop ld a, [de] and a @@ -437,47 +441,55 @@ WriteMonMoves: ; 3afb8 (e:6fb8) inc de dec c jr nz, .findEmptySlotLoop - pop de ; no empty move slots found + +; no empty move slots found + pop de push de push hl ld h, d ld l, e call WriteMonMoves_ShiftMoveData ; shift all moves one up (deleting move 1) - ld a, [wHPBarMaxHP] + ld a, [wLearningMovesFromDayCare] and a jr z, .writeMoveToSlot + +; shift PP as well if learning moves from day care push de - ld bc, $12 + ld bc, wPartyMon1PP - (wPartyMon1Moves + 3) add hl, bc ld d, h ld e, l call WriteMonMoves_ShiftMoveData ; shift all move PP data one up pop de + .writeMoveToSlot pop hl .writeMoveToSlot2 ld a, [hl] ld [de], a - ld a, [wHPBarMaxHP] + ld a, [wLearningMovesFromDayCare] and a jr z, .nextMove - push hl ; write move PP value + +; write move PP value if learning moves from day care + push hl ld a, [hl] - ld hl, $15 + ld hl, wPartyMon1PP - wPartyMon1Moves add hl, de push hl dec a ld hl, Moves - ld bc, $6 + ld bc, 6 call AddNTimes - ld de, wHPBarMaxHP + ld de, wBuffer ld a, BANK(Moves) call FarCopyData - ld a, [wHPBarNewHP + 1] + ld a, [wBuffer + 5] pop hl ld [hl], a pop hl jr .nextMove + .done pop bc pop de @@ -486,13 +498,13 @@ WriteMonMoves: ; 3afb8 (e:6fb8) ; shifts all move data one up (freeing 4th move slot) WriteMonMoves_ShiftMoveData: ; 3b04e (e:704e) - ld c, $3 -.asm_3b050 + ld c, NUM_MOVES - 1 +.loop inc de ld a, [de] ld [hli], a dec c - jr nz, .asm_3b050 + jr nz, .loop ret Evolution_FlagAction: ; 3b057 (e:7057) diff --git a/engine/experience.asm b/engine/experience.asm index 752536cf..b43fbcf9 100755 --- a/engine/experience.asm +++ b/engine/experience.asm @@ -10,15 +10,15 @@ CalcLevelFromExperience: ; 58f43 (16:4f43) push hl ld hl, wLoadedMonExp + 2 ; current exp ; compare exp needed for level d with current exp - ld a, [H_MULTIPLICAND + 2] + ld a, [hExperience + 2] ld c, a ld a, [hld] sub c - ld a, [H_MULTIPLICAND + 1] + ld a, [hExperience + 1] ld c, a ld a, [hld] sbc c - ld a, [H_MULTIPLICAND] + ld a, [hExperience] ld c, a ld a, [hl] sbc c @@ -33,7 +33,7 @@ CalcExperience: ; 58f6a (16:4f6a) add a add a ld c, a - ld b, $0 + ld b, 0 ld hl, GrowthRateTable add hl, bc call CalcDSquared @@ -50,96 +50,100 @@ CalcExperience: ; 58f6a (16:4f6a) ld [H_DIVISOR], a ld b, $4 call Divide - ld a, [H_MULTIPLICAND] ; (aliases: H_NUMTOPRINT) + ld a, [H_QUOTIENT + 1] push af - ld a, [H_MULTIPLICAND+1] + ld a, [H_QUOTIENT + 2] push af - ld a, [H_MULTIPLICAND+2] + ld a, [H_QUOTIENT + 3] push af call CalcDSquared ld a, [hl] and $7f ld [H_MULTIPLIER], a call Multiply - ld a, [H_MULTIPLICAND] ; (aliases: H_NUMTOPRINT) + ld a, [H_PRODUCT + 1] push af - ld a, [H_MULTIPLICAND+1] + ld a, [H_PRODUCT + 2] push af - ld a, [H_MULTIPLICAND+2] + ld a, [H_PRODUCT + 3] push af ld a, [hli] push af xor a ld [H_MULTIPLICAND], a - ld [H_MULTIPLICAND+1], a + ld [H_MULTIPLICAND + 1], a ld a, d - ld [H_MULTIPLICAND+2], a + ld [H_MULTIPLICAND + 2], a ld a, [hli] ld [H_MULTIPLIER], a call Multiply ld b, [hl] - ld a, [H_MULTIPLICAND+2] + ld a, [H_PRODUCT + 3] sub b - ld [H_MULTIPLICAND+2], a + ld [H_PRODUCT + 3], a ld b, $0 - ld a, [H_MULTIPLICAND+1] + ld a, [H_PRODUCT + 2] sbc b - ld [H_MULTIPLICAND+1], a - ld a, [H_MULTIPLICAND] + ld [H_PRODUCT + 2], a + ld a, [H_PRODUCT + 1] sbc b - ld [H_MULTIPLICAND], a + ld [H_PRODUCT + 1], a +; The difference of the linear term and the constant term consists of 3 bytes +; starting at H_PRODUCT + 1. Below, hExperience (an alias of that address) will +; be used instead for the further work of adding or subtracting the squared +; term and adding the cubed term. pop af and $80 jr nz, .subtractSquaredTerm ; check sign pop bc - ld a, [H_MULTIPLICAND+2] + ld a, [hExperience + 2] add b - ld [H_MULTIPLICAND+2], a + ld [hExperience + 2], a pop bc - ld a, [H_MULTIPLICAND+1] + ld a, [hExperience + 1] adc b - ld [H_MULTIPLICAND+1], a + ld [hExperience + 1], a pop bc - ld a, [H_MULTIPLICAND] + ld a, [hExperience] adc b - ld [H_MULTIPLICAND], a + ld [hExperience], a jr .addCubedTerm .subtractSquaredTerm pop bc - ld a, [H_MULTIPLICAND+2] + ld a, [hExperience + 2] sub b - ld [H_MULTIPLICAND+2], a + ld [hExperience + 2], a pop bc - ld a, [H_MULTIPLICAND+1] + ld a, [hExperience + 1] sbc b - ld [H_MULTIPLICAND+1], a + ld [hExperience + 1], a pop bc - ld a, [H_MULTIPLICAND] + ld a, [hExperience] sbc b - ld [H_MULTIPLICAND], a + ld [hExperience], a .addCubedTerm pop bc - ld a, [H_MULTIPLICAND+2] + ld a, [hExperience + 2] add b - ld [H_MULTIPLICAND+2], a + ld [hExperience + 2], a pop bc - ld a, [H_MULTIPLICAND+1] + ld a, [hExperience + 1] adc b - ld [H_MULTIPLICAND+1], a + ld [hExperience + 1], a pop bc - ld a, [H_MULTIPLICAND] + ld a, [hExperience] adc b - ld [H_MULTIPLICAND], a + ld [hExperience], a ret ; calculates d*d CalcDSquared: ; 59010 (16:5010) xor a - ld [H_MULTIPLICAND], a ; (aliases: H_NUMTOPRINT) - ld [H_MULTIPLICAND+1], a + ld [H_MULTIPLICAND], a + ld [H_MULTIPLICAND + 1], a ld a, d - ld [H_MULTIPLICAND+2], a - ld [H_MULTIPLIER], a ; (aliases: H_DIVISOR, H_REMAINDER, H_POWEROFTEN) + ld [H_MULTIPLICAND + 2], a + ld [H_MULTIPLIER], a jp Multiply ; each entry has the following scheme: diff --git a/engine/game_corner_slots.asm b/engine/game_corner_slots.asm index b3b2490c..ff17d4d3 100755 --- a/engine/game_corner_slots.asm +++ b/engine/game_corner_slots.asm @@ -7,7 +7,7 @@ StartSlotMachine: ; 37e2d (d:7e2d) cp $ff jr z, .printSomeonesKeys callba AbleToPlaySlotsCheck - ld a, [wHiddenObjectFunctionArgument] + ld a, [wCanPlaySlots] and a ret z ld a, [wLuckySlotHiddenObjectIndex] diff --git a/engine/game_corner_slots2.asm b/engine/game_corner_slots2.asm index 850b1f99..643536ea 100755 --- a/engine/game_corner_slots2.asm +++ b/engine/game_corner_slots2.asm @@ -1,4 +1,4 @@ -AbleToPlaySlotsCheck ; 2ff09 (b:7f09) +AbleToPlaySlotsCheck: ; 2ff09 (b:7f09) ld a, [wSpriteStateData1 + 2] and $8 jr z, .done ; not able @@ -19,7 +19,7 @@ AbleToPlaySlotsCheck ; 2ff09 (b:7f09) call PrintPredefTextID xor a .done - ld [wWhichTrade], a + ld [wCanPlaySlots], a ret GameCornerCoinCaseText: ; 2ff32 (b:7f32) diff --git a/engine/give_pokemon.asm b/engine/give_pokemon.asm index 45e88b9c..4b45631d 100755 --- a/engine/give_pokemon.asm +++ b/engine/give_pokemon.asm @@ -1,13 +1,16 @@ _GivePokemon: ; 4fda5 (13:7da5) +; returns success in carry +; and whether the mon was added to the party in [wAddedToParty] call EnableAutoTextBoxDrawing xor a - ld [wccd3], a + ld [wAddedToParty], a ld a, [wPartyCount] cp PARTY_LENGTH - jr c, .asm_4fe01 + jr c, .addToParty ld a, [W_NUMINBOX] cp MONS_PER_BOX - jr nc, .asm_4fdf9 + jr nc, .boxFull +; add to box xor a ld [W_ENEMYBATTSTATUS3], a ld a, [wcf91] @@ -19,32 +22,32 @@ _GivePokemon: ; 4fda5 (13:7da5) ld a, [wCurrentBoxNum] and $7f cp 9 - jr c, .asm_4fdec + jr c, .singleDigitBoxNum sub 9 ld [hl], "1" inc hl add "0" - jr .asm_4fdee -.asm_4fdec + jr .next +.singleDigitBoxNum add "1" -.asm_4fdee +.next ld [hli], a ld [hl], "@" ld hl, SetToBoxText call PrintText scf ret -.asm_4fdf9 +.boxFull ld hl, BoxIsFullText call PrintText and a ret -.asm_4fe01 +.addToParty call SetPokedexOwnedFlag call AddPartyMon - ld a, $1 + ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld [wccd3], a + ld [wAddedToParty], a scf ret diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 841929b8..44941d36 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -55,7 +55,7 @@ KabutopsFossilText: ; 5dbd4 (17:5bd4) DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) ; Displays a pokemon's front sprite in a pop-up window. ; [wcf91] = pokemon interal id number - ld a, $1 + ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 xor a @@ -85,7 +85,7 @@ PrintBlackboardLinkCableText: ; 5dc1a (17:5c1a) call EnableAutoTextBoxDrawing ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, [wWhichTrade] + ld a, [wHiddenObjectFunctionArgument] call PrintPredefTextID ret @@ -310,7 +310,7 @@ VermilionGymTrashText: ; 5ddf7 (17:5df7) GymTrashScript: ; 5ddfc (17:5dfc) call EnableAutoTextBoxDrawing - ld a, [wWhichTrade] + ld a, [wHiddenObjectFunctionArgument] ld [wcd5b], a ; Don't do the trash can puzzle if it's already been done. diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 31ae17a4..8e8b27b1 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -128,7 +128,7 @@ CinnabarGymQuiz: ; 1ea25 (7:6a25) TX_ASM xor a ld [wda38], a - ld a, [wWhichTrade] + ld a, [wHiddenObjectFunctionArgument] push af and $f ld [$ffdb], a diff --git a/engine/items/itemfinder.asm b/engine/items/itemfinder.asm index 96abecd3..51277632 100755 --- a/engine/items/itemfinder.asm +++ b/engine/items/itemfinder.asm @@ -1,14 +1,14 @@ HiddenItemNear: ; 7481f (1d:481f) ld hl, HiddenItemCoords - ld b, $0 -.asm_74824 - ld de, $0003 + ld b, 0 +.loop + ld de, 3 ld a, [W_CURMAP] call IsInRestOfArray ret nc ; return if current map has no hidden items push bc push hl - ld hl, wd6f0 + ld hl, wObtainedHiddenItemsFlags ld c, b ld b, $2 predef FlagActionPredef @@ -22,28 +22,30 @@ HiddenItemNear: ; 7481f (1d:481f) inc hl ld e, [hl] inc hl - jr nz, .asm_74824 + jr nz, .loop ; if the item has already been obtained +; check if the item is within 4-5 tiles (depending on the direction of item) ld a, [W_YCOORD] - call Func_7486b + call Sub5ClampTo0 cp d - jr nc, .asm_74824 + jr nc, .loop ld a, [W_YCOORD] - add $4 + add 4 cp d - jr c, .asm_74824 + jr c, .loop ld a, [W_XCOORD] - call Func_7486b + call Sub5ClampTo0 cp e - jr nc, .asm_74824 + jr nc, .loop ld a, [W_XCOORD] - add $5 + add 5 cp e - jr c, .asm_74824 + jr c, .loop scf ret -Func_7486b: ; 7486b (1d:486b) - sub $5 +Sub5ClampTo0: ; 7486b (1d:486b) +; subtract 5 but clamp to 0 + sub 5 cp $f0 ret c xor a diff --git a/engine/items/items.asm b/engine/items/items.asm index fe2d71c8..bc8d16fa 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -1216,11 +1216,11 @@ ItemUseMedicine: ; dabb (3:5abb) ld bc,-19 add hl,bc ; hl now points to experience ; update experience to minimum for new level - ld a,[$ff96] + ld a,[hExperience] ld [hli],a - ld a,[$ff97] + ld a,[hExperience + 1] ld [hli],a - ld a,[$ff98] + ld a,[hExperience + 2] ld [hl],a pop hl ld a,[wWhichPokemon] @@ -1618,8 +1618,8 @@ ItemUsePokeflute: ; e140 (3:6140) jp PrintText .inBattle xor a - ld [wWhichTrade],a ; initialize variable that indicates if any pokemon were woken up to zero - ld b,~SLP & $FF + ld [wWereAnyMonsAsleep],a + ld b,~SLP & $ff ld hl,wPartyMon1Status call WakeUpEntireParty ld a,[W_ISINBATTLE] @@ -1638,7 +1638,7 @@ ItemUsePokeflute: ; e140 (3:6140) and b ; remove Sleep status ld [hl],a call LoadScreenTilesFromBuffer2 ; restore saved screen - ld a,[wWhichTrade] + ld a,[wWereAnyMonsAsleep] and a ; were any pokemon asleep before playing the flute? ld hl,PlayedFluteNoEffectText jp z,PrintText ; if no pokemon were asleep @@ -1662,9 +1662,9 @@ ItemUsePokeflute: ; e140 (3:6140) ; INPUT: ; hl must point to status of first pokemon in party (player's or enemy's) ; b must equal ~SLP -; [wWhichTrade] should be initialized to 0 +; [wWereAnyMonsAsleep] should be initialized to 0 ; OUTPUT: -; [wWhichTrade]: set to 1 if any pokemon were asleep +; [wWereAnyMonsAsleep]: set to 1 if any pokemon were asleep WakeUpEntireParty: ; e1e5 (3:61e5) ld de,44 ld c,6 @@ -1674,7 +1674,7 @@ WakeUpEntireParty: ; e1e5 (3:61e5) and a,SLP ; is pokemon asleep? jr z,.notAsleep ld a,1 - ld [wWhichTrade],a ; indicate that a pokemon had to be woken up + ld [wWereAnyMonsAsleep],a ; indicate that a pokemon had to be woken up .notAsleep pop af and b ; remove Sleep status @@ -1874,7 +1874,7 @@ ItemUsePPRestore: ; e31e (3:631e) ld a,[wWhichPokemon] push af ld a,[wcf91] - ld [wWhichTrade],a + ld [wPPRestoreItem],a .chooseMon xor a ld [wUpdateSpritesEnabled],a @@ -1884,13 +1884,13 @@ ItemUsePPRestore: ; e31e (3:631e) jr nc,.chooseMove jp .itemNotUsed .chooseMove - ld a,[wWhichTrade] + ld a,[wPPRestoreItem] cp a,ELIXER jp nc,.useElixir ; if Elixir or Max Elixir ld a,$02 ld [wMoveMenuType],a ld hl,RaisePPWhichTechniqueText - ld a,[wWhichTrade] + ld a,[wPPRestoreItem] cp a,ETHER ; is it a PP Up? jr c,.printWhichTechniqueMessage ; if so, print the raise PP message ld hl,RestorePPWhichTechniqueText ; otherwise, print the restore PP message @@ -1911,7 +1911,7 @@ ItemUsePPRestore: ; e31e (3:631e) call GetMoveName call CopyStringToCF4B ; copy name to wcf4b pop hl - ld a,[wWhichTrade] + ld a,[wPPRestoreItem] cp a,ETHER jr nc,.useEther ; if Ether or Max Ether .usePPUp @@ -1973,7 +1973,7 @@ ItemUsePPRestore: ; e31e (3:631e) add hl,bc ; hl now points to move's PP ld a,[wd11e] ld b,a ; b = max PP - ld a,[wWhichTrade] + ld a,[wPPRestoreItem] cp a,MAX_ETHER jr z,.fullyRestorePP ld a,[hl] ; move PP @@ -2005,7 +2005,7 @@ ItemUsePPRestore: ; e31e (3:631e) jr .storeNewAmount .useElixir ; decrement the item ID so that ELIXER becomes ETHER and MAX_ELIXER becomes MAX_ETHER - ld hl,wWhichTrade + ld hl,wPPRestoreItem dec [hl] dec [hl] xor a @@ -2701,13 +2701,13 @@ SendNewMonToBox: ; e7a4 (3:67a4) ld d, a callab CalcExperience pop de - ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND) + ld a, [hExperience] ld [de], a inc de - ld a, [$ff97] + ld a, [hExperience + 1] ld [de], a inc de - ld a, [$ff98] + ld a, [hExperience + 2] ld [de], a inc de xor a diff --git a/engine/menu/league_pc.asm b/engine/menu/league_pc.asm index 560ed421..06a7894c 100755 --- a/engine/menu/league_pc.asm +++ b/engine/menu/league_pc.asm @@ -12,7 +12,7 @@ PKMNLeaguePC: ; 0x7657e ld [hTilesetType], a ld [W_SPRITEFLIPPED], a ld [wUpdateSpritesEnabled], a - ld [wTrainerScreenX], a + ld [wHoFTeamIndex2], a ld [wHoFTeamNo], a ld a, [wNumHoFTeams] ld b, a @@ -27,13 +27,13 @@ PKMNLeaguePC: ; 0x7657e ld hl, wHoFTeamNo inc [hl] push bc - ld a, [wTrainerScreenX] - ld [wHoFMonSpecies], a + ld a, [wHoFTeamIndex2] + ld [wHoFTeamIndex], a callba LoadHallOfFameTeams call LeaguePCShowTeam pop bc jr c, .doneShowingTeams - ld hl, wTrainerScreenX + ld hl, wHoFTeamIndex2 inc [hl] ld a, [hl] cp b diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm index 9e160f81..5dc6e61f 100755 --- a/engine/menu/main_menu.asm +++ b/engine/menu/main_menu.asm @@ -1,17 +1,16 @@ MainMenu: ; 5af2 (1:5af2) ; Check save file - call Func_5bff + call InitOptions xor a - ld [wd08a],a + ld [wOptionsInitialized],a inc a - ld [wd088],a - call Func_609e - jr nc,.next0 + ld [wSaveFileStatus],a + call CheckForPlayerNameInSRAM + jr nc,.mainMenuLoop - ; Predef 52 loads the save from SRAM to RAM predef LoadSAV -.next0 +.mainMenuLoop ld c,20 call DelayFrames xor a ; LINK_STATE_NONE @@ -30,9 +29,10 @@ MainMenu: ; 5af2 (1:5af2) call LoadFontTilePatterns ld hl,wd730 set 6,[hl] - ld a,[wd088] + ld a,[wSaveFileStatus] cp a,1 - jr z,.next1 + jr z,.noSaveFile +; there's a save file coord hl, 0, 0 ld b,6 ld c,13 @@ -41,7 +41,7 @@ MainMenu: ; 5af2 (1:5af2) ld de,ContinueText call PlaceString jr .next2 -.next1 +.noSaveFile coord hl, 0, 0 ld b,4 ld c,13 @@ -63,31 +63,33 @@ MainMenu: ; 5af2 (1:5af2) ld [wTopMenuItemY],a ld a,$B ld [wMenuWatchedKeys],a - ld a,[wd088] + ld a,[wSaveFileStatus] ld [wMaxMenuItem],a call HandleMenuInput - bit 1,a - jp nz,LoadTitlescreenGraphics ; load title screen (gfx and arrangement) + bit 1,a ; pressed B? + jp nz,DisplayTitleScreen ; if so, go back to the title screen ld c,20 call DelayFrames ld a,[wCurrentMenuItem] ld b,a - ld a,[wd088] + ld a,[wSaveFileStatus] cp a,2 - jp z,.next3 - inc b ; adjust MenuArrow_Counter -.next3 + jp z,.skipInc +; If there's no save file, increment the current menu item so that the numbers +; are the same whether or not there's a save file. + inc b +.skipInc ld a,b and a - jr z,.next4 ; if press_A on Continue + jr z,.choseContinue cp a,1 - jp z,Func_5d52 ; if press_A on NewGame - call DisplayOptionMenu ; if press_a on Options + jp z,StartNewGame + call DisplayOptionMenu ld a,1 - ld [wd08a],a - jp .next0 -.next4 - call ContinueGame + ld [wOptionsInitialized],a + jp .mainMenuLoop +.choseContinue + call DisplayContinueGameInfo ld hl,wd126 set 5,[hl] .inputLoop @@ -100,7 +102,7 @@ MainMenu: ; 5af2 (1:5af2) bit 0,a jr nz,.pressedA bit 1,a - jp nz,.next0 ; pressedB + jp nz,.mainMenuLoop ; pressed B jr .inputLoop .pressedA call GBPalWhiteOutWithDelay3 @@ -122,10 +124,10 @@ MainMenu: ; 5af2 (1:5af2) call SpecialWarpIn jp SpecialEnterMap -Func_5bff: ; 5bff (1:5bff) - ld a,1 +InitOptions: ; 5bff (1:5bff) + ld a,1 ; no delay ld [wLetterPrintingDelayFlags],a - ld a,3 + ld a,3 ; medium speed ld [W_OPTIONS],a ret @@ -301,7 +303,7 @@ LinkCanceledText: ; 5d4d (1:5d4d) TX_FAR _LinkCanceledText db "@" -Func_5d52: ; 5d52 (1:5d52) +StartNewGame: ; 5d52 (1:5d52) ld hl, wd732 res 1, [hl] call OakSpeech @@ -337,12 +339,12 @@ CableClubOptionsText: ; 5d97 (1:5d97) db "COLOSSEUM", $4e db "CANCEL@" -ContinueGame: ; 5db5 (1:5db5) +DisplayContinueGameInfo: ; 5db5 (1:5db5) xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 4, 7 - ld b, $8 - ld c, $e + ld b, 8 + ld c, 14 call TextBoxBorder coord hl, 5, 9 ld de, SaveScreenInfoText @@ -351,12 +353,12 @@ ContinueGame: ; 5db5 (1:5db5) ld de, wPlayerName call PlaceString coord hl, 17, 11 - call Func_5e2f + call PrintNumBadges coord hl, 16, 13 - call Func_5e42 + call PrintNumOwnedMons coord hl, 13, 15 - call Func_5e55 - ld a, $1 + call PrintPlayTime + ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a ld c, 30 jp DelayFrames @@ -377,17 +379,17 @@ PrintSaveScreenText: ; 5def (1:5def) ld de, wPlayerName call PlaceString coord hl, 17, 4 - call Func_5e2f + call PrintNumBadges coord hl, 16, 6 - call Func_5e42 + call PrintNumOwnedMons coord hl, 13, 8 - call Func_5e55 + call PrintPlayTime ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ld c, 30 jp DelayFrames -Func_5e2f: ; 5e2f (1:5e2f) +PrintNumBadges: ; 5e2f (1:5e2f) push hl ld hl, W_OBTAINEDBADGES ld b, $1 @@ -397,7 +399,7 @@ Func_5e2f: ; 5e2f (1:5e2f) ld bc, $102 jp PrintNumber -Func_5e42: ; 5e42 (1:5e42) +PrintNumOwnedMons: ; 5e42 (1:5e42) push hl ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned @@ -407,7 +409,7 @@ Func_5e42: ; 5e42 (1:5e42) ld bc, $103 jp PrintNumber -Func_5e55: ; 5e55 (1:5e55) +PrintPlayTime: ; 5e55 (1:5e55) ld de, W_PLAYTIMEHOURS + 1 ld bc, $103 call PrintNumber @@ -678,28 +680,32 @@ TextSpeedOptionData: ; 6096 (1:6096) db 7 ; default X coordinate (Medium) db $ff ; terminator -Func_609e: ; 609e (1:609e) - ld a, $a - ld [$0], a +CheckForPlayerNameInSRAM: ; 609e (1:609e) +; Check if the player name data in SRAM has a string terminator character +; (indicating that a name may have been saved there) and return whether it does +; in carry. + ld a, SRAM_ENABLE + ld [MBC1SRamEnable], a ld a, $1 - ld [$6000], a - ld [$4000], a + ld [MBC1SRamBankingMode], a + ld [MBC1SRamBank], a ld b, $b - ld hl, $a598 -.asm_60b0 + ld hl, sPlayerName +.loop ld a, [hli] - cp $50 - jr z, .asm_60c1 + cp "@" + jr z, .found dec b - jr nz, .asm_60b0 + jr nz, .loop +; not found xor a - ld [$0], a - ld [$6000], a + ld [MBC1SRamEnable], a + ld [MBC1SRamBankingMode], a and a ret -.asm_60c1 +.found xor a - ld [$0], a - ld [$6000], a + ld [MBC1SRamEnable], a + ld [MBC1SRamBankingMode], a scf ret diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index 08ce0da9..4e173bc0 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -71,8 +71,8 @@ HandlePokedexSideMenu: ; 4006d (10:406d) ld [wd11e],a ld a,[wd11e] push af - ld a,[wWhichTrade] - push af + ld a,[wDexMaxSeenMon] + push af ; this doesn't need to be preserved ld hl,wPokedexSeen call IsPokemonBitSet ld b,2 @@ -108,7 +108,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d) ld b,1 .exitSideMenu pop af - ld [wWhichTrade],a + ld [wDexMaxSeenMon],a pop af ld [wd11e],a pop af @@ -207,7 +207,7 @@ HandlePokedexListMenu: ; 40111 (10:4111) jr .maxSeenPokemonLoop .storeMaxSeenPokemon ld a,b - ld [wWhichTrade],a ; max seen pokemon + ld [wDexMaxSeenMon],a .loop xor a ld [H_AUTOBGTRANSFERENABLED],a @@ -218,7 +218,7 @@ HandlePokedexListMenu: ; 40111 (10:4111) ld a,[wListScrollOffset] ld [wd11e],a ld d,7 - ld a,[wWhichTrade] + ld a,[wDexMaxSeenMon] cp a,7 jr nc,.printPokemonLoop ld d,a @@ -294,9 +294,9 @@ HandlePokedexListMenu: ; 40111 (10:4111) bit 7,a ; was Down pressed? jr z,.checkIfRightPressed .downPressed ; scroll down one row - ld a,[wWhichTrade] + ld a,[wDexMaxSeenMon] cp a,7 - jp c,.loop + jp c,.loop ; can't if the list is shorter than 7 sub a,7 ld b,a ld a,[wListScrollOffset] @@ -309,9 +309,9 @@ HandlePokedexListMenu: ; 40111 (10:4111) bit 4,a ; was Right pressed? jr z,.checkIfLeftPressed .rightPressed ; scroll down 7 rows - ld a,[wWhichTrade] + ld a,[wDexMaxSeenMon] cp a,7 - jp c,.loop + jp c,.loop ; can't if the list is shorter than 7 sub a,6 ld b,a ld a,[wListScrollOffset] diff --git a/engine/menu/prize_menu.asm b/engine/menu/prize_menu.asm index d1fa0c72..b1b751b9 100755 --- a/engine/menu/prize_menu.asm +++ b/engine/menu/prize_menu.asm @@ -231,18 +231,24 @@ HandlePrizeChoice: ; 528c6 (14:68c6) pop af ld b,a call GivePokemon + +; If either the party or box was full, wait after displaying message. push af - ld a,[wccd3] ; XXX is there room? + ld a,[wAddedToParty] and a call z,WaitForTextScrollButtonPress pop af + +; If the mon couldn't be given to the player (because both the party and box +; were full), return without subtracting coins. ret nc + .SubtractCoins call LoadCoinsToSubtract ld hl,hCoins + 1 ld de,wPlayerCoins + 1 ld c,$02 ; how many bytes - predef SubBCDPredef ; subtract coins (BCD daa operations) + predef SubBCDPredef jp PrintPrizePrice .BagFull ld hl,PrizeRoomBagIsFullTextPtr diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm index 75de182b..3bf3464a 100755 --- a/engine/menu/status_screen.asm +++ b/engine/menu/status_screen.asm @@ -297,8 +297,8 @@ StatusScreen2: ; 12b57 (4:6b57) push af xor a ld [hTilesetType], a - ld [$ffba], a - ld bc, $0005 + ld [H_AUTOBGTRANSFERENABLED], a + ld bc, NUM_MOVES + 1 ld hl, wMoves call FillMemory ld hl, wLoadedMonMoves @@ -307,13 +307,13 @@ StatusScreen2: ; 12b57 (4:6b57) call CopyData callab FormatMovesString coord hl, 9, 2 - ld bc, $050a + lb bc, 5, 10 call ClearScreenArea ; Clear under name coord hl, 19, 3 ld [hl], $78 coord hl, 0, 8 - ld b, $8 - ld c, $12 + ld b, 8 + ld c, 18 call TextBoxBorder ; Draw move container coord hl, 2, 9 ld de, wMovesString @@ -387,9 +387,9 @@ StatusScreen2: ; 12b57 (4:6b57) jr nz, .PrintPP .PPDone coord hl, 9, 3 - ld de, EXPPointsText + ld de, StatusScreenExpText call PlaceString - ld a, [wLoadedMonLevel] ; level + ld a, [wLoadedMonLevel] push af cp MAX_LEVEL jr z, .Level100 @@ -407,11 +407,11 @@ StatusScreen2: ; 12b57 (4:6b57) coord hl, 12, 4 ld bc, $0307 call PrintNumber ; exp - call .asm_12c86 + call CalcExpToLevelUp ld de, wLoadedMonExp coord hl, 7, 6 ld bc, $0307 - call PrintNumber + call PrintNumber ; exp needed to level up coord hl, 9, 0 call StatusScreen_ClearName coord hl, 9, 1 @@ -422,7 +422,7 @@ StatusScreen2: ; 12b57 (4:6b57) coord hl, 9, 1 call PlaceString ld a, $1 - ld [$ffba], a + ld [H_AUTOBGTRANSFERENABLED], a call Delay3 call WaitForTextScrollButtonPress ; wait for button pop af @@ -433,25 +433,26 @@ StatusScreen2: ; 12b57 (4:6b57) ld [$ff24], a call GBPalWhiteOut jp ClearScreen -.asm_12c86 ; This does some magic with lvl/exp? - ld a, [wLoadedMonLevel] ; Load level + +CalcExpToLevelUp: ; 12c86 (4:6c86) + ld a, [wLoadedMonLevel] cp MAX_LEVEL - jr z, .asm_12ca7 ; If 100 + jr z, .atMaxLevel inc a ld d, a callab CalcExperience ld hl, wLoadedMonExp + 2 - ld a, [$ff98] + ld a, [hExperience + 2] sub [hl] ld [hld], a - ld a, [$ff97] + ld a, [hExperience + 1] sbc [hl] ld [hld], a - ld a, [$ff96] + ld a, [hExperience] sbc [hl] ld [hld], a ret -.asm_12ca7 +.atMaxLevel ld hl, wLoadedMonExp xor a ld [hli], a @@ -459,11 +460,9 @@ StatusScreen2: ; 12b57 (4:6b57) ld [hl], a ret -EXPPointsText: ; 12caf (4:6caf) - db "EXP POINTS", $4e - -LevelUpText: ; 12cba (4:6cba) - db "LEVEL UP@" +StatusScreenExpText: ; 12caf (4:6caf) + db "EXP POINTS" + next "LEVEL UP@" StatusScreen_ClearName: ; 12cc3 (4:6cc3) ld bc, 10 diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm index c7b2f4d6..9b9b1c7e 100755 --- a/engine/oak_speech.asm +++ b/engine/oak_speech.asm @@ -19,9 +19,9 @@ SetDefaultNames: ; 60ca (1:60ca) ld [W_OPTIONS], a pop af ld [wLetterPrintingDelayFlags], a - ld a, [wd08a] + ld a, [wOptionsInitialized] and a - call z, Func_5bff + call z, InitOptions ld hl, NintenText ld de, wPlayerName ld bc, $b diff --git a/engine/oam_dma.asm b/engine/oam_dma.asm index bd89677a..7326445e 100644 --- a/engine/oam_dma.asm +++ b/engine/oam_dma.asm @@ -15,7 +15,7 @@ WriteDMACodeToHRAM: DMARoutine: ; initiate DMA ld a, wOAMBuffer / $100 - ld [$ff46], a + ld [rDMA], a ; wait for DMA to finish ld a, $28 diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm index 910fcf04..3fb4ffca 100755 --- a/engine/overworld/hidden_items.asm +++ b/engine/overworld/hidden_items.asm @@ -1,9 +1,9 @@ HiddenItems: ; 76688 (1d:6688) ld hl, HiddenItemCoords - call Func_76857 - ld [wTrainerScreenX], a - ld hl, wd6f0 - ld a, [wTrainerScreenX] + call FindHiddenItemOrCoinsIndex + ld [wHiddenItemOrCoinsIndex], a + ld hl, wObtainedHiddenItemsFlags + ld a, [wHiddenItemOrCoinsIndex] ld c, a ld b, $2 predef FlagActionPredef @@ -11,9 +11,9 @@ HiddenItems: ; 76688 (1d:6688) and a ret nz call EnableAutoTextBoxDrawing - ld a, $1 + ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, [wWhichTrade] ; item ID + ld a, [wHiddenObjectFunctionArgument] ; item ID ld [wd11e], a call GetItemName tx_pre_jump FoundHiddenItemText @@ -23,12 +23,12 @@ INCLUDE "data/hidden_item_coords.asm" FoundHiddenItemText: ; 7675b (1d:675b) TX_FAR _FoundHiddenItemText TX_ASM - ld a, [wWhichTrade] ; item ID + ld a, [wHiddenObjectFunctionArgument] ; item ID ld b, a ld c, 1 call GiveItem jr nc, .BagFull - ld hl, wd6f0 + ld hl, wObtainedHiddenItemsFlags ld a, [wTrainerScreenX] ld c, a ld b, $1 @@ -56,10 +56,10 @@ HiddenCoins: ; 76799 (1d:6799) and a ret z ld hl, HiddenCoinCoords - call Func_76857 - ld [wTrainerScreenX], a - ld hl, wd6fe - ld a, [wTrainerScreenX] + call FindHiddenItemOrCoinsIndex + ld [wHiddenItemOrCoinsIndex], a + ld hl, wObtainedHiddenCoinsFlags + ld a, [wHiddenItemOrCoinsIndex] ld c, a ld b, $2 predef FlagActionPredef @@ -70,7 +70,7 @@ HiddenCoins: ; 76799 (1d:6799) ld [hCoins - 1], a ld [hCoins], a ld [hCoins + 1], a - ld a, [wWhichTrade] + ld a, [wHiddenObjectFunctionArgument] sub COIN cp 10 jr z, .bcd10 @@ -99,7 +99,7 @@ HiddenCoins: ; 76799 (1d:6799) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - ld hl, wd6fe + ld hl, wObtainedHiddenCoinsFlags ld a, [wTrainerScreenX] ld c, a ld b, $1 @@ -130,31 +130,31 @@ DroppedHiddenCoinsText: ; 7684d (1d:684d) TX_FAR _DroppedHiddenCoinsText db "@" -Func_76857: ; 76857 (1d:6857) - ld a, [wTrainerScreenY] +FindHiddenItemOrCoinsIndex: ; 76857 (1d:6857) + ld a, [wHiddenObjectY] ld d, a - ld a, [wTrainerScreenX] + ld a, [wHiddenObjectX] ld e, a ld a, [W_CURMAP] ld b, a - ld c, $ff + ld c, -1 .loop inc c ld a, [hli] cp $ff ; end of the list? ret z ; if so, we're done here cp b - jr nz, .asm_76877 + jr nz, .next1 ld a, [hli] cp d - jr nz, .asm_76878 + jr nz, .next2 ld a, [hli] cp e jr nz, .loop ld a, c ret -.asm_76877 +.next1 inc hl -.asm_76878 +.next2 inc hl jr .loop diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm index ae67aeed..cabfc093 100755 --- a/engine/overworld/hidden_objects.asm +++ b/engine/overworld/hidden_objects.asm @@ -1,4 +1,4 @@ -Func_46981: ; 46981 (11:6981) +IsPlayerOnDungeonWarp: ; 46981 (11:6981) xor a ld [wWhichDungeonWarp], a ld a, [wd72d] @@ -6,7 +6,7 @@ Func_46981: ; 46981 (11:6981) ret nz call ArePlayerCoordsInArray ret nc - ld a, [wWhichTrade] + ld a, [wCoordIndex] ld [wWhichDungeonWarp], a ld hl, wd72d set 4, [hl] @@ -58,7 +58,7 @@ CheckForHiddenObject: ; 469a0 (11:69a0) ld [wHiddenObjectX], a ld c, a call CheckIfCoordsInFrontOfPlayerMatch - ld a, [$ffea] + ld a, [hCoordsInFrontOfPlayerMatch] and a jr z, .foundMatchingObject inc hl @@ -85,7 +85,7 @@ CheckForHiddenObject: ; 469a0 (11:69a0) ret ; checks if the coordinates in front of the player's sprite match Y in b and X in c -; [$ffea] = $00 if they match, $ff if they don't match +; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01) ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction cp SPRITE_FACING_UP @@ -127,7 +127,7 @@ CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01) .didNotMatch ld a, $ff .done - ld [$ffea], a + ld [hCoordsInFrontOfPlayerMatch], a ret INCLUDE "data/hidden_objects.asm" diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 89b09bba..f618261e 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -210,9 +210,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1) .moveDown ld de, 2*SCREEN_WIDTH add hl, de ; move tile pointer two rows down - ld de, $100 - - ld bc, $400 + lb de, 1, 0 + lb bc, 4, SPRITE_FACING_DOWN jr TryWalking .notDown cp $80 ; $40 <= a < $80: up (or right) @@ -223,8 +222,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1) .moveUp ld de, -2*SCREEN_WIDTH add hl, de ; move tile pointer two rows up - ld de, $ff00 - ld bc, $804 + lb de, -1, 0 + lb bc, 8, SPRITE_FACING_UP jr TryWalking .notUp cp $c0 ; $80 <= a < $c0: left (or up) @@ -235,8 +234,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1) .moveLeft dec hl dec hl ; move tile pointer two columns left - ld de, $ff - ld bc, $208 + lb de, 0, -1 + lb bc, 2, SPRITE_FACING_LEFT jr TryWalking .notLeft ; $c0 <= a: right (or down) ld a, [wCurSpriteMovement2] @@ -245,8 +244,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1) .moveRight inc hl inc hl ; move tile pointer two columns right - ld de, $1 - ld bc, $10c + lb de, 0, 1 + lb bc, 1, SPRITE_FACING_RIGHT jr TryWalking ; changes facing direction by zeroing the movement delta and calling TryWalking diff --git a/engine/palettes.asm b/engine/palettes.asm index a9160d21..a325e0a3 100755 --- a/engine/palettes.asm +++ b/engine/palettes.asm @@ -328,10 +328,10 @@ SendSGBPacket: ; 71feb (1c:5feb) ld [$fff9],a ; send RESET signal (P14=LOW, P15=LOW) xor a - ld [$ff00],a + ld [rJOYP],a ; set P14=HIGH, P15=HIGH ld a,$30 - ld [$ff00],a + ld [rJOYP],a ;load length of packets (16 bytes) ld b,$10 .nextByte @@ -348,10 +348,10 @@ SendSGBPacket: ; 71feb (1c:5feb) ; else (if 0th bit is zero) set P14=LOW,P15=HIGH (send bit 0) ld a,$20 .next0 - ld [$ff00],a + ld [rJOYP],a ; must set P14=HIGH,P15=HIGH between each "pulse" ld a,$30 - ld [$ff00],a + ld [rJOYP],a ; rotation will put next bit in 0th position (so we can always use command ; "bit 0,d" to fetch the bit that has to be sent) rr d @@ -362,10 +362,10 @@ SendSGBPacket: ; 71feb (1c:5feb) jr nz,.nextByte ; send bit 1 as a "stop bit" (end of parameter data) ld a,$20 - ld [$ff00],a + ld [rJOYP],a ; set P14=HIGH,P15=HIGH ld a,$30 - ld [$ff00],a + ld [rJOYP],a xor a ld [$fff9],a ; wait for about 70000 cycles @@ -448,38 +448,38 @@ CheckSGB: ; 7209b (1c:609b) ld [$fff9], a ei call Wait7000 - ld a, [rJOYP] ; $ff0 + ld a, [rJOYP] and $3 cp $3 jr nz, .asm_720fd ld a, $20 - ld [rJOYP], a ; $ff0 - ld a, [rJOYP] ; $ff0 - ld a, [rJOYP] ; $ff0 + ld [rJOYP], a + ld a, [rJOYP] + ld a, [rJOYP] call Wait7000 call Wait7000 ld a, $30 - ld [rJOYP], a ; $ff0 + ld [rJOYP], a call Wait7000 call Wait7000 ld a, $10 - ld [rJOYP], a ; $ff0 - ld a, [rJOYP] ; $ff0 - ld a, [rJOYP] ; $ff0 - ld a, [rJOYP] ; $ff0 - ld a, [rJOYP] ; $ff0 - ld a, [rJOYP] ; $ff0 - ld a, [rJOYP] ; $ff0 + ld [rJOYP], a + ld a, [rJOYP] + ld a, [rJOYP] + ld a, [rJOYP] + ld a, [rJOYP] + ld a, [rJOYP] + ld a, [rJOYP] call Wait7000 call Wait7000 ld a, $30 - ld [rJOYP], a ; $ff0 - ld a, [rJOYP] ; $ff0 - ld a, [rJOYP] ; $ff0 - ld a, [rJOYP] ; $ff0 + ld [rJOYP], a + ld a, [rJOYP] + ld a, [rJOYP] + ld a, [rJOYP] call Wait7000 call Wait7000 - ld a, [rJOYP] ; $ff0 + ld a, [rJOYP] and $3 cp $3 jr nz, .asm_720fd diff --git a/engine/predefs.asm b/engine/predefs.asm index 17f94b73..73a22ad9 100755 --- a/engine/predefs.asm +++ b/engine/predefs.asm @@ -111,7 +111,7 @@ PredefPointers:: ; 4fe79 (13:7e79) add_predef InternalClockTradeAnim add_predef TrainerEngage add_predef IndexToPokedex - add_predef DisplayPicCenteredOrUpperRight; 3B display pic? + add_predef DisplayPicCenteredOrUpperRight add_predef UsedCut add_predef ShowPokedexData add_predef WriteMonMoves @@ -128,15 +128,15 @@ PredefPointers:: ; 4fe79 (13:7e79) add_predef DrawEnemyHUDAndHPBar add_predef LoadTownMap_Nest add_predef PrintMonType - add_predef EmotionBubble; 4C player exclamation + add_predef EmotionBubble add_predef EmptyFunc3; return immediately add_predef AskName add_predef PewterGuys add_predef SaveSAVtoSRAM2 - add_predef LoadSAVCheckSum2 + add_predef LoadSAV2 add_predef LoadSAV add_predef SaveSAVtoSRAM1 - add_predef DoInGameTradeDialogue ; 54 initiate trade + add_predef DoInGameTradeDialogue add_predef HallOfFamePC add_predef DisplayDexRating dbw $1E, _LeaveMapAnim ; wrong bank diff --git a/engine/save.asm b/engine/save.asm index 56468595..7265fa3c 100755 --- a/engine/save.asm +++ b/engine/save.asm @@ -4,11 +4,11 @@ LoadSAV: ; 735e8 (1c:75e8) call ClearScreen call LoadFontTilePatterns call LoadTextBoxTilePatterns - call LoadSAVCheckSum + call LoadSAV0 jr c, .badsum - call LoadSAVCheckSum1 + call LoadSAV1 jr c, .badsum - call LoadSAVCheckSum2 + call LoadSAV2 jr c, .badsum ld a, $2 ; good checksum jr .goodsum @@ -24,14 +24,14 @@ LoadSAV: ; 735e8 (1c:75e8) res 6, [hl] ld a, $1 ; bad checksum .goodsum - ld [wd088], a ; checksum flag + ld [wSaveFileStatus], a ret FileDataDestroyedText: ; 7361e (1c:761e) TX_FAR _FileDataDestroyedText db "@" -LoadSAVCheckSum: ; 73623 (1c:7623) +LoadSAV0: ; 73623 (1c:7623) ld a, SRAM_ENABLE ld [MBC1SRamEnable], a ld a, $1 @@ -43,7 +43,9 @@ LoadSAVCheckSum: ; 73623 (1c:7623) ld c, a ld a, [sMainDataCheckSum] ; SAV's checksum cp c - jp z, .Func_73652 + jp z, .checkSumsMatched + +; If the computed checksum didn't match the saved on, try again. ld hl, sPlayerName ld bc, sMainDataCheckSum - sPlayerName call SAVCheckSum @@ -52,7 +54,7 @@ LoadSAVCheckSum: ; 73623 (1c:7623) cp c jp nz, SAVBadCheckSum -.Func_73652 ; 73652 (1c:7652) +.checkSumsMatched ld hl, sPlayerName ld de, wPlayerName ld bc, 11 @@ -76,7 +78,7 @@ LoadSAVCheckSum: ; 73623 (1c:7623) and a jp SAVGoodChecksum -LoadSAVCheckSum1: ; 73690 (1c:7690) +LoadSAV1: ; 73690 (1c:7690) ld a, SRAM_ENABLE ld [MBC1SRamEnable], a ld a, $1 @@ -96,7 +98,7 @@ LoadSAVCheckSum1: ; 73690 (1c:7690) and a jp SAVGoodChecksum -LoadSAVCheckSum2: ; 736bd (1c:76bd) +LoadSAV2: ; 736bd (1c:76bd) ld a, SRAM_ENABLE ld [MBC1SRamEnable], a ld a, $1 @@ -129,10 +131,11 @@ SAVGoodChecksum: ; 736f8 (1c:76f8) ld [MBC1SRamEnable], a ret -Func_73701: ; 73701 (1c:7701) - call LoadSAVCheckSum - call LoadSAVCheckSum1 - jp LoadSAVCheckSum2 +LoadSAVIgnoreBadCheckSum: ; 73701 (1c:7701) +; unused function that loads save data and ignores bad checksums + call LoadSAV0 + call LoadSAV1 + jp LoadSAV2 SaveSAV: ; 7370a (1c:770a) callba PrintSaveScreenText @@ -140,7 +143,7 @@ SaveSAV: ; 7370a (1c:770a) call SaveSAVConfirm and a ;|0 = Yes|1 = No| ret nz - ld a,[wd088] + ld a,[wSaveFileStatus] dec a jr z,.save call SAVCheckRandomID @@ -270,14 +273,14 @@ SaveSAVtoSRAM2: ; 7380f (1c:780f) SaveSAVtoSRAM: ; 73848 (1c:7848) ld a, $2 - ld [wd088], a + ld [wSaveFileStatus], a call SaveSAVtoSRAM0 call SaveSAVtoSRAM1 jp SaveSAVtoSRAM2 SAVCheckSum: ; 73856 (1c:7856) ;Check Sum (result[1 byte] is complemented) - ld d, $0 + ld d, 0 .loop ld a, [hli] add d @@ -290,11 +293,11 @@ SAVCheckSum: ; 73856 (1c:7856) cpl ret -Func_73863: ; 73863 (1c:7863) +CalcIndividualBoxCheckSums: ; 73863 (1c:7863) ld hl, sBox1 ; sBox7 - ld de, sBoxes1CheckSum2 ; sBoxes2CheckSum2 + ld de, sBank2IndividualBoxChecksums ; sBank3IndividualBoxChecksums ld b, NUM_BOXES / 2 -.asm_7386b +.loop push bc push de ld bc, wBoxMonNicksEnd - W_NUMINBOX @@ -304,21 +307,23 @@ Func_73863: ; 73863 (1c:7863) inc de pop bc dec b - jr nz, .asm_7386b + jr nz, .loop ret -Func_7387b: ; 7387b (1c:787b) - ld hl, PointerTable_73895 +GetBoxSRAMLocation: ; 7387b (1c:787b) +; in: a = box num +; out: b = box SRAM bank, hl = pointer to start of box + ld hl, BoxSRAMPointerTable ld a, [wCurrentBoxNum] and $7f cp NUM_BOXES / 2 - ld b, $2 - jr c, .asm_7388c + ld b, 2 + jr c, .next inc b sub NUM_BOXES / 2 -.asm_7388c +.next ld e, a - ld d, $0 + ld d, 0 add hl, de add hl, de ld a, [hli] @@ -326,7 +331,7 @@ Func_7387b: ; 7387b (1c:787b) ld l, a ret -PointerTable_73895: ; 73895 (1c:7895) +BoxSRAMPointerTable: ; 73895 (1c:7895) dw sBox1 ; sBox7 dw sBox2 ; sBox8 dw sBox3 ; sBox9 @@ -342,9 +347,9 @@ ChangeBox:: ; 738a1 (1c:78a1) and a ret nz ; return if No was chosen ld hl, wCurrentBoxNum - bit 7, [hl] - call z, Func_73a29 - call Func_7393f + bit 7, [hl] ; is it the first time player is changing the box? + call z, EmptyAllSRAMBoxes ; if so, empty all boxes in SRAM + call DisplayChangeBoxMenu call UpdateSprites ld hl, hFlags_0xFFF6 set 1, [hl] @@ -353,17 +358,17 @@ ChangeBox:: ; 738a1 (1c:78a1) res 1, [hl] bit 1, a ret nz - call Func_7387b + call GetBoxSRAMLocation ld e, l ld d, h ld hl, W_NUMINBOX - call Func_7390e + call CopyBoxToOrFromSRAM ; copy old box from WRAM to SRAM ld a, [wCurrentMenuItem] set 7, a ld [wCurrentBoxNum], a - call Func_7387b + call GetBoxSRAMLocation ld de, W_NUMINBOX - call Func_7390e + call CopyBoxToOrFromSRAM ; copy new box from SRAM to WRAM ld hl, W_MAPTEXTPTR ld de, wChangeBoxSavedMapTextPointer ld a, [hli] @@ -384,7 +389,8 @@ WhenYouChangeBoxText: ; 73909 (1c:7909) TX_FAR _WhenYouChangeBoxText db "@" -Func_7390e: ; 7390e (1c:790e) +CopyBoxToOrFromSRAM: ; 7390e (1c:790e) +; copy an entire box from hl to de with b as the SRAM bank push hl ld a, SRAM_ENABLE ld [MBC1SRamEnable], a @@ -395,30 +401,33 @@ Func_7390e: ; 7390e (1c:790e) ld bc, wBoxMonNicksEnd - W_NUMINBOX call CopyData pop hl + +; mark the memory that the box was copied from as am empty box xor a ld [hli], a dec a ld [hl], a + ld hl, sBox1 ; sBox7 - ld bc, sBoxes1CheckSum - sBox1 + ld bc, sBank2AllBoxesChecksum - sBox1 call SAVCheckSum - ld [sBoxes1CheckSum], a ; sBoxes2CheckSum - call Func_73863 + ld [sBank2AllBoxesChecksum], a ; sBank3AllBoxesChecksum + call CalcIndividualBoxCheckSums xor a ld [MBC1SRamBankingMode], a ld [MBC1SRamEnable], a ret -Func_7393f: ; 7393f (1c:793f) +DisplayChangeBoxMenu: ; 7393f (1c:793f) xor a ld [H_AUTOBGTRANSFERENABLED], a - ld a, $3 + ld a, A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a - ld a, $b + ld a, 11 ld [wMaxMenuItem], a - ld a, $1 + ld a, 1 ld [wTopMenuItemY], a - ld a, $c + ld a, 12 ld [wTopMenuItemX], a xor a ld [wMenuWatchMovingOutOfBounds], a @@ -427,14 +436,14 @@ Func_7393f: ; 7393f (1c:793f) ld [wCurrentMenuItem], a ld [wLastMenuItem], a coord hl, 0, 0 - ld b, $2 - ld c, $9 + ld b, 2 + ld c, 9 call TextBoxBorder ld hl, ChooseABoxText call PrintText coord hl, 11, 0 - ld b, $c - ld c, $7 + ld b, 12 + ld c, 7 call TextBoxBorder ld hl, hFlags_0xFFF6 set 2, [hl] @@ -446,37 +455,37 @@ Func_7393f: ; 7393f (1c:793f) ld a, [wCurrentBoxNum] and $7f cp 9 - jr c, .asm_739a6 + jr c, .singleDigitBoxNum sub 9 coord hl, 8, 2 ld [hl], "1" add "0" - jr .asm_739a8 -.asm_739a6 + jr .next +.singleDigitBoxNum add "1" -.asm_739a8 +.next Coorda 9, 2 coord hl, 1, 2 ld de, BoxNoText call PlaceString - call Func_73a84 + call GetMonCountsForAllBoxes coord hl, 18, 1 - ld de, wWhichTrade + ld de, wBoxMonCounts ld bc, SCREEN_WIDTH ld a, $c -.asm_739c2 +.loop push af ld a, [de] - and a - jr z, .asm_739c9 - ld [hl], $78 -.asm_739c9 + and a ; is the box empty? + jr z, .skipPlacingPokeball + ld [hl], $78 ; place pokeball tile next to box name if box not empty +.skipPlacingPokeball add hl, bc inc de pop af dec a - jr nz, .asm_739c2 - ld a, $1 + jr nz, .loop + ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a ret @@ -501,51 +510,54 @@ BoxNames: ; 739d9 (1c:79d9) BoxNoText: ; 73a21 (1c:7a21) db "BOX No.@" -Func_73a29: ; 73a29 (1c:7a29) +EmptyAllSRAMBoxes: ; 73a29 (1c:7a29) +; marks all boxes in SRAM as empty (initialisation for the first time the +; player changes the box) ld a, SRAM_ENABLE ld [MBC1SRamEnable], a ld a, $1 ld [MBC1SRamBankingMode], a - ld a, $2 + ld a, 2 ld [MBC1SRamBank], a - call Func_73a4b - ld a, $3 + call EmptySRAMBoxesInBank + ld a, 3 ld [MBC1SRamBank], a - call Func_73a4b + call EmptySRAMBoxesInBank xor a ld [MBC1SRamBankingMode], a ld [MBC1SRamEnable], a ret -Func_73a4b: ; 73a4b (1c:7a4b) +EmptySRAMBoxesInBank: ; 73a4b (1c:7a4b) +; marks every box in the current SRAM bank as empty ld hl, sBox1 ; sBox7 - call Func_73a7f + call EmptySRAMBox ld hl, sBox2 ; sBox8 - call Func_73a7f + call EmptySRAMBox ld hl, sBox3 ; sBox9 - call Func_73a7f + call EmptySRAMBox ld hl, sBox4 ; sBox10 - call Func_73a7f + call EmptySRAMBox ld hl, sBox5 ; sBox11 - call Func_73a7f + call EmptySRAMBox ld hl, sBox6 ; sBox12 - call Func_73a7f + call EmptySRAMBox ld hl, sBox1 ; sBox7 - ld bc, sBoxes1CheckSum - sBox1 + ld bc, sBank2AllBoxesChecksum - sBox1 call SAVCheckSum - ld [sBoxes1CheckSum], a ; sBoxes2CheckSum - call Func_73863 + ld [sBank2AllBoxesChecksum], a ; sBank3AllBoxesChecksum + call CalcIndividualBoxCheckSums ret -Func_73a7f: ; 73a7f (1c:7a7f) +EmptySRAMBox: ; 73a7f (1c:7a7f) xor a ld [hli], a dec a ld [hl], a ret -Func_73a84: ; 73a84 (1c:7a84) - ld hl, wWhichTrade +GetMonCountsForAllBoxes: ; 73a84 (1c:7a84) + ld hl, wBoxMonCounts push hl ld a, SRAM_ENABLE ld [MBC1SRamEnable], a @@ -553,24 +565,27 @@ Func_73a84: ; 73a84 (1c:7a84) ld [MBC1SRamBankingMode], a ld a, $2 ld [MBC1SRamBank], a - call Func_73ab8 + call GetMonCountsForBoxesInBank ld a, $3 ld [MBC1SRamBank], a - call Func_73ab8 + call GetMonCountsForBoxesInBank xor a ld [MBC1SRamBankingMode], a ld [MBC1SRamEnable], a pop hl + +; copy the count for the current box from WRAM ld a, [wCurrentBoxNum] and $7f ld c, a - ld b, $0 + ld b, 0 add hl, bc ld a, [W_NUMINBOX] ld [hl], a + ret -Func_73ab8: ; 73ab8 (1c:7ab8) +GetMonCountsForBoxesInBank: ; 73ab8 (1c:7ab8) ld a, [sBox1] ; sBox7 ld [hli], a ld a, [sBox2] ; sBox8 @@ -646,7 +661,7 @@ SaveHallOfFameTeams: ; 73b0d (1c:7b0d) LoadHallOfFameTeams: ; 73b3f (1c:7b3f) ld hl, sHallOfFame ld bc, HOF_TEAM - ld a, [wWhichTrade] + ld a, [wHoFTeamIndex] call AddNTimes ld de, wcc5b ld bc, HOF_TEAM diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index ea1eb315..cf6ad3d5 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -867,7 +867,7 @@ LoadSlotMachineTiles: ; 378a8 (d:78a8) ld bc, $00f0 call CopyData call EnableLCD - ld hl, wTrainerEngageDistance + ld hl, wSlotMachineWheel1Offset ld a, $1c ld [hli], a ld [hli], a diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm index 3a4e2e4c..5acdd2c9 100755 --- a/engine/titlescreen.asm +++ b/engine/titlescreen.asm @@ -21,7 +21,7 @@ SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7) ld [wc0ef], a ld [wc0f0], a -LoadTitlescreenGraphics: ; 42dd (1:42dd) +DisplayTitleScreen: ; 42dd (1:42dd) call GBPalWhiteOut ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a diff --git a/home/init.asm b/home/init.asm index 932797ac..3e8d1d2b 100644 --- a/home/init.asm +++ b/home/init.asm @@ -23,17 +23,17 @@ rLCDC_DEFAULT EQU %11100011 xor a ld [rIF], a ld [rIE], a - ld [$ff43], a - ld [$ff42], a + ld [rSCX], a + ld [rSCY], a ld [rSB], a ld [rSC], a ld [rWX], a - ld [$ff4a], a - ld [$ff06], a - ld [$ff07], a + ld [rWY], a + ld [rTMA], a + ld [rTAC], a ld [rBGP], a ld [rOBP0], a - ld [$ff49], a + ld [rOBP1], a ld a, rLCDC_ENABLE_MASK ld [rLCDC], a @@ -66,10 +66,10 @@ rLCDC_DEFAULT EQU %11100011 xor a ld [hTilesetType], a - ld [$ff41], a + ld [rSTAT], a ld [hSCX], a ld [hSCY], a - ld [$ff0f], a + ld [rIF], a ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL ld [rIE], a diff --git a/hram.asm b/hram.asm index a05f3d18..8bbf7150 100644 --- a/hram.asm +++ b/hram.asm @@ -90,6 +90,8 @@ hNPCSpriteOffset EQU $FF95 ; temp value used when swapping bytes hSwapTemp EQU $FF95 +hExperience EQU $FF96 ; 3 bytes, big endian + ; Multiplcation and division variables are meant ; to overlap for back-to-back usage. Big endian. @@ -261,6 +263,8 @@ hQuotient2 EQU $FFE7 hSpriteVRAMSlotAndFacing EQU $FFE9 +hCoordsInFrontOfPlayerMatch EQU $FFEA + hSpriteAnimFrameCounter EQU $FFEA H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn diff --git a/macros.asm b/macros.asm index 5f1deaf6..ba83e73a 100644 --- a/macros.asm +++ b/macros.asm @@ -14,7 +14,7 @@ dex EQUS "db $5f, $50" ; End a Pokedex entry. percent EQUS "* $ff / 100" lb: MACRO ; r, hi, lo - ld \1, (\2) << 8 + (\3) + ld \1, (\2) << 8 + ((\3) & $ff) ENDM diff --git a/main.asm b/main.asm index 08747a5a..c90f5436 100755 --- a/main.asm +++ b/main.asm @@ -3743,7 +3743,7 @@ _AddPartyMon: ; f2e5 (3:72e5) dec de dec de xor a - ld [wHPBarMaxHP], a + ld [wLearningMovesFromDayCare], a predef WriteMonMoves pop de ld a, [wPlayerID] ; set trainer ID to player ID @@ -3758,13 +3758,13 @@ _AddPartyMon: ; f2e5 (3:72e5) callab CalcExperience pop de inc de - ld a, [H_MULTIPLICAND] ; write experience + ld a, [hExperience] ; write experience ld [de], a inc de - ld a, [H_MULTIPLICAND+1] + ld a, [hExperience + 1] ld [de], a inc de - ld a, [H_MULTIPLICAND+2] + ld a, [hExperience + 2] ld [de], a xor a ld b, $a diff --git a/scripts/agatha.asm b/scripts/agatha.asm index e65b1fa2..850cc0bb 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -67,7 +67,7 @@ AgathaScript0: ; 76490 (1d:6490) ld [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $3 jr c, .asm_764b4 ld hl, wd865 diff --git a/scripts/bruno.asm b/scripts/bruno.asm index bd28917c..76a5919a 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -67,7 +67,7 @@ BrunoScript0: ; 76339 (1d:6339) ld [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $3 jr c, .asm_7635d ld hl, wd864 diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index 20873a81..2c7bd449 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -42,7 +42,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld hl, CeruleanCityCoords1 call ArePlayerCoordsInArray jr nc, .asm_194f7 - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 ld a, $8 ld b, SPRITE_FACING_DOWN diff --git a/scripts/daycarem.asm b/scripts/daycarem.asm index 330f2234..794d681e 100755 --- a/scripts/daycarem.asm +++ b/scripts/daycarem.asm @@ -9,19 +9,19 @@ DayCareMText1: ; 56254 (15:6254) call SaveScreenTilesToBuffer2 ld a, [W_DAYCARE_IN_USE] and a - jp nz, DayCareMScript_562e1 - ld hl, DayCareMText_5640f + jp nz, .daycareInUse + ld hl, DayCareIntroText call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a - ld hl, DayCareMText_5643b - jp nz, DayCareMScript_56409 + ld hl, DayCareComeAgainText + jp nz, .done ld a, [wPartyCount] dec a - ld hl, DayCareMText_56445 - jp z, DayCareMScript_56409 - ld hl, DayCareMText_56414 + ld hl, DayCareOnlyHaveOneMonText + jp z, .done + ld hl, DayCareWhichMonText call PrintText xor a ld [wUpdateSpritesEnabled], a @@ -33,17 +33,17 @@ DayCareMText1: ; 56254 (15:6254) call RestoreScreenTilesAndReloadTilePatterns call LoadGBPal pop af - ld hl, DayCareMText_56437 - jp c, DayCareMScript_56409 + ld hl, DayCareAllRightThenText + jp c, .done callab KnowsHMMove - ld hl, DayCareMText_5644a - jp c, DayCareMScript_56409 + ld hl, DayCareCantAcceptMonWithHMText + jp c, .done xor a ld [wPartyAndBillsPCSavedMenuItem], a ld a, [wWhichPokemon] ld hl, wPartyMonNicks call GetPartyMonName - ld hl, DayCareMText_56419 + ld hl, DayCareWillLookAfterMonText call PrintText ld a, 1 ld [W_DAYCARE_IN_USE], a @@ -55,10 +55,10 @@ DayCareMText1: ; 56254 (15:6254) call RemovePokemon ld a, [wcf91] call PlayCry - ld hl, DayCareMText_5641e - jp DayCareMScript_56409 + ld hl, DayCareComeSeeMeInAWhileText + jp .done -DayCareMScript_562e1: ; 562e1 (15:62e1) +.daycareInUse xor a ld hl, W_DAYCAREMONNAME call GetPartyMonName @@ -68,40 +68,41 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) callab CalcLevelFromExperience ld a, d cp MAX_LEVEL - jr c, .asm_56315 + jr c, .skipCalcExp + ld d, MAX_LEVEL callab CalcExperience ld hl, wDayCareMonExp - ld a, [H_NUMTOPRINT] + ld a, [hExperience] ld [hli], a - ld a, [$ff97] + ld a, [hExperience + 1] ld [hli], a - ld a, [$ff98] + ld a, [hExperience + 2] ld [hl], a ld d, MAX_LEVEL -.asm_56315 +.skipCalcExp xor a - ld [wTrainerEngageDistance], a + ld [wDayCareNumLevelsGrown], a ld hl, wDayCareMonBoxLevel ld a, [hl] - ld [wTrainerSpriteOffset], a + ld [wDayCareStartLevel], a cp d ld [hl], d - ld hl, DayCareMText_56432 - jr z, .asm_56333 - ld a, [wTrainerSpriteOffset] + ld hl, DayCareMonNeedsMoreTimeText + jr z, .next + ld a, [wDayCareStartLevel] ld b, a ld a, d sub b - ld [wTrainerEngageDistance], a - ld hl, DayCareMText_56423 + ld [wDayCareNumLevelsGrown], a + ld hl, DayCareMonHasGrownText -.asm_56333 +.next call PrintText ld a, [wPartyCount] cp PARTY_LENGTH - ld hl, DayCareMText_56440 + ld hl, DayCareNoRoomForMonText jp z, .asm_56403 ld de, wTrainerFacingDirection xor a @@ -112,7 +113,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) ld a, $1 ld [hli], a ld [hl], $0 - ld a, [wTrainerEngageDistance] + ld a, [wDayCareNumLevelsGrown] inc a ld b, a ld c, $2 @@ -126,13 +127,13 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) pop hl dec b jr nz, .asm_56357 - ld hl, DayCareMText_56428 + ld hl, DayCareOweMoneyText call PrintText ld a, $13 ld [wTextBoxID], a call DisplayTextBoxID call YesNoChoice - ld hl, DayCareMText_56437 + ld hl, DayCareAllRightThenText ld a, [wCurrentMenuItem] and a jp nz, .asm_56403 @@ -144,13 +145,13 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) ld [hMoney + 2], a call HasEnoughMoney jr nc, .asm_56396 - ld hl, DayCareMText_56454 + ld hl, DayCareNotEnoughMoneyText jp .asm_56403 .asm_56396 xor a ld [W_DAYCARE_IN_USE], a - ld hl, wTrainerEngageDistance + ld hl, wDayCareNumLevelsGrown ld [hli], a inc hl ld de, wPlayerMoney + 2 @@ -161,7 +162,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) ld a, MONEY_BOX ld [wTextBoxID], a call DisplayTextBoxID - ld hl, DayCareMText_5644f + ld hl, DayCareHeresYourMonText call PrintText ld a, DAYCARE_TO_PARTY ld [wMoveMonType], a @@ -178,10 +179,12 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) ld d, h ld e, l ld a, 1 - ld [wHPBarMaxHP], a + ld [wLearningMovesFromDayCare], a predef WriteMonMoves pop bc pop af + +; set mon's HP to max ld hl, wPartyMon1HP call AddNTimes ld d, h @@ -193,73 +196,74 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) inc de ld a, [hl] ld [de], a + ld a, [wcf91] call PlayCry - ld hl, DayCareMText_5642d - jr DayCareMScript_56409 + ld hl, DayCareGotMonBackText + jr .done .asm_56403 - ld a, [wTrainerSpriteOffset] + ld a, [wDayCareStartLevel] ld [wDayCareMonBoxLevel], a -DayCareMScript_56409: ; 56409 (15:6409) +.done call PrintText jp TextScriptEnd -DayCareMText_5640f: ; 5640f (15:640f) - TX_FAR _DayCareMText_5640f +DayCareIntroText: ; 5640f (15:640f) + TX_FAR _DayCareIntroText db "@" -DayCareMText_56414: ; 56414 (15:6414) - TX_FAR _DayCareMText_56414 +DayCareWhichMonText: ; 56414 (15:6414) + TX_FAR _DayCareWhichMonText db "@" -DayCareMText_56419: ; 56419 (15:6419) - TX_FAR _DayCareMText_56419 +DayCareWillLookAfterMonText: ; 56419 (15:6419) + TX_FAR _DayCareWillLookAfterMonText db "@" -DayCareMText_5641e: ; 5641e (15:641e) - TX_FAR _DayCareMText_5641e +DayCareComeSeeMeInAWhileText: ; 5641e (15:641e) + TX_FAR _DayCareComeSeeMeInAWhileText db "@" -DayCareMText_56423: ; 56423 (15:6423) - TX_FAR _DayCareMText_56423 +DayCareMonHasGrownText: ; 56423 (15:6423) + TX_FAR _DayCareMonHasGrownText db "@" -DayCareMText_56428: ; 56428 (15:6428) - TX_FAR _DayCareMText_56428 +DayCareOweMoneyText: ; 56428 (15:6428) + TX_FAR _DayCareOweMoneyText db "@" -DayCareMText_5642d: ; 5642d (15:642d) - TX_FAR _DayCareMText_5642d +DayCareGotMonBackText: ; 5642d (15:642d) + TX_FAR _DayCareGotMonBackText db "@" -DayCareMText_56432: ; 56432 (15:6432) - TX_FAR _DayCareMText_56432 +DayCareMonNeedsMoreTimeText: ; 56432 (15:6432) + TX_FAR _DayCareMonNeedsMoreTimeText db "@" -DayCareMText_56437: ; 56437 (15:6437) - TX_FAR _DayCareMText_56437 -DayCareMText_5643b: ; 5643b (15:643b) - TX_FAR _DayCareMText_5643b +DayCareAllRightThenText: ; 56437 (15:6437) + TX_FAR _DayCareAllRightThenText +DayCareComeAgainText: ; 5643b (15:643b) + TX_FAR _DayCareComeAgainText db "@" -DayCareMText_56440: ; 56440 (15:6440) - TX_FAR _DayCareMText_56440 +DayCareNoRoomForMonText: ; 56440 (15:6440) + TX_FAR _DayCareNoRoomForMonText db "@" -DayCareMText_56445: ; 56445 (15:6445) - TX_FAR _DayCareMText_56445 +DayCareOnlyHaveOneMonText: ; 56445 (15:6445) + TX_FAR _DayCareOnlyHaveOneMonText db "@" -DayCareMText_5644a: ; 5644a (15:644a) - TX_FAR _DayCareMText_5644a +DayCareCantAcceptMonWithHMText: ; 5644a (15:644a) + TX_FAR _DayCareCantAcceptMonWithHMText db "@" -DayCareMText_5644f: ; 5644f (15:644f) - TX_FAR _DayCareMText_5644f +DayCareHeresYourMonText: ; 5644f (15:644f) + TX_FAR _DayCareHeresYourMonText db "@" -DayCareMText_56454: ; 56454 (15:6454) - TX_FAR _DayCareMText_56454 +DayCareNotEnoughMoneyText: ; 56454 (15:6454) + TX_FAR _DayCareNotEnoughMoneyText db "@" diff --git a/scripts/lance.asm b/scripts/lance.asm index e335914b..a4089be4 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -60,7 +60,7 @@ LanceScript0: ; 5a305 (16:6305) jp nc, CheckFightingMapTrainers xor a ld [hJoyHeld], a - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $3 jr nc, .asm_5a325 ld a, $1 diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index 1f1fcde0..eb6c3e7d 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -68,7 +68,7 @@ LoreleiScript0: ; 761e2 (1d:61e2) ld [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $3 jr c, .asm_76206 ld hl, wd863 diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index fa31718f..c22bf761 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -65,7 +65,7 @@ Mansion3Script_5225b: ; 5225b (14:625b) ret nz call ArePlayerCoordsInArray ret nc - ld a, [wWhichTrade] + ld a, [wCoordIndex] ld [wWhichDungeonWarp], a ld hl, wd72d set 4, [hl] diff --git a/scripts/mtmoonpokecenter.asm b/scripts/mtmoonpokecenter.asm index bba73dbd..d4996b4b 100755 --- a/scripts/mtmoonpokecenter.asm +++ b/scripts/mtmoonpokecenter.asm @@ -25,51 +25,51 @@ MtMoonPokecenterText4: ; 492ec (12:52ec) TX_ASM ld a, [wd7c6] add a - jp c, .asm_49353 + jp c, .alreadyBoughtMagikarp ld hl, MtMoonPokecenterText_4935c call PrintText - ld a, $13 + ld a, MONEY_BOX ld [wTextBoxID], a call DisplayTextBoxID call YesNoChoice ld a, [wCurrentMenuItem] and a - jp nz, .asm_4934e + jp nz, .choseNo ld [hMoney], a ld [hMoney + 2], a ld a, $5 ld [hMoney + 1], a call HasEnoughMoney - jr nc, .asm_faa09 + jr nc, .enoughMoney ld hl, MtMoonPokecenterText_49366 - jr .asm_49356 -.asm_faa09 + jr .printText +.enoughMoney ld bc,(MAGIKARP << 8) | 5 call GivePokemon - jr nc, .asm_49359 + jr nc, .done xor a - ld [wWhichTrade], a - ld [wTrainerFacingDirection], a + ld [wPriceTemp], a + ld [wPriceTemp + 2], a ld a, $5 - ld [wTrainerEngageDistance], a - ld hl, wTrainerFacingDirection + ld [wPriceTemp + 1], a + ld hl, wPriceTemp + 2 ld de, wPlayerMoney + 2 ld c, $3 predef SubBCDPredef - ld a, $13 + ld a, MONEY_BOX ld [wTextBoxID], a call DisplayTextBoxID ld hl, wd7c6 set 7, [hl] - jr .asm_49359 -.asm_4934e + jr .done +.choseNo ld hl, MtMoonPokecenterText_49361 - jr .asm_49356 -.asm_49353 + jr .printText +.alreadyBoughtMagikarp ld hl, MtMoonPokecenterText_4936b -.asm_49356 +.printText call PrintText -.asm_49359 +.done jp TextScriptEnd MtMoonPokecenterText_4935c: ; 4935c (12:535c) diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 38c3f717..f4d7de10 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -96,11 +96,11 @@ Museum1FText1: ; 5c135 (17:4135) ld hl, wd754 set 0, [hl] xor a - ld [wMuseumPriceTemp], a - ld [wMuseumPriceTemp + 1], a + ld [wPriceTemp], a + ld [wPriceTemp + 1], a ld a, $50 - ld [wMuseumPriceTemp + 2], a - ld hl, wMuseumPriceTemp + 2 + ld [wPriceTemp + 2], a + ld hl, wPriceTemp + 2 ld de, wPlayerMoney + 2 ld c, $3 predef SubBCDPredef diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 5463b879..226c2d2d 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -307,7 +307,7 @@ OaksLabScript9: ; 1cd00 (7:4d00) ld a, $d ld [hSpriteIndexOrTextID], a call DisplayTextID - ld a, [wTrainerEngageDistance] + ld a, [wRivalStarterBallSpriteIndex] cp $2 jr nz, .asm_1cd28 ld a, HS_STARTER_BALL_1 @@ -323,7 +323,7 @@ OaksLabScript9: ; 1cd00 (7:4d00) ld [wcc4d], a predef HideObject call Delay3 - ld a, [wWhichTrade] + ld a, [wRivalStarterTemp] ld [W_RIVALSTARTER], a ld [wcf91], a ld [wd11e], a @@ -806,9 +806,9 @@ OaksLabText29: ; 1d102 (7:5102) OaksLabText2: ; 1d102 (7:5102) TX_ASM ld a, STARTER2 - ld [wWhichTrade], a + ld [wRivalStarterTemp], a ld a, $3 - ld [wTrainerEngageDistance], a + ld [wRivalStarterBallSpriteIndex], a ld a, STARTER1 ld b, $2 jr OaksLabScript_1d133 @@ -817,9 +817,9 @@ OaksLabText30: ; 1d113 (7:5113) OaksLabText3: ; 1d113 (7:5113) TX_ASM ld a, STARTER3 - ld [wWhichTrade], a + ld [wRivalStarterTemp], a ld a, $4 - ld [wTrainerEngageDistance], a + ld [wRivalStarterBallSpriteIndex], a ld a, STARTER2 ld b, $3 jr OaksLabScript_1d133 @@ -828,9 +828,9 @@ OaksLabText31: ; 1d124 (7:5124) OaksLabText4: ; 1d124 (7:5124) TX_ASM ld a, STARTER1 - ld [wWhichTrade], a + ld [wRivalStarterTemp], a ld a, $2 - ld [wTrainerEngageDistance], a + ld [wRivalStarterBallSpriteIndex], a ld a, STARTER3 ld b, $4 @@ -858,13 +858,13 @@ OaksLabScript_1d157: ; 1d157 (7:5157) ld a, $9 ld [H_SPRITEDATAOFFSET], a call GetPointerWithinSpriteStateData1 - ld [hl], $0 + ld [hl], SPRITE_FACING_DOWN ld a, $1 ld [H_SPRITEINDEX], a ld a, $9 ld [H_SPRITEDATAOFFSET], a call GetPointerWithinSpriteStateData1 - ld [hl], $c + ld [hl], SPRITE_FACING_RIGHT ld hl, wd730 set 6, [hl] predef StarterDex ; StarterDex diff --git a/scripts/pewterpokecenter.asm b/scripts/pewterpokecenter.asm index 42bc3086..584878eb 100755 --- a/scripts/pewterpokecenter.asm +++ b/scripts/pewterpokecenter.asm @@ -26,39 +26,45 @@ PewterPokecenterText3: ; 5c59b (17:459b) ld c, 32 call DelayFrames ld hl, JigglypuffFacingDirections - ld de, wTrainerFacingDirection - ld bc, $0004 + ld de, wJigglypuffFacingDirections + ld bc, 4 call CopyData - ld a, [wSpriteStateData1 + $32] - ld hl, wTrainerFacingDirection -.asm_5c5c3 + + ld a, [wSpriteStateData1 + 3 * $10 + $2] + ld hl, wJigglypuffFacingDirections +.findMatchingFacingDirectionLoop cp [hl] inc hl - jr nz, .asm_5c5c3 + jr nz, .findMatchingFacingDirectionLoop dec hl push hl ld c, BANK(Music_JigglypuffSong) ld a, MUSIC_JIGGLYPUFF_SONG call PlayMusic pop hl -.asm_5c5d1 +.loop ld a, [hl] - ld [wSpriteStateData1 + $32], a + ld [wSpriteStateData1 + 3 * $10 + $2], a + +; rotate the array push hl - ld hl, wTrainerFacingDirection - ld de, wTrainerEngageDistance - ld bc, $0004 + ld hl, wJigglypuffFacingDirections + ld de, wJigglypuffFacingDirections - 1 + ld bc, 4 call CopyData - ld a, [wTrainerEngageDistance] - ld [wcd42], a + ld a, [wJigglypuffFacingDirections - 1] + ld [wJigglypuffFacingDirections + 3], a pop hl + ld c, 24 call DelayFrames + ld a, [wc026] ld b, a ld a, [wc027] or b - jr nz, .asm_5c5d1 + jr nz, .loop + ld c, 48 call DelayFrames call PlayDefaultMusic diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index e89630fc..2e5b55f7 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -26,7 +26,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) ld [hJoyHeld], a ld a, SPRITE_FACING_RIGHT ld [wSpriteStateData1 + 9], a - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr z, .asm_7520f ld a, $2 diff --git a/scripts/seafoamislands1.asm b/scripts/seafoamislands1.asm index 6a8b23ea..f71fc648 100755 --- a/scripts/seafoamislands1.asm +++ b/scripts/seafoamislands1.asm @@ -10,7 +10,7 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) call CheckBoulderCoords ret nc ld hl, wd7e8 - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr nz, .asm_44819 set 6, [hl] @@ -36,7 +36,7 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) ld a, $9f ld [wDungeonWarpDestinationMap], a ld hl, Seafoam1HolesCoords - jp Func_46981 + jp IsPlayerOnDungeonWarp Seafoam1HolesCoords: ; 44846 (11:4846) db $06,$11 diff --git a/scripts/seafoamislands2.asm b/scripts/seafoamislands2.asm index 44e92bd0..a62d6bda 100755 --- a/scripts/seafoamislands2.asm +++ b/scripts/seafoamislands2.asm @@ -8,7 +8,7 @@ SeafoamIslands2Script: ; 46315 (11:6315) call CheckBoulderCoords ret nc ld hl, wd87f - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr nz, .asm_46340 set 0, [hl] @@ -34,7 +34,7 @@ SeafoamIslands2Script: ; 46315 (11:6315) ld a, $a0 ld [wDungeonWarpDestinationMap], a ld hl, Seafoam2HolesCoords - jp Func_46981 + jp IsPlayerOnDungeonWarp Seafoam2HolesCoords: ; 4636d (11:636d) db $06,$12 diff --git a/scripts/seafoamislands3.asm b/scripts/seafoamislands3.asm index 882553ab..0b650135 100755 --- a/scripts/seafoamislands3.asm +++ b/scripts/seafoamislands3.asm @@ -8,7 +8,7 @@ SeafoamIslands3Script: ; 46451 (11:6451) call CheckBoulderCoords ret nc ld hl, wd880 - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr nz, .asm_4647c set 0, [hl] @@ -34,7 +34,7 @@ SeafoamIslands3Script: ; 46451 (11:6451) ld a, $a1 ld [wDungeonWarpDestinationMap], a ld hl, Seafoam3HolesCoords - jp Func_46981 + jp IsPlayerOnDungeonWarp Seafoam3HolesCoords: ; 464a9 (11:64a9) db $06,$13 diff --git a/scripts/seafoamislands4.asm b/scripts/seafoamislands4.asm index 8009e221..f16ab2c6 100755 --- a/scripts/seafoamislands4.asm +++ b/scripts/seafoamislands4.asm @@ -8,7 +8,7 @@ SeafoamIslands4Script: ; 4658d (11:658d) call CheckBoulderCoords ret nc ld hl, wd881 - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr nz, .asm_465b8 set 0, [hl] @@ -35,7 +35,7 @@ SeafoamIslands4Script: ; 4658d (11:658d) ld a, $a2 ld [wDungeonWarpDestinationMap], a ld hl, Seafoam4HolesCoords - call Func_46981 + call IsPlayerOnDungeonWarp ld a, [wd732] bit 4, a ret nz diff --git a/scripts/seafoamislands5.asm b/scripts/seafoamislands5.asm index 47583600..ab303728 100755 --- a/scripts/seafoamislands5.asm +++ b/scripts/seafoamislands5.asm @@ -34,7 +34,7 @@ SeafoamIslands5Script0: ; 467c7 (11:67c7) ld hl, CoordsData_467fe call ArePlayerCoordsInArray ret nc - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $3 jr nc, .asm_467e6 ld a, $40 @@ -81,7 +81,7 @@ SeafoamIslands5Script2: ; 46816 (11:6816) call ArePlayerCoordsInArray ld a, $0 jr nc, .asm_46849 - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr nz, .asm_46837 ld de, RLEMovementData_46859 diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 8538d37f..5043b947 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -142,7 +142,7 @@ SilphCo7Script0: ; 51c23 (14:5c23) ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF ld de, MovementData_51c7d - ld a, [wWhichTrade] + ld a, [wCoordIndex] ld [wcf0d], a cp $1 jr z, .asm_51c6c diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index a8cf3b8d..adae2e91 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -57,15 +57,15 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) ld bc, $0078 ld a, $14 call FillMemory - ld a, $1 - ld [$ffba], a + ld a, 1 + ld [H_AUTOBGTRANSFERENABLED], a call Delay3 xor a - ld [$ffba], a - ld [wWhichTrade], a - ld [$ff49], a - ld a, $58 - ld [wTrainerEngageDistance], a + ld [H_AUTOBGTRANSFERENABLED], a + ld [wSSAnneSmokeDriftAmount], a + ld [rOBP1], a + ld a, 88 + ld [wSSAnneSmokeX], a ld hl, wMapViewVRAMPointer ld c, [hl] inc hl @@ -88,11 +88,11 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) push hl push de call ScheduleEastColumnRedraw - call VermilionDock_1dc59 + call VermilionDock_EmitSmokePuff pop de ld b, $10 .asm_1dc11 - call VermilionDock_1dc42 + call VermilionDock_AnimSmokePuffDriftRight ld c, $8 .asm_1dc16 call VermilionDock_1dc7c @@ -105,7 +105,7 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) dec e jr nz, .asm_1dbfa xor a - ld [$ff4a], a + ld [rWY], a ld [hWY], a call VermilionDock_1dc94 ld a, $90 @@ -122,33 +122,34 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) dec [hl] ret -VermilionDock_1dc42: ; 1dc42 (7:5c42) +VermilionDock_AnimSmokePuffDriftRight: ; 1dc42 (7:5c42) push bc push de ld hl, wOAMBuffer + $11 - ld a, [wWhichTrade] + ld a, [wSSAnneSmokeDriftAmount] swap a ld c, a - ld de, $0004 -.asm_1dc50 + ld de, 4 +.loop inc [hl] inc [hl] add hl, de dec c - jr nz, .asm_1dc50 + jr nz, .loop pop de pop bc ret -VermilionDock_1dc59: ; 1dc59 (7:5c59) - ld a, [wTrainerEngageDistance] - sub $10 - ld [wTrainerEngageDistance], a +VermilionDock_EmitSmokePuff: ; 1dc59 (7:5c59) +; new smoke puff above the S.S. Anne's front smokestack + ld a, [wSSAnneSmokeX] + sub 16 + ld [wSSAnneSmokeX], a ld c, a - ld b, $64 - ld a, [wWhichTrade] + ld b, 100 ; Y + ld a, [wSSAnneSmokeDriftAmount] inc a - ld [wWhichTrade], a + ld [wSSAnneSmokeDriftAmount], a ld a, $1 ld de, VermilionDockOAMBlock call WriteOAMBlock @@ -171,7 +172,7 @@ VermilionDock_1dc7c: ; 1dc7c (7:5c7c) cp l jr nz, .asm_1dc86 ld a, h - ld [$ff43], a + ld [rSCX], a .asm_1dc8e ld a, [rLY] cp h diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index 51346032..fd095638 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -49,7 +49,7 @@ VictoryRoad2Script0: ; 517f1 (14:57f1) call CheckBoulderCoords jp nc, CheckFightingMapTrainers ld hl, wd7ee - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $2 jr z, .asm_5180b bit 0, [hl] diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index 9aeb1d18..14b6895d 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -34,7 +34,7 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) ld hl, .coordsData_449f9 call CheckBoulderCoords jp nc, .asm_449fe - ld a, [wWhichTrade] + ld a, [wCoordIndex] cp $1 jr nz, .asm_449dc ld hl, wd126 @@ -60,11 +60,11 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) db $FF .asm_449fe - ld a, $c2 + ld a, VICTORY_ROAD_2 ld [wDungeonWarpDestinationMap], a ld hl, .coordsData_449f9 - call Func_46981 - ld a, [wWhichTrade] + call IsPlayerOnDungeonWarp + ld a, [wCoordIndex] cp $1 jr nz, .asm_44a1b ld hl, wd72d diff --git a/sram.asm b/sram.asm index 9d498df9..f0cf6fac 100644 --- a/sram.asm +++ b/sram.asm @@ -29,8 +29,8 @@ sBox3:: ds wBoxMonNicksEnd - W_NUMINBOX ; a8c4 sBox4:: ds wBoxMonNicksEnd - W_NUMINBOX ; ad26 sBox5:: ds wBoxMonNicksEnd - W_NUMINBOX ; b188 sBox6:: ds wBoxMonNicksEnd - W_NUMINBOX ; b5ea -sBoxes1CheckSum:: ds 1 ; ba4c -sBoxes1CheckSum2:: ds 6 ; ba4d +sBank2AllBoxesChecksum:: ds 1 ; ba4c +sBank2IndividualBoxChecksums:: ds 6 ; ba4d SECTION "Saved Boxes 2", SRAM, BANK[3] @@ -41,5 +41,5 @@ sBox9:: ds wBoxMonNicksEnd - W_NUMINBOX ; a8c4 sBox10:: ds wBoxMonNicksEnd - W_NUMINBOX ; ad26 sBox11:: ds wBoxMonNicksEnd - W_NUMINBOX ; b188 sBox12:: ds wBoxMonNicksEnd - W_NUMINBOX ; b5ea -sBoxes2CheckSum:: ds 1 ; ba4c -sBoxes2CheckSum2:: ds 6 ; ba4d +sBank3AllBoxesChecksum:: ds 1 ; ba4c +sBank3IndividualBoxChecksums:: ds 6 ; ba4d diff --git a/text/maps/daycare_1.asm b/text/maps/daycare_1.asm index a4182351..a42e3cf2 100644 --- a/text/maps/daycare_1.asm +++ b/text/maps/daycare_1.asm @@ -1,16 +1,16 @@ -_DayCareMText_5640f:: ; 8ab95 (22:6b95) +_DayCareIntroText:: ; 8ab95 (22:6b95) text "I run a DAYCARE." line "Would you like me" cont "to raise one of" cont "your #MON?" done -_DayCareMText_56414:: ; 8abd4 (22:6bd4) +_DayCareWhichMonText:: ; 8abd4 (22:6bd4) text "Which #MON" line "should I raise?" prompt -_DayCareMText_56419:: ; 8abf0 (22:6bf0) +_DayCareWillLookAfterMonText:: ; 8abf0 (22:6bf0) text "Fine, I'll look" line "after @" TX_RAM wcd6d @@ -18,12 +18,12 @@ _DayCareMText_56419:: ; 8abf0 (22:6bf0) cont "for a while." prompt -_DayCareMText_5641e:: ; 8ac19 (22:6c19) +_DayCareComeSeeMeInAWhileText:: ; 8ac19 (22:6c19) text "Come see me in" line "a while." done -_DayCareMText_56423:: ; 8ac32 (22:6c32) +_DayCareMonHasGrownText:: ; 8ac32 (22:6c32) text "Your @" TX_RAM wcd6d db $0 @@ -31,15 +31,13 @@ _DayCareMText_56423:: ; 8ac32 (22:6c32) para "By level, it's" line "grown by @" - -DayCareMText_8ac67:: ; 8ac67 (22:6c67) - TX_NUM wTrainerEngageDistance,$1,$3 + TX_NUM wDayCareNumLevelsGrown,$1,$3 text "!" para "Aren't I great?" prompt -_DayCareMText_56428:: ; 8ac7d (22:6c7d) +_DayCareOweMoneyText:: ; 8ac7d (22:6c7d) text "You owe me ¥@" TX_BCD wcd3f, $c2 db $0 @@ -47,14 +45,14 @@ _DayCareMText_56428:: ; 8ac7d (22:6c7d) cont "of this #MON." done -_DayCareMText_5642d:: ; 8acae (22:6cae) +_DayCareGotMonBackText:: ; 8acae (22:6cae) text $52, " got" line "@" TX_RAM W_DAYCAREMONNAME text " back!" done -_DayCareMText_56432:: ; 8acc1 (22:6cc1) +_DayCareMonNeedsMoreTimeText:: ; 8acc1 (22:6cc1) text "Back already?" line "Your @" TX_RAM wcd6d diff --git a/text/maps/daycare_2.asm b/text/maps/daycare_2.asm index c6478a76..b5104e60 100644 --- a/text/maps/daycare_2.asm +++ b/text/maps/daycare_2.asm @@ -1,8 +1,8 @@ -_DayCareMText_56437:: ; 8c000 (23:4000) +_DayCareAllRightThenText:: ; 8c000 (23:4000) text "All right then," line "@@" -_DayCareMText_5643b:: ; 8c013 (23:4013) +_DayCareComeAgainText:: ; 8c013 (23:4013) IF DEF(_YELLOW) text "Come again." ELSE @@ -10,28 +10,28 @@ ELSE ENDC done -_DayCareMText_56440:: ; 8c020 (23:4020) +_DayCareNoRoomForMonText:: ; 8c020 (23:4020) text "You have no room" line "for this #MON!" done -_DayCareMText_56445:: ; 8c041 (23:4041) +_DayCareOnlyHaveOneMonText:: ; 8c041 (23:4041) text "You only have one" line "#MON with you." done -_DayCareMText_5644a:: ; 8c063 (23:4063) +_DayCareCantAcceptMonWithHMText:: ; 8c063 (23:4063) text "I can't accept a" line "#MON that" cont "knows an HM move." done -_DayCareMText_5644f:: ; 8c090 (23:4090) +_DayCareHeresYourMonText:: ; 8c090 (23:4090) text "Thank you! Here's" line "your #MON!" prompt -_DayCareMText_56454:: ; 8c0ad (23:40ad) +_DayCareNotEnoughMoneyText:: ; 8c0ad (23:40ad) text "Hey, you don't" line "have enough ¥!" done diff --git a/wram.asm b/wram.asm index 8633e732..f089352b 100755 --- a/wram.asm +++ b/wram.asm @@ -424,6 +424,10 @@ wNumStepsToTake:: ; cca1 wRLEByteCount:: ; ccd2 ds 1 +wAddedToParty:: ; ccd3 +; 0 = not added +; 1 = added + wSimulatedJoypadStatesEnd:: ; ccd3 ; this is the end of the joypad states ; the list starts above this address and extends downwards in memory until here @@ -431,7 +435,13 @@ wSimulatedJoypadStatesEnd:: ; ccd3 wParentMenuItem:: ; ccd3 -wccd3:: ds 1 ; used in battle, pokemon, PC and game corner stuff +wCanEvolveFlags:: ; ccd3 +; 1 flag for each party member indicating whether it can evolve +; The purpose of these flags is to track which mons levelled up during the +; current battle at the end of the battle when evolution occurs. +; Other methods of evolution simply set it by calling TryEvolvingMon. + ds 1 + wForceEvolution:: wccd4:: ds 1 ; has a direct reference for simulated joypad stuff in vermillion and seafoam @@ -634,9 +644,33 @@ wOverrideSimulatedJoypadStatesMask:: ; cd3b ds 1 +wHoFTeamIndex:: ; cd3d + +wSSAnneSmokeDriftAmount:: ; cd3d +; multiplied by 16 to get the number of times to go right by 2 pixels + +wRivalStarterTemp:: ; cd3d + +wBoxMonCounts:: ; cd3d +; 12 bytes +; array of the number of mons in each box + +wDexMaxSeenMon:: ; cd3d + +wPPRestoreItem:: ; cd3d + +wWereAnyMonsAsleep:: ; cd3d + +wCanPlaySlots:: ; cd3d + +wNumShakes:: ; cd3d + +wDayCareStartLevel:: ; cd3d +; the level of the mon at the time it entered day care + wWhichBadge:: ; cd3d -wMuseumPriceTemp:: ; cd3d +wPriceTemp:: ; cd3d ; 3-byte BCD number wTitleMonSpecies:: ; cd3d @@ -701,6 +735,12 @@ wWhichTrade:: ; cd3d wTrainerSpriteOffset:: ; cd3d ds 1 +wSSAnneSmokeX:: ; cd3e + +wRivalStarterBallSpriteIndex:: ; cd3e + +wDayCareNumLevelsGrown:: ; cd3e + wOptionsBattleAnimCursorX:: ; cd3e wTrainerInfoTextBoxWidth:: ; cd3e @@ -733,6 +773,8 @@ wHiddenObjectFunctionRomBank:: ; cd3e wTrainerEngageDistance:: ; cd3e ds 1 +wJigglypuffFacingDirections:: ; cd3f + wOptionsBattleStyleCursorX:: ; cd3f wTrainerInfoTextBoxNextRowOffset:: ; cd3f @@ -774,6 +816,10 @@ wHiddenObjectY:: ; cd40 wTrainerScreenY:: ; cd40 ds 1 +wHoFTeamIndex2:: ; cd41 + +wHiddenItemOrCoinsIndex:: ; cd41 + wTradedPlayerMonOT:: ; cd41 wHiddenObjectX:: ; cd41 @@ -962,16 +1008,32 @@ wTileMapBackup2:: ; cd81 ; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top) ds 20 * 18 +wEvoOldSpecies:: ; cee9 + wBuffer:: ; cee9 ; Temporary storage area of 30 bytes. wTownMapCoords:: ; cee9 ; lower nybble is x, upper nybble is y +wLearningMovesFromDayCare:: ; cee9 +; whether WriteMonMoves is being used to make a mon learn moves from day care +; non-zero if so + wHPBarMaxHP:: ; cee9 - ds 2 + ds 1 + +wEvoNewSpecies:: ; ceea + ds 1 + +wEvoMonTileOffset:: ; ceeb + wHPBarOldHP:: ; ceeb - ds 2 + ds 1 + +wEvoCancelled:: ; ceec + ds 1 + wHPBarNewHP:: ; ceed ds 2 wHPBarDelta:: ; ceef @@ -1453,7 +1515,10 @@ W_SUBANIMCOUNTER:: ; d087 ; counts the number of subentries left in the current subanimation ds 1 -wd088:: ds 1 ; savefile checksum (if file is corrupted) +wSaveFileStatus:: +; 1 = no save file or save file is corrupted +; 2 = save file exists and no corruption has been detected + ds 1 W_NUMFBTILES:: ; d089 ; number of tiles in current battle animation frame block @@ -1462,6 +1527,8 @@ W_NUMFBTILES:: ; d089 wTradedMonMovingRight:: ; d08a ; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa +wOptionsInitialized:: ; d08a + wd08a:: ds 1 ; used with sprites and displaying the option menu on the main menu screen? wAnimCounter:: ; d08b @@ -2079,6 +2146,8 @@ wBoxItems:: ; d53b ds 1 ; end wCurrentBoxNum:: ; d5a0 +; bits 0-6: box number +; bit 7: whether the player has changed boxes before ds 2 wNumHoFTeams:: ; d5a2 @@ -2319,8 +2388,11 @@ W_ROUTE18GATECURSCRIPT:: ; d669 ds 134 -wd6f0:: ds 14 ; flags for hidden items? -wd6fe:: ds 2 ; flags for hidden coins? +wObtainedHiddenItemsFlags:: + ds 14 + +wObtainedHiddenCoinsFlags:: + ds 2 wWalkBikeSurfState:: ; d700 ; $00 = walking -- cgit v1.3.1-sl0p From fcab935a0f449246380480613ac0896e0b90a0d8 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 20 Jul 2015 18:32:02 -0700 Subject: enumerate events --- constants.asm | 1 + constants/event_constants.asm | 2562 +++++++++++++++++++++++++++++++++ engine/hall_of_fame.asm | 3 +- engine/hidden_object_functions17.asm | 12 +- engine/hidden_object_functions18.asm | 3 +- engine/hidden_object_functions7.asm | 24 +- engine/items/items.asm | 18 +- engine/menu/bills_pc.asm | 9 +- engine/menu/pc.asm | 3 +- engine/menu/start_menu.asm | 9 +- engine/overworld/cable_club_npc.asm | 3 +- engine/overworld/cinnabar_lab.asm | 4 +- engine/pokedex_rating.asm | 5 +- home/overworld.asm | 6 +- macros.asm | 426 ++++++ main.asm | 13 +- scripts/agatha.asm | 11 +- scripts/bikeshop.asm | 9 +- scripts/billshouse.asm | 18 +- scripts/blueshouse.asm | 12 +- scripts/bruno.asm | 11 +- scripts/celadoncity.asm | 13 +- scripts/celadondiner.asm | 6 +- scripts/celadongamecorner.asm | 27 +- scripts/celadongym.asm | 45 +- scripts/celadonmart3.asm | 6 +- scripts/celadonmartroof.asm | 18 +- scripts/ceruleancity.asm | 18 +- scripts/ceruleangym.asm | 26 +- scripts/cinnabargym.asm | 53 +- scripts/cinnabarisland.asm | 6 +- scripts/copycatshouse2f.asm | 6 +- scripts/fanclub.asm | 24 +- scripts/fightingdojo.asm | 45 +- scripts/fuchsiacity.asm | 5 +- scripts/fuchsiagym.asm | 42 +- scripts/fuchsiahouse2.asm | 12 +- scripts/gary.asm | 6 +- scripts/halloffameroom.asm | 8 +- scripts/indigoplateaulobby.asm | 11 +- scripts/lab3.asm | 6 +- scripts/lab4.asm | 11 +- scripts/lance.asm | 17 +- scripts/lavenderhouse1.asm | 12 +- scripts/lavenderhouse2.asm | 3 +- scripts/lavendermart.asm | 3 +- scripts/lorelei.asm | 11 +- scripts/mansion1.asm | 13 +- scripts/mansion2.asm | 13 +- scripts/mansion3.asm | 11 +- scripts/mansion4.asm | 11 +- scripts/mtmoon1.asm | 28 +- scripts/mtmoon3.asm | 40 +- scripts/mtmoonpokecenter.asm | 6 +- scripts/museum1f.asm | 15 +- scripts/oakslab.asm | 60 +- scripts/pallettown.asm | 24 +- scripts/pewtercity.asm | 6 +- scripts/pewtergym.asm | 22 +- scripts/pokemontower2.asm | 18 +- scripts/pokemontower3.asm | 12 +- scripts/pokemontower4.asm | 12 +- scripts/pokemontower5.asm | 23 +- scripts/pokemontower6.asm | 18 +- scripts/pokemontower7.asm | 18 +- scripts/powerplant.asm | 36 +- scripts/rockethideout1.asm | 31 +- scripts/rockethideout2.asm | 4 +- scripts/rockethideout3.asm | 8 +- scripts/rockethideout4.asm | 28 +- scripts/rocktunnel1.asm | 28 +- scripts/rocktunnel2.asm | 32 +- scripts/route1.asm | 4 +- scripts/route10.asm | 24 +- scripts/route11.asm | 40 +- scripts/route11gateupstairs.asm | 9 +- scripts/route12.asm | 38 +- scripts/route12gateupstairs.asm | 6 +- scripts/route13.asm | 40 +- scripts/route14.asm | 40 +- scripts/route15.asm | 40 +- scripts/route15gateupstairs.asm | 6 +- scripts/route16.asm | 34 +- scripts/route16house.asm | 6 +- scripts/route17.asm | 40 +- scripts/route18.asm | 12 +- scripts/route19.asm | 40 +- scripts/route20.asm | 52 +- scripts/route21.asm | 36 +- scripts/route22.asm | 28 +- scripts/route23.asm | 28 +- scripts/route24.asm | 46 +- scripts/route25.asm | 47 +- scripts/route2gate.asm | 6 +- scripts/route3.asm | 32 +- scripts/route4.asm | 4 +- scripts/route6.asm | 24 +- scripts/route8.asm | 36 +- scripts/route9.asm | 36 +- scripts/safarizoneentrance-yellow.asm | 5 +- scripts/safarizoneentrance.asm | 15 +- scripts/safarizonesecrethouse.asm | 6 +- scripts/saffrongym.asm | 48 +- scripts/saffronhouse2.asm | 6 +- scripts/seafoamislands1.asm | 9 +- scripts/seafoamislands2.asm | 6 +- scripts/seafoamislands3.asm | 6 +- scripts/seafoamislands4.asm | 14 +- scripts/seafoamislands5.asm | 12 +- scripts/silphco1.asm | 7 +- scripts/silphco10.asm | 17 +- scripts/silphco11.asm | 26 +- scripts/silphco2.asm | 35 +- scripts/silphco3.asm | 24 +- scripts/silphco4.asm | 25 +- scripts/silphco5.asm | 35 +- scripts/silphco6.asm | 21 +- scripts/silphco7.asm | 53 +- scripts/silphco8.asm | 21 +- scripts/silphco9.asm | 40 +- scripts/ssanne10.asm | 24 +- scripts/ssanne5.asm | 8 +- scripts/ssanne7.asm | 12 +- scripts/ssanne8.asm | 16 +- scripts/ssanne9.asm | 16 +- scripts/unknowndungeon3.asm | 4 +- scripts/vermilioncity.asm | 16 +- scripts/vermiliondock.asm | 15 +- scripts/vermiliongym.asm | 30 +- scripts/victoryroad1.asm | 17 +- scripts/victoryroad2.asm | 40 +- scripts/victoryroad3.asm | 26 +- scripts/viridiancity.asm | 21 +- scripts/viridianforest.asm | 12 +- scripts/viridiangym.asm | 57 +- scripts/viridianmart.asm | 6 +- wram.asm | 139 +- 137 files changed, 4108 insertions(+), 1655 deletions(-) create mode 100755 constants/event_constants.asm (limited to 'scripts/lorelei.asm') diff --git a/constants.asm b/constants.asm index 0b24ea05..e121b6b3 100644 --- a/constants.asm +++ b/constants.asm @@ -30,3 +30,4 @@ INCLUDE "constants/credits_constants.asm" INCLUDE "constants/music_constants.asm" INCLUDE "constants/tilesets.asm" INCLUDE "constants/starter_mons.asm" +INCLUDE "constants/event_constants.asm" diff --git a/constants/event_constants.asm b/constants/event_constants.asm new file mode 100755 index 00000000..64241ae6 --- /dev/null +++ b/constants/event_constants.asm @@ -0,0 +1,2562 @@ +const_value = 0 + + const EVENT_STOPPED_FROM_LEAVING_PALLET + const EVENT_001 + const EVENT_002 + const EVENT_003 + const EVENT_004 + const EVENT_005 + const EVENT_006 + const EVENT_007 + const EVENT_008 + const EVENT_009 + const EVENT_00A + const EVENT_00B + const EVENT_00C + const EVENT_00D + const EVENT_00E + const EVENT_00F + const EVENT_010 + const EVENT_011 + const EVENT_012 + const EVENT_013 + const EVENT_014 + const EVENT_015 + const EVENT_016 + const EVENT_017 + const EVENT_018 + const EVENT_019 + const EVENT_01A + const EVENT_01B + const EVENT_01C + const EVENT_01D + const EVENT_01E + const EVENT_01F + const EVENT_FOLLOWED_OAK_INSIDE_LAB + const EVENT_OAK_ASKED_TO_CHOOSE_MON + const EVENT_GOT_STARTER + const EVENT_BATTLED_RIVAL_IN_OAKS_LAB + const EVENT_GOT_POKEBALLS_FROM_OAK + const EVENT_GOT_POKEDEX + const EVENT_026 + const EVENT_027 + const EVENT_028 + const EVENT_029 + const EVENT_02A + const EVENT_02B + const EVENT_02C + const EVENT_02D + const EVENT_02E + const EVENT_02F + const EVENT_030 + const EVENT_031 + const EVENT_032 + const EVENT_033 + const EVENT_034 + const EVENT_035 + const EVENT_036 + const EVENT_037 + const EVENT_038 + const EVENT_039 + const EVENT_03A + const EVENT_03B + const EVENT_03C + const EVENT_03D + const EVENT_03E + const EVENT_03F + const EVENT_040 + const EVENT_041 + const EVENT_042 + const EVENT_043 + const EVENT_044 + const EVENT_045 + const EVENT_046 + const EVENT_047 + const EVENT_048 + const EVENT_049 + const EVENT_04A + const EVENT_04B + const EVENT_04C + const EVENT_04D + const EVENT_04E + const EVENT_04F + const EVENT_050 + const EVENT_051 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7 + const EVENT_05A + const EVENT_05B + const EVENT_05C + const EVENT_05D + const EVENT_05E + const EVENT_05F + const EVENT_060 + const EVENT_061 + const EVENT_062 + const EVENT_063 + const EVENT_064 + const EVENT_065 + const EVENT_066 + const EVENT_067 + const EVENT_068 + const EVENT_069 + const EVENT_06A + const EVENT_06B + const EVENT_06C + const EVENT_06D + const EVENT_06E + const EVENT_06F + const EVENT_070 + const EVENT_071 + const EVENT_BEAT_PEWTER_GYM_TRAINER_0 + const EVENT_073 + const EVENT_074 + const EVENT_075 + const EVENT_076 + const EVENT_077 + const EVENT_078 + const EVENT_079 + const EVENT_07A + const EVENT_07B + const EVENT_07C + const EVENT_07D + const EVENT_07E + const EVENT_07F + const EVENT_080 + const EVENT_081 + const EVENT_082 + const EVENT_083 + const EVENT_084 + const EVENT_085 + const EVENT_086 + const EVENT_087 + const EVENT_088 + const EVENT_089 + const EVENT_08A + const EVENT_08B + const EVENT_08C + const EVENT_08D + const EVENT_08E + const EVENT_08F + const EVENT_090 + const EVENT_091 + const EVENT_092 + const EVENT_093 + const EVENT_094 + const EVENT_095 + const EVENT_096 + const EVENT_097 + const EVENT_098 + const EVENT_099 + const EVENT_09A + const EVENT_09B + const EVENT_09C + const EVENT_09D + const EVENT_09E + const EVENT_09F + const EVENT_0A0 + const EVENT_0A1 + const EVENT_0A2 + const EVENT_0A3 + const EVENT_0A4 + const EVENT_0A5 + const EVENT_0A6 + const EVENT_0A7 + const EVENT_0A8 + const EVENT_0A9 + const EVENT_0AA + const EVENT_0AB + const EVENT_0AC + const EVENT_0AD + const EVENT_0AE + const EVENT_0AF + const EVENT_0B0 + const EVENT_0B1 + const EVENT_0B2 + const EVENT_0B3 + const EVENT_0B4 + const EVENT_0B5 + const EVENT_0B6 + const EVENT_0B7 + const EVENT_0B8 + const EVENT_0B9 + const EVENT_BEAT_CERULEAN_GYM_TRAINER_0 + const EVENT_BEAT_CERULEAN_GYM_TRAINER_1 + const EVENT_0BC + const EVENT_0BD + const EVENT_0BE + const EVENT_0BF + const EVENT_0C0 + const EVENT_0C1 + const EVENT_0C2 + const EVENT_0C3 + const EVENT_0C4 + const EVENT_0C5 + const EVENT_0C6 + const EVENT_0C7 + const EVENT_0C8 + const EVENT_0C9 + const EVENT_0CA + const EVENT_0CB + const EVENT_0CC + const EVENT_0CD + const EVENT_0CE + const EVENT_0CF + const EVENT_0D0 + const EVENT_0D1 + const EVENT_0D2 + const EVENT_0D3 + const EVENT_0D4 + const EVENT_0D5 + const EVENT_0D6 + const EVENT_0D7 + const EVENT_0D8 + const EVENT_0D9 + const EVENT_0DA + const EVENT_0DB + const EVENT_0DC + const EVENT_0DD + const EVENT_0DE + const EVENT_0DF + const EVENT_0E0 + const EVENT_0E1 + const EVENT_0E2 + const EVENT_0E3 + const EVENT_0E4 + const EVENT_0E5 + const EVENT_0E6 + const EVENT_0E7 + const EVENT_0E8 + const EVENT_0E9 + const EVENT_0EA + const EVENT_0EB + const EVENT_0EC + const EVENT_0ED + const EVENT_0EE + const EVENT_0EF + const EVENT_0F0 + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 + const EVENT_0F4 + const EVENT_0F5 + const EVENT_0F6 + const EVENT_0F7 + const EVENT_0F8 + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 + const EVENT_0FC + const EVENT_0FD + const EVENT_0FE + const EVENT_0FF + const EVENT_100 + const EVENT_101 + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 + const EVENT_106 + const EVENT_107 + const EVENT_108 + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 + const EVENT_10C + const EVENT_10D + const EVENT_10E + const EVENT_10F + const EVENT_110 + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_2 + const EVENT_114 + const EVENT_115 + const EVENT_116 + const EVENT_117 + const EVENT_118 + const EVENT_119 + const EVENT_11A + const EVENT_11B + const EVENT_11C + const EVENT_11D + const EVENT_11E + const EVENT_11F + const EVENT_120 + const EVENT_121 + const EVENT_122 + const EVENT_123 + const EVENT_124 + const EVENT_125 + const EVENT_126 + const EVENT_127 + const EVENT_128 + const EVENT_129 + const EVENT_12A + const EVENT_12B + const EVENT_12C + const EVENT_12D + const EVENT_12E + const EVENT_12F + const EVENT_130 + const EVENT_131 + const EVENT_132 + const EVENT_133 + const EVENT_134 + const EVENT_135 + const EVENT_136 + const EVENT_137 + const EVENT_138 + const EVENT_139 + const EVENT_13A + const EVENT_13B + const EVENT_13C + const EVENT_13D + const EVENT_13E + const EVENT_13F + const EVENT_140 + const EVENT_141 + const EVENT_142 + const EVENT_143 + const EVENT_144 + const EVENT_145 + const EVENT_146 + const EVENT_147 + const EVENT_148 + const EVENT_149 + const EVENT_14A + const EVENT_14B + const EVENT_14C + const EVENT_14D + const EVENT_14E + const EVENT_14F + const EVENT_150 + const EVENT_GOT_BIKE_VOUCHER + const EVENT_152 + const EVENT_153 + const EVENT_154 + const EVENT_155 + const EVENT_156 + const EVENT_157 + const EVENT_158 + const EVENT_159 + const EVENT_15A + const EVENT_15B + const EVENT_15C + const EVENT_15D + const EVENT_15E + const EVENT_15F + const EVENT_2ND_LOCK_OPENED + const EVENT_1ST_LOCK_OPENED + const EVENT_BEAT_VERMILION_GYM_TRAINER_0 + const EVENT_BEAT_VERMILION_GYM_TRAINER_1 + const EVENT_BEAT_VERMILION_GYM_TRAINER_2 + const EVENT_165 + const EVENT_166 + const EVENT_167 + const EVENT_168 + const EVENT_169 + const EVENT_16A + const EVENT_16B + const EVENT_16C + const EVENT_16D + const EVENT_16E + const EVENT_16F + const EVENT_170 + const EVENT_171 + const EVENT_172 + const EVENT_173 + const EVENT_174 + const EVENT_175 + const EVENT_176 + const EVENT_177 + const EVENT_178 + const EVENT_179 + const EVENT_17A + const EVENT_17B + const EVENT_17C + const EVENT_17D + const EVENT_17E + const EVENT_17F + const EVENT_180 + const EVENT_181 + const EVENT_182 + const EVENT_183 + const EVENT_184 + const EVENT_185 + const EVENT_186 + const EVENT_187 + const EVENT_188 + const EVENT_189 + const EVENT_18A + const EVENT_18B + const EVENT_18C + const EVENT_18D + const EVENT_18E + const EVENT_18F + const EVENT_190 + const EVENT_191 + const EVENT_192 + const EVENT_193 + const EVENT_194 + const EVENT_195 + const EVENT_196 + const EVENT_197 + const EVENT_198 + const EVENT_199 + const EVENT_19A + const EVENT_19B + const EVENT_19C + const EVENT_19D + const EVENT_19E + const EVENT_19F + const EVENT_1A0 + const EVENT_1A1 + const EVENT_1A2 + const EVENT_1A3 + const EVENT_1A4 + const EVENT_1A5 + const EVENT_1A6 + const EVENT_1A7 + const EVENT_1A8 + const EVENT_1A9 + const EVENT_BEAT_CELADON_GYM_TRAINER_0 + const EVENT_BEAT_CELADON_GYM_TRAINER_2 + const EVENT_BEAT_CELADON_GYM_TRAINER_3 + const EVENT_BEAT_CELADON_GYM_TRAINER_4 + const EVENT_BEAT_CELADON_GYM_TRAINER_5 + const EVENT_BEAT_CELADON_GYM_TRAINER_6 + const EVENT_BEAT_CELADON_GYM_TRAINER_7 + const EVENT_1B1 + const EVENT_1B2 + const EVENT_1B3 + const EVENT_1B4 + const EVENT_1B5 + const EVENT_1B6 + const EVENT_1B7 + const EVENT_1B8 + const EVENT_1B9 + const EVENT_1BA + const EVENT_1BB + const EVENT_1BC + const EVENT_1BD + const EVENT_1BE + const EVENT_1BF + const EVENT_1C0 + const EVENT_1C1 + const EVENT_1C2 + const EVENT_1C3 + const EVENT_1C4 + const EVENT_1C5 + const EVENT_1C6 + const EVENT_1C7 + const EVENT_1C8 + const EVENT_1C9 + const EVENT_1CA + const EVENT_1CB + const EVENT_1CC + const EVENT_1CD + const EVENT_1CE + const EVENT_1CF + const EVENT_1D0 + const EVENT_1D1 + const EVENT_1D2 + const EVENT_1D3 + const EVENT_1D4 + const EVENT_1D5 + const EVENT_1D6 + const EVENT_1D7 + const EVENT_1D8 + const EVENT_1D9 + const EVENT_1DA + const EVENT_1DB + const EVENT_1DC + const EVENT_1DD + const EVENT_1DE + const EVENT_1DF + const EVENT_1E0 + const EVENT_1E1 + const EVENT_1E2 + const EVENT_1E3 + const EVENT_1E4 + const EVENT_1E5 + const EVENT_1E6 + const EVENT_1E7 + const EVENT_1E8 + const EVENT_1E9 + const EVENT_1EA + const EVENT_1EB + const EVENT_1EC + const EVENT_1ED + const EVENT_1EE + const EVENT_1EF + const EVENT_1F0 + const EVENT_1F1 + const EVENT_1F2 + const EVENT_1F3 + const EVENT_1F4 + const EVENT_1F5 + const EVENT_1F6 + const EVENT_1F7 + const EVENT_1F8 + const EVENT_1F9 + const EVENT_1FA + const EVENT_1FB + const EVENT_1FC + const EVENT_1FD + const EVENT_1FE + const EVENT_1FF + const EVENT_200 + const EVENT_201 + const EVENT_202 + const EVENT_203 + const EVENT_204 + const EVENT_205 + const EVENT_206 + const EVENT_207 + const EVENT_208 + const EVENT_209 + const EVENT_20A + const EVENT_20B + const EVENT_20C + const EVENT_20D + const EVENT_20E + const EVENT_20F + const EVENT_210 + const EVENT_211 + const EVENT_212 + const EVENT_213 + const EVENT_214 + const EVENT_215 + const EVENT_216 + const EVENT_217 + const EVENT_218 + const EVENT_219 + const EVENT_21A + const EVENT_21B + const EVENT_21C + const EVENT_21D + const EVENT_21E + const EVENT_21F + const EVENT_220 + const EVENT_221 + const EVENT_222 + const EVENT_223 + const EVENT_224 + const EVENT_225 + const EVENT_226 + const EVENT_227 + const EVENT_228 + const EVENT_229 + const EVENT_22A + const EVENT_22B + const EVENT_22C + const EVENT_22D + const EVENT_22E + const EVENT_22F + const EVENT_230 + const EVENT_231 + const EVENT_232 + const EVENT_233 + const EVENT_234 + const EVENT_235 + const EVENT_236 + const EVENT_237 + const EVENT_238 + const EVENT_239 + const EVENT_23A + const EVENT_23B + const EVENT_23C + const EVENT_23D + const EVENT_23E + const EVENT_23F + const EVENT_240 + const EVENT_241 + const EVENT_242 + const EVENT_243 + const EVENT_244 + const EVENT_245 + const EVENT_246 + const EVENT_247 + const EVENT_248 + const EVENT_249 + const EVENT_24A + const EVENT_24B + const EVENT_24C + const EVENT_24D + const EVENT_SAFARI_GAME_OVER + const EVENT_IN_SAFARI_ZONE + const EVENT_250 + const EVENT_251 + const EVENT_252 + const EVENT_253 + const EVENT_254 + const EVENT_255 + const EVENT_256 + const EVENT_257 + const EVENT_258 + const EVENT_259 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 + const EVENT_260 + const EVENT_261 + const EVENT_262 + const EVENT_263 + const EVENT_264 + const EVENT_265 + const EVENT_266 + const EVENT_267 + const EVENT_268 + const EVENT_269 + const EVENT_26A + const EVENT_26B + const EVENT_26C + const EVENT_26D + const EVENT_26E + const EVENT_26F + const EVENT_270 + const EVENT_271 + const EVENT_272 + const EVENT_273 + const EVENT_274 + const EVENT_275 + const EVENT_276 + const EVENT_277 + const EVENT_278 + const EVENT_279 + const EVENT_27A + const EVENT_27B + const EVENT_27C + const EVENT_27D + const EVENT_27E + const EVENT_27F + const EVENT_280 + const EVENT_281 + const EVENT_282 + const EVENT_283 + const EVENT_284 + const EVENT_285 + const EVENT_286 + const EVENT_287 + const EVENT_288 + const EVENT_BEAT_MANSION_1_TRAINER_0 + const EVENT_28A + const EVENT_28B + const EVENT_28C + const EVENT_28D + const EVENT_28E + const EVENT_28F + const EVENT_290 + const EVENT_291 + const EVENT_292 + const EVENT_293 + const EVENT_294 + const EVENT_295 + const EVENT_296 + const EVENT_297 + const EVENT_298 + const EVENT_299 + const EVENT_29A + const EVENT_29B + const EVENT_29C + const EVENT_29D + const EVENT_29E + const EVENT_29F + const EVENT_2A0 + const EVENT_2A1 + const EVENT_2A2 + const EVENT_2A3 + const EVENT_2A4 + const EVENT_2A5 + const EVENT_2A6 + const EVENT_2A7 + const EVENT_2A8 + const EVENT_2A9 + const EVENT_2AA + const EVENT_2AB + const EVENT_2AC + const EVENT_2AD + const EVENT_2AE + const EVENT_2AF + const EVENT_2B0 + const EVENT_2B1 + const EVENT_2B2 + const EVENT_2B3 + const EVENT_2B4 + const EVENT_2B5 + const EVENT_2B6 + const EVENT_2B7 + const EVENT_2B8 + const EVENT_2B9 + const EVENT_2BA + const EVENT_2BB + const EVENT_2BC + const EVENT_2BD + const EVENT_2BE + const EVENT_2BF + const EVENT_2C0 + const EVENT_2C1 + const EVENT_2C2 + const EVENT_2C3 + const EVENT_2C4 + const EVENT_2C5 + const EVENT_2C6 + const EVENT_2C7 + const EVENT_2C8 + const EVENT_2C9 + const EVENT_2CA + const EVENT_2CB + const EVENT_2CC + const EVENT_2CD + const EVENT_2CE + const EVENT_2CF + const EVENT_2D0 + const EVENT_2D1 + const EVENT_2D2 + const EVENT_2D3 + const EVENT_2D4 + const EVENT_2D5 + const EVENT_2D6 + const EVENT_2D7 + const EVENT_2D8 + const EVENT_2D9 + const EVENT_2DA + const EVENT_2DB + const EVENT_2DC + const EVENT_2DD + const EVENT_2DE + const EVENT_2DF + const EVENT_2E0 + const EVENT_2E1 + const EVENT_2E2 + const EVENT_2E3 + const EVENT_2E4 + const EVENT_2E5 + const EVENT_2E6 + const EVENT_2E7 + const EVENT_2E8 + const EVENT_2E9 + const EVENT_2EA + const EVENT_2EB + const EVENT_2EC + const EVENT_2ED + const EVENT_2EE + const EVENT_2EF + const EVENT_2F0 + const EVENT_2F1 + const EVENT_2F2 + const EVENT_2F3 + const EVENT_2F4 + const EVENT_2F5 + const EVENT_2F6 + const EVENT_2F7 + const EVENT_2F8 + const EVENT_2F9 + const EVENT_2FA + const EVENT_2FB + const EVENT_2FC + const EVENT_2FD + const EVENT_2FE + const EVENT_2FF + const EVENT_300 + const EVENT_301 + const EVENT_302 + const EVENT_303 + const EVENT_304 + const EVENT_305 + const EVENT_306 + const EVENT_307 + const EVENT_308 + const EVENT_309 + const EVENT_30A + const EVENT_30B + const EVENT_30C + const EVENT_30D + const EVENT_30E + const EVENT_30F + const EVENT_310 + const EVENT_311 + const EVENT_312 + const EVENT_313 + const EVENT_314 + const EVENT_315 + const EVENT_316 + const EVENT_317 + const EVENT_318 + const EVENT_319 + const EVENT_31A + const EVENT_31B + const EVENT_31C + const EVENT_31D + const EVENT_31E + const EVENT_31F + const EVENT_320 + const EVENT_321 + const EVENT_322 + const EVENT_323 + const EVENT_324 + const EVENT_325 + const EVENT_326 + const EVENT_327 + const EVENT_328 + const EVENT_329 + const EVENT_32A + const EVENT_32B + const EVENT_32C + const EVENT_32D + const EVENT_32E + const EVENT_32F + const EVENT_330 + const EVENT_331 + const EVENT_332 + const EVENT_333 + const EVENT_334 + const EVENT_335 + const EVENT_336 + const EVENT_337 + const EVENT_338 + const EVENT_339 + const EVENT_33A + const EVENT_33B + const EVENT_33C + const EVENT_33D + const EVENT_33E + const EVENT_33F + const EVENT_340 + const EVENT_341 + const EVENT_342 + const EVENT_343 + const EVENT_344 + const EVENT_345 + const EVENT_346 + const EVENT_347 + const EVENT_348 + const EVENT_349 + const EVENT_34A + const EVENT_34B + const EVENT_34C + const EVENT_34D + const EVENT_34E + const EVENT_34F + const EVENT_350 + const EVENT_351 + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 + const EVENT_356 + const EVENT_357 + const EVENT_358 + const EVENT_359 + const EVENT_35A + const EVENT_35B + const EVENT_35C + const EVENT_35D + const EVENT_35E + const EVENT_35F + const EVENT_360 + const EVENT_361 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_0 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_1 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_2 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_3 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_4 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_5 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_6 + const EVENT_369 + const EVENT_36A + const EVENT_36B + const EVENT_36C + const EVENT_36D + const EVENT_36E + const EVENT_36F + const EVENT_370 + const EVENT_371 + const EVENT_372 + const EVENT_373 + const EVENT_374 + const EVENT_375 + const EVENT_376 + const EVENT_377 + const EVENT_378 + const EVENT_379 + const EVENT_37A + const EVENT_37B + const EVENT_37C + const EVENT_37D + const EVENT_37E + const EVENT_37F + const EVENT_380 + const EVENT_381 + const EVENT_382 + const EVENT_383 + const EVENT_384 + const EVENT_385 + const EVENT_386 + const EVENT_387 + const EVENT_388 + const EVENT_389 + const EVENT_38A + const EVENT_38B + const EVENT_38C + const EVENT_38D + const EVENT_38E + const EVENT_38F + const EVENT_390 + const EVENT_391 + const EVENT_392 + const EVENT_393 + const EVENT_394 + const EVENT_395 + const EVENT_396 + const EVENT_397 + const EVENT_398 + const EVENT_399 + const EVENT_39A + const EVENT_39B + const EVENT_39C + const EVENT_39D + const EVENT_39E + const EVENT_39F + const EVENT_3A0 + const EVENT_3A1 + const EVENT_3A2 + const EVENT_3A3 + const EVENT_3A4 + const EVENT_3A5 + const EVENT_3A6 + const EVENT_3A7 + const EVENT_3A8 + const EVENT_3A9 + const EVENT_3AA + const EVENT_3AB + const EVENT_3AC + const EVENT_3AD + const EVENT_3AE + const EVENT_3AF + const EVENT_3B0 + const EVENT_3B1 + const EVENT_3B2 + const EVENT_3B3 + const EVENT_3B4 + const EVENT_3B5 + const EVENT_3B6 + const EVENT_3B7 + const EVENT_3B8 + const EVENT_3B9 + const EVENT_3BA + const EVENT_3BB + const EVENT_3BC + const EVENT_3BD + const EVENT_3BE + const EVENT_3BF + const EVENT_3C0 + const EVENT_3C1 + const EVENT_3C2 + const EVENT_3C3 + const EVENT_3C4 + const EVENT_3C5 + const EVENT_3C6 + const EVENT_3C7 + const EVENT_3C8 + const EVENT_3C9 + const EVENT_3CA + const EVENT_3CB + const EVENT_3CC + const EVENT_3CD + const EVENT_3CE + const EVENT_3CF + const EVENT_3D0 + const EVENT_3D1 + const EVENT_3D2 + const EVENT_3D3 + const EVENT_3D4 + const EVENT_3D5 + const EVENT_3D6 + const EVENT_3D7 + const EVENT_3D8 + const EVENT_3D9 + const EVENT_3DA + const EVENT_3DB + const EVENT_3DC + const EVENT_3DD + const EVENT_3DE + const EVENT_3DF + const EVENT_3E0 + const EVENT_3E1 + const EVENT_BEAT_ROUTE_3_TRAINER_0 + const EVENT_BEAT_ROUTE_3_TRAINER_2 + const EVENT_BEAT_ROUTE_3_TRAINER_3 + const EVENT_BEAT_ROUTE_3_TRAINER_4 + const EVENT_BEAT_ROUTE_3_TRAINER_5 + const EVENT_BEAT_ROUTE_3_TRAINER_6 + const EVENT_BEAT_ROUTE_3_TRAINER_7 + const EVENT_BEAT_ROUTE_3_TRAINER_8 + const EVENT_3EA + const EVENT_3EB + const EVENT_3EC + const EVENT_3ED + const EVENT_3EE + const EVENT_3EF + const EVENT_3F0 + const EVENT_3F1 + const EVENT_BEAT_ROUTE_4_TRAINER_0 + const EVENT_3F3 + const EVENT_3F4 + const EVENT_3F5 + const EVENT_3F6 + const EVENT_3F7 + const EVENT_3F8 + const EVENT_3F9 + const EVENT_3FA + const EVENT_3FB + const EVENT_3FC + const EVENT_3FD + const EVENT_3FE + const EVENT_BOUGHT_MAGIKARP + const EVENT_400 + const EVENT_401 + const EVENT_402 + const EVENT_403 + const EVENT_404 + const EVENT_405 + const EVENT_406 + const EVENT_407 + const EVENT_408 + const EVENT_409 + const EVENT_40A + const EVENT_40B + const EVENT_40C + const EVENT_40D + const EVENT_40E + const EVENT_40F + const EVENT_410 + const EVENT_BEAT_ROUTE_6_TRAINER_0 + const EVENT_BEAT_ROUTE_6_TRAINER_1 + const EVENT_BEAT_ROUTE_6_TRAINER_2 + const EVENT_BEAT_ROUTE_6_TRAINER_3 + const EVENT_BEAT_ROUTE_6_TRAINER_4 + const EVENT_BEAT_ROUTE_6_TRAINER_5 + const EVENT_417 + const EVENT_418 + const EVENT_419 + const EVENT_41A + const EVENT_41B + const EVENT_41C + const EVENT_41D + const EVENT_41E + const EVENT_41F + const EVENT_420 + const EVENT_421 + const EVENT_422 + const EVENT_423 + const EVENT_424 + const EVENT_425 + const EVENT_426 + const EVENT_427 + const EVENT_428 + const EVENT_429 + const EVENT_42A + const EVENT_42B + const EVENT_42C + const EVENT_42D + const EVENT_42E + const EVENT_42F + const EVENT_430 + const EVENT_BEAT_ROUTE_8_TRAINER_0 + const EVENT_BEAT_ROUTE_8_TRAINER_1 + const EVENT_BEAT_ROUTE_8_TRAINER_2 + const EVENT_BEAT_ROUTE_8_TRAINER_3 + const EVENT_BEAT_ROUTE_8_TRAINER_4 + const EVENT_BEAT_ROUTE_8_TRAINER_5 + const EVENT_BEAT_ROUTE_8_TRAINER_6 + const EVENT_BEAT_ROUTE_8_TRAINER_7 + const EVENT_BEAT_ROUTE_8_TRAINER_8 + const EVENT_43A + const EVENT_43B + const EVENT_43C + const EVENT_43D + const EVENT_43E + const EVENT_43F + const EVENT_440 + const EVENT_BEAT_ROUTE_9_TRAINER_0 + const EVENT_BEAT_ROUTE_9_TRAINER_2 + const EVENT_BEAT_ROUTE_9_TRAINER_3 + const EVENT_BEAT_ROUTE_9_TRAINER_4 + const EVENT_BEAT_ROUTE_9_TRAINER_5 + const EVENT_BEAT_ROUTE_9_TRAINER_6 + const EVENT_BEAT_ROUTE_9_TRAINER_7 + const EVENT_BEAT_ROUTE_9_TRAINER_8 + const EVENT_BEAT_ROUTE_9_TRAINER_9 + const EVENT_44A + const EVENT_44B + const EVENT_44C + const EVENT_44D + const EVENT_44E + const EVENT_44F + const EVENT_450 + const EVENT_BEAT_ROUTE_10_TRAINER_0 + const EVENT_BEAT_ROUTE_10_TRAINER_1 + const EVENT_BEAT_ROUTE_10_TRAINER_2 + const EVENT_BEAT_ROUTE_10_TRAINER_3 + const EVENT_BEAT_ROUTE_10_TRAINER_4 + const EVENT_BEAT_ROUTE_10_TRAINER_5 + const EVENT_457 + const EVENT_458 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 + const EVENT_460 + const EVENT_BEAT_POWER_PLANT_TRAINER_0 + const EVENT_BEAT_POWER_PLANT_TRAINER_1 + const EVENT_BEAT_POWER_PLANT_TRAINER_2 + const EVENT_BEAT_POWER_PLANT_TRAINER_3 + const EVENT_BEAT_POWER_PLANT_TRAINER_4 + const EVENT_BEAT_POWER_PLANT_TRAINER_5 + const EVENT_BEAT_POWER_PLANT_TRAINER_6 + const EVENT_BEAT_POWER_PLANT_TRAINER_7 + const EVENT_BEAT_POWER_PLANT_TRAINER_8 + const EVENT_46A + const EVENT_46B + const EVENT_46C + const EVENT_46D + const EVENT_46E + const EVENT_46F + const EVENT_470 + const EVENT_BEAT_ROUTE_11_TRAINER_0 + const EVENT_BEAT_ROUTE_11_TRAINER_1 + const EVENT_BEAT_ROUTE_11_TRAINER_2 + const EVENT_BEAT_ROUTE_11_TRAINER_3 + const EVENT_BEAT_ROUTE_11_TRAINER_4 + const EVENT_BEAT_ROUTE_11_TRAINER_5 + const EVENT_BEAT_ROUTE_11_TRAINER_6 + const EVENT_BEAT_ROUTE_11_TRAINER_7 + const EVENT_BEAT_ROUTE_11_TRAINER_8 + const EVENT_BEAT_ROUTE_11_TRAINER_9 + const EVENT_47B + const EVENT_47C + const EVENT_47D + const EVENT_47E + const EVENT_47F + const EVENT_480 + const EVENT_481 + const EVENT_BEAT_ROUTE_12_TRAINER_0 + const EVENT_BEAT_ROUTE_12_TRAINER_1 + const EVENT_BEAT_ROUTE_12_TRAINER_2 + const EVENT_BEAT_ROUTE_12_TRAINER_3 + const EVENT_BEAT_ROUTE_12_TRAINER_4 + const EVENT_BEAT_ROUTE_12_TRAINER_5 + const EVENT_BEAT_ROUTE_12_TRAINER_6 + const EVENT_489 + const EVENT_48A + const EVENT_48B + const EVENT_48C + const EVENT_48D + const EVENT_FIGHT_ROUTE12_SNORLAX + const EVENT_BEAT_ROUTE12_SNORLAX + const EVENT_490 + const EVENT_BEAT_ROUTE_13_TRAINER_0 + const EVENT_BEAT_ROUTE_13_TRAINER_2 + const EVENT_BEAT_ROUTE_13_TRAINER_3 + const EVENT_BEAT_ROUTE_13_TRAINER_4 + const EVENT_BEAT_ROUTE_13_TRAINER_5 + const EVENT_BEAT_ROUTE_13_TRAINER_6 + const EVENT_BEAT_ROUTE_13_TRAINER_7 + const EVENT_BEAT_ROUTE_13_TRAINER_8 + const EVENT_BEAT_ROUTE_13_TRAINER_9 + const EVENT_BEAT_ROUTE_13_TRAINER_10 + const EVENT_49B + const EVENT_49C + const EVENT_49D + const EVENT_49E + const EVENT_49F + const EVENT_4A0 + const EVENT_BEAT_ROUTE_14_TRAINER_0 + const EVENT_BEAT_ROUTE_14_TRAINER_1 + const EVENT_BEAT_ROUTE_14_TRAINER_2 + const EVENT_BEAT_ROUTE_14_TRAINER_3 + const EVENT_BEAT_ROUTE_14_TRAINER_4 + const EVENT_BEAT_ROUTE_14_TRAINER_5 + const EVENT_BEAT_ROUTE_14_TRAINER_6 + const EVENT_BEAT_ROUTE_14_TRAINER_7 + const EVENT_BEAT_ROUTE_14_TRAINER_8 + const EVENT_BEAT_ROUTE_14_TRAINER_9 + const EVENT_4AB + const EVENT_4AC + const EVENT_4AD + const EVENT_4AE + const EVENT_4AF + const EVENT_4B0 + const EVENT_BEAT_ROUTE_15_TRAINER_0 + const EVENT_BEAT_ROUTE_15_TRAINER_1 + const EVENT_BEAT_ROUTE_15_TRAINER_2 + const EVENT_BEAT_ROUTE_15_TRAINER_3 + const EVENT_BEAT_ROUTE_15_TRAINER_4 + const EVENT_BEAT_ROUTE_15_TRAINER_5 + const EVENT_BEAT_ROUTE_15_TRAINER_6 + const EVENT_BEAT_ROUTE_15_TRAINER_7 + const EVENT_BEAT_ROUTE_15_TRAINER_8 + const EVENT_BEAT_ROUTE_15_TRAINER_9 + const EVENT_4BB + const EVENT_4BC + const EVENT_4BD + const EVENT_4BE + const EVENT_4BF + const EVENT_4C0 + const EVENT_BEAT_ROUTE_16_TRAINER_0 + const EVENT_BEAT_ROUTE_16_TRAINER_1 + const EVENT_BEAT_ROUTE_16_TRAINER_2 + const EVENT_BEAT_ROUTE_16_TRAINER_3 + const EVENT_BEAT_ROUTE_16_TRAINER_4 + const EVENT_BEAT_ROUTE_16_TRAINER_5 + const EVENT_4C7 + const EVENT_FIGHT_ROUTE16_SNORLAX + const EVENT_BEAT_ROUTE16_SNORLAX + const EVENT_4CA + const EVENT_4CB + const EVENT_4CC + const EVENT_4CD + const EVENT_4CE + const EVENT_4CF + const EVENT_4D0 + const EVENT_BEAT_ROUTE_17_TRAINER_0 + const EVENT_BEAT_ROUTE_17_TRAINER_1 + const EVENT_BEAT_ROUTE_17_TRAINER_2 + const EVENT_BEAT_ROUTE_17_TRAINER_3 + const EVENT_BEAT_ROUTE_17_TRAINER_4 + const EVENT_BEAT_ROUTE_17_TRAINER_5 + const EVENT_BEAT_ROUTE_17_TRAINER_6 + const EVENT_BEAT_ROUTE_17_TRAINER_7 + const EVENT_BEAT_ROUTE_17_TRAINER_8 + const EVENT_BEAT_ROUTE_17_TRAINER_9 + const EVENT_4DB + const EVENT_4DC + const EVENT_4DD + const EVENT_4DE + const EVENT_4DF + const EVENT_4E0 + const EVENT_BEAT_ROUTE_18_TRAINER_0 + const EVENT_BEAT_ROUTE_18_TRAINER_1 + const EVENT_BEAT_ROUTE_18_TRAINER_2 + const EVENT_4E4 + const EVENT_4E5 + const EVENT_4E6 + const EVENT_4E7 + const EVENT_4E8 + const EVENT_4E9 + const EVENT_4EA + const EVENT_4EB + const EVENT_4EC + const EVENT_4ED + const EVENT_4EE + const EVENT_4EF + const EVENT_4F0 + const EVENT_BEAT_ROUTE_19_TRAINER_0 + const EVENT_BEAT_ROUTE_19_TRAINER_1 + const EVENT_BEAT_ROUTE_19_TRAINER_2 + const EVENT_BEAT_ROUTE_19_TRAINER_3 + const EVENT_BEAT_ROUTE_19_TRAINER_4 + const EVENT_BEAT_ROUTE_19_TRAINER_5 + const EVENT_BEAT_ROUTE_19_TRAINER_6 + const EVENT_BEAT_ROUTE_19_TRAINER_7 + const EVENT_BEAT_ROUTE_19_TRAINER_8 + const EVENT_BEAT_ROUTE_19_TRAINER_9 + const EVENT_4FB + const EVENT_4FC + const EVENT_4FD + const EVENT_4FE + const EVENT_4FF + const EVENT_500 + const EVENT_BEAT_ROUTE_20_TRAINER_0 + const EVENT_BEAT_ROUTE_20_TRAINER_2 + const EVENT_BEAT_ROUTE_20_TRAINER_3 + const EVENT_BEAT_ROUTE_20_TRAINER_4 + const EVENT_BEAT_ROUTE_20_TRAINER_5 + const EVENT_BEAT_ROUTE_20_TRAINER_6 + const EVENT_BEAT_ROUTE_20_TRAINER_7 + const EVENT_BEAT_ROUTE_20_TRAINER_8 + const EVENT_BEAT_ROUTE_20_TRAINER_9 + const EVENT_BEAT_ROUTE_20_TRAINER_10 + const EVENT_50B + const EVENT_50C + const EVENT_50D + const EVENT_50E + const EVENT_50F + const EVENT_510 + const EVENT_BEAT_ROUTE_21_TRAINER_0 + const EVENT_BEAT_ROUTE_21_TRAINER_1 + const EVENT_BEAT_ROUTE_21_TRAINER_2 + const EVENT_BEAT_ROUTE_21_TRAINER_3 + const EVENT_BEAT_ROUTE_21_TRAINER_4 + const EVENT_BEAT_ROUTE_21_TRAINER_5 + const EVENT_BEAT_ROUTE_21_TRAINER_6 + const EVENT_BEAT_ROUTE_21_TRAINER_7 + const EVENT_BEAT_ROUTE_21_TRAINER_8 + const EVENT_51A + const EVENT_51B + const EVENT_51C + const EVENT_51D + const EVENT_51E + const EVENT_51F + const EVENT_520 + const EVENT_521 + const EVENT_522 + const EVENT_523 + const EVENT_524 + const EVENT_525 + const EVENT_526 + const EVENT_527 + const EVENT_528 + const EVENT_529 + const EVENT_52A + const EVENT_52B + const EVENT_52C + const EVENT_52D + const EVENT_52E + const EVENT_52F + const EVENT_530 + const EVENT_531 + const EVENT_532 + const EVENT_533 + const EVENT_534 + const EVENT_535 + const EVENT_536 + const EVENT_537 + const EVENT_538 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 + const EVENT_53F + const EVENT_540 + const EVENT_541 + const EVENT_BEAT_ROUTE_24_TRAINER_0 + const EVENT_BEAT_ROUTE_24_TRAINER_2 + const EVENT_BEAT_ROUTE_24_TRAINER_3 + const EVENT_BEAT_ROUTE_24_TRAINER_4 + const EVENT_BEAT_ROUTE_24_TRAINER_5 + const EVENT_BEAT_ROUTE_24_TRAINER_6 + const EVENT_548 + const EVENT_549 + const EVENT_54A + const EVENT_54B + const EVENT_54C + const EVENT_54D + const EVENT_54E + const EVENT_54F + const EVENT_550 + const EVENT_BEAT_ROUTE_25_TRAINER_0 + const EVENT_BEAT_ROUTE_25_TRAINER_2 + const EVENT_BEAT_ROUTE_25_TRAINER_3 + const EVENT_BEAT_ROUTE_25_TRAINER_4 + const EVENT_BEAT_ROUTE_25_TRAINER_5 + const EVENT_BEAT_ROUTE_25_TRAINER_6 + const EVENT_BEAT_ROUTE_25_TRAINER_7 + const EVENT_BEAT_ROUTE_25_TRAINER_8 + const EVENT_BEAT_ROUTE_25_TRAINER_9 + const EVENT_55A + const EVENT_55B + const EVENT_55C + const EVENT_55D + const EVENT_55E + const EVENT_55F + const EVENT_560 + const EVENT_561 + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 + const EVENT_565 + const EVENT_566 + const EVENT_567 + const EVENT_568 + const EVENT_569 + const EVENT_56A + const EVENT_56B + const EVENT_56C + const EVENT_56D + const EVENT_56E + const EVENT_56F + const EVENT_570 + const EVENT_BEAT_MT_MOON_1_TRAINER_0 + const EVENT_BEAT_MT_MOON_1_TRAINER_2 + const EVENT_BEAT_MT_MOON_1_TRAINER_3 + const EVENT_BEAT_MT_MOON_1_TRAINER_4 + const EVENT_BEAT_MT_MOON_1_TRAINER_5 + const EVENT_BEAT_MT_MOON_1_TRAINER_6 + const EVENT_BEAT_MT_MOON_1_TRAINER_7 + const EVENT_578 + const EVENT_579 + const EVENT_BEAT_MT_MOON_3_TRAINER_0 + const EVENT_BEAT_MT_MOON_3_TRAINER_2 + const EVENT_BEAT_MT_MOON_3_TRAINER_3 + const EVENT_BEAT_MT_MOON_3_TRAINER_4 + const EVENT_57E + const EVENT_57F + const EVENT_580 + const EVENT_581 + const EVENT_582 + const EVENT_583 + const EVENT_584 + const EVENT_585 + const EVENT_586 + const EVENT_587 + const EVENT_588 + const EVENT_589 + const EVENT_58A + const EVENT_58B + const EVENT_58C + const EVENT_58D + const EVENT_58E + const EVENT_58F + const EVENT_590 + const EVENT_591 + const EVENT_592 + const EVENT_593 + const EVENT_594 + const EVENT_595 + const EVENT_596 + const EVENT_597 + const EVENT_598 + const EVENT_599 + const EVENT_59A + const EVENT_59B + const EVENT_59C + const EVENT_59D + const EVENT_59E + const EVENT_59F + const EVENT_5A0 + const EVENT_5A1 + const EVENT_5A2 + const EVENT_5A3 + const EVENT_5A4 + const EVENT_5A5 + const EVENT_5A6 + const EVENT_5A7 + const EVENT_5A8 + const EVENT_5A9 + const EVENT_5AA + const EVENT_5AB + const EVENT_5AC + const EVENT_5AD + const EVENT_5AE + const EVENT_5AF + const EVENT_5B0 + const EVENT_5B1 + const EVENT_5B2 + const EVENT_5B3 + const EVENT_5B4 + const EVENT_5B5 + const EVENT_5B6 + const EVENT_5B7 + const EVENT_5B8 + const EVENT_5B9 + const EVENT_5BA + const EVENT_5BB + const EVENT_5BC + const EVENT_5BD + const EVENT_5BE + const EVENT_5BF + const EVENT_5C0 + const EVENT_5C1 + const EVENT_5C2 + const EVENT_5C3 + const EVENT_BEAT_SS_ANNE_5_TRAINER_0 + const EVENT_BEAT_SS_ANNE_5_TRAINER_1 + const EVENT_5C6 + const EVENT_5C7 + const EVENT_5C8 + const EVENT_5C9 + const EVENT_5CA + const EVENT_5CB + const EVENT_5CC + const EVENT_5CD + const EVENT_5CE + const EVENT_5CF + const EVENT_5D0 + const EVENT_5D1 + const EVENT_5D2 + const EVENT_5D3 + const EVENT_5D4 + const EVENT_5D5 + const EVENT_5D6 + const EVENT_5D7 + const EVENT_5D8 + const EVENT_5D9 + const EVENT_5DA + const EVENT_5DB + const EVENT_5DC + const EVENT_5DD + const EVENT_5DE + const EVENT_5DF + const EVENT_5E0 + const EVENT_5E1 + const EVENT_SS_ANNE_LEFT + const EVENT_5E3 + const EVENT_5E4 + const EVENT_5E5 + const EVENT_5E6 + const EVENT_5E7 + const EVENT_5E8 + const EVENT_5E9 + const EVENT_5EA + const EVENT_5EB + const EVENT_5EC + const EVENT_5ED + const EVENT_5EE + const EVENT_5EF + const EVENT_5F0 + const EVENT_BEAT_SS_ANNE_8_TRAINER_0 + const EVENT_BEAT_SS_ANNE_8_TRAINER_1 + const EVENT_BEAT_SS_ANNE_8_TRAINER_2 + const EVENT_BEAT_SS_ANNE_8_TRAINER_3 + const EVENT_5F5 + const EVENT_5F6 + const EVENT_5F7 + const EVENT_5F8 + const EVENT_5F9 + const EVENT_5FA + const EVENT_5FB + const EVENT_5FC + const EVENT_5FD + const EVENT_5FE + const EVENT_5FF + const EVENT_600 + const EVENT_BEAT_SS_ANNE_9_TRAINER_0 + const EVENT_BEAT_SS_ANNE_9_TRAINER_1 + const EVENT_BEAT_SS_ANNE_9_TRAINER_2 + const EVENT_BEAT_SS_ANNE_9_TRAINER_3 + const EVENT_605 + const EVENT_606 + const EVENT_607 + const EVENT_608 + const EVENT_609 + const EVENT_60A + const EVENT_60B + const EVENT_60C + const EVENT_60D + const EVENT_60E + const EVENT_60F + const EVENT_610 + const EVENT_BEAT_SS_ANNE_10_TRAINER_0 + const EVENT_BEAT_SS_ANNE_10_TRAINER_1 + const EVENT_BEAT_SS_ANNE_10_TRAINER_2 + const EVENT_BEAT_SS_ANNE_10_TRAINER_3 + const EVENT_BEAT_SS_ANNE_10_TRAINER_4 + const EVENT_BEAT_SS_ANNE_10_TRAINER_5 + const EVENT_617 + const EVENT_618 + const EVENT_619 + const EVENT_61A + const EVENT_61B + const EVENT_61C + const EVENT_61D + const EVENT_61E + const EVENT_61F + const EVENT_620 + const EVENT_621 + const EVENT_622 + const EVENT_623 + const EVENT_624 + const EVENT_625 + const EVENT_626 + const EVENT_627 + const EVENT_628 + const EVENT_629 + const EVENT_62A + const EVENT_62B + const EVENT_62C + const EVENT_62D + const EVENT_62E + const EVENT_62F + const EVENT_630 + const EVENT_631 + const EVENT_632 + const EVENT_633 + const EVENT_634 + const EVENT_635 + const EVENT_636 + const EVENT_637 + const EVENT_638 + const EVENT_639 + const EVENT_63A + const EVENT_63B + const EVENT_63C + const EVENT_63D + const EVENT_63E + const EVENT_63F + const EVENT_640 + const EVENT_641 + const EVENT_642 + const EVENT_643 + const EVENT_644 + const EVENT_645 + const EVENT_646 + const EVENT_647 + const EVENT_648 + const EVENT_649 + const EVENT_64A + const EVENT_64B + const EVENT_64C + const EVENT_64D + const EVENT_64E + const EVENT_64F + const EVENT_650 + const EVENT_651 + const EVENT_652 + const EVENT_653 + const EVENT_654 + const EVENT_655 + const EVENT_656 + const EVENT_657 + const EVENT_658 + const EVENT_659 + const EVENT_65A + const EVENT_65B + const EVENT_65C + const EVENT_65D + const EVENT_65E + const EVENT_65F + const EVENT_660 + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 + const EVENT_665 + const EVENT_666 + const EVENT_667 + const EVENT_668 + const EVENT_669 + const EVENT_66A + const EVENT_66B + const EVENT_66C + const EVENT_66D + const EVENT_66E + const EVENT_66F + const EVENT_670 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 + const EVENT_676 + const EVENT_677 + const EVENT_678 + const EVENT_679 + const EVENT_67A + const EVENT_67B + const EVENT_67C + const EVENT_67D + const EVENT_67E + const EVENT_67F + const EVENT_680 + const EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 + const EVENT_682 + const EVENT_683 + const EVENT_684 + const EVENT_685 + const EVENT_686 + const EVENT_687 + const EVENT_688 + const EVENT_689 + const EVENT_68A + const EVENT_68B + const EVENT_68C + const EVENT_68D + const EVENT_68E + const EVENT_68F + const EVENT_690 + const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 + const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 + const EVENT_693 + const EVENT_694 + const EVENT_695 + const EVENT_696 + const EVENT_697 + const EVENT_698 + const EVENT_699 + const EVENT_69A + const EVENT_69B + const EVENT_69C + const EVENT_69D + const EVENT_69E + const EVENT_69F + const EVENT_6A0 + const EVENT_6A1 + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 + const EVENT_6A5 + const EVENT_6A6 + const EVENT_6A7 + const EVENT_6A8 + const EVENT_6A9 + const EVENT_6AA + const EVENT_6AB + const EVENT_6AC + const EVENT_6AD + const EVENT_6AE + const EVENT_6AF + const EVENT_6B0 + const EVENT_6B1 + const EVENT_6B2 + const EVENT_6B3 + const EVENT_6B4 + const EVENT_6B5 + const EVENT_6B6 + const EVENT_6B7 + const EVENT_6B8 + const EVENT_6B9 + const EVENT_6BA + const EVENT_6BB + const EVENT_6BC + const EVENT_6BD + const EVENT_6BE + const EVENT_6BF + const EVENT_6C0 + const EVENT_6C1 + const EVENT_6C2 + const EVENT_6C3 + const EVENT_6C4 + const EVENT_6C5 + const EVENT_6C6 + const EVENT_6C7 + const EVENT_6C8 + const EVENT_6C9 + const EVENT_6CA + const EVENT_6CB + const EVENT_6CC + const EVENT_6CD + const EVENT_6CE + const EVENT_6CF + const EVENT_6D0 + const EVENT_6D1 + const EVENT_6D2 + const EVENT_6D3 + const EVENT_6D4 + const EVENT_6D5 + const EVENT_6D6 + const EVENT_6D7 + const EVENT_6D8 + const EVENT_6D9 + const EVENT_6DA + const EVENT_6DB + const EVENT_6DC + const EVENT_6DD + const EVENT_6DE + const EVENT_6DF + const EVENT_6E0 + const EVENT_6E1 + const EVENT_6E2 + const EVENT_6E3 + const EVENT_6E4 + const EVENT_6E5 + const EVENT_6E6 + const EVENT_6E7 + const EVENT_6E8 + const EVENT_6E9 + const EVENT_6EA + const EVENT_6EB + const EVENT_6EC + const EVENT_6ED + const EVENT_6EE + const EVENT_6EF + const EVENT_6F0 + const EVENT_6F1 + const EVENT_BEAT_SILPH_CO_2F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_2F_TRAINER_1 + const EVENT_BEAT_SILPH_CO_2F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_2F_TRAINER_3 + const EVENT_6F6 + const EVENT_6F7 + const EVENT_6F8 + const EVENT_6F9 + const EVENT_6FA + const EVENT_6FB + const EVENT_6FC + const EVENT_6FD + const EVENT_6FE + const EVENT_6FF + const EVENT_700 + const EVENT_701 + const EVENT_BEAT_SILPH_CO_3F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_3F_TRAINER_1 + const EVENT_704 + const EVENT_705 + const EVENT_706 + const EVENT_707 + const EVENT_708 + const EVENT_709 + const EVENT_70A + const EVENT_70B + const EVENT_70C + const EVENT_70D + const EVENT_70E + const EVENT_70F + const EVENT_710 + const EVENT_711 + const EVENT_BEAT_SILPH_CO_4F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_4F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_4F_TRAINER_3 + const EVENT_715 + const EVENT_716 + const EVENT_717 + const EVENT_718 + const EVENT_719 + const EVENT_71A + const EVENT_71B + const EVENT_71C + const EVENT_71D + const EVENT_71E + const EVENT_71F + const EVENT_720 + const EVENT_721 + const EVENT_BEAT_SILPH_CO_5F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_5F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_5F_TRAINER_3 + const EVENT_BEAT_SILPH_CO_5F_TRAINER_4 + const EVENT_726 + const EVENT_727 + const EVENT_728 + const EVENT_729 + const EVENT_72A + const EVENT_72B + const EVENT_72C + const EVENT_72D + const EVENT_72E + const EVENT_72F + const EVENT_730 + const EVENT_731 + const EVENT_732 + const EVENT_733 + const EVENT_734 + const EVENT_735 + const EVENT_BEAT_SILPH_CO_6F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_6F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_6F_TRAINER_3 + const EVENT_739 + const EVENT_73A + const EVENT_73B + const EVENT_73C + const EVENT_73D + const EVENT_73E + const EVENT_73F + const EVENT_740 + const EVENT_741 + const EVENT_742 + const EVENT_743 + const EVENT_744 + const EVENT_BEAT_SILPH_CO_7F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_7F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_7F_TRAINER_3 + const EVENT_BEAT_SILPH_CO_7F_TRAINER_4 + const EVENT_749 + const EVENT_74A + const EVENT_74B + const EVENT_74C + const EVENT_74D + const EVENT_74E + const EVENT_74F + const EVENT_750 + const EVENT_751 + const EVENT_BEAT_SILPH_CO_8F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_8F_TRAINER_1 + const EVENT_BEAT_SILPH_CO_8F_TRAINER_2 + const EVENT_755 + const EVENT_756 + const EVENT_757 + const EVENT_758 + const EVENT_759 + const EVENT_75A + const EVENT_75B + const EVENT_75C + const EVENT_75D + const EVENT_75E + const EVENT_75F + const EVENT_760 + const EVENT_761 + const EVENT_BEAT_SILPH_CO_9F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_9F_TRAINER_1 + const EVENT_BEAT_SILPH_CO_9F_TRAINER_2 + const EVENT_765 + const EVENT_766 + const EVENT_767 + const EVENT_768 + const EVENT_769 + const EVENT_76A + const EVENT_76B + const EVENT_76C + const EVENT_76D + const EVENT_76E + const EVENT_76F + const EVENT_770 + const EVENT_BEAT_SILPH_CO_10F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_10F_TRAINER_1 + const EVENT_773 + const EVENT_774 + const EVENT_775 + const EVENT_776 + const EVENT_777 + const EVENT_778 + const EVENT_779 + const EVENT_77A + const EVENT_77B + const EVENT_77C + const EVENT_77D + const EVENT_77E + const EVENT_77F + const EVENT_780 + const EVENT_781 + const EVENT_782 + const EVENT_783 + const EVENT_BEAT_SILPH_CO_11F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_11F_TRAINER_1 + const EVENT_786 + const EVENT_787 + const EVENT_788 + const EVENT_789 + const EVENT_78A + const EVENT_78B + const EVENT_78C + const EVENT_78D + const EVENT_78E + const EVENT_78F + const EVENT_790 + const EVENT_791 + const EVENT_792 + const EVENT_793 + const EVENT_794 + const EVENT_795 + const EVENT_796 + const EVENT_797 + const EVENT_798 + const EVENT_799 + const EVENT_79A + const EVENT_79B + const EVENT_79C + const EVENT_79D + const EVENT_79E + const EVENT_79F + const EVENT_7A0 + const EVENT_7A1 + const EVENT_7A2 + const EVENT_7A3 + const EVENT_7A4 + const EVENT_7A5 + const EVENT_7A6 + const EVENT_7A7 + const EVENT_7A8 + const EVENT_7A9 + const EVENT_7AA + const EVENT_7AB + const EVENT_7AC + const EVENT_7AD + const EVENT_7AE + const EVENT_7AF + const EVENT_7B0 + const EVENT_7B1 + const EVENT_7B2 + const EVENT_7B3 + const EVENT_7B4 + const EVENT_7B5 + const EVENT_7B6 + const EVENT_7B7 + const EVENT_7B8 + const EVENT_7B9 + const EVENT_7BA + const EVENT_7BB + const EVENT_7BC + const EVENT_7BD + const EVENT_7BE + const EVENT_7BF + const EVENT_7C0 + const EVENT_7C1 + const EVENT_7C2 + const EVENT_7C3 + const EVENT_7C4 + const EVENT_7C5 + const EVENT_7C6 + const EVENT_7C7 + const EVENT_7C8 + const EVENT_7C9 + const EVENT_7CA + const EVENT_7CB + const EVENT_7CC + const EVENT_7CD + const EVENT_7CE + const EVENT_7CF + const EVENT_7D0 + const EVENT_7D1 + const EVENT_7D2 + const EVENT_7D3 + const EVENT_7D4 + const EVENT_7D5 + const EVENT_7D6 + const EVENT_7D7 + const EVENT_7D8 + const EVENT_7D9 + const EVENT_7DA + const EVENT_7DB + const EVENT_7DC + const EVENT_7DD + const EVENT_7DE + const EVENT_7DF + const EVENT_7E0 + const EVENT_7E1 + const EVENT_7E2 + const EVENT_7E3 + const EVENT_7E4 + const EVENT_7E5 + const EVENT_7E6 + const EVENT_7E7 + const EVENT_7E8 + const EVENT_7E9 + const EVENT_7EA + const EVENT_7EB + const EVENT_7EC + const EVENT_7ED + const EVENT_7EE + const EVENT_7EF + const EVENT_7F0 + const EVENT_7F1 + const EVENT_7F2 + const EVENT_7F3 + const EVENT_7F4 + const EVENT_7F5 + const EVENT_7F6 + const EVENT_7F7 + const EVENT_7F8 + const EVENT_7F9 + const EVENT_7FA + const EVENT_7FB + const EVENT_7FC + const EVENT_7FD + const EVENT_7FE + const EVENT_7FF + const EVENT_800 + const EVENT_BEAT_MANSION_2_TRAINER_0 + const EVENT_802 + const EVENT_803 + const EVENT_804 + const EVENT_805 + const EVENT_806 + const EVENT_807 + const EVENT_808 + const EVENT_809 + const EVENT_80A + const EVENT_80B + const EVENT_80C + const EVENT_80D + const EVENT_80E + const EVENT_80F + const EVENT_810 + const EVENT_BEAT_MANSION_3_TRAINER_0 + const EVENT_BEAT_MANSION_3_TRAINER_2 + const EVENT_813 + const EVENT_814 + const EVENT_815 + const EVENT_816 + const EVENT_817 + const EVENT_818 + const EVENT_819 + const EVENT_81A + const EVENT_81B + const EVENT_81C + const EVENT_81D + const EVENT_81E + const EVENT_81F + const EVENT_820 + const EVENT_BEAT_MANSION_4_TRAINER_0 + const EVENT_BEAT_MANSION_4_TRAINER_2 + const EVENT_823 + const EVENT_824 + const EVENT_825 + const EVENT_826 + const EVENT_827 + const EVENT_828 + const EVENT_829 + const EVENT_82A + const EVENT_82B + const EVENT_82C + const EVENT_82D + const EVENT_82E + const EVENT_82F + const EVENT_830 + const EVENT_831 + const EVENT_832 + const EVENT_833 + const EVENT_834 + const EVENT_835 + const EVENT_836 + const EVENT_837 + const EVENT_838 + const EVENT_839 + const EVENT_83A + const EVENT_83B + const EVENT_83C + const EVENT_83D + const EVENT_83E + const EVENT_83F + const EVENT_840 + const EVENT_841 + const EVENT_842 + const EVENT_843 + const EVENT_844 + const EVENT_845 + const EVENT_846 + const EVENT_847 + const EVENT_848 + const EVENT_849 + const EVENT_84A + const EVENT_84B + const EVENT_84C + const EVENT_84D + const EVENT_84E + const EVENT_84F + const EVENT_850 + const EVENT_851 + const EVENT_852 + const EVENT_853 + const EVENT_854 + const EVENT_855 + const EVENT_856 + const EVENT_857 + const EVENT_858 + const EVENT_859 + const EVENT_85A + const EVENT_85B + const EVENT_85C + const EVENT_85D + const EVENT_85E + const EVENT_85F + const EVENT_860 + const EVENT_861 + const EVENT_862 + const EVENT_863 + const EVENT_864 + const EVENT_865 + const EVENT_866 + const EVENT_867 + const EVENT_868 + const EVENT_869 + const EVENT_86A + const EVENT_86B + const EVENT_86C + const EVENT_86D + const EVENT_86E + const EVENT_86F + const EVENT_870 + const EVENT_871 + const EVENT_872 + const EVENT_873 + const EVENT_874 + const EVENT_875 + const EVENT_876 + const EVENT_877 + const EVENT_878 + const EVENT_879 + const EVENT_87A + const EVENT_87B + const EVENT_87C + const EVENT_87D + const EVENT_87E + const EVENT_87F + const EVENT_880 + const EVENT_881 + const EVENT_882 + const EVENT_883 + const EVENT_884 + const EVENT_885 + const EVENT_886 + const EVENT_887 + const EVENT_888 + const EVENT_889 + const EVENT_88A + const EVENT_88B + const EVENT_88C + const EVENT_88D + const EVENT_88E + const EVENT_88F + const EVENT_890 + const EVENT_891 + const EVENT_892 + const EVENT_893 + const EVENT_894 + const EVENT_895 + const EVENT_896 + const EVENT_897 + const EVENT_898 + const EVENT_899 + const EVENT_89A + const EVENT_89B + const EVENT_89C + const EVENT_89D + const EVENT_89E + const EVENT_89F + const EVENT_8A0 + const EVENT_8A1 + const EVENT_8A2 + const EVENT_8A3 + const EVENT_8A4 + const EVENT_8A5 + const EVENT_8A6 + const EVENT_8A7 + const EVENT_8A8 + const EVENT_8A9 + const EVENT_8AA + const EVENT_8AB + const EVENT_8AC + const EVENT_8AD + const EVENT_8AE + const EVENT_8AF + const EVENT_8B0 + const EVENT_8B1 + const EVENT_8B2 + const EVENT_8B3 + const EVENT_8B4 + const EVENT_8B5 + const EVENT_8B6 + const EVENT_8B7 + const EVENT_8B8 + const EVENT_8B9 + const EVENT_8BA + const EVENT_8BB + const EVENT_8BC + const EVENT_8BD + const EVENT_8BE + const EVENT_8BF + const EVENT_8C0 + const EVENT_BEAT_UNKNOWN_DUNGEON_3_TRAINER_0 + const EVENT_8C2 + const EVENT_8C3 + const EVENT_8C4 + const EVENT_8C5 + const EVENT_8C6 + const EVENT_8C7 + const EVENT_8C8 + const EVENT_8C9 + const EVENT_8CA + const EVENT_8CB + const EVENT_8CC + const EVENT_8CD + const EVENT_8CE + const EVENT_8CF + const EVENT_8D0 + const EVENT_8D1 + const EVENT_8D2 + const EVENT_8D3 + const EVENT_8D4 + const EVENT_8D5 + const EVENT_8D6 + const EVENT_8D7 + const EVENT_8D8 + const EVENT_8D9 + const EVENT_8DA + const EVENT_8DB + const EVENT_8DC + const EVENT_8DD + const EVENT_8DE + const EVENT_8DF + const EVENT_8E0 + const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 + const EVENT_8E2 + const EVENT_8E3 + const EVENT_8E4 + const EVENT_8E5 + const EVENT_8E6 + const EVENT_8E7 + const EVENT_8E8 + const EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 + const EVENT_8EA + const EVENT_8EB + const EVENT_8EC + const EVENT_8ED + const EVENT_8EE + const EVENT_8EF + const EVENT_8F0 + const EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 + const EVENT_8F2 + const EVENT_8F3 + const EVENT_8F4 + const EVENT_8F5 + const EVENT_8F6 + const EVENT_8F7 + const EVENT_8F8 + const EVENT_BEAT_LANCES_ROOM_TRAINER_0 + const EVENT_8FA + const EVENT_8FB + const EVENT_8FC + const EVENT_8FD + const EVENT_8FE + const EVENT_8FF + const EVENT_900 + const EVENT_901 + const EVENT_902 + const EVENT_903 + const EVENT_904 + const EVENT_905 + const EVENT_906 + const EVENT_907 + const EVENT_908 + const EVENT_909 + const EVENT_90A + const EVENT_90B + const EVENT_90C + const EVENT_90D + const EVENT_90E + const EVENT_90F + const EVENT_910 + const EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0 + const EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1 + const EVENT_913 + const EVENT_914 + const EVENT_915 + const EVENT_916 + const EVENT_917 + const EVENT_918 + const EVENT_919 + const EVENT_91A + const EVENT_91B + const EVENT_91C + const EVENT_91D + const EVENT_91E + const EVENT_91F + const EVENT_920 + const EVENT_921 + const EVENT_922 + const EVENT_923 + const EVENT_924 + const EVENT_925 + const EVENT_926 + const EVENT_927 + const EVENT_928 + const EVENT_929 + const EVENT_92A + const EVENT_92B + const EVENT_92C + const EVENT_92D + const EVENT_92E + const EVENT_92F + const EVENT_930 + const EVENT_931 + const EVENT_932 + const EVENT_933 + const EVENT_934 + const EVENT_935 + const EVENT_936 + const EVENT_937 + const EVENT_938 + const EVENT_939 + const EVENT_93A + const EVENT_93B + const EVENT_93C + const EVENT_93D + const EVENT_93E + const EVENT_93F + const EVENT_940 + const EVENT_941 + const EVENT_942 + const EVENT_943 + const EVENT_944 + const EVENT_945 + const EVENT_946 + const EVENT_947 + const EVENT_948 + const EVENT_949 + const EVENT_94A + const EVENT_94B + const EVENT_94C + const EVENT_94D + const EVENT_94E + const EVENT_94F + const EVENT_950 + const EVENT_951 + const EVENT_952 + const EVENT_953 + const EVENT_954 + const EVENT_955 + const EVENT_956 + const EVENT_957 + const EVENT_958 + const EVENT_959 + const EVENT_95A + const EVENT_95B + const EVENT_95C + const EVENT_95D + const EVENT_95E + const EVENT_95F + const EVENT_960 + const EVENT_961 + const EVENT_962 + const EVENT_963 + const EVENT_964 + const EVENT_965 + const EVENT_966 + const EVENT_967 + const EVENT_968 + const EVENT_969 + const EVENT_96A + const EVENT_96B + const EVENT_96C + const EVENT_96D + const EVENT_96E + const EVENT_96F + const EVENT_970 + const EVENT_971 + const EVENT_972 + const EVENT_973 + const EVENT_974 + const EVENT_975 + const EVENT_976 + const EVENT_977 + const EVENT_978 + const EVENT_979 + const EVENT_97A + const EVENT_97B + const EVENT_97C + const EVENT_97D + const EVENT_97E + const EVENT_97F + const EVENT_980 + const EVENT_981 + const EVENT_982 + const EVENT_983 + const EVENT_984 + const EVENT_985 + const EVENT_986 + const EVENT_987 + const EVENT_988 + const EVENT_989 + const EVENT_98A + const EVENT_98B + const EVENT_98C + const EVENT_98D + const EVENT_98E + const EVENT_98F + const EVENT_990 + const EVENT_991 + const EVENT_992 + const EVENT_993 + const EVENT_994 + const EVENT_995 + const EVENT_996 + const EVENT_997 + const EVENT_998 + const EVENT_999 + const EVENT_99A + const EVENT_99B + const EVENT_99C + const EVENT_99D + const EVENT_99E + const EVENT_99F + const EVENT_9A0 + const EVENT_9A1 + const EVENT_9A2 + const EVENT_9A3 + const EVENT_9A4 + const EVENT_9A5 + const EVENT_9A6 + const EVENT_9A7 + const EVENT_9A8 + const EVENT_9A9 + const EVENT_9AA + const EVENT_9AB + const EVENT_9AC + const EVENT_9AD + const EVENT_9AE + const EVENT_9AF + const EVENT_9B0 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8 + const EVENT_9B9 + const EVENT_9BA + const EVENT_9BB + const EVENT_9BC + const EVENT_9BD + const EVENT_9BE + const EVENT_9BF + const EVENT_9C0 + const EVENT_9C1 + const EVENT_9C2 + const EVENT_9C3 + const EVENT_9C4 + const EVENT_9C5 + const EVENT_9C6 + const EVENT_9C7 + const EVENT_9C8 + const EVENT_9C9 + const EVENT_9CA + const EVENT_9CB + const EVENT_9CC + const EVENT_9CD + const EVENT_9CE + const EVENT_9CF + const EVENT_9D0 + const EVENT_9D1 + const EVENT_9D2 + const EVENT_9D3 + const EVENT_9D4 + const EVENT_9D5 + const EVENT_9D6 + const EVENT_9D7 + const EVENT_9D8 + const EVENT_9D9 + const EVENT_BEAT_SEAFOAM_ISLANDS_5_TRAINER_0 + const EVENT_9DB + const EVENT_9DC + const EVENT_9DD + const EVENT_9DE + const EVENT_9DF + const EVENT_9E0 + const EVENT_9E1 + const EVENT_9E2 + const EVENT_9E3 + const EVENT_9E4 + const EVENT_9E5 + const EVENT_9E6 + const EVENT_9E7 + const EVENT_9E8 + const EVENT_9E9 + const EVENT_9EA + const EVENT_9EB + const EVENT_9EC + const EVENT_9ED + const EVENT_9EE + const EVENT_9EF + const EVENT_9F0 + const EVENT_9F1 + const EVENT_9F2 + const EVENT_9F3 + const EVENT_9F4 + const EVENT_9F5 + const EVENT_9F6 + const EVENT_9F7 + const EVENT_9F8 + const EVENT_9F9 + const EVENT_9FA + const EVENT_9FB + const EVENT_9FC + const EVENT_9FD + const EVENT_9FE + const EVENT_9FF diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm index 0d933571..7361fea2 100755 --- a/engine/hall_of_fame.asm +++ b/engine/hall_of_fame.asm @@ -207,8 +207,7 @@ HoFLoadMonPlayerPicTileIDs: ; 7036d (1c:436d) predef_jump CopyTileIDsFromList HoFDisplayPlayerStats: ; 70377 (1c:4377) - ld hl, wd747 - set 3, [hl] + SetEvent EVENT_003 predef DisplayDexRating coord hl, 0, 4 ld b, $6 diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 94b37193..01787e3e 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -314,8 +314,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) ld [wcd5b], a ; Don't do the trash can puzzle if it's already been done. - ld a, [wd773] - bit 0, a + CheckEvent EVENT_2ND_LOCK_OPENED jr z, .ok tx_pre_jump VermilionGymTrashText @@ -335,8 +334,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) .openFirstLock ; Next can is trying for the second switch. - ld hl, wd773 - set 1, [hl] + SetEvent EVENT_1ST_LOCK_OPENED ld hl, GymTrashCans ld a, [wcd5b] @@ -379,8 +377,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) jr z, .openSecondLock ; Reset the cans. - ld hl, wd773 - res 1, [hl] + ResetEvent EVENT_1ST_LOCK_OPENED call Random and $e @@ -391,8 +388,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) .openSecondLock ; Completed the trash can puzzle. - ld hl, wd773 - set 0, [hl] + SetEvent EVENT_2ND_LOCK_OPENED ld hl, wd126 set 6, [hl] diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index e293b0a0..cf18799d 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -152,8 +152,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SaffronCityPokecenterBenchGuyText2 jr nz, .asm_624f2 ld hl, SaffronCityPokecenterBenchGuyText1 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 8893e496..d4a0ce88 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -36,8 +36,7 @@ StrengthsAndWeaknessesText: ; 1e983 (7:6983) db "@" SafariZoneCheck: ; 1e988 (7:6988) - ld hl, wd790 - bit 7, [hl]; if we are not in the Safari Zone, + CheckEventHL EVENT_IN_SAFARI_ZONE ; if we are not in the Safari Zone, jr z, SafariZoneGameStillGoing ; don't bother printing game over text ld a, [W_NUMSAFARIBALLS] and a @@ -85,8 +84,7 @@ SafariZoneGameOver: ; 1e9b0 (7:69b0) ld [wDestinationWarpID], a ld a, $5 ld [W_SAFARIZONEENTRANCECURSCRIPT], a - ld hl, wd790 - set 6, [hl] + SetEvent EVENT_SAFARI_GAME_OVER ld a, $1 ld [wSafariZoneGameOver], a ret @@ -191,7 +189,7 @@ CinnabarQuizQuestionsText6: ; 1ea85 (7:6a85) db "@" CinnabarGymQuiz_1ea8a: ; 1ea8a (7:6a8a) - ld hl, wd79c + EventFlagAddress hl, EVENT_2A8 predef_jump FlagActionPredef CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) @@ -208,6 +206,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld hl, CinnabarGymQuizCorrectText call PrintText ld a, [$ffe0] + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_SET call CinnabarGymQuiz_1ea8a @@ -221,9 +220,10 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) call PrintText ld a, [$ffdb] add $2 + AdjustEventBit EVENT_29A, 2 ld c, a ld b, FLAG_TEST - ld hl, wd79a + EventFlagAddress hl, EVENT_29A predef FlagActionPredef ld a, c and a @@ -240,6 +240,7 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) TX_ASM ld a, [$ffe0] + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_TEST call CinnabarGymQuiz_1ea8a @@ -277,6 +278,7 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) push bc ld a, [$ffdb] ld [$ffe0], a + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_TEST call CinnabarGymQuiz_1ea8a @@ -320,12 +322,11 @@ BillsHousePC: ; 1eb6e (7:6b6e) ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_UP ret nz - ld a, [wd7f2] - bit 7, a + CheckEvent EVENT_55F jr nz, .asm_1ebd2 - bit 3, a + CheckEventReuseA EVENT_55B jr nz, .asm_1eb86 - bit 6, a + CheckEventReuseA EVENT_55E jr nz, .asm_1eb8b .asm_1eb86 tx_pre_jump BillsHouseMonitorText @@ -354,8 +355,7 @@ BillsHousePC: ; 1eb6e (7:6b6e) call PlaySound call WaitForSoundToFinish call PlayDefaultMusic - ld hl, wd7f2 - set 3, [hl] + SetEvent EVENT_55B ret .asm_1ebd2 ld a, $1 diff --git a/engine/items/items.asm b/engine/items/items.asm index f2c41ef6..a7c731c2 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -432,8 +432,7 @@ ItemUseBall: ; d687 (3:5687) call ClearSprites call SendNewMonToBox ld hl,ItemUseBallText07 - ld a,[wd7f1] - bit 0,a ;already met Bill? + CheckEvent EVENT_550 jr nz,.sendToBox2 ld hl,ItemUseBallText08 .sendToBox2 @@ -1375,8 +1374,7 @@ ItemUseEscapeRope: ; dfaf (3:5faf) set 6,[hl] ld hl,wd72e res 4,[hl] - ld hl,wd790 - res 7,[hl] ; unset Safari Zone bit + ResetEvent EVENT_IN_SAFARI_ZONE xor a ld [W_NUMSAFARIBALLS],a ld [W_SAFARIZONEENTRANCECURSCRIPT],a @@ -1584,8 +1582,7 @@ ItemUsePokeflute: ; e140 (3:6140) ld a,[W_CURMAP] cp a,ROUTE_12 jr nz,.notRoute12 - ld a,[wd7d8] - bit 7,a ; has the player beaten Route 12 Snorlax yet? + CheckEvent EVENT_BEAT_ROUTE12_SNORLAX jr nz,.noSnorlaxToWakeUp ; if the player hasn't beaten Route 12 Snorlax ld hl,Route12SnorlaxFluteCoords @@ -1593,14 +1590,12 @@ ItemUsePokeflute: ; e140 (3:6140) jr nc,.noSnorlaxToWakeUp ld hl,PlayedFluteHadEffectText call PrintText - ld hl,wd7d8 - set 6,[hl] ; trigger Snorlax fight (handled by map script) + SetEvent EVENT_FIGHT_ROUTE12_SNORLAX ret .notRoute12 cp a,ROUTE_16 jr nz,.noSnorlaxToWakeUp - ld a,[wd7e0] - bit 1,a ; has the player beaten Route 16 Snorlax yet? + CheckEvent EVENT_BEAT_ROUTE16_SNORLAX jr nz,.noSnorlaxToWakeUp ; if the player hasn't beaten Route 16 Snorlax ld hl,Route16SnorlaxFluteCoords @@ -1608,8 +1603,7 @@ ItemUsePokeflute: ; e140 (3:6140) jr nc,.noSnorlaxToWakeUp ld hl,PlayedFluteHadEffectText call PrintText - ld hl,wd7e0 - set 0,[hl] ; trigger Snorlax fight (handled by map script) + SetEvent EVENT_FIGHT_ROUTE16_SNORLAX ret .noSnorlaxToWakeUp ld hl,PlayedFluteNoEffectText diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index d491cd38..f9df345f 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -5,8 +5,7 @@ DisplayPCMainMenu:: ; 213c8 (8:53c8) ld a, [wNumHoFTeams] and a jr nz, .leaguePCAvailable - ld a, [wd74b] - bit 5, a ; received pokedex? + CheckEvent EVENT_GOT_POKEDEX jr z, .noOaksPC ld a, [wNumHoFTeams] and a @@ -29,8 +28,7 @@ DisplayPCMainMenu:: ; 213c8 (8:53c8) call UpdateSprites ld a, 3 ld [wMaxMenuItem], a - ld a, [wd7f1] - bit 0, a + CheckEvent EVENT_550 jr nz, .metBill coord hl, 2, 2 ld de, SomeonesPCText @@ -47,8 +45,7 @@ DisplayPCMainMenu:: ; 213c8 (8:53c8) ld h, b ld de, PlayersPCText call PlaceString - ld a, [wd74b] - bit 5, a ; received pokedex? + CheckEvent EVENT_GOT_POKEDEX jr z, .noOaksPC2 coord hl, 2, 6 ld de, OaksPCText diff --git a/engine/menu/pc.asm b/engine/menu/pc.asm index b5281964..43bd8452 100755 --- a/engine/menu/pc.asm +++ b/engine/menu/pc.asm @@ -74,8 +74,7 @@ BillsPC: ; 17ee4 (5:7ee4) ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - ld a, [wd7f1] ;has to do with having met Bill - bit 0, a + CheckEvent EVENT_550 jr nz, .billsPC ;if you've met bill, use that bill's instead of someone's ld hl, AccessedSomeonesPCText jr .printText diff --git a/engine/menu/start_menu.asm b/engine/menu/start_menu.asm index bd876f5b..3c48e6ed 100755 --- a/engine/menu/start_menu.asm +++ b/engine/menu/start_menu.asm @@ -24,8 +24,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) and a jr nz,.loop ; if the player pressed tried to go past the top item, wrap around to the bottom - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ld a,6 ; there are 7 menu items with the pokedex, so the max index is 6 jr nz,.wrapMenuItemId dec a ; there are only 6 menu items without the pokedex @@ -37,8 +36,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) bit 7,a jr z,.buttonPressed ; if the player pressed tried to go past the bottom item, wrap around to the top - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ld a,[wCurrentMenuItem] ld c,7 ; there are 7 menu items with the pokedex jr nz,.checkIfPastBottom @@ -59,8 +57,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) and a,%00001010 ; was the Start button or B button pressed? jp nz,CloseStartMenu call SaveScreenTilesToBuffer2 ; copy background from wTileMap to wTileMapBackup2 - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ld a,[wCurrentMenuItem] jr nz,.displayMenuItem inc a ; adjust position to account for missing pokedex menu item diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm index 2a9b19fe..65837150 100755 --- a/engine/overworld/cable_club_npc.asm +++ b/engine/overworld/cable_club_npc.asm @@ -1,8 +1,7 @@ CableClubNPC: ; 71c5 (1:71c5) ld hl, CableClubNPCWelcomeText call PrintText - ld a, [wd74b] - bit 5, a ; received pokedex? + CheckEvent EVENT_GOT_POKEDEX jp nz, .receivedPokedex ; if the player hasn't received the pokedex ld c, 60 diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm index 18ce23ed..5cc5536c 100755 --- a/engine/overworld/cinnabar_lab.asm +++ b/engine/overworld/cinnabar_lab.asm @@ -65,9 +65,7 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) callba RemoveItemByID ld hl, LabFossil_610b8 call PrintText - ld hl, wd7a3 - set 0, [hl] - set 1, [hl] + SetEvents EVENT_2E0, EVENT_2E1 ret .asm_610a7 ld hl, LabFossil_610bd diff --git a/engine/pokedex_rating.asm b/engine/pokedex_rating.asm index 881c9716..2d7073df 100755 --- a/engine/pokedex_rating.asm +++ b/engine/pokedex_rating.asm @@ -23,10 +23,7 @@ DisplayDexRating: ; 44169 (11:4169) ld a, [hli] ld h, [hl] ld l, a ; load text pointer into hl - ld a, [wd747] - bit 3, a - res 3, a - ld [wd747], a + CheckAndResetEventA EVENT_003 jr nz, .label3 push hl ld hl, PokedexRatingText_441cc diff --git a/home/overworld.asm b/home/overworld.asm index cc5e9f5e..9b60d7e9 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -287,8 +287,7 @@ OverworldLoopLessDelay:: ld hl,wd72c res 0,[hl] ; indicate that the player has stepped thrice since the last battle .doneStepCounting - ld a,[wd790] - bit 7,a ; in the safari zone? + CheckEvent EVENT_IN_SAFARI_ZONE jr z,.notSafariZone callba SafariZoneCheckSteps ld a,[wSafariZoneGameOver] @@ -320,8 +319,7 @@ OverworldLoopLessDelay:: ld a,[W_CURMAP] cp a,CINNABAR_GYM jr nz,.notCinnabarGym - ld hl,wd79b - set 7,[hl] + SetEvent EVENT_2A7 .notCinnabarGym ld hl,wd72e set 5,[hl] diff --git a/macros.asm b/macros.asm index 659b0722..11f0f37b 100644 --- a/macros.asm +++ b/macros.asm @@ -79,6 +79,432 @@ bcd3: MACRO coins equs "bcd2" money equs "bcd3" +;\1 = event index +;\2 = return result in carry instead of zero flag +CheckEvent: MACRO +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + + IF _NARG > 1 + IF ((\1) % 8) == 7 + add a + ELSE + REPT ((\1) % 8) + 1 + rrca + ENDR + ENDC + ELSE + bit (\1) % 8, a + ENDC + ENDM + +;\1 = event index +CheckEventReuseA: MACRO +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + ENDC + + bit (\1) % 8, a + ENDM + +;\1 = reg +;\2 = event index +;\3 = event index this event is relative to (optional, this is needed when there is a fixed flag address) +EventFlagBit: MACRO + IF _NARG > 2 + ld \1, ((\3) % 8) + ((\2) - (\3)) + ELSE + ld \1, (\2) % 8 + ENDC + ENDM + +;\1 = reg +;\2 = event index +EventFlagAddress: MACRO +event_byte = ((\2) / 8) + ld \1, wEventFlags + event_byte + ENDM + +;\1 = event index +CheckEventHL: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckEventReuseHL: MACRO +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + bit (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +CheckEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +CheckEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndSetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + set (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndResetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + res (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndSetEventA: MACRO + ld a, [wEventFlags + ((\1) / 8)] + bit (\1) % 8, a + set (\1) % 8, a + ld [wEventFlags + ((\1) / 8)], a + ENDM + +;\1 = event index +CheckAndResetEventA: MACRO + ld a, [wEventFlags + ((\1) / 8)] + bit (\1) % 8, a + res (\1) % 8, a + ld [wEventFlags + ((\1) / 8)], a + ENDM + +;\1 = event index +SetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + set (\1) % 8, [hl] + ENDM + +;\1 = event index +SetEventReuseHL: MACRO + IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + set (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +SetEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + set (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +SetEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + set (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index +;\3 = event index (optional) +SetEvents: MACRO + SetEvent \1 + SetEventReuseHL \2 + + IF _NARG > 2 + SetEventReuseHL \3 + ENDC + ENDM + +;\1 = event index +ResetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + res (\1) % 8, [hl] + ENDM + +;\1 = event index +ResetEventReuseHL: MACRO + IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + res (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +ResetEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + res (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +ResetEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + res (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index +;\3 = event index (optional) +ResetEvents: MACRO + ResetEvent \1 + ResetEventReuseHL \2 + + IF _NARG > 2 + ResetEventReuseHL \3 + ENDC + ENDM + +;\1 = event index +;\2 = number of bytes away from the base address (optional, for matching the ROM) +dbEventFlagBit: MACRO + IF _NARG > 1 + db ((\1) % 8) + ((\2) * 8) + ELSE + db ((\1) % 8) + ENDC + ENDM + +;\1 = event index +;\2 = number of bytes away from the base address (optional, for matching the ROM) +dwEventFlagAddress: MACRO + IF _NARG > 1 + dw wEventFlags + ((\1) / 8) - (\2) + ELSE + dw wEventFlags + ((\1) / 8) + ENDC + ENDM + +;\1 = start +;\2 = end +SetEventRange: MACRO +event_start_byte = ((\1) / 8) +event_end_byte = ((\2) / 8) + + IF event_end_byte < event_start_byte + FAIL "Incorrect argument order in SetEventRange." + ENDC + + IF event_start_byte == event_end_byte + ld a, [wEventFlags + event_start_byte] + or (1 << (((\2) % 8) + 1)) - (1 << ((\1) % 8)) + ld [wEventFlags + event_start_byte], a + ELSE +event_fill_start = event_start_byte + 1 +event_fill_count = event_end_byte - event_start_byte - 1 + + IF ((\1) % 8) == 0 +event_fill_start = -1 + event_fill_start +event_fill_count = 1 + event_fill_count + ELSE + ld a, [wEventFlags + event_start_byte] + or $ff - ((1 << ((\1) % 8)) - 1) + ld [wEventFlags + event_start_byte], a + ENDC + + IF ((\2) % 8) == 7 +event_fill_count = 1 + event_fill_count + ENDC + + IF event_fill_count == 1 + ld hl, wEventFlags + event_fill_start + ld [hl], $ff + ENDC + + IF event_fill_count > 1 + ld a, $ff + ld hl, wEventFlags + event_fill_start + + REPT -1 + event_fill_count + ld [hli], a + ENDR + + ld [hl], a + ENDC + + IF ((\2) % 8) == 0 + ld hl, wEventFlags + event_end_byte + set 0, [hl] + ELSE + IF ((\2) % 8) != 7 + ld a, [wEventFlags + event_end_byte] + or (1 << (((\2) % 8) + 1)) - 1 + ld [wEventFlags + event_end_byte], a + ENDC + ENDC + ENDC + ENDM + +;\1 = start +;\2 = end +;\3 = assume a is 0 if present +ResetEventRange: MACRO +event_start_byte = ((\1) / 8) +event_end_byte = ((\2) / 8) + + IF event_end_byte < event_start_byte + FAIL "Incorrect argument order in ResetEventRange." + ENDC + + IF event_start_byte == event_end_byte + ld a, [wEventFlags + event_start_byte] + and ~((1 << (((\2) % 8) + 1)) - (1 << ((\1) % 8))) & $ff + ld [wEventFlags + event_start_byte], a + ELSE +event_fill_start = event_start_byte + 1 +event_fill_count = event_end_byte - event_start_byte - 1 + + IF ((\1) % 8) == 0 +event_fill_start = -1 + event_fill_start +event_fill_count = 1 + event_fill_count + ELSE + ld a, [wEventFlags + event_start_byte] + and ~($ff - ((1 << ((\1) % 8)) - 1)) & $ff + ld [wEventFlags + event_start_byte], a + ENDC + + IF ((\2) % 8) == 7 +event_fill_count = 1 + event_fill_count + ENDC + + IF event_fill_count == 1 + ld hl, wEventFlags + event_fill_start + ld [hl], 0 + ENDC + + IF event_fill_count > 1 + ld hl, wEventFlags + event_fill_start + + ; force xor a if we just to wrote to it above + IF (_NARG < 3) || (((\1) % 8) != 0) + xor a + ENDC + + REPT -1 + event_fill_count + ld [hli], a + ENDR + + ld [hl], a + ENDC + + IF ((\2) % 8) == 0 + ld hl, wEventFlags + event_end_byte + res 0, [hl] + ELSE + IF ((\2) % 8) != 7 + ld a, [wEventFlags + event_end_byte] + and ~((1 << (((\2) % 8) + 1)) - 1) $ ff + ld [wEventFlags + event_end_byte], a + ENDC + ENDC + ENDC + ENDM + +; returns whether both events are set in Z flag +;\1 = event index 1 +;\2 = event index 2 +CheckBothEventsSet: MACRO + IF ((\1) / 8) == ((\2) / 8) + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + ELSE + ; This case doesn't happen in the original ROM. + IF ((\1) % 8) == ((\2) % 8) + push hl + ld a, [wEventFlags + ((\1) / 8)] + ld hl, wEventFlags + ((\2) / 8) + and [hl] + cpl + bit ((\1) % 8), a + pop hl + ELSE + push bc + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) + ld b, a + ld a, [wEventFlags + ((\2) / 8)] + and (1 << ((\2) % 8)) + or b + cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + pop bc + ENDC + ENDC + ENDM + +; returns the complement of whether either event is set in Z flag +;\1 = event index 1 +;\2 = event index 2 +CheckEitherEventSet: MACRO + IF ((\1) / 8) == ((\2) / 8) + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + ELSE + ; This case doesn't happen in the original ROM. + IF ((\1) % 8) == ((\2) % 8) + push hl + ld a, [wEventFlags + ((\1) / 8)] + ld hl, wEventFlags + ((\2) / 8) + or [hl] + bit ((\1) % 8), a + pop hl + ELSE + push bc + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) + ld b, a + ld a, [wEventFlags + ((\2) / 8)] + and (1 << ((\2) % 8)) + or b + pop bc + ENDC + ENDC + ENDM + +; for handling fixed event bits when events are inserted/removed +;\1 = event index +;\2 = fixed flag bit +AdjustEventBit: MACRO + IF ((\1) % 8) != (\2) + add ((\1) % 8) - (\2) + ENDC + ENDM + ;\1 = r ;\2 = X ;\3 = Y diff --git a/main.asm b/main.asm index 2261acb8..ea13bd64 100755 --- a/main.asm +++ b/main.asm @@ -1002,8 +1002,7 @@ DisplayTextIDInit: ; 7096 (1:7096) ; if text ID is 0 (i.e. the start menu) ; Note that the start menu text border is also drawn in the function directly ; below this, so this seems unnecessary. - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ; start menu with pokedex coord hl, 10, 0 ld b,$0e @@ -1071,8 +1070,7 @@ DisplayTextIDInit: ; 7096 (1:7096) ; function that displays the start menu DrawStartMenu: ; 710b (1:710b) - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ; menu with pokedex coord hl, 10, 0 ld b,$0e @@ -1098,8 +1096,7 @@ DrawStartMenu: ; 710b (1:710b) ld hl,wd730 set 6,[hl] ; no pauses between printing each letter coord hl, 12, 2 - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ; case for not having pokdex ld a,$06 jr z,.storeMenuItemCount @@ -2763,9 +2760,7 @@ CheckForForcedBikeSurf: ; cdc0 (3:4dc0) ld a, [W_CURMAP] cp SEAFOAM_ISLANDS_5 ret nz - ld a, [wd881] - and $3 - cp $3 + CheckBothEventsSet EVENT_9D0, EVENT_9D1 ret z ld hl, CoordsData_cdf7 call ArePlayerCoordsInArray diff --git a/scripts/agatha.asm b/scripts/agatha.asm index 850cc0bb..c9df27d2 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -13,8 +13,7 @@ AgathaScript_76443: ; 76443 (1d:6443) bit 5, [hl] res 5, [hl] ret z - ld a, [wd865] - bit 1, a + CheckEvent EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 jr z, .asm_76457 ld a, $e jp AgathaScript_76459 @@ -70,9 +69,7 @@ AgathaScript0: ; 76490 (1d:6490) ld a, [wCoordIndex] cp $3 jr c, .asm_764b4 - ld hl, wd865 - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_8F6 jr z, AgathaScript_76474 .asm_764b4 ld a, $2 @@ -124,9 +121,9 @@ AgathaTextPointers: ; 76505 (1d:6505) AgathaTrainerHeaders: ; 76509 (1d:6509) AgathaTrainerHeader0: ; 76509 (1d:6509) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd865 ; flag's byte + dwEventFlagAddress EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 dw AgathaBeforeBattleText ; TextBeforeBattle dw AgathaAfterBattleText ; TextAfterBattle dw AgathaEndBattleText ; TextEndBattle diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index 6779d9f6..bdae3536 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -8,8 +8,7 @@ BikeShopTextPointers: ; 1d73f (7:573f) BikeShopText1: ; 1d745 (7:5745) TX_ASM - ld a, [wd75f] - bit 0, a + CheckEvent EVENT_0C0 jr z, .asm_260d4 ld hl, BikeShopText_1d82f call PrintText @@ -26,8 +25,7 @@ BikeShopText1: ; 1d745 (7:5745) ld a, BIKE_VOUCHER ld [$ffdb], a callba RemoveItemByID - ld hl, wd75f - set 0, [hl] + SetEvent EVENT_0C0 ld hl, BikeShopText_1d824 call PrintText jr .Done @@ -131,8 +129,7 @@ BikeShopText_1d843: ; 1d843 (7:5843) BikeShopText3: ; 1d848 (7:5848) TX_ASM - ld a, [wd75f] - bit 0, a + CheckEvent EVENT_0C0 ld hl, BikeShopText_1d861 jr nz, .asm_34d2d ld hl, BikeShopText_1d85c diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index 115b3b19..b7e85f9a 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -51,8 +51,7 @@ BillsHouseScript2: ; 1e7a6 (7:67a6) ld a, HS_BILL_POKEMON ld [wcc4d], a predef HideObject - ld hl, wd7f2 - set 6, [hl] + SetEvent EVENT_55E xor a ld [wJoyIgnore], a ld a, $3 @@ -60,8 +59,7 @@ BillsHouseScript2: ; 1e7a6 (7:67a6) ret BillsHouseScript3: ; 1e7c5 (7:67c5) - ld a, [wd7f2] - bit 3, a + CheckEvent EVENT_55B ret z ld a, $f0 ld [wJoyIgnore], a @@ -103,10 +101,8 @@ BillsHouseScript4: ; 1e80d (7:680d) ret nz xor a ld [wJoyIgnore], a - ld hl, wd7f2 - set 5, [hl] - ld hl, wd7f1 - set 0, [hl] + SetEvent EVENT_55D + SetEvent EVENT_550 ld a, $0 ld [W_BILLSHOUSECURSCRIPT], a ret @@ -163,8 +159,7 @@ BillsHouseText_1e86f: ; 1e86f (7:686f) BillsHouseText2: ; 1e874 (7:6874) TX_ASM - ld a, [wd7f2] - bit 4, a + CheckEvent EVENT_55C jr nz, .asm_1e8a9 ld hl, BillThankYouText call PrintText @@ -173,8 +168,7 @@ BillsHouseText2: ; 1e874 (7:6874) jr nc, .BagFull ld hl, SSTicketReceivedText call PrintText - ld hl, wd7f2 - set 4, [hl] + SetEvent EVENT_55C ld a, HS_CERULEAN_GUARD_1 ld [wcc4d], a predef ShowObject diff --git a/scripts/blueshouse.asm b/scripts/blueshouse.asm index 5d6f1f83..17b182f5 100755 --- a/scripts/blueshouse.asm +++ b/scripts/blueshouse.asm @@ -9,8 +9,7 @@ BluesHouseScriptPointers: ; 19b47 (6:5b47) dw BluesHouseScript1 BluesHouseScript0: ; 19b4b (6:5b4b) - ld hl,wd74a - set 1,[hl] + SetEvent EVENT_019 ; trigger the next script ld a,1 @@ -27,11 +26,9 @@ BluesHouseTextPointers: ; 19b57 (6:5b57) BluesHouseText1: ; 19b5d (6:5b5d) TX_ASM - ld a,[wd74a] - bit 0,a + CheckEvent EVENT_018 jr nz,.GotMap - ld a,[wd74b] - bit 5,a + CheckEvent EVENT_GOT_POKEDEX jr nz,.GiveMap ld hl,DaisyInitialText call PrintText @@ -47,8 +44,7 @@ BluesHouseText1: ; 19b5d (6:5b5d) predef HideObject ; hide table map object ld hl,GotMapText call PrintText - ld hl,wd74a - set 0,[hl] + SetEvent EVENT_018 jr .done .GotMap ld hl,DaisyUseMapText diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 76a5919a..9cd55193 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -13,8 +13,7 @@ BrunoScript_762ec: ; 762ec (1d:62ec) bit 5, [hl] res 5, [hl] ret z - ld a, [wd864] - bit 1, a + CheckEvent EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 jr z, .asm_76300 ld a, $5 jp BrunoScript_76302 @@ -70,9 +69,7 @@ BrunoScript0: ; 76339 (1d:6339) ld a, [wCoordIndex] cp $3 jr c, .asm_7635d - ld hl, wd864 - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_8EE jr z, BrunoScript_7631d .asm_7635d ld a, $2 @@ -121,9 +118,9 @@ BrunoTextPointers: ; 763a8 (1d:63a8) BrunoTrainerHeaders: ; 763ac (1d:63ac) BrunoTrainerHeader0: ; 763ac (1d:63ac) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd864 ; flag's byte + dwEventFlagAddress EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 dw BrunoBeforeBattleText ; TextBeforeBattle dw BrunoAfterBattleText ; TextAfterBattle dw BrunoEndBattleText ; TextEndBattle diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index 9107d254..65e71cca 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -1,10 +1,7 @@ CeladonCityScript: ; 19956 (6:5956) call EnableAutoTextBoxDrawing - ld hl, wd77e - res 0, [hl] - res 7, [hl] - ld hl, wd816 - res 7, [hl] + ResetEvents EVENT_1B8, EVENT_1BF + ResetEvent EVENT_67F ret CeladonCityTextPointers: ; 19966 (6:5966) @@ -45,8 +42,7 @@ CeladonCityText4: ; 19999 (6:5999) CeladonCityText5: ; 1999e (6:599e) TX_ASM - ld a, [wd777] - bit 0, a + CheckEvent EVENT_180 jr nz, .asm_7053f ld hl, TM41PreText call PrintText @@ -59,8 +55,7 @@ CeladonCityText5: ; 1999e (6:599e) .Success ld hl, ReceivedTM41Text call PrintText - ld hl, wd777 - set 0, [hl] + SetEvent EVENT_180 jr .Done .asm_7053f ld hl, TM41ExplanationText diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index f6db1606..d4d4b84b 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -27,16 +27,14 @@ CeladonDinerText4: ; 4916e (12:516e) CeladonDinerText5: ; 49173 (12:5173) TX_ASM - ld a, [wd783] - bit 0, a + CheckEvent EVENT_1E0 jr nz, .asm_eb14d ld hl, CeladonDinerText_491a7 call PrintText ld bc, (COIN_CASE << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd783 - set 0, [hl] + SetEvent EVENT_1E0 ld hl, ReceivedCoinCaseText call PrintText jr .asm_68b61 diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index c8d07058..51ffef89 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -28,8 +28,7 @@ CeladonGameCornerScript_48bec: ; 48bec (12:4bec) bit 5, [hl] res 5, [hl] ret z - ld a, [wd77e] - bit 1, a + CheckEvent EVENT_1B9 ret nz ld a, $2a ld [wd09f], a @@ -227,8 +226,7 @@ CeladonGameCornerText4: ; 48d45 (12:4d45) CeladonGameCornerText5: ; 48d4a (12:4d4a) TX_ASM - ld a, [wd77e] - bit 2, a + CheckEvent EVENT_1BA jr nz, .asm_48d89 ld hl, CeladonGameCornerText_48d9c call PrintText @@ -246,8 +244,7 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - ld hl, wd77e - set 2, [hl] + SetEvent EVENT_1BA ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, Received10CoinsText @@ -286,8 +283,7 @@ CeladonGameCornerText6: ; 48db1 (12:4db1) CeladonGameCornerText7: ; 48db6 (12:4db6) TX_ASM - ld a, [wd77c] - bit 1, a + CheckEvent EVENT_1A9 ld hl, CeladonGameCornerText_48dca jr z, .asm_48dc4 ld hl, CeladonGameCornerText_48dcf @@ -309,8 +305,7 @@ CeladonGameCornerText8: ; 48dd4 (12:4dd4) CeladonGameCornerText9: ; 48dd9 (12:4dd9) TX_ASM - ld a, [wd77e] - bit 4, a + CheckEvent EVENT_1BC jr nz, .asm_48e13 ld hl, CeladonGameCornerText_48e26 call PrintText @@ -328,8 +323,7 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - ld hl, wd77e - set 4, [hl] + SetEvent EVENT_1BC ld hl, Received20CoinsText jr .asm_48e20 .asm_48e13 @@ -362,8 +356,7 @@ CeladonGameCornerText_48e36: ; 48e36 (12:4e36) CeladonGameCornerText10: ; 48e3b (12:4e3b) TX_ASM - ld a, [wd77e] - bit 3, a + CheckEvent EVENT_1BB jr nz, .asm_48e75 ld hl, CeladonGameCornerText_48e88 call PrintText @@ -381,8 +374,7 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - ld hl, wd77e - set 3, [hl] + SetEvent EVENT_1BB ld hl, CeladonGameCornerText_48e8d jr .asm_48e82 .asm_48e75 @@ -457,8 +449,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) ld a, SFX_GO_INSIDE call PlaySound call WaitForSoundToFinish - ld hl, wd77e - set 1, [hl] + SetEvent EVENT_1B9 ld a, $43 ld [wd09f], a ld bc, $0208 diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index b978b272..1e2959dd 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -46,16 +46,14 @@ CeladonGymText_48963: ; 48963 (12:4963) ld a, $9 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd77c - set 1, [hl] + SetEvent EVENT_1A9 ld bc, (TM_21 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd77c - set 0, [hl] + SetEvent EVENT_1A8 jr .asm_4898c .BagFull ld a, $b @@ -68,11 +66,7 @@ CeladonGymText_48963: ; 48963 (12:4963) set 3, [hl] ; deactivate gym trainers - ld a, [wd77c] - or %11111100 - ld [wd77c], a - ld hl, wd77d - set 0, [hl] + SetEventRange EVENT_BEAT_CELADON_GYM_TRAINER_0, EVENT_BEAT_CELADON_GYM_TRAINER_7 jp CeladonGymText_48943 @@ -91,63 +85,63 @@ CeladonGymTextPointers: ; 489a6 (12:49a6) CeladonGymTrainerHeaders: ; 489bc (12:49bc) CeladonGymTrainerHeader0: ; 489bc (12:49bc) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_0 dw CeladonGymBattleText2 ; TextBeforeBattle dw CeladonGymAfterBattleText2 ; TextAfterBattle dw CeladonGymEndBattleText2 ; TextEndBattle dw CeladonGymEndBattleText2 ; TextEndBattle CeladonGymTrainerHeader2: ; 489c8 (12:49c8) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_2 dw CeladonGymBattleText3 ; TextBeforeBattle dw CeladonGymAfterBattleText3 ; TextAfterBattle dw CeladonGymEndBattleText3 ; TextEndBattle dw CeladonGymEndBattleText3 ; TextEndBattle CeladonGymTrainerHeader3: ; 489d4 (12:49d4) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_3 dw CeladonGymBattleText4 ; TextBeforeBattle dw CeladonGymAfterBattleText4 ; TextAfterBattle dw CeladonGymEndBattleText4 ; TextEndBattle dw CeladonGymEndBattleText4 ; TextEndBattle CeladonGymTrainerHeader4: ; 489e0 (12:49e0) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_4 dw CeladonGymBattleText5 ; TextBeforeBattle dw CeladonGymAfterBattleText5 ; TextAfterBattle dw CeladonGymEndBattleText5 ; TextEndBattle dw CeladonGymEndBattleText5 ; TextEndBattle CeladonGymTrainerHeader5: ; 489ec (12:49ec) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_5 dw CeladonGymBattleText6 ; TextBeforeBattle dw CeladonGymAfterBattleText6 ; TextAfterBattle dw CeladonGymEndBattleText6 ; TextEndBattle dw CeladonGymEndBattleText6 ; TextEndBattle CeladonGymTrainerHeader6: ; 489f8 (12:49f8) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_6 db ($2 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_6 dw CeladonGymBattleText7 ; TextBeforeBattle dw CeladonGymAfterBattleText7 ; TextAfterBattle dw CeladonGymEndBattleText7 ; TextEndBattle dw CeladonGymEndBattleText7 ; TextEndBattle CeladonGymTrainerHeader7: ; 48a04 (12:4a04) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_7, 1 db ($3 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_7, 1 dw CeladonGymBattleText8 ; TextBeforeBattle dw CeladonGymAfterBattleText8 ; TextAfterBattle dw CeladonGymEndBattleText8 ; TextEndBattle @@ -157,10 +151,9 @@ CeladonGymTrainerHeader7: ; 48a04 (12:4a04) CeladonGymText1: ; 48a11 (12:4a11) TX_ASM - ld a, [wd77c] - bit 1, a + CheckEvent EVENT_1A9 jr z, .asm_48a2d - bit 0, a + CheckEventReuseA EVENT_1A8 jr nz, .asm_48a25 call z, CeladonGymText_48963 call DisableWaitingAfterTextDisplay diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index 46e58d8c..6e17ac77 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -22,16 +22,14 @@ CeladonMart3TextPointers: ; 48228 (12:4228) CeladonMart3Text1: ; 4824a (12:424a) TX_ASM - ld a, [wd778] - bit 7, a + CheckEvent EVENT_18F jr nz, .asm_a5463 ld hl, TM18PreReceiveText call PrintText ld bc, (TM_18 << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd778 - set 7, [hl] + SetEvent EVENT_18F ld hl, ReceivedTM18Text jr .asm_81359 .BagFull diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index f83e466d..e509ffeb 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -83,8 +83,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr z, .asm_484b6 cp SODA_POP jr z, .asm_48492 - ld a, [wd778] - bit 6, a + CheckEvent EVENT_18E jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48515 call PrintText @@ -94,12 +93,10 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, ReceivedTM49Text call PrintText - ld hl, wd778 - set 6, [hl] + SetEvent EVENT_18E ret .asm_48492 - ld a, [wd778] - bit 5, a + CheckEvent EVENT_18D jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48504 call PrintText @@ -109,12 +106,10 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_4850a call PrintText - ld hl, wd778 - set 5, [hl] + SetEvent EVENT_18D ret .asm_484b6 - ld a, [wd778] - bit 4, a + CheckEvent EVENT_18C jr nz, .asm_484e0 ld hl, CeladonMartRoofText_484f3 call PrintText @@ -124,8 +119,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_484f9 call PrintText - ld hl, wd778 - set 4, [hl] + SetEvent EVENT_18C ret .BagFull ld hl, CeladonMartRoofText_48526 diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index 48480167..b009ca95 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -25,8 +25,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) jp z, CeruleanCityScript_1948c ld a, $f0 ld [wJoyIgnore], a - ld hl, wd75b - set 7, [hl] + SetEvent EVENT_0A7 ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -36,8 +35,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) ret CeruleanCityScript0: ; 194c8 (6:54c8) - ld a, [wd75b] - bit 7, a + CheckEvent EVENT_0A7 jr nz, .asm_194f7 ld hl, CeruleanCityCoords1 call ArePlayerCoordsInArray @@ -58,8 +56,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld [hSpriteIndexOrTextID], a jp DisplayTextID .asm_194f7 - ld a, [wd75a] - bit 0, a + CheckEvent EVENT_098 ret nz ld hl, CeruleanCityCoords2 call ArePlayerCoordsInArray @@ -170,8 +167,7 @@ CeruleanCityScript2: ; 195b1 (6:55b1) call CeruleanCityScript_1955d ld a, $f0 ld [wJoyIgnore], a - ld hl, wd75a - set 0, [hl] + SetEvent EVENT_098 ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -252,8 +248,7 @@ CeruleanCityTextPointers: ; 1962d (6:562d) CeruleanCityText1: ; 1964f (6:564f) TX_ASM - ld a, [wd75a] ; rival battle flag - bit 0, a + CheckEvent EVENT_098 ; do pre-battle text jr z, .PreBattleText ; or talk about bill @@ -284,8 +279,7 @@ CeruleanCityText_19677: ; 19677 (6:5677) CeruleanCityText2: ; 1967c (6:567c) TX_ASM - ld a, [wd75b] - bit 7, a + CheckEvent EVENT_0A7 jr nz, .asm_4ca20 ld hl, CeruleanCityText_196d9 call PrintText diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index 2343af03..e4c614d6 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -46,16 +46,14 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) ld a, $5 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd75e - set 7, [hl] + SetEvent EVENT_0BF ld bc, (TM_11 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $6 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd75e - set 6, [hl] + SetEvent EVENT_0BE jr .asm_5c736 .BagFull ld a, $7 @@ -68,9 +66,7 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) set 1, [hl] ; deactivate gym trainers - ld hl, wd75e - set 2, [hl] - set 3, [hl] + SetEvents EVENT_BEAT_CERULEAN_GYM_TRAINER_0, EVENT_BEAT_CERULEAN_GYM_TRAINER_1 jp CeruleanGymScript_5c6ed @@ -85,18 +81,18 @@ CeruleanGymTextPointers: ; 5c74a (17:474a) CeruleanGymTrainerHeaders: ; 5c758 (17:4758) CeruleanGymTrainerHeader0: ; 5c758 (17:4758) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd75e ; flag's byte + dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_0 dw CeruleanGymBattleText1 ; TextBeforeBattle dw CeruleanGymAfterBattleText1 ; TextAfterBattle dw CeruleanGymEndBattleText1 ; TextEndBattle dw CeruleanGymEndBattleText1 ; TextEndBattle CeruleanGymTrainerHeader1: ; 5c764 (17:4764) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd75e ; flag's byte + dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_1 dw CeruleanGymBattleText2 ; TextBeforeBattle dw CeruleanGymAfterBattleText2 ; TextAfterBattle dw CeruleanGymEndBattleText2 ; TextEndBattle @@ -106,10 +102,9 @@ CeruleanGymTrainerHeader1: ; 5c764 (17:4764) CeruleanGymText1: ; 5c771 (17:4771) TX_ASM - ld a, [wd75e] - bit 7, a + CheckEvent EVENT_0BF jr z, .asm_5c78d - bit 6, a + CheckEventReuseA EVENT_0BE jr nz, .asm_5c785 call z, CeruleanGymScript_5c70d call DisableWaitingAfterTextDisplay @@ -203,8 +198,7 @@ CeruleanGymAfterBattleText2: ; 5c80c (17:480c) CeruleanGymText4: ; 5c811 (17:4811) TX_ASM - ld a, [wd75e] - bit 7, a + CheckEvent EVENT_0BF jr nz, .asm_5c821 ld hl, CeruleanGymText_5c82a call PrintText diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index 213568d5..fe7f1c13 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -15,8 +15,7 @@ CinnabarGymScript_75759: ; 75759 (1d:5759) bit 5, [hl] res 5, [hl] call nz, Func_3ead - ld hl, wd79b - res 7, [hl] + ResetEvent EVENT_2A7 ret CinnabarGymScript_75772: ; 75772 (1d:5772) ld hl, Gym7CityName @@ -98,9 +97,10 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) jp z, CinnabarGymScript_75792 ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a + AdjustEventBit EVENT_29A, 2 ld c, a ld b, FLAG_TEST - ld hl, wd79a + EventFlagAddress hl, EVENT_29A call CinnabarGymScript_757f1 ld a, c and a @@ -112,15 +112,17 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) .asm_7581b ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a + AdjustEventBit EVENT_29A, 2 ld c, a ld b, FLAG_SET - ld hl, wd79a + EventFlagAddress hl, EVENT_29A call CinnabarGymScript_757f1 ld a, [wTrainerHeaderFlagBit] sub $2 + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_SET - ld hl, wd79c + EventFlagAddress hl, EVENT_2A8 call CinnabarGymScript_757f1 call Func_3ead xor a @@ -141,16 +143,14 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd79a - set 1, [hl] + SetEvent EVENT_299 ld bc, (TM_38 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $b ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd79a - set 0, [hl] + SetEvent EVENT_298 jr .asm_75880 .BagFull ld a, $c @@ -163,11 +163,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) set 6, [hl] ; deactivate gym trainers - ld a, [wd79a] - or %11111100 - ld [wd79a], a - ld hl, wd79b - set 0, [hl] + SetEventRange EVENT_29A, EVENT_2A0 ld hl, wd126 set 5, [hl] @@ -210,10 +206,9 @@ CinnabarGymScript_758b7: ; 758b7 (1d:58b7) CinnabarGymText1: ; 758df (1d:58df) TX_ASM - ld a, [wd79a] - bit 1, a + CheckEvent EVENT_299 jr z, .asm_d9332 - bit 0, a + CheckEventReuseA EVENT_298 jr nz, .asm_3012f call z, CinnabarGymScript3_75857 call DisableWaitingAfterTextDisplay @@ -263,8 +258,7 @@ TM38NoRoomText: ; 75934 (1d:5934) CinnabarGymText2: ; 75939 (1d:5939) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 2, a + CheckEvent EVENT_29A jr nz, .asm_46bb4 ld hl, CinnabarGymText_7595f call PrintText @@ -292,8 +286,7 @@ CinnabarGymText_75969: ; 75969 (1d:5969) CinnabarGymText3: ; 7596e (1d:596e) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 3, a + CheckEvent EVENT_29B jr nz, .asm_4b406 ld hl, CinnabarGymText_75994 call PrintText @@ -321,8 +314,7 @@ CinnabarGymText_7599e: ; 7599e (1d:599e) CinnabarGymText4: ; 759a3 (1d:59a3) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 4, a + CheckEvent EVENT_29C jr nz, .asm_c0673 ld hl, CinnabarGymText_759c9 call PrintText @@ -350,8 +342,7 @@ CinnabarGymText_759d3: ; 759d3 (1d:59d3) CinnabarGymText5: ; 759d8 (1d:59d8) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 5, a + CheckEvent EVENT_29D jr nz, .asm_5cfd7 ld hl, CinnabarGymText_759fe call PrintText @@ -379,8 +370,7 @@ CinnabarGymText_75a08: ; 75a08 (1d:5a08) CinnabarGymText6: ; 75a0d (1d:5a0d) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 6, a + CheckEvent EVENT_29E jr nz, .asm_776b4 ld hl, CinnabarGymText_75a33 call PrintText @@ -408,8 +398,7 @@ CinnabarGymText_75a3d: ; 75a3d (1d:5a3d) CinnabarGymText7: ; 75a42 (1d:5a42) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 7, a + CheckEvent EVENT_29F jr nz, .asm_2f755 ld hl, CinnabarGymText_75a68 call PrintText @@ -437,8 +426,7 @@ CinnabarGymText_75a72: ; 75a72 (1d:5a72) CinnabarGymText8: ; 75a77 (1d:5a77) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79b] - bit 0, a + CheckEvent EVENT_2A0 jr nz, .asm_d87be ld hl, CinnabarGymText_75a9d call PrintText @@ -465,8 +453,7 @@ CinnabarGymText_75aa7: ; 75aa7 (1d:5aa7) CinnabarGymText9: ; 75aac (1d:5aac) TX_ASM - ld a, [wd79a] - bit 1, a + CheckEvent EVENT_299 jr nz, .asm_627d9 ld hl, CinnabarGymText_75ac2 jr .asm_0b11d diff --git a/scripts/cinnabarisland.asm b/scripts/cinnabarisland.asm index 92c0fc6b..2fc0503f 100755 --- a/scripts/cinnabarisland.asm +++ b/scripts/cinnabarisland.asm @@ -2,10 +2,8 @@ CinnabarIslandScript: ; 1ca19 (7:4a19) call EnableAutoTextBoxDrawing ld hl, wd126 set 5, [hl] - ld hl, wd796 - res 0, [hl] - ld hl, wd7a3 - res 1, [hl] + ResetEvent EVENT_278 + ResetEvent EVENT_2E1 ld hl, CinnabarIslandScriptPointers ld a, [W_CINNABARISLANDCURSCRIPT] jp CallFunctionInTable diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index 51a633b1..d6a330f3 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -12,8 +12,7 @@ CopycatsHouse2FTextPointers: ; 5cc74 (17:4c74) CopycatsHouse2FText1: ; 5cc82 (17:4c82) TX_ASM - ld a, [wd7af] - bit 0, a + CheckEvent EVENT_340 jr nz, .asm_7ccf3 ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -32,8 +31,7 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) ld a, POKE_DOLL ld [$ffdb], a callba RemoveItemByID - ld hl, wd7af - set 0, [hl] + SetEvent EVENT_340 jr .asm_62ecd .BagFull ld hl, TM31NoRoomText diff --git a/scripts/fanclub.asm b/scripts/fanclub.asm index 79621fce..45298c0b 100755 --- a/scripts/fanclub.asm +++ b/scripts/fanclub.asm @@ -3,8 +3,7 @@ FanClubScript: ; 59b70 (16:5b70) FanClubBikeInBag: ; check if any bike paraphernalia in bag - ld a, [wd771] - bit 1, a ; got bike voucher? + CheckEvent EVENT_GOT_BIKE_VOUCHER ret nz ld b, BICYCLE call IsItemInBag @@ -25,19 +24,16 @@ FanClubTextPointers: ; 59b84 (16:5b84) FanClubText1: ; pikachu fan TX_ASM - ld a, [wd771] - bit 7, a + CheckEvent EVENT_157 jr nz, .mineisbetter ld hl, .normaltext call PrintText - ld hl, wd771 - set 6, [hl] + SetEvent EVENT_156 jr .done .mineisbetter ld hl, .bettertext call PrintText - ld hl, wd771 - res 7, [hl] + ResetEvent EVENT_157 .done jp TextScriptEnd @@ -52,19 +48,16 @@ FanClubText1: FanClubText2: ; seel fan TX_ASM - ld a, [wd771] - bit 6, a + CheckEvent EVENT_156 jr nz, .mineisbetter ld hl, .normaltext call PrintText - ld hl, wd771 - set 7, [hl] + SetEvent EVENT_157 jr .done .mineisbetter ld hl, .bettertext call PrintText - ld hl, wd771 - res 6, [hl] + ResetEvent EVENT_156 .done jp TextScriptEnd @@ -125,8 +118,7 @@ FanClubText5: jr nc, .BagFull ld hl, .receivedvouchertext call PrintText - ld hl, wd771 - set 1, [hl] + SetEvent EVENT_GOT_BIKE_VOUCHER jr .done .BagFull ld hl, .bagfulltext diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index c21dde00..e27baf57 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -21,15 +21,13 @@ FightingDojoScriptPointers: ; 5cd7b (17:4d7b) dw FightingDojoScript3 FightingDojoScript1: ; 5cd83 (17:4d83) - ld a, [wd7b1] - bit 0, a + CheckEvent EVENT_350 ret nz call CheckFightingMapTrainers ld a, [wTrainerHeaderFlagBit] and a ret nz - ld a, [wd7b1] - bit 1, a + CheckEvent EVENT_351 ret nz xor a ld [hJoyHeld], a @@ -72,9 +70,7 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6) .asm_5cde4 ld a, $f0 ld [wJoyIgnore], a - ld a, [wd7b1] - or $3e - ld [wd7b1], a + SetEventRange EVENT_351, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 ld a, $8 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -96,36 +92,36 @@ FightingDojoTextPointers: ; 5ce03 (17:4e03) FightingDojoTrainerHeaders: ; 5ce13 (17:4e13) FightingDojoTrainerHeader0: ; 5ce13 (17:4e13) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7b1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 dw FightingDojoBattleText1 ; TextBeforeBattle dw FightingDojoAfterBattleText1 ; TextAfterBattle dw FightingDojoEndBattleText1 ; TextEndBattle dw FightingDojoEndBattleText1 ; TextEndBattle FightingDojoTrainerHeader1: ; 5ce1f (17:4e1f) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7b1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 dw FightingDojoBattleText2 ; TextBeforeBattle dw FightingDojoAfterBattleText2 ; TextAfterBattle dw FightingDojoEndBattleText2 ; TextEndBattle dw FightingDojoEndBattleText2 ; TextEndBattle FightingDojoTrainerHeader2: ; 5ce2b (17:4e2b) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7b1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 dw FightingDojoBattleText3 ; TextBeforeBattle dw FightingDojoAfterBattleText3 ; TextAfterBattle dw FightingDojoEndBattleText3 ; TextEndBattle dw FightingDojoEndBattleText3 ; TextEndBattle FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7b1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 dw FightingDojoBattleText4 ; TextBeforeBattle dw FightingDojoAfterBattleText4 ; TextAfterBattle dw FightingDojoEndBattleText4 ; TextEndBattle @@ -135,10 +131,9 @@ FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) FightingDojoText1: ; 5ce44 (17:4e44) TX_ASM - ld a, [wd7b1] - bit 0, a + CheckEvent EVENT_350 jp nz, .continue1 - bit 1, a + CheckEventReuseA EVENT_351 jp nz, .continue2 ld hl, FightingDojoText_5ce8e call PrintText @@ -257,8 +252,7 @@ FightingDojoAfterBattleText4: ; 5cf01 (17:4f01) FightingDojoText6: ; 5cf06 (17:4f06) ; Hitmonlee Poké Ball TX_ASM - ld a, [wd7b1] - and %11000000 + CheckEitherEventSet EVENT_356, EVENT_357 jr z, .GetMon ld hl, OtherHitmonText call PrintText @@ -282,9 +276,7 @@ FightingDojoText6: ; 5cf06 (17:4f06) ld a, HS_FIGHTING_DOJO_GIFT_1 ld [wcc4d], a predef HideObject - ld hl, wd7b1 - set 6, [hl] - set 0, [hl] + SetEvents EVENT_356, EVENT_350 .done jp TextScriptEnd @@ -295,8 +287,7 @@ WantHitmonleeText: ; 5cf49 (17:4f49) FightingDojoText7: ; 5cf4e (17:4f4e) ; Hitmonchan Poké Ball TX_ASM - ld a, [wd7b1] - and %11000000 + CheckEitherEventSet EVENT_356, EVENT_357 jr z, .GetMon ld hl, OtherHitmonText call PrintText @@ -315,9 +306,7 @@ FightingDojoText7: ; 5cf4e (17:4f4e) ld c,30 call GivePokemon jr nc, .done - ld hl, wd7b1 - set 7, [hl] - set 0, [hl] + SetEvents EVENT_357, EVENT_350 ; once Poké Ball is taken, hide sprite ld a, HS_FIGHTING_DOJO_GIFT_2 diff --git a/scripts/fuchsiacity.asm b/scripts/fuchsiacity.asm index 462e6084..b314b983 100755 --- a/scripts/fuchsiacity.asm +++ b/scripts/fuchsiacity.asm @@ -135,10 +135,9 @@ FuchsiaCityLaprasText: ; 19aef (6:5aef) FuchsiaCityText24: ; 19af4 (6:5af4) TX_ASM - ld a, [wd7f6] - bit 6, a + CheckEvent EVENT_57E jr nz, .asm_3b4e8 - bit 7, a + CheckEventReuseA EVENT_57F jr nz, .asm_667d5 ld hl, FuchsiaCityText_19b2a call PrintText diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index 843e7293..f13af011 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -46,16 +46,14 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) ld a, $9 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd792 - set 1, [hl] + SetEvent EVENT_259 ld bc, (TM_06 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd792 - set 0, [hl] + SetEvent EVENT_258 jr .asm_754c0 .BagFull ld a, $b @@ -68,9 +66,7 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) set 4, [hl] ; deactivate gym trainers - ld a, [wd792] - or %11111100 - ld [wd792], a + SetEventRange EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 jp FuchsiaGymScript_75477 @@ -89,54 +85,54 @@ FuchsiaGymTextPointers: ; 754d5 (1d:54d5) FuchsiaGymTrainerHeaders: ; 754eb (1d:54eb) FuchsiaGymTrainerHeader0: ; 754eb (1d:54eb) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 dw FuchsiaGymBattleText1 ; TextBeforeBattle dw FuchsiaGymAfterBattleText1 ; TextAfterBattle dw FuchsiaGymEndBattleText1 ; TextEndBattle dw FuchsiaGymEndBattleText1 ; TextEndBattle FuchsiaGymTrainerHeader2: ; 754f7 (1d:54f7) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 dw FuchsiaGymBattleText2 ; TextBeforeBattle dw FuchsiaGymAfterBattleText2 ; TextAfterBattle dw FuchsiaGymEndBattleText2 ; TextEndBattle dw FuchsiaGymEndBattleText2 ; TextEndBattle FuchsiaGymTrainerHeader3: ; 75503 (1d:5503) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 dw FuchsiaGymBattleText3 ; TextBeforeBattle dw FuchsiaGymAfterBattleText3 ; TextAfterBattle dw FuchsiaGymEndBattleText3 ; TextEndBattle dw FuchsiaGymEndBattleText3 ; TextEndBattle FuchsiaGymTrainerHeader4: ; 7550f (1d:550f) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 dw FuchsiaGymBattleText4 ; TextBeforeBattle dw FuchsiaGymAfterBattleText4 ; TextAfterBattle dw FuchsiaGymEndBattleText4 ; TextEndBattle dw FuchsiaGymEndBattleText4 ; TextEndBattle FuchsiaGymTrainerHeader5: ; 7551b (1d:551b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 dw FuchsiaGymBattleText5 ; TextBeforeBattle dw FuchsiaGymAfterBattleText5 ; TextAfterBattle dw FuchsiaGymEndBattleText5 ; TextEndBattle dw FuchsiaGymEndBattleText5 ; TextEndBattle FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 dw FuchsiaGymBattleText6 ; TextBeforeBattle dw FuchsiaGymAfterBattleText6 ; TextAfterBattle dw FuchsiaGymEndBattleText6 ; TextEndBattle @@ -146,10 +142,9 @@ FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) FuchsiaGymText1: ; 75534 (1d:5534) TX_ASM - ld a, [wd792] - bit 1, a + CheckEvent EVENT_259 jr z, .asm_181b6 - bit 0, a + CheckEventReuseA EVENT_258 jr nz, .asm_adc3b call z, FuchsiaGymScript3_75497 call DisableWaitingAfterTextDisplay @@ -318,8 +313,7 @@ FuchsiaGymAfterBattleText6: ; 75635 (1d:5635) FuchsiaGymText8: ; 7563a (1d:563a) TX_ASM - ld a, [wd792] - bit 1, a + CheckEvent EVENT_259 ld hl, FuchsiaGymText_75653 jr nz, .asm_50671 ld hl, FuchsiaGymText_7564e diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index f758b49e..b755b3bc 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -10,14 +10,12 @@ FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8) FuchsiaHouse2Text1: ; 750c2 (1d:50c2) TX_ASM - ld a, [wd78e] - bit 0, a + CheckEvent EVENT_238 jr nz, .subtract ld b,GOLD_TEETH call IsItemInBag jr nz, .asm_3f30f - ld a, [wd78e] - bit 1, a + CheckEvent EVENT_239 jr nz, .asm_60cba ld hl, WardenGibberishText1 call PrintText @@ -36,8 +34,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) ld a, GOLD_TEETH ld [$ffdb], a callba RemoveItemByID - ld hl, wd78e - set 1, [hl] + SetEvent EVENT_239 .asm_60cba ld hl, WardenThankYouText call PrintText @@ -46,8 +43,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) jr nc, .BagFull ld hl, ReceivedHM04Text call PrintText - ld hl, wd78e - set 0, [hl] + SetEvent EVENT_238 jr .asm_52039 .subtract ld hl, HM04ExplanationText diff --git a/scripts/gary.asm b/scripts/gary.asm index d01161da..ab991942 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -94,8 +94,7 @@ GaryScript3: ; 75fbb (1d:5fbb) cp $ff jp z, GaryScript_75f29 call UpdateSprites - ld hl, wd867 - set 1, [hl] + SetEvent EVENT_901 ld a, $f0 ld [wJoyIgnore], a ld a, $1 @@ -249,8 +248,7 @@ GaryTextPointers: ; 760d6 (1d:60d6) GaryText1: ; 760e0 (1d:60e0) TX_ASM - ld a, [wd867] - bit 1, a + CheckEvent EVENT_901 ld hl, GaryText_760f4 jr z, .asm_17e9f ld hl, GaryText_76103 diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index bc0d19e1..136061d8 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -39,12 +39,8 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) ld [hl], a ld [W_LANCECURSCRIPT], a ld [W_HALLOFFAMEROOMCURSCRIPT], a - ld hl, wd863 - ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hl], a + ; Elite 4 events + ResetEventRange EVENT_8E0, EVENT_907, 1 xor a ld [W_HALLOFFAMEROOMCURSCRIPT], a ld a, PALLET_TOWN diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm index 1b09a61d..8cde0854 100755 --- a/scripts/indigoplateaulobby.asm +++ b/scripts/indigoplateaulobby.asm @@ -5,18 +5,13 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) bit 6, [hl] res 6, [hl] ret z - ld hl, wd869 - res 7, [hl] + ResetEvent EVENT_917 ld hl, wd734 bit 1, [hl] res 1, [hl] ret z - ld hl, wd863 - xor a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hl], a + ; Elite 4 events + ResetEventRange EVENT_8E0, EVENT_8FF ret IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f) diff --git a/scripts/lab3.asm b/scripts/lab3.asm index e91d36f3..0351038d 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -10,8 +10,7 @@ Lab3TextPointers: ; 75c8a (1d:5c8a) Lab3Text1: ; 75c94 (1d:5c94) TX_ASM - ld a, [wd7a1] - bit 7, a + CheckEvent EVENT_2D7 jr nz, .asm_e551a ld hl, TM35PreReceiveText call PrintText @@ -20,8 +19,7 @@ Lab3Text1: ; 75c94 (1d:5c94) jr nc, .BagFull ld hl, ReceivedTM35Text call PrintText - ld hl, wd7a1 - set 7, [hl] + SetEvent EVENT_2D7 jr .asm_eb896 .BagFull ld hl, TM35NoRoomText diff --git a/scripts/lab4.asm b/scripts/lab4.asm index 21fee0c6..44dcb2c3 100755 --- a/scripts/lab4.asm +++ b/scripts/lab4.asm @@ -49,8 +49,7 @@ FossilsList: ; 75d68 (1d:5d68) Lab4Text1: ; 75d6c (1d:5d6c) TX_ASM - ld a, [wd7a3] - bit 0, a + CheckEvent EVENT_2E0 jr nz, .asm_75d96 ld hl, Lab4Text_75dc6 call PrintText @@ -75,17 +74,13 @@ Lab4Text1: ; 75d6c (1d:5d6c) call LoadFossilItemAndMonNameBank1D ld hl, Lab4Text_75dd5 call PrintText - ld hl, wd7a3 - set 2, [hl] + SetEvent EVENT_2E2 ld a, [W_FOSSILMON] ld b, a ld c, 30 call GivePokemon jr nc, .asm_75d93 - ld hl, wd7a3 - res 0, [hl] - res 1, [hl] - res 2, [hl] + ResetEvents EVENT_2E0, EVENT_2E1, EVENT_2E2 jr .asm_75d93 Lab4Text_75dc6: ; 75dc6 (1d:5dc6) diff --git a/scripts/lance.asm b/scripts/lance.asm index 80780cd1..9d3a2f99 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -13,8 +13,7 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) bit 5, [hl] res 5, [hl] ret z - ld a, [wd866] - bit 7, a + CheckEvent EVENT_8FF jr nz, .asm_5a2da ld a, $31 ld b, $32 @@ -52,8 +51,7 @@ LanceScript4: ; 5a304 (16:6304) ret LanceScript0: ; 5a305 (16:6305) - ld a, [wd866] - bit 6, a + CheckEvent EVENT_8FE ret nz ld hl, CoordsData_5a33e call ArePlayerCoordsInArray @@ -69,9 +67,7 @@ LanceScript0: ; 5a305 (16:6305) .asm_5a325 cp $5 jr z, LanceScript_5a35b - ld hl, wd866 - bit 7, [hl] - set 7, [hl] + CheckAndSetEvent EVENT_8FF ret nz ld hl, wd126 set 5, [hl] @@ -133,9 +129,9 @@ LanceTextPointers: ; 5a395 (16:6395) LanceTrainerHeaders: ; 5a397 (16:6397) LanceTrainerHeader0: ; 5a397 (16:6397) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_LANCES_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd866 ; flag's byte + dwEventFlagAddress EVENT_BEAT_LANCES_ROOM_TRAINER_0 dw LanceBeforeBattleText ; TextBeforeBattle dw LanceAfterBattleText ; TextAfterBattle dw LanceEndBattleText ; TextEndBattle @@ -160,6 +156,5 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText TX_ASM - ld hl, wd866 - set 6, [hl] + SetEvent EVENT_8FE jp TextScriptEnd diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index 9c812c71..21e67013 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -12,8 +12,7 @@ LavenderHouse1TextPointers: ; 1d8ac (7:58ac) LavenderHouse1Text1: ; 1d8b8 (7:58b8) TX_ASM - ld a, [wd7e0] - bit 7, a + CheckEvent EVENT_4CF jr nz, .asm_72e5d ld hl, LavenderHouse1Text_1d8d1 call PrintText @@ -34,8 +33,7 @@ LavenderHouse1Text_1d8d6: ; 1d8d6 (7:58d6) LavenderHouse1Text2: ; 1d8db (7:58db) TX_ASM - ld a, [wd7e0] - bit 7, a + CheckEvent EVENT_4CF jr nz, .asm_06470 ld hl, LavenderHouse1Text_1d8f4 call PrintText @@ -70,8 +68,7 @@ LavenderHouse1Text4: ; 1d90b (7:590b) LavenderHouse1Text5: ; 1d918 (7:5918) TX_ASM - ld a, [wd76c] - bit 0, a + CheckEvent EVENT_128 jr nz, .asm_15ac2 ld hl, LavenderHouse1Text_1d94c call PrintText @@ -80,8 +77,7 @@ LavenderHouse1Text5: ; 1d918 (7:5918) jr nc, .BagFull ld hl, ReceivedFluteText call PrintText - ld hl, wd76c - set 0, [hl] + SetEvent EVENT_128 jr .asm_da749 .BagFull ld hl, FluteNoRoomText diff --git a/scripts/lavenderhouse2.asm b/scripts/lavenderhouse2.asm index 4dc5c7b7..4c3ad333 100755 --- a/scripts/lavenderhouse2.asm +++ b/scripts/lavenderhouse2.asm @@ -15,8 +15,7 @@ LavenderHouse2Text1: ; 1d9b6 (7:59b6) LavenderHouse2Text2: ; 1d9c3 (7:59c3) TX_ASM - ld a, [wd7e0] - bit 7, a + CheckEvent EVENT_4CF jr nz, .asm_65711 ld hl, LavenderHouse2Text_1d9dc call PrintText diff --git a/scripts/lavendermart.asm b/scripts/lavendermart.asm index 53967cf2..ababf70d 100755 --- a/scripts/lavendermart.asm +++ b/scripts/lavendermart.asm @@ -12,8 +12,7 @@ LavenderMartText2: ; 5c935 (17:4935) LavenderMartText3: ; 5c93a (17:493a) TX_ASM - ld a, [wd7e0] - bit 7, a + CheckEvent EVENT_4CF jr nz, .asm_c88d4 ld hl, LavenderMart_5c953 call PrintText diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index eb6c3e7d..a8e0cb5b 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -15,8 +15,7 @@ LoreleiScript_76191: ; 76191 (1d:6191) ret z ld hl, wd734 set 1, [hl] - ld a, [wd863] - bit 1, a + CheckEvent EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 jr z, .asm_761a9 ld a, $5 jr .asm_761ab @@ -71,9 +70,7 @@ LoreleiScript0: ; 761e2 (1d:61e2) ld a, [wCoordIndex] cp $3 jr c, .asm_76206 - ld hl, wd863 - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_8E6 jr z, LoreleiScript_761c6 .asm_76206 ld a, $2 @@ -121,9 +118,9 @@ LoreleiTextPointers: ; 76251 (1d:6251) LoreleiTrainerHeaders: ; 76255 (1d:6255) LoreleiTrainerHeader0: ; 76255 (1d:6255) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd863 ; flag's byte + dwEventFlagAddress EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 dw LoreleiBeforeBattleText ; TextBeforeBattle dw LoreleiAfterBattleText ; TextAfterBattle dw LoreleiEndBattleText ; TextEndBattle diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index a9e2616a..ff8707e0 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -13,8 +13,7 @@ Mansion1Subscript1: ; 442c5 (11:42c5) bit 5, [hl] res 5, [hl] ret z - ld a, [wd796] - bit 0, a + CheckEvent EVENT_278 jr nz, .asm_442ec ld bc, $060c call Mansion1Script_4430b @@ -69,9 +68,9 @@ Mansion1TextPointers: ; 4432c (11:432c) Mansion1TrainerHeaders: ; 44334 (11:4334) Mansion1TrainerHeader0: ; 44334 (11:4334) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_1_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd798 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_1_TRAINER_0 dw Mansion1BattleText2 ; TextBeforeBattle dw Mansion1AfterBattleText2 ; TextAfterBattle dw Mansion1EndBattleText2 ; TextEndBattle @@ -113,11 +112,9 @@ Mansion1Text4: ; 4435a (11:435a) call PrintText ld a, SFX_GO_INSIDE call PlaySound - ld hl, wd796 - bit 0, [hl] - set 0, [hl] + CheckAndSetEvent EVENT_278 jr z, .asm_44392 - res 0, [hl] + ResetEventReuseHL EVENT_278 jr .asm_44392 .asm_4438c ld hl, MansionSwitchNotPressedText diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index 1cacae02..6e1a26c0 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -13,8 +13,7 @@ Mansion2Script_51fee: ; 51fee (14:5fee) bit 5, [hl] res 5, [hl] ret z - ld a, [wd796] - bit 0, a + CheckEvent EVENT_278 jr nz, .asm_52016 ld a, $e ld bc, $204 @@ -66,9 +65,9 @@ Mansion2TextPointers: ; 5204d (14:604d) Mansion2TrainerHeaders: ; 52057 (14:6057) Mansion2TrainerHeader0: ; 52057 (14:6057) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_2_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd847 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_2_TRAINER_0 dw Mansion2BattleText1 ; TextBeforeBattle dw Mansion2AfterBattleText1 ; TextAfterBattle dw Mansion2EndBattleText1 ; TextEndBattle @@ -119,11 +118,9 @@ Mansion2Text5: ; 52087 (14:6087) call PrintText ld a, SFX_GO_INSIDE call PlaySound - ld hl, wd796 - bit 0, [hl] - set 0, [hl] + CheckAndSetEvent EVENT_278 jr z, .asm_520bf - res 0, [hl] + ResetEventReuseHL EVENT_278 jr .asm_520bf .asm_520b9 ld hl, Mansion2Text_520cc diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index c22bf761..0aec82b3 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -13,8 +13,7 @@ Mansion3Script_52204: ; 52204 (14:6204) bit 5, [hl] res 5, [hl] ret z - ld a, [wd796] - bit 0, a + CheckEvent EVENT_278 jr nz, .asm_52224 ld a, $e ld bc, $207 @@ -93,18 +92,18 @@ Mansion3TextPointers: ; 5228a (14:628a) Mansion3TrainerHeaders: ; 52296 (14:6296) Mansion3TrainerHeader0: ; 52296 (14:6296) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd849 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_0 dw Mansion3BattleText1 ; TextBeforeBattle dw Mansion3AfterBattleText1 ; TextAfterBattle dw Mansion3EndBattleText1 ; TextEndBattle dw Mansion3EndBattleText1 ; TextEndBattle Mansion3TrainerHeader2: ; 522a2 (14:62a2) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd849 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_2 dw Mansion3BattleText2 ; TextBeforeBattle dw Mansion3AfterBattleText2 ; TextAfterBattle dw Mansion3EndBattleText2 ; TextEndBattle diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index 68e74fd5..98c55a76 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -13,8 +13,7 @@ Mansion4Script_523cf: ; 523cf (14:63cf) bit 5, [hl] res 5, [hl] ret z - ld a, [wd796] - bit 0, a + CheckEvent EVENT_278 jr nz, .asm_523ff ld a, $e ld bc, $80d @@ -72,18 +71,18 @@ Mansion4TextPointers: ; 52436 (14:6436) Mansion4TrainerHeaders: ; 52448 (14:6448) Mansion4TrainerHeader0: ; 52448 (14:6448) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd84b ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_0 dw Mansion4BattleText1 ; TextBeforeBattle dw Mansion4AfterBattleText1 ; TextAfterBattle dw Mansion4EndBattleText1 ; TextEndBattle dw Mansion4EndBattleText1 ; TextEndBattle Mansion4TrainerHeader2: ; 52454 (14:6454) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd84b ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_2 dw Mansion4BattleText2 ; TextBeforeBattle dw Mansion4AfterBattleText2 ; TextAfterBattle dw Mansion4EndBattleText2 ; TextEndBattle diff --git a/scripts/mtmoon1.asm b/scripts/mtmoon1.asm index 868b70d1..4a5eeae3 100755 --- a/scripts/mtmoon1.asm +++ b/scripts/mtmoon1.asm @@ -30,63 +30,63 @@ MtMoon1TextPointers: ; 499e1 (12:59e1) MtMoon1TrainerHeaders: ; 499fd (12:59fd) MtMoon1TrainerHeader0: ; 499fd (12:59fd) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_0 dw MtMoon1BattleText2 ; TextBeforeBattle dw MtMoon1AfterBattleText2 ; TextAfterBattle dw MtMoon1EndBattleText2 ; TextEndBattle dw MtMoon1EndBattleText2 ; TextEndBattle MtMoon1TrainerHeader2: ; 49a09 (12:5a09) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_2 dw MtMoon1BattleText3 ; TextBeforeBattle dw MtMoon1AfterBattleText3 ; TextAfterBattle dw MtMoon1EndBattleText3 ; TextEndBattle dw MtMoon1EndBattleText3 ; TextEndBattle MtMoon1TrainerHeader3: ; 49a15 (12:5a15) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_3 dw MtMoon1BattleText4 ; TextBeforeBattle dw MtMoon1AfterBattleText4 ; TextAfterBattle dw MtMoon1EndBattleText4 ; TextEndBattle dw MtMoon1EndBattleText4 ; TextEndBattle MtMoon1TrainerHeader4: ; 49a21 (12:5a21) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_4 dw MtMoon1BattleText5 ; TextBeforeBattle dw MtMoon1AfterBattleText5 ; TextAfterBattle dw MtMoon1EndBattleText5 ; TextEndBattle dw MtMoon1EndBattleText5 ; TextEndBattle MtMoon1TrainerHeader5: ; 49a2d (12:5a2d) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_5 dw MtMoon1BattleText6 ; TextBeforeBattle dw MtMoon1AfterBattleText6 ; TextAfterBattle dw MtMoon1EndBattleText6 ; TextEndBattle dw MtMoon1EndBattleText6 ; TextEndBattle MtMoon1TrainerHeader6: ; 49a39 (12:5a39) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_6 dw MtMoon1BattleText7 ; TextBeforeBattle dw MtMoon1AfterBattleText7 ; TextAfterBattle dw MtMoon1EndBattleText7 ; TextEndBattle dw MtMoon1EndBattleText7 ; TextEndBattle MtMoon1TrainerHeader7: ; 49a45 (12:5a45) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_7 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_7 dw MtMoon1BattleText8 ; TextBeforeBattle dw MtMoon1AfterBattleText8 ; TextAfterBattle dw MtMoon1EndBattleText8 ; TextEndBattle diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index ee163738..dfa92260 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -5,8 +5,7 @@ MtMoon3Script: ; 49d0b (12:5d0b) ld a, [W_MTMOON3CURSCRIPT] call ExecuteCurMapScriptInTable ld [W_MTMOON3CURSCRIPT], a - ld a, [wd7f6] - bit 1, a + CheckEvent EVENT_579 ret z ld hl, CoordsData_49d37 call ArePlayerCoordsInArray @@ -54,8 +53,7 @@ MtMoon3ScriptPointers: ; 49d63 (12:5d63) dw MtMoon3Script5 MtMoon3Script0: ; 49d6f (12:5d6f) - ld a, [wd7f6] - bit 1, a + CheckEvent EVENT_579 jp nz, MtMoon3Script_49d91 ld a, [W_YCOORD] cp $8 @@ -70,8 +68,7 @@ MtMoon3Script0: ; 49d6f (12:5d6f) jp DisplayTextID MtMoon3Script_49d91: ; 49d91 (12:5d91) - ld a, [wd7f6] - and $c0 + CheckEitherEventSet EVENT_57E, EVENT_57F jp z, CheckFightingMapTrainers ret @@ -81,8 +78,7 @@ MtMoon3Script3: ; 49d9a (12:5d9a) jp z, MtMoon3Script_49d58 call UpdateSprites call Delay3 - ld hl, wd7f6 - set 1, [hl] + SetEvent EVENT_579 xor a ld [wJoyIgnore], a ld a, $0 @@ -142,8 +138,7 @@ MtMoon3Script5: ; 49dfb (12:5dfb) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld a, [wd7f6] - bit 6, a + CheckEvent EVENT_57E jr z, .asm_49e1d ld a, HS_MT_MOON_3_FOSSIL_2 jr .asm_49e1f @@ -173,36 +168,36 @@ MtMoon3TextPointers: ; 49e34 (12:5e34) MtMoon3TrainerHeaders: ; 49e48 (12:5e48) MtMoon3TrainerHeader0: ; 49e48 (12:5e48) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7f6 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_0 dw MtMoon3BattleText2 ; TextBeforeBattle dw MtMoon3AfterBattleText2 ; TextAfterBattle dw MtMoon3EndBattleText2 ; TextEndBattle dw MtMoon3EndBattleText2 ; TextEndBattle MtMoon3TrainerHeader2: ; 49e54 (12:5e54) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7f6 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_2 dw MtMoon3BattleText3 ; TextBeforeBattle dw MtMoon3AfterBattleText3 ; TextAfterBattle dw MtMoon3EndBattleText3 ; TextEndBattle dw MtMoon3EndBattleText3 ; TextEndBattle MtMoon3TrainerHeader3: ; 49e60 (12:5e60) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7f6 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_3 dw MtMoon3BattleText4 ; TextBeforeBattle dw MtMoon3AfterBattleText4 ; TextAfterBattle dw MtMoon3EndBattleText4 ; TextEndBattle dw MtMoon3EndBattleText4 ; TextEndBattle MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7f6 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_4 dw MtMoon3BattleText5 ; TextBeforeBattle dw MtMoon3AfterBattleText5 ; TextAfterBattle dw MtMoon3EndBattleText5 ; TextEndBattle @@ -212,8 +207,7 @@ MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) MtMoon3Text1: ; 49e79 (12:5e79) TX_ASM - ld a, [wd7f6] - bit 1, a + CheckEvent EVENT_579 jr z, .asm_49e8d and $c0 jr nz, .asm_49eb8 @@ -284,8 +278,7 @@ MtMoon3Text6: ; 49ee9 (12:5ee9) ld a, HS_MT_MOON_3_FOSSIL_1 ld [wcc4d], a predef HideObject - ld hl, wd7f6 - set 6, [hl] + SetEvent EVENT_57E ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -313,8 +306,7 @@ MtMoon3Text7: ; 49f29 (12:5f29) ld a, HS_MT_MOON_3_FOSSIL_2 ld [wcc4d], a predef HideObject - ld hl, wd7f6 - set 7, [hl] + SetEvent EVENT_57F ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a diff --git a/scripts/mtmoonpokecenter.asm b/scripts/mtmoonpokecenter.asm index d4996b4b..63cc06e4 100755 --- a/scripts/mtmoonpokecenter.asm +++ b/scripts/mtmoonpokecenter.asm @@ -23,8 +23,7 @@ MtMoonPokecenterText3: ; 492e7 (12:52e7) MtMoonPokecenterText4: ; 492ec (12:52ec) TX_ASM - ld a, [wd7c6] - add a + CheckEvent EVENT_BOUGHT_MAGIKARP, 1 jp c, .alreadyBoughtMagikarp ld hl, MtMoonPokecenterText_4935c call PrintText @@ -59,8 +58,7 @@ MtMoonPokecenterText4: ; 492ec (12:52ec) ld a, MONEY_BOX ld [wTextBoxID], a call DisplayTextBoxID - ld hl, wd7c6 - set 7, [hl] + SetEvent EVENT_BOUGHT_MAGIKARP jr .done .choseNo ld hl, MtMoonPokecenterText_49361 diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 32e489ca..2acf1af5 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -54,15 +54,13 @@ Museum1FText1: ; 5c135 (17:4135) cp $c jp z, Museum1FScript_5c1f9 .asm_d49e7 - ld a, [wd754] - bit 0, a + CheckEvent EVENT_068 jr nz, .asm_31a16 ld hl, Museum1FText_5c23d call PrintText jp Museum1FScriptEnd .asm_b8709 - ld a, [wd754] - bit 0, a + CheckEvent EVENT_068 jr z, .asm_3ded4 .asm_31a16 ld hl, Museum1FText_5c242 @@ -93,8 +91,7 @@ Museum1FText1: ; 5c135 (17:4135) .asm_0f3e3 ld hl, Museum1FText_5c224 call PrintText - ld hl, wd754 - set 0, [hl] + SetEvent EVENT_068 xor a ld [wPriceTemp], a ld [wPriceTemp + 1], a @@ -190,16 +187,14 @@ Museum1FText_5c251: ; 5c251 (17:4251) Museum1FText3: ; 5c256 (17:4256) TX_ASM - ld a, [wd754] - bit 1, a + CheckEvent EVENT_069 jr nz, .asm_5c285 ld hl, Museum1FText_5c28e call PrintText ld bc, (OLD_AMBER << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd754 - set 1, [hl] + SetEvent EVENT_069 ld a, HS_OLD_AMBER ld [wcc4d], a predef HideObject diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index ae6da40d..6f51aca0 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -1,6 +1,5 @@ OaksLabScript: ; 1cb0e (7:4b0e) - ld a, [wd74b] - bit 6, a + CheckEvent EVENT_026 call nz, OaksLabScript_1d076 ld a, $1 ld [wAutoTextBoxDrawingControl], a @@ -32,8 +31,7 @@ OaksLabScriptPointers: ; 1cb28 (7:4b28) dw OaksLabScript18 OaksLabScript0: ; 1cb4e (7:4b4e) - ld a, [wd74b] - bit 7, a + CheckEvent EVENT_027 ret z ld a, [wNPCMovementScriptFunctionNum] and a @@ -110,10 +108,8 @@ OaksLabScript4: ; 1cbd2 (7:4bd2) ld a, [wSimulatedJoypadStatesIndex] and a ret nz - ld hl, wd747 - set 0, [hl] - ld hl, wd74b - set 0, [hl] + SetEvent EVENT_STOPPED_FROM_LEAVING_PALLET + SetEvent EVENT_FOLLOWED_OAK_INSIDE_LAB ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP @@ -146,8 +142,7 @@ OaksLabScript5: ; 1cbfd (7:4bfd) ld a, $14 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd74b - set 1, [hl] + SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON xor a ld [wJoyIgnore], a @@ -336,8 +331,7 @@ OaksLabScript9: ; 1cd00 (7:4d00) ld a, $e ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd74b - set 2, [hl] + SetEvent EVENT_GOT_STARTER xor a ld [wJoyIgnore], a @@ -435,8 +429,7 @@ OaksLabScript12: ; 1ce03 (7:4e03) ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay predef HealParty - ld hl, wd74b - set 3, [hl] + SetEvent EVENT_BATTLED_RIVAL_IN_OAKS_LAB ld a, $d ld [W_OAKSLABCURSCRIPT], a @@ -603,10 +596,8 @@ OaksLabScript16: ; 1cf12 (7:4f12) ld a, $1b ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd74b - set 5, [hl] - ld hl, wd74e - set 0, [hl] + SetEvent EVENT_GOT_POKEDEX + SetEvent EVENT_038 ld a, HS_LYING_OLD_MAN ld [wcc4d], a predef HideObject @@ -641,10 +632,9 @@ OaksLabScript17: ; 1cfd4 (7:4fd4) ld a, HS_OAKS_LAB_RIVAL ld [wcc4d], a predef HideObject - ld hl, wd7eb - set 0, [hl] - res 1, [hl] - set 7, [hl] + SetEvent EVENT_520 + ResetEventReuseHL EVENT_521 + SetEventReuseHL EVENT_527 ld a, HS_ROUTE_22_RIVAL_1 ld [wcc4d], a predef ShowObject @@ -772,8 +762,7 @@ OaksLabTextPointers: ; 1d082 (7:5082) OaksLabText28: ; 1d0ce (7:50ce) OaksLabText1: ; 1d0ce (7:50ce) TX_ASM - ld a, [wd74b] - bit 0, a + CheckEvent EVENT_FOLLOWED_OAK_INSIDE_LAB jr nz, .asm_1d0de ld hl, OaksLabGaryText1 call PrintText @@ -839,10 +828,9 @@ OaksLabScript_1d133: ; 1d133 (7:5133) ld [wd11e], a ld a, b ld [wSpriteIndex], a - ld a, [wd74b] - bit 2, a + CheckEvent EVENT_GOT_STARTER jp nz, OaksLabScript_1d22d - bit 1, a + CheckEventReuseA EVENT_OAK_ASKED_TO_CHOOSE_MON jr nz, OaksLabScript_1d157 ld hl, OaksLabText39 call PrintText @@ -976,8 +964,7 @@ OaksLabLastMonText: ; 1d243 (7:5243) OaksLabText32: ; 1d248 (7:5248) OaksLabText5: ; 1d248 (7:5248) TX_ASM - ld a, [wd747] - bit 6, a + CheckEvent EVENT_006 jr nz, .asm_1d266 ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned @@ -985,8 +972,7 @@ OaksLabText5: ; 1d248 (7:5248) ld a, [wd11e] cp $2 jr c, .asm_1d279 - ld a, [wd74b] - bit 5, a + CheckEvent EVENT_GOT_POKEDEX jr z, .asm_1d279 .asm_1d266 ld hl, OaksLabText_1d31d @@ -999,13 +985,11 @@ OaksLabText5: ; 1d248 (7:5248) ld b,POKE_BALL call IsItemInBag jr nz, .asm_1d2e7 - ld a, [wd7eb] - bit 5, a + CheckEvent EVENT_525 jr nz, .asm_1d2d0 - ld a, [wd74b] - bit 5, a + CheckEvent EVENT_GOT_POKEDEX jr nz, .asm_1d2c8 - bit 3, a + CheckEventReuseA EVENT_BATTLED_RIVAL_IN_OAKS_LAB jr nz, .asm_1d2a9 ld a, [wd72e] bit 3, a @@ -1036,9 +1020,7 @@ OaksLabText5: ; 1d248 (7:5248) call PrintText jr .asm_1d2ed .asm_1d2d0 - ld hl, wd74b - bit 4, [hl] - set 4, [hl] + CheckAndSetEvent EVENT_GOT_POKEBALLS_FROM_OAK jr nz, .asm_1d2e7 ld bc, (POKE_BALL << 8) | 5 call GiveItem diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index b463c4d6..15956e7b 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -1,9 +1,7 @@ PalletTownScript: ; 18e5b (6:4e5b) - ld a,[wd74b] - bit 4,a + CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK jr z,.next - ld hl,wd747 - set 6,[hl] + SetEvent EVENT_006 .next call EnableAutoTextBoxDrawing ld hl,PalletTownScriptPointers @@ -20,8 +18,7 @@ PalletTownScriptPointers: ; 18e73 (6:4e73) dw PalletTownScript6 PalletTownScript0: ; 18e81 (6:4e81) - ld a,[wd747] - bit 0,a + CheckEvent EVENT_STOPPED_FROM_LEAVING_PALLET ret nz ld a,[W_YCOORD] cp 1 ; is player near north exit? @@ -38,8 +35,7 @@ PalletTownScript0: ; 18e81 (6:4e81) call PlayMusic ld a,$FC ld [wJoyIgnore],a - ld hl,wd74b - set 7,[hl] + SetEvent EVENT_027 ; trigger the next script ld a,1 @@ -134,14 +130,12 @@ PalletTownScript4: ; 18f4b (6:4f4b) ret PalletTownScript5: ; 18f56 (6:4f56) - ld a,[wd74a] - bit 2,a + CheckEvent EVENT_01A jr nz,.next and 3 cp 3 jr nz,.next - ld hl,wd74a - set 2,[hl] + SetEvent EVENT_01A ld a,HS_DAISY_SITTING ld [wcc4d],a predef HideObject @@ -149,11 +143,9 @@ PalletTownScript5: ; 18f56 (6:4f56) ld [wcc4d],a predef_jump ShowObject .next - ld a,[wd74b] - bit 4,a + CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK ret z - ld hl,wd74b - set 6,[hl] + SetEvent EVENT_026 PalletTownScript6: ; 18f87 (6:4f87) ret diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index 94d23caa..2fce86df 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -16,14 +16,12 @@ PewterCityScriptPointers: ; 19243 (6:5243) PewterCityScript0: ; 19251 (6:5251) xor a ld [W_MUSEUM1FCURSCRIPT], a - ld hl, wd754 - res 0, [hl] + ResetEvent EVENT_068 call PewterCityScript_1925e ret PewterCityScript_1925e: ; 1925e (6:525e) - ld a, [wd755] - bit 7, a + CheckEvent EVENT_077 ret nz ld hl, CoordsData_19277 call ArePlayerCoordsInArray diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 9f1493d4..e2798b24 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -46,16 +46,14 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld a, $4 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd755 - set 7, [hl] + SetEvent EVENT_077 ld bc, (TM_34 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $5 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd755 - set 6, [hl] + SetEvent EVENT_076 jr .asm_5c408 .BagFull ld a, $6 @@ -74,13 +72,10 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld [wcc4d], a predef HideObject - ld hl, wd7eb - res 0, [hl] - res 7, [hl] + ResetEvents EVENT_520, EVENT_527 ; deactivate gym trainers - ld hl, wd755 - set 2, [hl] + SetEvent EVENT_BEAT_PEWTER_GYM_TRAINER_0 jp PewterGymScript_5c3bf @@ -94,9 +89,9 @@ PewterGymTextPointers: ; 5c435 (17:4435) PewterGymTrainerHeaders: ; 5c441 (17:4441) PewterGymTrainerHeader0: ; 5c441 (17:4441) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_PEWTER_GYM_TRAINER_0 db ($5 << 4) ; trainer's view range - dw wd755 ; flag's byte + dwEventFlagAddress EVENT_BEAT_PEWTER_GYM_TRAINER_0 dw PewterGymBattleText1 ; TextBeforeBattle dw PewterGymAfterBattleText1 ; TextAfterBattle dw PewterGymEndBattleText1 ; TextEndBattle @@ -106,10 +101,9 @@ PewterGymTrainerHeader0: ; 5c441 (17:4441) PewterGymText1: ; 5c44e (17:444e) TX_ASM - ld a, [wd755] - bit 7, a + CheckEvent EVENT_077 jr z, .asm_5c46a - bit 6, a + CheckEventReuseA EVENT_076 jr nz, .asm_5c462 call z, PewterGymScript_5c3df call DisableWaitingAfterTextDisplay diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index 6a54d549..a9619170 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -17,8 +17,7 @@ PokemonTower2ScriptPointers: ; 60509 (18:4509) dw PokemonTower2Script2 PokemonTower2Script0: ; 6050f (18:450f) - ld a, [wd764] - bit 7, a + CheckEvent EVENT_0EF ret nz ld hl, CoordsData_6055e call ArePlayerCoordsInArray @@ -29,15 +28,13 @@ PokemonTower2Script0: ; 6050f (18:450f) ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ld hl, wd764 - res 6, [hl] + ResetEvent EVENT_0EE ld a, [wCoordIndex] cp $1 ld a, PLAYER_DIR_UP ld b, SPRITE_FACING_DOWN jr nz, .asm_60544 - ld hl, wd764 - set 6, [hl] + SetEvent EVENT_0EE ld a, PLAYER_DIR_LEFT ld b, SPRITE_FACING_RIGHT .asm_60544 @@ -66,14 +63,12 @@ PokemonTower2Script1: ; 60563 (18:4563) jp z, PokemonTower2Script_604fe ld a, $f0 ld [wJoyIgnore], a - ld hl, wd764 - set 7, [hl] + SetEvent EVENT_0EF ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID ld de, MovementData_605b2 - ld a, [wd764] - bit 6, a + CheckEvent EVENT_0EE jr nz, .asm_60589 ld de, MovementData_605a9 .asm_60589 @@ -132,8 +127,7 @@ PokemonTower2TextPointers: ; 605db (18:45db) PokemonTower2Text1: ; 605df (18:45df) TX_ASM - ld a, [wd764] - bit 7, a + CheckEvent EVENT_0EF jr z, .asm_16f24 ld hl, PokemonTower2Text_6063c call PrintText diff --git a/scripts/pokemontower3.asm b/scripts/pokemontower3.asm index 9d08aec4..a4fbbf18 100755 --- a/scripts/pokemontower3.asm +++ b/scripts/pokemontower3.asm @@ -20,27 +20,27 @@ PokemonTower3TextPointers: ; 606e5 (18:46e5) PokemonTower3TrainerHeaders: ; 606ed (18:46ed) PokemonTower3TrainerHeader0: ; 606ed (18:46ed) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd765 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 dw PokemonTower3BattleText1 ; TextBeforeBattle dw PokemonTower3AfterBattleText1 ; TextAfterBattle dw PokemonTower3EndBattleText1 ; TextEndBattle dw PokemonTower3EndBattleText1 ; TextEndBattle PokemonTower3TrainerHeader1: ; 606f9 (18:46f9) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd765 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 dw PokemonTower3BattleText2 ; TextBeforeBattle dw PokemonTower3AfterBattleText2 ; TextAfterBattle dw PokemonTower3EndBattleText2 ; TextEndBattle dw PokemonTower3EndBattleText2 ; TextEndBattle PokemonTower3TrainerHeader2: ; 60705 (18:4705) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd765 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 dw PokemonTower3BattleText3 ; TextBeforeBattle dw PokemonTower3AfterBattleText3 ; TextAfterBattle dw PokemonTower3EndBattleText3 ; TextEndBattle diff --git a/scripts/pokemontower4.asm b/scripts/pokemontower4.asm index c4732397..2638bdc2 100755 --- a/scripts/pokemontower4.asm +++ b/scripts/pokemontower4.asm @@ -22,27 +22,27 @@ PokemonTower4TextPointers: ; 6080f (18:480f) PokemonTower4TrainerHeaders: ; 6081b (18:481b) PokemonTower4TrainerHeader0: ; 6081b (18:481b) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd766 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 dw PokemonTower4BattleText1 ; TextBeforeBattle dw PokemonTower4AfterBattleText1 ; TextAfterBattle dw PokemonTower4EndBattleText1 ; TextEndBattle dw PokemonTower4EndBattleText1 ; TextEndBattle PokemonTower4TrainerHeader1: ; 60827 (18:4827) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd766 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 dw PokemonTower4BattleText2 ; TextBeforeBattle dw PokemonTower4AfterBattleText2 ; TextAfterBattle dw PokemonTower4EndBattleText2 ; TextEndBattle dw PokemonTower4EndBattleText2 ; TextEndBattle PokemonTower4TrainerHeader2: ; 60833 (18:4833) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd766 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 dw PokemonTower4BattleText3 ; TextBeforeBattle dw PokemonTower4AfterBattleText3 ; TextAfterBattle dw PokemonTower4EndBattleText3 ; TextEndBattle diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index 9ef5d419..b418b361 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -18,13 +18,10 @@ PokemonTower5Script0: ; 6094b (18:494b) jr c, .asm_60960 ld hl, wd72e res 4, [hl] - ld hl, wd767 - res 7, [hl] + ResetEvent EVENT_107 jp CheckFightingMapTrainers .asm_60960 - ld hl, wd767 - bit 7, [hl] - set 7, [hl] + CheckAndSetEvent EVENT_107 ret nz xor a ld [hJoyHeld], a @@ -62,36 +59,36 @@ PokemonTower5TextPointers: ; 6099b (18:499b) PokemonTower5TrainerHeaders: ; 609a9 (18:49a9) PokemonTower5TrainerHeader0: ; 609a9 (18:49a9) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd767 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 dw PokemonTower5BattleText1 ; TextBeforeBattle dw PokemonTower5AfterBattleText1 ; TextAfterBattle dw PokemonTower5EndBattleText1 ; TextEndBattle dw PokemonTower5EndBattleText1 ; TextEndBattle PokemonTower5TrainerHeader1: ; 609b5 (18:49b5) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd767 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 dw PokemonTower5BattleText2 ; TextBeforeBattle dw PokemonTower5AfterBattleText2 ; TextAfterBattle dw PokemonTower5EndBattleText2 ; TextEndBattle dw PokemonTower5EndBattleText2 ; TextEndBattle PokemonTower5TrainerHeader2: ; 609c1 (18:49c1) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd767 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 dw PokemonTower5BattleText3 ; TextBeforeBattle dw PokemonTower5AfterBattleText3 ; TextAfterBattle dw PokemonTower5EndBattleText3 ; TextEndBattle dw PokemonTower5EndBattleText3 ; TextEndBattle PokemonTower5TrainerHeader3: ; 609cd (18:49cd) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd767 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 dw PokemonTower5BattleText4 ; TextBeforeBattle dw PokemonTower5AfterBattleText4 ; TextAfterBattle dw PokemonTower5EndBattleText4 ; TextEndBattle diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index e9412fb0..68260484 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -22,8 +22,7 @@ PokemonTower6ScriptPointers: ; 60b0d (18:4b0d) dw PokemonTower6Script4 PokemonTower6Script0: ; 60b17 (18:4b17) - ld a, [wd768] - bit 7, a + CheckEvent EVENT_10F jp nz, CheckFightingMapTrainers ld hl, CoordsData_60b45 call ArePlayerCoordsInArray @@ -60,8 +59,7 @@ PokemonTower6Script4: ; 60b48 (18:4b48) ld a, [wBattleResult] and a jr nz, .asm_60b82 - ld hl, wd768 - set 7, [hl] + SetEvent EVENT_10F ld a, $7 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -107,27 +105,27 @@ PokemonTower6TextPointers: ; 60bb1 (18:4bb1) PokemonTower6TrainerHeaders: ; 60bbf (18:4bbf) PokemonTower6TrainerHeader0: ; 60bbf (18:4bbf) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd768 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 dw PokemonTower6BattleText1 ; TextBeforeBattle dw PokemonTower6AfterBattleText1 ; TextAfterBattle dw PokemonTower6EndBattleText1 ; TextEndBattle dw PokemonTower6EndBattleText1 ; TextEndBattle PokemonTower6TrainerHeader1: ; 60bcb (18:4bcb) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd768 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 dw PokemonTower6BattleText2 ; TextBeforeBattle dw PokemonTower6AfterBattleText2 ; TextAfterBattle dw PokemonTower6EndBattleText2 ; TextEndBattle dw PokemonTower6EndBattleText2 ; TextEndBattle PokemonTower6TrainerHeader2: ; 60bd7 (18:4bd7) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd768 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 dw PokemonTower6BattleText3 ; TextBeforeBattle dw PokemonTower6AfterBattleText3 ; TextAfterBattle dw PokemonTower6EndBattleText3 ; TextEndBattle diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index 60635f20..c2fe1508 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -206,27 +206,27 @@ PokemonTower7TextPointers: ; 60e3f (18:4e3f) PokemonTower7TrainerHeaders: ; 60e47 (18:4e47) PokemonTower7TrainerHeader0: ; 60e47 (18:4e47) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd769 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 dw PokemonTower7BattleText1 ; TextBeforeBattle dw PokemonTower7AfterBattleText1 ; TextAfterBattle dw PokemonTower7EndBattleText1 ; TextEndBattle dw PokemonTower7EndBattleText1 ; TextEndBattle PokemonTower7TrainerHeader1: ; 60e53 (18:4e53) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd769 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 dw PokemonTower7BattleText2 ; TextBeforeBattle dw PokemonTower7AfterBattleText2 ; TextAfterBattle dw PokemonTower7EndBattleText2 ; TextEndBattle dw PokemonTower7EndBattleText2 ; TextEndBattle PokemonTower7TrainerHeader2: ; 60e5f (18:4e5f) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd769 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_2 dw PokemonTower7BattleText3 ; TextBeforeBattle dw PokemonTower7AfterBattleText3 ; TextAfterBattle dw PokemonTower7EndBattleText3 ; TextEndBattle @@ -256,10 +256,8 @@ PokemonTower7FujiText: TX_ASM ld hl, TowerRescueFujiText call PrintText - ld hl, wd7e0 - set 7, [hl] - ld hl, wd769 - set 7, [hl] + SetEvent EVENT_4CF + SetEvent EVENT_117 ld a, HS_LAVENDER_HOUSE_1_MR_FUJI ld [wcc4d], a predef ShowObject diff --git a/scripts/powerplant.asm b/scripts/powerplant.asm index 0026d525..48f291e1 100755 --- a/scripts/powerplant.asm +++ b/scripts/powerplant.asm @@ -30,81 +30,81 @@ PowerPlantTextPointers: ; 1e2df (7:62df) PowerPlantTrainerHeaders: ; 1e2fb (7:62fb) PowerPlantTrainerHeader0: ; 1e2fb (7:62fb) - db 1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_0 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_0 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader1: ; 1e307 (7:6307) - db 2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_1 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_1 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader2: ; 1e313 (7:6313) - db 3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_2 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_2 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader3: ; 1e31f (7:631f) - db 4 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_3 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_3 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader4: ; 1e32b (7:632b) - db 5 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_4 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_4 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader5: ; 1e337 (7:6337) - db 6 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_5 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_5 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader6: ; 1e343 (7:6343) - db 7 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_6 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_6 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader7: ; 1e34f (7:634f) - db 8 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_7, 1 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_7, 1 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader8: ; 1e35b (7:635b) - db 9 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_8, 1 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_8, 1 dw ZapdosBattleText ; TextBeforeBattle dw ZapdosBattleText ; TextAfterBattle dw ZapdosBattleText ; TextEndBattle diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index b798744d..ccf40cb4 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -13,18 +13,16 @@ RocketHideout1Script_44be0: ; 44be0 (11:4be0) bit 5, [hl] res 5, [hl] ret z - ld a, [wd815] - bit 7, a + CheckEvent EVENT_677 jr nz, .asm_44c01 - bit 5, a + CheckEventReuseA EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 jr nz, .asm_44bf7 ld a, $54 jr .asm_44c03 .asm_44bf7 ld a, SFX_GO_INSIDE call PlaySound - ld hl, wd815 - bit 7, [hl] + CheckEventHL EVENT_677 .asm_44c01 ld a, $e .asm_44c03 @@ -48,45 +46,45 @@ RocketHideout1TextPointers: ; 44c14 (11:4c14) RocketHideout1TrainerHeaders: ; 44c22 (11:4c22) RocketHideout1TrainerHeader0: ; 44c22 (11:4c22) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 dw RocketHideout1BattleText2 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt2 ; TextAfterBattle dw RocketHideout1EndBattleText2 ; TextEndBattle dw RocketHideout1EndBattleText2 ; TextEndBattle RocketHideout1TrainerHeader2: ; 44c2e (11:4c2e) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 dw RocketHideout1BattleText3 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt3 ; TextAfterBattle dw RocketHideout1EndBattleText3 ; TextEndBattle dw RocketHideout1EndBattleText3 ; TextEndBattle RocketHideout1TrainerHeader3: ; 44c3a (11:4c3a) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 dw RocketHideout1BattleText4 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt4 ; TextAfterBattle dw RocketHideout1EndBattleText4 ; TextEndBattle dw RocketHideout1EndBattleText4 ; TextEndBattle RocketHideout1TrainerHeader4: ; 44c46 (11:4c46) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 dw RocketHideout1BattleText5 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt5 ; TextAfterBattle dw RocketHideout1EndBattleText5 ; TextEndBattle dw RocketHideout1EndBattleText5 ; TextEndBattle RocketHideout1TrainerHeader5: ; 44c52 (11:4c52) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 dw RocketHideout1BattleText6 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt6 ; TextAfterBattle dw RocketHideout1EndBattleText6 ; TextEndBattle @@ -127,8 +125,7 @@ RocketHideout1Text5: ; 44c87 (11:4c87) RocketHideout1EndBattleText6: ; 44c91 (11:4c91) TX_FAR _RocketHideout1EndBattleText6 TX_ASM - ld hl, wd815 - set 5, [hl] + SetEvent EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 ld hl, RocketHideout1Text_44c9f ret diff --git a/scripts/rockethideout2.asm b/scripts/rockethideout2.asm index ead69458..f269faef 100755 --- a/scripts/rockethideout2.asm +++ b/scripts/rockethideout2.asm @@ -422,9 +422,9 @@ RocketHideout2TextPointers: ; 450c7 (11:50c7) RocketHideout2TrainerHeaders: ; 450d1 (11:50d1) RocketHideout2TrainerHeader0: ; 450d1 (11:50d1) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd817 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 dw RocketHideout2BattleText2 ; TextBeforeBattle dw RocketHideout2AfterBattleTxt2 ; TextAfterBattle dw RocketHideout2EndBattleText2 ; TextEndBattle diff --git a/scripts/rockethideout3.asm b/scripts/rockethideout3.asm index 2060c26c..1f6d5b41 100755 --- a/scripts/rockethideout3.asm +++ b/scripts/rockethideout3.asm @@ -151,18 +151,18 @@ RocketHideout3TextPointers: ; 452fa (11:52fa) RocketHideout3TrainerHeaders: ; 45302 (11:5302) RocketHideout3TrainerHeader0: ; 45302 (11:5302) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd819 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 dw RocketHideout3BattleText2 ; TextBeforeBattle dw RocketHideout3AfterBattleTxt2 ; TextAfterBattle dw RocketHideout3EndBattleText2 ; TextEndBattle dw RocketHideout3EndBattleText2 ; TextEndBattle RocketHideout3TrainerHeader2: ; 4530e (11:530e) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd819 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 dw RocketHideout3BattleTxt ; TextBeforeBattle dw RocketHideout3AfterBattleText3 ; TextAfterBattle dw RocketHideout3EndBattleText3 ; TextEndBattle diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index 44536279..e6ba430b 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -13,8 +13,7 @@ RocketHideout4Script_45473: ; 45473 (11:5473) bit 5, [hl] res 5, [hl] ret z - ld a, [wd81b] - bit 5, a + CheckEvent EVENT_6A5 jr nz, .asm_45496 and $c cp $c @@ -24,8 +23,7 @@ RocketHideout4Script_45473: ; 45473 (11:5473) .asm_4548c ld a, SFX_GO_INSIDE call PlaySound - ld hl, wd81b - set 5, [hl] + SetEvent EVENT_6A5 .asm_45496 ld a, $e .asm_45498 @@ -53,8 +51,7 @@ RocketHideout4Script3: ; 454b6 (11:54b6) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - ld hl, wd81b - set 7, [hl] + SetEvent EVENT_6A7 ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -90,27 +87,27 @@ RocketHideout4TextPointers: ; 45501 (11:5501) RocketHideout4TrainerHeaders: ; 45515 (11:5515) RocketHideout4TrainerHeader0: ; 45515 (11:5515) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd81b ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 dw RocketHideout4BattleText2 ; TextBeforeBattle dw RocketHideout4AfterBattleText2 ; TextAfterBattle dw RocketHideout4EndBattleText2 ; TextEndBattle dw RocketHideout4EndBattleText2 ; TextEndBattle RocketHideout4TrainerHeader2: ; 45521 (11:5521) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 db ($0 << 4) ; trainer's view range - dw wd81b ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 dw RocketHideout4BattleText3 ; TextBeforeBattle dw RocketHideout4AfterBattleText3 ; TextAfterBattle dw RocketHideout4EndBattleText3 ; TextEndBattle dw RocketHideout4EndBattleText3 ; TextEndBattle RocketHideout4TrainerHeader3: ; 4552d (11:552d) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 db ($1 << 4) ; trainer's view range - dw wd81b ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 dw RocketHideout4BattleText4 ; TextBeforeBattle dw RocketHideout4AfterBattleText4 ; TextAfterBattle dw RocketHideout4EndBattleText4 ; TextEndBattle @@ -120,8 +117,7 @@ RocketHideout4TrainerHeader3: ; 4552d (11:552d) RocketHideout4Text1: ; 4553a (11:553a) TX_ASM - ld a, [wd81b] - bit 7, a + CheckEvent EVENT_6A7 jp nz, .asm_545571 ld hl, RocketHideout4Text_4557a call PrintText @@ -213,9 +209,7 @@ RocketHideout4AfterBattleText4: ; 455cf (11:55cf) TX_ASM ld hl, RocketHideout4Text_455ec call PrintText - ld hl, wd81b - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_6A6 jr nz, .asm_455e9 ld a, HS_ROCKET_HIDEOUT_4_ITEM_5 ld [wcc4d], a diff --git a/scripts/rocktunnel1.asm b/scripts/rocktunnel1.asm index 72881e65..d03a5ba1 100755 --- a/scripts/rocktunnel1.asm +++ b/scripts/rocktunnel1.asm @@ -24,63 +24,63 @@ RockTunnel1TextPointers: ; 444f5 (11:44f5) RockTunnel1TrainerHeaders: ; 44505 (11:4505) RockTunnel1TrainerHeader1: ; 44505 (11:4505) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 dw RockTunnel1BattleText1 ; TextBeforeBattle dw RockTunnel1AfterBattleText1 ; TextAfterBattle dw RockTunnel1EndBattleText1 ; TextEndBattle dw RockTunnel1EndBattleText1 ; TextEndBattle RockTunnel1TrainerHeader2: ; 44511 (11:4511) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 dw RockTunnel1BattleText2 ; TextBeforeBattle dw RockTunnel1AfterBattleText2 ; TextAfterBattle dw RockTunnel1EndBattleText2 ; TextEndBattle dw RockTunnel1EndBattleText2 ; TextEndBattle RockTunnel1TrainerHeader3: ; 4451d (11:451d) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 dw RockTunnel1BattleText3 ; TextBeforeBattle dw RockTunnel1AfterBattleText3 ; TextAfterBattle dw RockTunnel1EndBattleText3 ; TextEndBattle dw RockTunnel1EndBattleText3 ; TextEndBattle RockTunnel1TrainerHeader4: ; 44529 (11:4529) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 dw RockTunnel1BattleText4 ; TextBeforeBattle dw RockTunnel1AfterBattleText4 ; TextAfterBattle dw RockTunnel1EndBattleText4 ; TextEndBattle dw RockTunnel1EndBattleText4 ; TextEndBattle RockTunnel1TrainerHeader5: ; 44535 (11:4535) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 dw RockTunnel1BattleText5 ; TextBeforeBattle dw RockTunnel1AfterBattleText5 ; TextAfterBattle dw RockTunnel1EndBattleText5 ; TextEndBattle dw RockTunnel1EndBattleText5 ; TextEndBattle RockTunnel1TrainerHeader6: ; 44541 (11:4541) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 dw RockTunnel1BattleText6 ; TextBeforeBattle dw RockTunnel1AfterBattleText6 ; TextAfterBattle dw RockTunnel1EndBattleText6 ; TextEndBattle dw RockTunnel1EndBattleText6 ; TextEndBattle RockTunnel1TrainerHeader7: ; 4454d (11:454d) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 dw RockTunnel1BattleText7 ; TextBeforeBattle dw RockTunnel1AfterBattleText7 ; TextAfterBattle dw RockTunnel1EndBattleText7 ; TextEndBattle diff --git a/scripts/rocktunnel2.asm b/scripts/rocktunnel2.asm index 832a244f..2082394a 100755 --- a/scripts/rocktunnel2.asm +++ b/scripts/rocktunnel2.asm @@ -24,72 +24,72 @@ RockTunnel2TextPointers: ; 46004 (11:6004) RockTunnel2TrainerHeaders: ; 46014 (11:6014) RockTunnel2TrainerHeader0: ; 46014 (11:6014) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 dw RockTunnel2BattleText2 ; TextBeforeBattle dw RockTunnel2AfterBattleText2 ; TextAfterBattle dw RockTunnel2EndBattleText2 ; TextEndBattle dw RockTunnel2EndBattleText2 ; TextEndBattle RockTunnel2TrainerHeader2: ; 46020 (11:6020) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 dw RockTunnel2BattleText3 ; TextBeforeBattle dw RockTunnel2AfterBattleText3 ; TextAfterBattle dw RockTunnel2EndBattleText3 ; TextEndBattle dw RockTunnel2EndBattleText3 ; TextEndBattle RockTunnel2TrainerHeader3: ; 4602c (11:602c) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 dw RockTunnel2BattleText4 ; TextBeforeBattle dw RockTunnel2AfterBattleText4 ; TextAfterBattle dw RockTunnel2EndBattleText4 ; TextEndBattle dw RockTunnel2EndBattleText4 ; TextEndBattle RockTunnel2TrainerHeader4: ; 46038 (11:6038) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 dw RockTunnel2BattleText5 ; TextBeforeBattle dw RockTunnel2AfterBattleText5 ; TextAfterBattle dw RockTunnel2EndBattleText5 ; TextEndBattle dw RockTunnel2EndBattleText5 ; TextEndBattle RockTunnel2TrainerHeader5: ; 46044 (11:6044) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 dw RockTunnel2BattleText6 ; TextBeforeBattle dw RockTunnel2AfterBattleText6 ; TextAfterBattle dw RockTunnel2EndBattleText6 ; TextEndBattle dw RockTunnel2EndBattleText6 ; TextEndBattle RockTunnel2TrainerHeader6: ; 46050 (11:6050) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 dw RockTunnel2BattleText7 ; TextBeforeBattle dw RockTunnel2AfterBattleText7 ; TextAfterBattle dw RockTunnel2EndBattleText7 ; TextEndBattle dw RockTunnel2EndBattleText7 ; TextEndBattle RockTunnel2TrainerHeader7: ; 4605c (11:605c) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 dw RockTunnel2BattleText8 ; TextBeforeBattle dw RockTunnel2AfterBattleText8 ; TextAfterBattle dw RockTunnel2EndBattleText8 ; TextEndBattle dw RockTunnel2EndBattleText8 ; TextEndBattle RockTunnel2TrainerHeader8: ; 46068 (11:6068) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8, 1 dw RockTunnel2BattleText9 ; TextBeforeBattle dw RockTunnel2AfterBattleText9 ; TextAfterBattle dw RockTunnel2EndBattleText9 ; TextEndBattle diff --git a/scripts/route1.asm b/scripts/route1.asm index 74ac9605..d1e39c06 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -8,9 +8,7 @@ Route1TextPointers: ; 1cab2 (7:4ab2) Route1Text1: ; 1cab8 (7:4ab8) TX_ASM - ld hl, wd7bf - bit 0, [hl] - set 0, [hl] + CheckAndSetEvent EVENT_3C0 jr nz, .asm_1cada ld hl, Route1ViridianMartSampleText call PrintText diff --git a/scripts/route10.asm b/scripts/route10.asm index fbc3b01a..2d5d2ae4 100755 --- a/scripts/route10.asm +++ b/scripts/route10.asm @@ -26,54 +26,54 @@ Route10TextPointers: ; 5934f (16:534f) Route10TrainerHeaders: ; 59363 (16:5363) Route10TrainerHeader0: ; 59363 (16:5363) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_0 dw Route10BattleText1 ; TextBeforeBattle dw Route10AfterBattleText1 ; TextAfterBattle dw Route10EndBattleText1 ; TextEndBattle dw Route10EndBattleText1 ; TextEndBattle Route10TrainerHeader1: ; 5936f (16:536f) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_1 dw Route10BattleText2 ; TextBeforeBattle dw Route10AfterBattleText2 ; TextAfterBattle dw Route10EndBattleText2 ; TextEndBattle dw Route10EndBattleText2 ; TextEndBattle Route10TrainerHeader2: ; 5937b (16:537b) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_2 dw Route10BattleText3 ; TextBeforeBattle dw Route10AfterBattleText3 ; TextAfterBattle dw Route10EndBattleText3 ; TextEndBattle dw Route10EndBattleText3 ; TextEndBattle Route10TrainerHeader3: ; 59387 (16:5387) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_3 dw Route10BattleText4 ; TextBeforeBattle dw Route10AfterBattleText4 ; TextAfterBattle dw Route10EndBattleText4 ; TextEndBattle dw Route10EndBattleText4 ; TextEndBattle Route10TrainerHeader4: ; 59393 (16:5393) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_4 dw Route10BattleText5 ; TextBeforeBattle dw Route10AfterBattleText5 ; TextAfterBattle dw Route10EndBattleText5 ; TextEndBattle dw Route10EndBattleText5 ; TextEndBattle Route10TrainerHeader5: ; 5939f (16:539f) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_5 dw Route10BattleText6 ; TextBeforeBattle dw Route10AfterBattleText6 ; TextAfterBattle dw Route10EndBattleText6 ; TextEndBattle diff --git a/scripts/route11.asm b/scripts/route11.asm index 7a31232b..3a9f1e0d 100755 --- a/scripts/route11.asm +++ b/scripts/route11.asm @@ -27,90 +27,90 @@ Route11TextPointers: ; 59465 (16:5465) Route11TrainerHeaders: ; 5947b (16:547b) Route11TrainerHeader0: ; 5947b (16:547b) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_0 dw Route11BattleText1 ; TextBeforeBattle dw Route11AfterBattleText1 ; TextAfterBattle dw Route11EndBattleText1 ; TextEndBattle dw Route11EndBattleText1 ; TextEndBattle Route11TrainerHeader1: ; 59487 (16:5487) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_1 dw Route11BattleText2 ; TextBeforeBattle dw Route11AfterBattleText2 ; TextAfterBattle dw Route11EndBattleText2 ; TextEndBattle dw Route11EndBattleText2 ; TextEndBattle Route11TrainerHeader2: ; 59493 (16:5493) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_2 dw Route11BattleText3 ; TextBeforeBattle dw Route11AfterBattleText3 ; TextAfterBattle dw Route11EndBattleText3 ; TextEndBattle dw Route11EndBattleText3 ; TextEndBattle Route11TrainerHeader3: ; 5949f (16:549f) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_3 dw Route11BattleText4 ; TextBeforeBattle dw Route11AfterBattleText4 ; TextAfterBattle dw Route11EndBattleText4 ; TextEndBattle dw Route11EndBattleText4 ; TextEndBattle Route11TrainerHeader4: ; 594ab (16:54ab) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_4 dw Route11BattleText5 ; TextBeforeBattle dw Route11AfterBattleText5 ; TextAfterBattle dw Route11EndBattleText5 ; TextEndBattle dw Route11EndBattleText5 ; TextEndBattle Route11TrainerHeader5: ; 594b7 (16:54b7) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_5 dw Route11BattleText6 ; TextBeforeBattle dw Route11AfterBattleText6 ; TextAfterBattle dw Route11EndBattleText6 ; TextEndBattle dw Route11EndBattleText6 ; TextEndBattle Route11TrainerHeader6: ; 594c3 (16:54c3) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_6 dw Route11BattleText7 ; TextBeforeBattle dw Route11AfterBattleText7 ; TextAfterBattle dw Route11EndBattleText7 ; TextEndBattle dw Route11EndBattleText7 ; TextEndBattle Route11TrainerHeader7: ; 594cf (16:54cf) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_7, 1 db ($4 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_7, 1 dw Route11BattleText8 ; TextBeforeBattle dw Route11AfterBattleText8 ; TextAfterBattle dw Route11EndBattleText8 ; TextEndBattle dw Route11EndBattleText8 ; TextEndBattle Route11TrainerHeader8: ; 594db (16:54db) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_8, 1 dw Route11BattleText9 ; TextBeforeBattle dw Route11AfterBattleText9 ; TextAfterBattle dw Route11EndBattleText9 ; TextEndBattle dw Route11EndBattleText9 ; TextEndBattle Route11TrainerHeader9: ; 594e7 (16:54e7) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_9, 1 db ($4 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_9, 1 dw Route11BattleText10 ; TextBeforeBattle dw Route11AfterBattleText10 ; TextAfterBattle dw Route11EndBattleText10 ; TextEndBattle diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index eded4165..7720b176 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -17,8 +17,7 @@ Route11GateUpstairsScriptEnd: ; 49469 (12:5469) Route11GateUpstairsText2: ; 4946c (12:546c) TX_ASM - ld a, [wd7d6] - add a + CheckEvent EVENT_47F, 1 jr c, .asm_4949b ld a, 30 ; pokemon needed ld [$ffdb], a @@ -35,8 +34,7 @@ Route11GateUpstairsText2: ; 4946c (12:546c) ld a, [$ffdb] dec a jr nz, .asm_494a1 - ld hl, wd7d6 - set 7, [hl] + SetEvent EVENT_47F .asm_4949b ld hl, Route11GateUpstairsText_494a3 call PrintText @@ -52,8 +50,7 @@ Route11GateUpstairsText3: ; 494a8 (12:54a8) ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_UP jp nz, GateUpstairsScript_PrintIfFacingUp - ld a, [wd7d8] - bit 7, a ; fought snorlax? + CheckEvent EVENT_BEAT_ROUTE12_SNORLAX ld hl, BinocularsSnorlaxText jr z, .print ld hl, BinocularsNoSnorlaxText diff --git a/scripts/route12.asm b/scripts/route12.asm index 8fe9d8f7..be20958e 100755 --- a/scripts/route12.asm +++ b/scripts/route12.asm @@ -21,11 +21,10 @@ Route12ScriptPointers: ; 59611 (16:5611) dw Route12Script3 Route12Script0: ; 59619 (16:5619) - ld hl, wd7d8 - bit 7, [hl] + CheckEventHL EVENT_BEAT_ROUTE12_SNORLAX jp nz, CheckFightingMapTrainers - bit 6, [hl] - res 6, [hl] + CheckEventReuseHL EVENT_FIGHT_ROUTE12_SNORLAX + ResetEventReuseHL EVENT_FIGHT_ROUTE12_SNORLAX jp z, CheckFightingMapTrainers ld a, $d ld [hSpriteIndexOrTextID], a @@ -54,8 +53,7 @@ Route12Script3: ; 5964c (16:564c) ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_59664 - ld hl, wd7d8 - set 7, [hl] + SetEvent EVENT_BEAT_ROUTE12_SNORLAX call Delay3 ld a, $0 ld [W_ROUTE12CURSCRIPT], a @@ -80,63 +78,63 @@ Route12TextPointers: ; 59675 (16:5675) Route12TrainerHeaders: ; 59691 (16:5691) Route12TrainerHeader0: ; 59691 (16:5691) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_0 dw Route12BattleText1 ; TextBeforeBattle dw Route12AfterBattleText1 ; TextAfterBattle dw Route12EndBattleText1 ; TextEndBattle dw Route12EndBattleText1 ; TextEndBattle Route12TrainerHeader1: ; 5969d (16:569d) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_1 dw Route12BattleText2 ; TextBeforeBattle dw Route12AfterBattleText2 ; TextAfterBattle dw Route12EndBattleText2 ; TextEndBattle dw Route12EndBattleText2 ; TextEndBattle Route12TrainerHeader2: ; 596a9 (16:56a9) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_2 dw Route12BattleText3 ; TextBeforeBattle dw Route12AfterBattleText3 ; TextAfterBattle dw Route12EndBattleText3 ; TextEndBattle dw Route12EndBattleText3 ; TextEndBattle Route12TrainerHeader3: ; 596b5 (16:56b5) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_3 dw Route12BattleText4 ; TextBeforeBattle dw Route12AfterBattleText4 ; TextAfterBattle dw Route12EndBattleText4 ; TextEndBattle dw Route12EndBattleText4 ; TextEndBattle Route12TrainerHeader4: ; 596c1 (16:56c1) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_4 dw Route12BattleText5 ; TextBeforeBattle dw Route12AfterBattleText5 ; TextAfterBattle dw Route12EndBattleText5 ; TextEndBattle dw Route12EndBattleText5 ; TextEndBattle Route12TrainerHeader5: ; 596cd (16:56cd) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_5 dw Route12BattleText6 ; TextBeforeBattle dw Route12AfterBattleText6 ; TextAfterBattle dw Route12EndBattleText6 ; TextEndBattle dw Route12EndBattleText6 ; TextEndBattle Route12TrainerHeader6: ; 596d9 (16:56d9) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_6, 1 db ($1 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_6, 1 dw Route12BattleText7 ; TextBeforeBattle dw Route12AfterBattleText7 ; TextAfterBattle dw Route12EndBattleText7 ; TextEndBattle diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index d4e8e983..e1f8901f 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -8,8 +8,7 @@ Route12GateUpstairsTextPointers: ; 49563 (12:5563) Route12GateUpstairsText1: ; 49569 (12:5569) TX_ASM - ld a, [wd7d7] - rrca + CheckEvent EVENT_480, 1 jr c, .asm_0ad3c ld hl, TM39PreReceiveText call PrintText @@ -18,8 +17,7 @@ Route12GateUpstairsText1: ; 49569 (12:5569) jr nc, .BagFull ld hl, ReceivedTM39Text call PrintText - ld hl, wd7d7 - set 0, [hl] + SetEvent EVENT_480 jr .asm_4ba56 .BagFull ld hl, TM39NoRoomText diff --git a/scripts/route13.asm b/scripts/route13.asm index aed4745c..ab061071 100755 --- a/scripts/route13.asm +++ b/scripts/route13.asm @@ -29,90 +29,90 @@ Route13TextPointers: ; 55837 (15:5837) Route13TrainerHeaders: ; 55851 (15:5851) Route13TrainerHeader0: ; 55851 (15:5851) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_0 dw Route13BattleText2 ; TextBeforeBattle dw Route13AfterBattleText2 ; TextAfterBattle dw Route13EndBattleText2 ; TextEndBattle dw Route13EndBattleText2 ; TextEndBattle Route13TrainerHeader2: ; 5585d (15:585d) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_2 dw Route13BattleText3 ; TextBeforeBattle dw Route13AfterBattleText3 ; TextAfterBattle dw Route13EndBattleText3 ; TextEndBattle dw Route13EndBattleText3 ; TextEndBattle Route13TrainerHeader3: ; 55869 (15:5869) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_3 dw Route13BattleText4 ; TextBeforeBattle dw Route13AfterBattleText4 ; TextAfterBattle dw Route13EndBattleText4 ; TextEndBattle dw Route13EndBattleText4 ; TextEndBattle Route13TrainerHeader4: ; 55875 (15:5875) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_4 dw Route13BattleText5 ; TextBeforeBattle dw Route13AfterBattleText5 ; TextAfterBattle dw Route13EndBattleText5 ; TextEndBattle dw Route13EndBattleText5 ; TextEndBattle Route13TrainerHeader5: ; 55881 (15:5881) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_5 dw Route13BattleText6 ; TextBeforeBattle dw Route13AfterBattleText6 ; TextAfterBattle dw Route13EndBattleText6 ; TextEndBattle dw Route13EndBattleText6 ; TextEndBattle Route13TrainerHeader6: ; 5588d (15:588d) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_6 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_6 dw Route13BattleText7 ; TextBeforeBattle dw Route13AfterBattleText7 ; TextAfterBattle dw Route13EndBattleText7 ; TextEndBattle dw Route13EndBattleText7 ; TextEndBattle Route13TrainerHeader7: ; 55899 (15:5899) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_7 db ($4 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_7 dw Route13BattleText8 ; TextBeforeBattle dw Route13AfterBattleText8 ; TextAfterBattle dw Route13EndBattleText8 ; TextEndBattle dw Route13EndBattleText8 ; TextEndBattle Route13TrainerHeader8: ; 558a5 (15:58a5) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_8, 1 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_8, 1 dw Route13BattleText9 ; TextBeforeBattle dw Route13AfterBattleText9 ; TextAfterBattle dw Route13EndBattleText9 ; TextEndBattle dw Route13EndBattleText9 ; TextEndBattle Route13TrainerHeader9: ; 558b1 (15:58b1) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_9, 1 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_9, 1 dw Route13BattleText10 ; TextBeforeBattle dw Route13AfterBattleText10 ; TextAfterBattle dw Route13EndBattleText10 ; TextEndBattle dw Route13EndBattleText10 ; TextEndBattle Route13TrainerHeader10: ; 558bd (15:58bd) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_10, 1 db ($4 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_10, 1 dw Route13BattleText11 ; TextBeforeBattle dw Route13AfterBattleText11 ; TextAfterBattle dw Route13EndBattleText11 ; TextEndBattle diff --git a/scripts/route14.asm b/scripts/route14.asm index 25a2cd85..d65e257f 100755 --- a/scripts/route14.asm +++ b/scripts/route14.asm @@ -27,90 +27,90 @@ Route14TextPointers: ; 559ec (15:59ec) Route14TrainerHeaders: ; 55a02 (15:5a02) Route14TrainerHeader0: ; 55a02 (15:5a02) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_0 dw Route14BattleText1 ; TextBeforeBattle dw Route14AfterBattleText1 ; TextAfterBattle dw Route14EndBattleText1 ; TextEndBattle dw Route14EndBattleText1 ; TextEndBattle Route14TrainerHeader1: ; 55a0e (15:5a0e) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_1 dw Route14BattleText2 ; TextBeforeBattle dw Route14AfterBattleText2 ; TextAfterBattle dw Route14EndBattleText2 ; TextEndBattle dw Route14EndBattleText2 ; TextEndBattle Route14TrainerHeader2: ; 55a1a (15:5a1a) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_2 dw Route14BattleText3 ; TextBeforeBattle dw Route14AfterBattleText3 ; TextAfterBattle dw Route14EndBattleText3 ; TextEndBattle dw Route14EndBattleText3 ; TextEndBattle Route14TrainerHeader3: ; 55a26 (15:5a26) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_3 dw Route14BattleText4 ; TextBeforeBattle dw Route14AfterBattleText4 ; TextAfterBattle dw Route14EndBattleText4 ; TextEndBattle dw Route14EndBattleText4 ; TextEndBattle Route14TrainerHeader4: ; 55a32 (15:5a32) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_4 dw Route14BattleText5 ; TextBeforeBattle dw Route14AfterBattleText5 ; TextAfterBattle dw Route14EndBattleText5 ; TextEndBattle dw Route14EndBattleText5 ; TextEndBattle Route14TrainerHeader5: ; 55a3e (15:5a3e) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_5 dw Route14BattleText6 ; TextBeforeBattle dw Route14AfterBattleText6 ; TextAfterBattle dw Route14EndBattleText6 ; TextEndBattle dw Route14EndBattleText6 ; TextEndBattle Route14TrainerHeader6: ; 55a4a (15:5a4a) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_6 dw Route14BattleText7 ; TextBeforeBattle dw Route14AfterBattleText7 ; TextAfterBattle dw Route14EndBattleText7 ; TextEndBattle dw Route14EndBattleText7 ; TextEndBattle Route14TrainerHeader7: ; 55a56 (15:5a56) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_7, 1 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_7, 1 dw Route14BattleText8 ; TextBeforeBattle dw Route14AfterBattleText8 ; TextAfterBattle dw Route14EndBattleText8 ; TextEndBattle dw Route14EndBattleText8 ; TextEndBattle Route14TrainerHeader8: ; 55a62 (15:5a62) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_8, 1 dw Route14BattleText9 ; TextBeforeBattle dw Route14AfterBattleText9 ; TextAfterBattle dw Route14EndBattleText9 ; TextEndBattle dw Route14EndBattleText9 ; TextEndBattle Route14TrainerHeader9: ; 55a6e (15:5a6e) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_9, 1 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_9, 1 dw Route14BattleText10 ; TextBeforeBattle dw Route14AfterBattleText10 ; TextAfterBattle dw Route14EndBattleText10 ; TextEndBattle diff --git a/scripts/route15.asm b/scripts/route15.asm index fe70d2b4..023f859c 100755 --- a/scripts/route15.asm +++ b/scripts/route15.asm @@ -28,90 +28,90 @@ Route15TextPointers: ; 597c7 (16:57c7) Route15TrainerHeaders: ; 597df (16:57df) Route15TrainerHeader0: ; 597df (16:57df) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_0 dw Route15BattleText1 ; TextBeforeBattle dw Route15AfterBattleText1 ; TextAfterBattle dw Route15EndBattleText1 ; TextEndBattle dw Route15EndBattleText1 ; TextEndBattle Route15TrainerHeader1: ; 597eb (16:57eb) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_1 dw Route15BattleText2 ; TextBeforeBattle dw Route15AfterBattleText2 ; TextAfterBattle dw Route15EndBattleText2 ; TextEndBattle dw Route15EndBattleText2 ; TextEndBattle Route15TrainerHeader2: ; 597f7 (16:57f7) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_2 dw Route15BattleText3 ; TextBeforeBattle dw Route15AfterBattleText3 ; TextAfterBattle dw Route15EndBattleText3 ; TextEndBattle dw Route15EndBattleText3 ; TextEndBattle Route15TrainerHeader3: ; 59803 (16:5803) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_3 dw Route15BattleText4 ; TextBeforeBattle dw Route15AfterBattleText4 ; TextAfterBattle dw Route15EndBattleText4 ; TextEndBattle dw Route15EndBattleText4 ; TextEndBattle Route15TrainerHeader4: ; 5980f (16:580f) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_4 dw Route15BattleText5 ; TextBeforeBattle dw Route15AfterBattleText5 ; TextAfterBattle dw Route15EndBattleText5 ; TextEndBattle dw Route15EndBattleText5 ; TextEndBattle Route15TrainerHeader5: ; 5981b (16:581b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_5 dw Route15BattleText6 ; TextBeforeBattle dw Route15AfterBattleText6 ; TextAfterBattle dw Route15EndBattleText6 ; TextEndBattle dw Route15EndBattleText6 ; TextEndBattle Route15TrainerHeader6: ; 59827 (16:5827) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_6 dw Route15BattleText7 ; TextBeforeBattle dw Route15AfterBattleText7 ; TextAfterBattle dw Route15EndBattleText7 ; TextEndBattle dw Route15EndBattleText7 ; TextEndBattle Route15TrainerHeader7: ; 59833 (16:5833) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_7, 1 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_7, 1 dw Route15BattleText8 ; TextBeforeBattle dw Route15AfterBattleText8 ; TextAfterBattle dw Route15EndBattleText8 ; TextEndBattle dw Route15EndBattleText8 ; TextEndBattle Route15TrainerHeader8: ; 5983f (16:583f) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_8, 1 dw Route15BattleText9 ; TextBeforeBattle dw Route15AfterBattleText9 ; TextAfterBattle dw Route15EndBattleText9 ; TextEndBattle dw Route15EndBattleText9 ; TextEndBattle Route15TrainerHeader9: ; 5984b (16:584b) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_9, 1 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_9, 1 dw Route15BattleText10 ; TextBeforeBattle dw Route15AfterBattleText10 ; TextAfterBattle dw Route15EndBattleText10 ; TextEndBattle diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index 8969fd74..e3a3cf3b 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -7,8 +7,7 @@ Route15GateUpstairsTextPointers: ; 4964d (12:564d) Route15GateUpstairsText1: ; 49651 (12:5651) TX_ASM - ld a, [wd7dd] - bit 0, a + CheckEvent EVENT_4B0 jr nz, .asm_49683 ld a, 50 ; pokemon needed ld [$ffdb], a @@ -24,8 +23,7 @@ Route15GateUpstairsText1: ; 49651 (12:5651) ld a, [$ffdb] cp $1 jr nz, .asm_49689 - ld hl, wd7dd - set 0, [hl] + SetEvent EVENT_4B0 .asm_49683 ld hl, Route15GateUpstairsText_4968c call PrintText diff --git a/scripts/route16.asm b/scripts/route16.asm index cdf436a5..286b5289 100755 --- a/scripts/route16.asm +++ b/scripts/route16.asm @@ -21,11 +21,10 @@ Route16ScriptPointers: ; 59951 (16:5951) dw Route16Script3 Route16Script0: ; 59959 (16:5959) - ld hl, wd7e0 - bit 1, [hl] + CheckEventHL EVENT_BEAT_ROUTE16_SNORLAX jp nz, CheckFightingMapTrainers - bit 0, [hl] - res 0, [hl] + CheckEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX + ResetEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX jp z, CheckFightingMapTrainers ld a, $a ld [hSpriteIndexOrTextID], a @@ -55,8 +54,7 @@ Route16Script3: ; 5998f (16:598f) ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_599a8 - ld hl, wd7e0 - set 1, [hl] + SetEvent EVENT_BEAT_ROUTE16_SNORLAX call Delay3 ld a, $0 ld [W_ROUTE16CURSCRIPT], a @@ -78,54 +76,54 @@ Route16TextPointers: ; 599b9 (16:59b9) Route16TrainerHeaders: ; 599cf (16:59cf) Route16TrainerHeader0: ; 599cf (16:59cf) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_0 dw Route16BattleText1 ; TextBeforeBattle dw Route16AfterBattleText1 ; TextAfterBattle dw Route16EndBattleText1 ; TextEndBattle dw Route16EndBattleText1 ; TextEndBattle Route16TrainerHeader1: ; 599db (16:59db) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_1 dw Route16BattleText2 ; TextBeforeBattle dw Route16AfterBattleText2 ; TextAfterBattle dw Route16EndBattleText2 ; TextEndBattle dw Route16EndBattleText2 ; TextEndBattle Route16TrainerHeader2: ; 599e7 (16:59e7) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_2 dw Route16BattleText3 ; TextBeforeBattle dw Route16AfterBattleText3 ; TextAfterBattle dw Route16EndBattleText3 ; TextEndBattle dw Route16EndBattleText3 ; TextEndBattle Route16TrainerHeader3: ; 599f3 (16:59f3) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_3 dw Route16BattleText4 ; TextBeforeBattle dw Route16AfterBattleText4 ; TextAfterBattle dw Route16EndBattleText4 ; TextEndBattle dw Route16EndBattleText4 ; TextEndBattle Route16TrainerHeader4: ; 599ff (16:59ff) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_4 dw Route16BattleText5 ; TextBeforeBattle dw Route16AfterBattleText5 ; TextAfterBattle dw Route16EndBattleText5 ; TextEndBattle dw Route16EndBattleText5 ; TextEndBattle Route16TrainerHeader5: ; 59a0b (16:5a0b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_5 dw Route16BattleText6 ; TextBeforeBattle dw Route16AfterBattleText6 ; TextAfterBattle dw Route16EndBattleText6 ; TextEndBattle diff --git a/scripts/route16house.asm b/scripts/route16house.asm index 5035b190..d01465cb 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -7,8 +7,7 @@ Route16HouseTextPointers: ; 1e5fb (7:65fb) Route16HouseText1: ; 1e5ff (7:65ff) TX_ASM - ld a, [wd7e0] - bit 6, a + CheckEvent EVENT_4CE ld hl, HM02ExplanationText jr nz, .asm_13616 ld hl, Route16HouseText3 @@ -16,8 +15,7 @@ Route16HouseText1: ; 1e5ff (7:65ff) ld bc, (HM_02 << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd7e0 - set 6, [hl] + SetEvent EVENT_4CE ld hl, ReceivedHM02Text jr .asm_13616 .BagFull diff --git a/scripts/route17.asm b/scripts/route17.asm index 8de70c3b..28c43627 100755 --- a/scripts/route17.asm +++ b/scripts/route17.asm @@ -32,90 +32,90 @@ Route17TextPointers: ; 55b93 (15:5b93) Route17TrainerHeaders: ; 55bb3 (15:5bb3) Route17TrainerHeader0: ; 55bb3 (15:5bb3) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_0 dw Route17BattleText1 ; TextBeforeBattle dw Route17AfterBattleText1 ; TextAfterBattle dw Route17EndBattleText1 ; TextEndBattle dw Route17EndBattleText1 ; TextEndBattle Route17TrainerHeader1: ; 55bbf (15:5bbf) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_1 dw Route17BattleText2 ; TextBeforeBattle dw Route17AfterBattleText2 ; TextAfterBattle dw Route17EndBattleText2 ; TextEndBattle dw Route17EndBattleText2 ; TextEndBattle Route17TrainerHeader2: ; 55bcb (15:5bcb) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_2 dw Route17BattleText3 ; TextBeforeBattle dw Route17AfterBattleText3 ; TextAfterBattle dw Route17EndBattleText3 ; TextEndBattle dw Route17EndBattleText3 ; TextEndBattle Route17TrainerHeader3: ; 55bd7 (15:5bd7) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_3 dw Route17BattleText4 ; TextBeforeBattle dw Route17AfterBattleText4 ; TextAfterBattle dw Route17EndBattleText4 ; TextEndBattle dw Route17EndBattleText4 ; TextEndBattle Route17TrainerHeader4: ; 55be3 (15:5be3) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_4 dw Route17BattleText5 ; TextBeforeBattle dw Route17AfterBattleText5 ; TextAfterBattle dw Route17EndBattleText5 ; TextEndBattle dw Route17EndBattleText5 ; TextEndBattle Route17TrainerHeader5: ; 55bef (15:5bef) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_5 dw Route17BattleText6 ; TextBeforeBattle dw Route17AfterBattleText6 ; TextAfterBattle dw Route17EndBattleText6 ; TextEndBattle dw Route17EndBattleText6 ; TextEndBattle Route17TrainerHeader6: ; 55bfb (15:5bfb) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_6 dw Route17BattleText7 ; TextBeforeBattle dw Route17AfterBattleText7 ; TextAfterBattle dw Route17EndBattleText7 ; TextEndBattle dw Route17EndBattleText7 ; TextEndBattle Route17TrainerHeader7: ; 55c07 (15:5c07) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_7, 1 db ($2 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_7, 1 dw Route17BattleText8 ; TextBeforeBattle dw Route17AfterBattleText8 ; TextAfterBattle dw Route17EndBattleText8 ; TextEndBattle dw Route17EndBattleText8 ; TextEndBattle Route17TrainerHeader8: ; 55c13 (15:5c13) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_8, 1 dw Route17BattleText9 ; TextBeforeBattle dw Route17AfterBattleText9 ; TextAfterBattle dw Route17EndBattleText9 ; TextEndBattle dw Route17EndBattleText9 ; TextEndBattle Route17TrainerHeader9: ; 55c1f (15:5c1f) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_9, 1 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_9, 1 dw Route17BattleText10 ; TextBeforeBattle dw Route17AfterBattleText10 ; TextAfterBattle dw Route17EndBattleText10 ; TextEndBattle diff --git a/scripts/route18.asm b/scripts/route18.asm index 80242169..9a077faf 100755 --- a/scripts/route18.asm +++ b/scripts/route18.asm @@ -21,27 +21,27 @@ Route18TextPointers: ; 59ae0 (16:5ae0) Route18TrainerHeaders: ; 59aea (16:5aea) Route18TrainerHeader0: ; 59aea (16:5aea) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7e3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_0 dw Route18BattleText1 ; TextBeforeBattle dw Route18AfterBattleText1 ; TextAfterBattle dw Route18EndBattleText1 ; TextEndBattle dw Route18EndBattleText1 ; TextEndBattle Route18TrainerHeader1: ; 59af6 (16:5af6) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7e3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_1 dw Route18BattleText2 ; TextBeforeBattle dw Route18AfterBattleText2 ; TextAfterBattle dw Route18EndBattleText2 ; TextEndBattle dw Route18EndBattleText2 ; TextEndBattle Route18TrainerHeader2: ; 59b02 (16:5b02) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7e3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_2 dw Route18BattleText3 ; TextBeforeBattle dw Route18AfterBattleText3 ; TextAfterBattle dw Route18EndBattleText3 ; TextEndBattle diff --git a/scripts/route19.asm b/scripts/route19.asm index 0265d2a3..4a60e40f 100755 --- a/scripts/route19.asm +++ b/scripts/route19.asm @@ -27,90 +27,90 @@ Route19TextPointers: ; 55d5d (15:5d5d) Route19TrainerHeaders: ; 55d73 (15:5d73) Route19TrainerHeader0: ; 55d73 (15:5d73) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_0 dw Route19BattleText1 ; TextBeforeBattle dw Route19AfterBattleText1 ; TextAfterBattle dw Route19EndBattleText1 ; TextEndBattle dw Route19EndBattleText1 ; TextEndBattle Route19TrainerHeader1: ; 55d7f (15:5d7f) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_1 dw Route19BattleText2 ; TextBeforeBattle dw Route19AfterBattleText2 ; TextAfterBattle dw Route19EndBattleText2 ; TextEndBattle dw Route19EndBattleText2 ; TextEndBattle Route19TrainerHeader2: ; 55d8b (15:5d8b) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_2 dw Route19BattleText3 ; TextBeforeBattle dw Route19AfterBattleText3 ; TextAfterBattle dw Route19EndBattleText3 ; TextEndBattle dw Route19EndBattleText3 ; TextEndBattle Route19TrainerHeader3: ; 55d97 (15:5d97) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_3 dw Route19BattleText4 ; TextBeforeBattle dw Route19AfterBattleText4 ; TextAfterBattle dw Route19EndBattleText4 ; TextEndBattle dw Route19EndBattleText4 ; TextEndBattle Route19TrainerHeader4: ; 55da3 (15:5da3) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_4 dw Route19BattleText5 ; TextBeforeBattle dw Route19AfterBattleText5 ; TextAfterBattle dw Route19EndBattleText5 ; TextEndBattle dw Route19EndBattleText5 ; TextEndBattle Route19TrainerHeader5: ; 55daf (15:5daf) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_5 dw Route19BattleText6 ; TextBeforeBattle dw Route19AfterBattleText6 ; TextAfterBattle dw Route19EndBattleText6 ; TextEndBattle dw Route19EndBattleText6 ; TextEndBattle Route19TrainerHeader6: ; 55dbb (15:5dbb) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_6 dw Route19BattleText7 ; TextBeforeBattle dw Route19AfterBattleText7 ; TextAfterBattle dw Route19EndBattleText7 ; TextEndBattle dw Route19EndBattleText7 ; TextEndBattle Route19TrainerHeader7: ; 55dc7 (15:5dc7) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_7, 1 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_7, 1 dw Route19BattleText8 ; TextBeforeBattle dw Route19AfterBattleText8 ; TextAfterBattle dw Route19EndBattleText8 ; TextEndBattle dw Route19EndBattleText8 ; TextEndBattle Route19TrainerHeader8: ; 55dd3 (15:5dd3) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_8, 1 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_8, 1 dw Route19BattleText9 ; TextBeforeBattle dw Route19AfterBattleText9 ; TextAfterBattle dw Route19EndBattleText9 ; TextEndBattle dw Route19EndBattleText9 ; TextEndBattle Route19TrainerHeader9: ; 55ddf (15:5ddf) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_9, 1 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_9, 1 dw Route19BattleText10 ; TextBeforeBattle dw Route19AfterBattleText10 ; TextAfterBattle dw Route19EndBattleText10 ; TextEndBattle diff --git a/scripts/route20.asm b/scripts/route20.asm index 085a6c18..f4690732 100755 --- a/scripts/route20.asm +++ b/scripts/route20.asm @@ -1,7 +1,5 @@ Route20Script: ; 50ca9 (14:4ca9) - ld hl, wd7e7 - bit 0, [hl] - res 0, [hl] + CheckAndResetEvent EVENT_500 call nz, Route20Script_50cc6 call EnableAutoTextBoxDrawing ld hl, Route20TrainerHeader0 @@ -12,9 +10,7 @@ Route20Script: ; 50ca9 (14:4ca9) ret Route20Script_50cc6: ; 50cc6 (14:4cc6) - ld a, [wd880] - and $3 - cp $3 + CheckBothEventsSet EVENT_9C8, EVENT_9C9 jr z, .asm_50cef ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 call Route20Script_50d0c @@ -40,9 +36,7 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) db $FF .asm_50cef - ld a, [wd881] - and $3 - cp $3 + CheckBothEventsSet EVENT_9D0, EVENT_9D1 ret z ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 call Route20Script_50d0c @@ -83,90 +77,90 @@ Route20TextPointers: ; 50d22 (14:4d22) Route20TrainerHeaders: ; 50d3a (14:4d3a) Route20TrainerHeader0: ; 50d3a (14:4d3a) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_0 dw Route20BattleText1 ; TextBeforeBattle dw Route20AfterBattleText1 ; TextAfterBattle dw Route20EndBattleText1 ; TextEndBattle dw Route20EndBattleText1 ; TextEndBattle Route20TrainerHeader2: ; 50d46 (14:4d46) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_2 dw Route20BattleText2 ; TextBeforeBattle dw Route20AfterBattleText2 ; TextAfterBattle dw Route20EndBattleText2 ; TextEndBattle dw Route20EndBattleText2 ; TextEndBattle Route20TrainerHeader3: ; 50d52 (14:4d52) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_3 dw Route20BattleText3 ; TextBeforeBattle dw Route20AfterBattleText3 ; TextAfterBattle dw Route20EndBattleText3 ; TextEndBattle dw Route20EndBattleText3 ; TextEndBattle Route20TrainerHeader4: ; 50d5e (14:4d5e) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_4 dw Route20BattleText4 ; TextBeforeBattle dw Route20AfterBattleText4 ; TextAfterBattle dw Route20EndBattleText4 ; TextEndBattle dw Route20EndBattleText4 ; TextEndBattle Route20TrainerHeader5: ; 50d6a (14:4d6a) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_5 dw Route20BattleText5 ; TextBeforeBattle dw Route20AfterBattleText5 ; TextAfterBattle dw Route20EndBattleText5 ; TextEndBattle dw Route20EndBattleText5 ; TextEndBattle Route20TrainerHeader6: ; 50d76 (14:4d76) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_6 dw Route20BattleText6 ; TextBeforeBattle dw Route20AfterBattleText6 ; TextAfterBattle dw Route20EndBattleText6 ; TextEndBattle dw Route20EndBattleText6 ; TextEndBattle Route20TrainerHeader7: ; 50d82 (14:4d82) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_7 db ($2 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_7 dw Route20BattleText7 ; TextBeforeBattle dw Route20AfterBattleText7 ; TextAfterBattle dw Route20EndBattleText7 ; TextEndBattle dw Route20EndBattleText7 ; TextEndBattle Route20TrainerHeader8: ; 50d8e (14:4d8e) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_8, 1 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_8, 1 dw Route20BattleText8 ; TextBeforeBattle dw Route20AfterBattleText8 ; TextAfterBattle dw Route20EndBattleText8 ; TextEndBattle dw Route20EndBattleText8 ; TextEndBattle Route20TrainerHeader9: ; 50d9a (14:4d9a) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_9, 1 db ($3 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_9, 1 dw Route20BattleText9 ; TextBeforeBattle dw Route20AfterBattleText9 ; TextAfterBattle dw Route20EndBattleText9 ; TextEndBattle dw Route20EndBattleText9 ; TextEndBattle Route20TrainerHeader10: ; 50da6 (14:4da6) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_10, 1 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_10, 1 dw Route20BattleText10 ; TextBeforeBattle dw Route20AfterBattleText10 ; TextAfterBattle dw Route20EndBattleText10 ; TextEndBattle diff --git a/scripts/route21.asm b/scripts/route21.asm index cbb5ea7b..4c8087fd 100755 --- a/scripts/route21.asm +++ b/scripts/route21.asm @@ -25,81 +25,81 @@ Route21TextPointers: ; 55f04 (15:5f04) Route21TrainerHeaders: ; 55f16 (15:5f16) Route21TrainerHeader0: ; 55f16 (15:5f16) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_0 dw Route21BattleText1 ; TextBeforeBattle dw Route21AfterBattleText1 ; TextAfterBattle dw Route21EndBattleText1 ; TextEndBattle dw Route21EndBattleText1 ; TextEndBattle Route21TrainerHeader1: ; 55f22 (15:5f22) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_1 db ($0 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_1 dw Route21BattleText2 ; TextBeforeBattle dw Route21AfterBattleText2 ; TextAfterBattle dw Route21EndBattleText2 ; TextEndBattle dw Route21EndBattleText2 ; TextEndBattle Route21TrainerHeader2: ; 55f2e (15:5f2e) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_2 dw Route21BattleText3 ; TextBeforeBattle dw Route21AfterBattleText3 ; TextAfterBattle dw Route21EndBattleText3 ; TextEndBattle dw Route21EndBattleText3 ; TextEndBattle Route21TrainerHeader3: ; 55f3a (15:5f3a) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_3 dw Route21BattleText4 ; TextBeforeBattle dw Route21AfterBattleText4 ; TextAfterBattle dw Route21EndBattleText4 ; TextEndBattle dw Route21EndBattleText4 ; TextEndBattle Route21TrainerHeader4: ; 55f46 (15:5f46) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_4 dw Route21BattleText5 ; TextBeforeBattle dw Route21AfterBattleText5 ; TextAfterBattle dw Route21EndBattleText5 ; TextEndBattle dw Route21EndBattleText5 ; TextEndBattle Route21TrainerHeader5: ; 55f52 (15:5f52) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_5 dw Route21BattleText6 ; TextBeforeBattle dw Route21AfterBattleText6 ; TextAfterBattle dw Route21EndBattleText6 ; TextEndBattle dw Route21EndBattleText6 ; TextEndBattle Route21TrainerHeader6: ; 55f5e (15:5f5e) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_6 dw Route21BattleText7 ; TextBeforeBattle dw Route21AfterBattleText7 ; TextAfterBattle dw Route21EndBattleText7 ; TextEndBattle dw Route21EndBattleText7 ; TextEndBattle Route21TrainerHeader7: ; 55f6a (15:5f6a) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_7, 1 db ($0 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_7, 1 dw Route21BattleText8 ; TextBeforeBattle dw Route21AfterBattleText8 ; TextAfterBattle dw Route21EndBattleText8 ; TextEndBattle dw Route21EndBattleText8 ; TextEndBattle Route21TrainerHeader8: ; 55f76 (15:5f76) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_8, 1 db ($0 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_8, 1 dw Route21BattleText9 ; TextBeforeBattle dw Route21AfterBattleText9 ; TextAfterBattle dw Route21EndBattleText9 ; TextEndBattle diff --git a/scripts/route22.asm b/scripts/route22.asm index 01f8bee8..dec8afd6 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -55,8 +55,7 @@ Route22RivalMovementData: ; 50efb (14:4efb) db $FF Route22Script0: ; 50f00 (14:4f00) - ld a, [wd7eb] - bit 7, a + CheckEvent EVENT_527 ret z ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray @@ -69,10 +68,9 @@ Route22Script0: ; 50f00 (14:4f00) ld [wJoyIgnore], a ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a - ld a, [wd7eb] - bit 0, a ; is this the rival battle at the beginning of the game? + CheckEvent EVENT_520 jr nz, .firstRivalBattle - bit 1, a ; is this the rival at the end of the game? + CheckEventReuseA EVENT_521 ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret @@ -165,8 +163,7 @@ Route22Script2: ; 50fb5 (14:4fb5) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7eb - set 5, [hl] + SetEvent EVENT_525 ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -230,9 +227,7 @@ Route22Script3: ; 5102a (14:502a) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ld hl, wd7eb - res 0, [hl] - res 7, [hl] + ResetEvents EVENT_520, EVENT_527 ld a, $0 ld [W_ROUTE22CURSCRIPT], a ret @@ -327,8 +322,7 @@ Route22Script5: ; 510df (14:50df) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7eb - set 6, [hl] + SetEvent EVENT_526 ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -378,9 +372,7 @@ Route22Script6: ; 51151 (14:5151) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ld hl, wd7eb - res 1, [hl] - res 7, [hl] + ResetEvents EVENT_521, EVENT_527 ld a, $7 ld [W_ROUTE22CURSCRIPT], a ret @@ -392,8 +384,7 @@ Route22TextPointers: ; 51175 (14:5175) Route22Text1: ; 5117b (14:517b) TX_ASM - ld a, [wd7eb] - bit 5, a + CheckEvent EVENT_525 jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText @@ -406,8 +397,7 @@ Route22Text1: ; 5117b (14:517b) Route22Text2: ; 51194 (14:5194) TX_ASM - ld a, [wd7eb] - bit 6, a + CheckEvent EVENT_526 jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText diff --git a/scripts/route23.asm b/scripts/route23.asm index cfcf41f5..e17b7d23 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -10,12 +10,8 @@ Route23Script_511e9: ; 511e9 (14:51e9) bit 6, [hl] res 6, [hl] ret z - ld hl, wd7ee - res 0, [hl] - res 7, [hl] - ld hl, wd813 - res 0, [hl] - res 6, [hl] + ResetEvents EVENT_538, EVENT_53F + ResetEvents EVENT_660, EVENT_666 ld a, HS_VICTORY_ROAD_3_BOULDER ld [wcc4d], a predef ShowObject @@ -33,7 +29,7 @@ Route23Script0: ; 51219 (14:5219) ld a, [W_YCOORD] ld b, a ld e, $0 - ld c, $7 + EventFlagBit c, EVENT_536 + 1, EVENT_530 .asm_51224 ld a, [hli] cp $ff @@ -53,7 +49,7 @@ Route23Script0: ; 51219 (14:5219) ld a, c ld [wWhichBadge], a ld b, FLAG_TEST - ld hl, wd7ed + EventFlagAddress hl, EVENT_530 predef FlagActionPredef ld a, c and a @@ -147,43 +143,43 @@ Route23TextPointers: ; 512f7 (14:52f7) Route23Text1: ; 51307 (14:5307) TX_ASM - ld a, $6 + EventFlagBit a, EVENT_536, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text2: ; 51310 (14:5310) TX_ASM - ld a, $5 + EventFlagBit a, EVENT_535, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text3: ; 51319 (14:5319) TX_ASM - ld a, $4 + EventFlagBit a, EVENT_534, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text4: ; 51322 (14:5322) TX_ASM - ld a, $3 + EventFlagBit a, EVENT_533, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text5: ; 5132b (14:532b) TX_ASM - ld a, $2 + EventFlagBit a, EVENT_532, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text6: ; 51334 (14:5334) TX_ASM - ld a, $1 + EventFlagBit a, EVENT_531, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text7: ; 5133d (14:533d) TX_ASM - ld a, $0 + EventFlagBit a, EVENT_530 call Route23Script_51346 jp TextScriptEnd @@ -211,7 +207,7 @@ Route23Script_51346: ; 51346 (14:5346) ld a, [wWhichBadge] ld c, a ld b, FLAG_SET - ld hl, wd7ed + EventFlagAddress hl, EVENT_530 predef FlagActionPredef ld a, $2 ld [W_ROUTE23CURSCRIPT], a diff --git a/scripts/route24.asm b/scripts/route24.asm index f6822a35..c946159c 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -22,8 +22,7 @@ Route24ScriptPointers: ; 513cb (14:53cb) dw Route24Script4 Route24Script0: ; 513d5 (14:53d5) - ld a, [wd7ef] - bit 0, a + CheckEvent EVENT_540 jp nz, CheckFightingMapTrainers ld hl, CoordsData_5140e call ArePlayerCoordsInArray @@ -33,9 +32,7 @@ Route24Script0: ; 513d5 (14:53d5) ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd7f0 - bit 1, [hl] - res 1, [hl] + CheckAndResetEvent EVENT_549 ret z ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a @@ -67,8 +64,7 @@ Route24Script3: ; 51422 (14:5422) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7ef - set 1, [hl] + SetEvent EVENT_541 ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -91,54 +87,54 @@ Route24TextPointers: ; 5144b (14:544b) Route24TrainerHeaders: ; 5145b (14:545b) Route24TrainerHeader0: ; 5145b (14:545b) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_0 dw Route24BattleText1 ; TextBeforeBattle dw Route24AfterBattleText1 ; TextAfterBattle dw Route24EndBattleText1 ; TextEndBattle dw Route24EndBattleText1 ; TextEndBattle Route24TrainerHeader2: ; 51467 (14:5467) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_2 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_2 dw Route24BattleText2 ; TextBeforeBattle dw Route24AfterBattleText2 ; TextAfterBattle dw Route24EndBattleText2 ; TextEndBattle dw Route24EndBattleText2 ; TextEndBattle Route24TrainerHeader3: ; 51473 (14:5473) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_3 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_3 dw Route24BattleText3 ; TextBeforeBattle dw Route24AfterBattleText3 ; TextAfterBattle dw Route24EndBattleText3 ; TextEndBattle dw Route24EndBattleText3 ; TextEndBattle Route24TrainerHeader4: ; 5147f (14:547f) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_4 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_4 dw Route24BattleText4 ; TextBeforeBattle dw Route24AfterBattleText4 ; TextAfterBattle dw Route24EndBattleText4 ; TextEndBattle dw Route24EndBattleText4 ; TextEndBattle Route24TrainerHeader5: ; 5148b (14:548b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_5 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_5 dw Route24BattleText5 ; TextBeforeBattle dw Route24AfterBattleText5 ; TextAfterBattle dw Route24EndBattleText5 ; TextEndBattle dw Route24EndBattleText5 ; TextEndBattle Route24TrainerHeader6: ; 51497 (14:5497) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_6 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_6 dw Route24BattleText6 ; TextBeforeBattle dw Route24AfterBattleText6 ; TextAfterBattle dw Route24EndBattleText6 ; TextEndBattle @@ -148,18 +144,15 @@ Route24TrainerHeader6: ; 51497 (14:5497) Route24Text1: ; 514a4 (14:54a4) TX_ASM - ld hl, wd7f0 - res 1, [hl] - ld a, [wd7ef] - bit 0, a + ResetEvent EVENT_549 + CheckEvent EVENT_540 jr nz, .asm_514f9 ld hl, Route24Text_51510 call PrintText ld bc, (NUGGET << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd7ef - set 0, [hl] + SetEvent EVENT_540 ld hl, Route24Text_5151a call PrintText ld hl, Route24Text_51526 @@ -187,8 +180,7 @@ Route24Text1: ; 514a4 (14:54a4) .BagFull ld hl, Route24Text_51521 call PrintText - ld hl, wd7f0 - set 1, [hl] + SetEvent EVENT_549 jp TextScriptEnd Route24Text_51510: ; 51510 (14:5510) diff --git a/scripts/route25.asm b/scripts/route25.asm index 5f544365..6bbb5e26 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -13,19 +13,18 @@ Route25Script_515e1: ; 515e1 (14:55e1) bit 6, [hl] res 6, [hl] ret z - ld hl, wd7f2 - bit 7, [hl] + CheckEventHL EVENT_55F ret nz - bit 5, [hl] + CheckEventReuseHL EVENT_55D jr nz, .asm_515ff - res 6, [hl] + ResetEventReuseHL EVENT_55E ld a, HS_BILL_POKEMON ld [wcc4d], a predef_jump ShowObject .asm_515ff - bit 4, [hl] + CheckEventAfterBranchReuseHL EVENT_55C, EVENT_55D ret z - set 7, [hl] + SetEventReuseHL EVENT_55F ld a, HS_NUGGET_BRIDGE_GUY ld [wcc4d], a predef HideObject @@ -56,81 +55,81 @@ Route25TextPointers: ; 51628 (14:5628) Route25TrainerHeaders: ; 5163e (14:563e) Route25TrainerHeader0: ; 5163e (14:563e) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_0 dw Route25BattleText1 ; TextBeforeBattle dw Route25AfterBattleText1 ; TextAfterBattle dw Route25EndBattleText1 ; TextEndBattle dw Route25EndBattleText1 ; TextEndBattle Route25TrainerHeader2: ; 5164a (14:564a) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_2 dw Route25BattleText2 ; TextBeforeBattle dw Route25AfterBattleText2 ; TextAfterBattle dw Route25EndBattleText2 ; TextEndBattle dw Route25EndBattleText2 ; TextEndBattle Route25TrainerHeader3: ; 51656 (14:5656) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_3 dw Route25BattleText3 ; TextBeforeBattle dw Route25AfterBattleText3 ; TextAfterBattle dw Route25EndBattleText3 ; TextEndBattle dw Route25EndBattleText3 ; TextEndBattle Route25TrainerHeader4: ; 51662 (14:5662) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_4 dw Route25BattleText4 ; TextBeforeBattle dw Route25AfterBattleText4 ; TextAfterBattle dw Route25EndBattleText4 ; TextEndBattle dw Route25EndBattleText4 ; TextEndBattle Route25TrainerHeader5: ; 5166e (14:566e) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_5 dw Route25BattleText5 ; TextBeforeBattle dw Route25AfterBattleText5 ; TextAfterBattle dw Route25EndBattleText5 ; TextEndBattle dw Route25EndBattleText5 ; TextEndBattle Route25TrainerHeader6: ; 5167a (14:567a) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_6 dw Route25BattleText6 ; TextBeforeBattle dw Route25AfterBattleText6 ; TextAfterBattle dw Route25EndBattleText6 ; TextEndBattle dw Route25EndBattleText6 ; TextEndBattle Route25TrainerHeader7: ; 51686 (14:5686) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_7 db ($3 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_7 dw Route25BattleText7 ; TextBeforeBattle dw Route25AfterBattleText7 ; TextAfterBattle dw Route25EndBattleText7 ; TextEndBattle dw Route25EndBattleText7 ; TextEndBattle Route25TrainerHeader8: ; 51692 (14:5692) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_8, 1 db ($2 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_8, 1 dw Route25BattleText8 ; TextBeforeBattle dw Route25AfterBattleText8 ; TextAfterBattle dw Route25EndBattleText8 ; TextEndBattle dw Route25EndBattleText8 ; TextEndBattle Route25TrainerHeader9: ; 5169e (14:569e) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_9, 1 db ($2 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_9, 1 dw Route25BattleText9 ; TextBeforeBattle dw Route25AfterBattleText9 ; TextAfterBattle dw Route25EndBattleText9 ; TextEndBattle diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index e8d02321..49c28e02 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -7,8 +7,7 @@ Route2GateTextPointers: ; 5d5d7 (17:55d7) Route2GateText1: ; 5d5db (17:55db) TX_ASM - ld a, [wd7c2] - bit 0, a + CheckEvent EVENT_3D8 jr nz, .asm_5d60d ld a, 10 ; pokemon needed ld [$ffdb], a @@ -24,8 +23,7 @@ Route2GateText1: ; 5d5db (17:55db) ld a, [$ffdb] cp $1 jr nz, .asm_5d613 - ld hl, wd7c2 - set 0, [hl] + SetEvent EVENT_3D8 .asm_5d60d ld hl, Route2GateText_5d616 call PrintText diff --git a/scripts/route3.asm b/scripts/route3.asm index c39a5435..50c4e00d 100755 --- a/scripts/route3.asm +++ b/scripts/route3.asm @@ -26,72 +26,72 @@ Route3TextPointers: ; 55511 (15:5511) Route3TrainerHeaders: ; 55525 (15:5525) Route3TrainerHeader0: ; 55525 (15:5525) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_0 dw Route3BattleText1 ; TextBeforeBattle dw Route3AfterBattleText1 ; TextAfterBattle dw Route3EndBattleText1 ; TextEndBattle dw Route3EndBattleText1 ; TextEndBattle Route3TrainerHeader2: ; 55531 (15:5531) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_2 dw Route3BattleText2 ; TextBeforeBattle dw Route3AfterBattleText2 ; TextAfterBattle dw Route3EndBattleText2 ; TextEndBattle dw Route3EndBattleText2 ; TextEndBattle Route3TrainerHeader3: ; 5553d (15:553d) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_3 dw Route3BattleText3 ; TextBeforeBattle dw Route3AfterBattleText3 ; TextAfterBattle dw Route3EndBattleText3 ; TextEndBattle dw Route3EndBattleText3 ; TextEndBattle Route3TrainerHeader4: ; 55549 (15:5549) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_4 db ($1 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_4 dw Route3BattleText4 ; TextBeforeBattle dw Route3AfterBattleText4 ; TextAfterBattle dw Route3EndBattleText4 ; TextEndBattle dw Route3EndBattleText4 ; TextEndBattle Route3TrainerHeader5: ; 55555 (15:5555) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_5 dw Route3BattleText5 ; TextBeforeBattle dw Route3AfterBattleText5 ; TextAfterBattle dw Route3EndBattleText5 ; TextEndBattle dw Route3EndBattleText5 ; TextEndBattle Route3TrainerHeader6: ; 55561 (15:5561) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_6 dw Route3BattleText6 ; TextBeforeBattle dw Route3AfterBattleText6 ; TextAfterBattle dw Route3EndBattleText6 ; TextEndBattle dw Route3EndBattleText6 ; TextEndBattle Route3TrainerHeader7: ; 5556d (15:556d) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_7, 1 db ($3 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_7, 1 dw Route3BattleText7 ; TextBeforeBattle dw Route3AfterBattleText7 ; TextAfterBattle dw Route3EndBattleText7 ; TextEndBattle dw Route3EndBattleText7 ; TextEndBattle Route3TrainerHeader8: ; 55579 (15:5579) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_8, 1 db ($2 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_8, 1 dw Route3BattleText8 ; TextBeforeBattle dw Route3AfterBattleText8 ; TextAfterBattle dw Route3EndBattleText8 ; TextEndBattle diff --git a/scripts/route4.asm b/scripts/route4.asm index 10d3882d..f5bdd9e8 100755 --- a/scripts/route4.asm +++ b/scripts/route4.asm @@ -22,9 +22,9 @@ Route4TextPointers: ; 55671 (15:5671) Route4TrainerHeaders: ; 5567d (15:567d) Route4TrainerHeader0: ; 5567d (15:567d) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_4_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7c5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_4_TRAINER_0 dw Route4BattleText1 ; TextBeforeBattle dw Route4AfterBattleText1 ; TextAfterBattle dw Route4EndBattleText1 ; TextEndBattle diff --git a/scripts/route6.asm b/scripts/route6.asm index 51116390..e748fed1 100755 --- a/scripts/route6.asm +++ b/scripts/route6.asm @@ -23,54 +23,54 @@ Route6TextPointers: ; 590c9 (16:50c9) Route6TrainerHeaders: ; 590d7 (16:50d7) Route6TrainerHeader0: ; 590d7 (16:50d7) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_0 dw Route6BattleText1 ; TextBeforeBattle dw Route6AfterBattleText1 ; TextAfterBattle dw Route6EndBattleText1 ; TextEndBattle dw Route6EndBattleText1 ; TextEndBattle Route6TrainerHeader1: ; 590e3 (16:50e3) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_1 db ($0 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_1 dw Route6BattleText2 ; TextBeforeBattle dw Route6AfterBattleText1 ; TextAfterBattle dw Route6EndBattleText2 ; TextEndBattle dw Route6EndBattleText2 ; TextEndBattle Route6TrainerHeader2: ; 590ef (16:50ef) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_2 dw Route6BattleText3 ; TextBeforeBattle dw Route6AfterBattleText3 ; TextAfterBattle dw Route6EndBattleText3 ; TextEndBattle dw Route6EndBattleText3 ; TextEndBattle Route6TrainerHeader3: ; 590fb (16:50fb) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_3 dw Route6BattleText4 ; TextBeforeBattle dw Route6AfterBattleText4 ; TextAfterBattle dw Route6EndBattleText4 ; TextEndBattle dw Route6EndBattleText4 ; TextEndBattle Route6TrainerHeader4: ; 59107 (16:5107) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_4 dw Route6BattleText5 ; TextBeforeBattle dw Route6AfterBattleText5 ; TextAfterBattle dw Route6EndBattleText5 ; TextEndBattle dw Route6EndBattleText5 ; TextEndBattle Route6TrainerHeader5: ; 59113 (16:5113) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_5 dw Route6BattleText6 ; TextBeforeBattle dw Route6AfterBattleText6 ; TextAfterBattle dw Route6EndBattleText6 ; TextEndBattle diff --git a/scripts/route8.asm b/scripts/route8.asm index 8d589c90..c734c62d 100755 --- a/scripts/route8.asm +++ b/scripts/route8.asm @@ -26,81 +26,81 @@ Route8TextPointers: ; 591cf (16:51cf) Route8TrainerHeaders: ; 591e3 (16:51e3) Route8TrainerHeader0: ; 591e3 (16:51e3) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_0 dw Route8BattleText1 ; TextBeforeBattle dw Route8AfterBattleText1 ; TextAfterBattle dw Route8EndBattleText1 ; TextEndBattle dw Route8EndBattleText1 ; TextEndBattle Route8TrainerHeader1: ; 591ef (16:51ef) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_1 dw Route8BattleText2 ; TextBeforeBattle dw Route8AfterBattleText2 ; TextAfterBattle dw Route8EndBattleText2 ; TextEndBattle dw Route8EndBattleText2 ; TextEndBattle Route8TrainerHeader2: ; 591fb (16:51fb) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_2 dw Route8BattleText3 ; TextBeforeBattle dw Route8AfterBattleText3 ; TextAfterBattle dw Route8EndBattleText3 ; TextEndBattle dw Route8EndBattleText3 ; TextEndBattle Route8TrainerHeader3: ; 59207 (16:5207) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_3 dw Route8BattleText4 ; TextBeforeBattle dw Route8AfterBattleText4 ; TextAfterBattle dw Route8EndBattleText4 ; TextEndBattle dw Route8EndBattleText4 ; TextEndBattle Route8TrainerHeader4: ; 59213 (16:5213) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_4 dw Route8BattleText5 ; TextBeforeBattle dw Route8AfterBattleText5 ; TextAfterBattle dw Route8EndBattleText5 ; TextEndBattle dw Route8EndBattleText5 ; TextEndBattle Route8TrainerHeader5: ; 5921f (16:521f) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_5 dw Route8BattleText6 ; TextBeforeBattle dw Route8AfterBattleText6 ; TextAfterBattle dw Route8EndBattleText6 ; TextEndBattle dw Route8EndBattleText6 ; TextEndBattle Route8TrainerHeader6: ; 5922b (16:522b) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_6 db ($2 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_6 dw Route8BattleText7 ; TextBeforeBattle dw Route8AfterBattleText7 ; TextAfterBattle dw Route8EndBattleText7 ; TextEndBattle dw Route8EndBattleText7 ; TextEndBattle Route8TrainerHeader7: ; 59237 (16:5237) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_7, 1 db ($2 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_7, 1 dw Route8BattleText8 ; TextBeforeBattle dw Route8AfterBattleText8 ; TextAfterBattle dw Route8EndBattleText8 ; TextEndBattle dw Route8EndBattleText8 ; TextEndBattle Route8TrainerHeader8: ; 59243 (16:5243) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_8, 1 db ($4 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_8, 1 dw Route8BattleText9 ; TextBeforeBattle dw Route8AfterBattleText9 ; TextAfterBattle dw Route8EndBattleText9 ; TextEndBattle diff --git a/scripts/route9.asm b/scripts/route9.asm index d6050970..9d26ee96 100755 --- a/scripts/route9.asm +++ b/scripts/route9.asm @@ -27,81 +27,81 @@ Route9TextPointers: ; 556d5 (15:56d5) Route9TrainerHeaders: ; 556eb (15:56eb) Route9TrainerHeader0: ; 556eb (15:56eb) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_0 dw Route9BattleText1 ; TextBeforeBattle dw Route9AfterBattleText1 ; TextAfterBattle dw Route9EndBattleText1 ; TextEndBattle dw Route9EndBattleText1 ; TextEndBattle Route9TrainerHeader2: ; 556f7 (15:56f7) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_2 dw Route9BattleText2 ; TextBeforeBattle dw Route9AfterBattleText2 ; TextAfterBattle dw Route9EndBattleText2 ; TextEndBattle dw Route9EndBattleText2 ; TextEndBattle Route9TrainerHeader3: ; 55703 (15:5703) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_3 dw Route9BattleText3 ; TextBeforeBattle dw Route9AfterBattleText3 ; TextAfterBattle dw Route9EndBattleText3 ; TextEndBattle dw Route9EndBattleText3 ; TextEndBattle Route9TrainerHeader4: ; 5570f (15:570f) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_4 dw Route9BattleText4 ; TextBeforeBattle dw Route9AfterBattleText4 ; TextAfterBattle dw Route9EndBattleText4 ; TextEndBattle dw Route9EndBattleText4 ; TextEndBattle Route9TrainerHeader5: ; 5571b (15:571b) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_5 dw Route9BattleText5 ; TextBeforeBattle dw Route9AfterBattleText5 ; TextAfterBattle dw Route9EndBattleText5 ; TextEndBattle dw Route9EndBattleText5 ; TextEndBattle Route9TrainerHeader6: ; 55727 (15:5727) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_6 dw Route9BattleText6 ; TextBeforeBattle dw Route9AfterBattleText6 ; TextAfterBattle dw Route9EndBattleText6 ; TextEndBattle dw Route9EndBattleText6 ; TextEndBattle Route9TrainerHeader7: ; 55733 (15:5733) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_7 db ($4 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_7 dw Route9BattleText7 ; TextBeforeBattle dw Route9AfterBattleText7 ; TextAfterBattle dw Route9EndBattleText7 ; TextEndBattle dw Route9EndBattleText7 ; TextEndBattle Route9TrainerHeader8: ; 5573f (15:573f) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_8, 1 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_8, 1 dw Route9BattleText8 ; TextBeforeBattle dw Route9AfterBattleText8 ; TextAfterBattle dw Route9EndBattleText8 ; TextEndBattle dw Route9EndBattleText8 ; TextEndBattle Route9TrainerHeader9: ; 5574b (15:574b) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_9, 1 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_9, 1 dw Route9BattleText9 ; TextBeforeBattle dw Route9AfterBattleText9 ; TextAfterBattle dw Route9EndBattleText9 ; TextEndBattle diff --git a/scripts/safarizoneentrance-yellow.asm b/scripts/safarizoneentrance-yellow.asm index 74ecaa54..6ff0e298 100644 --- a/scripts/safarizoneentrance-yellow.asm +++ b/scripts/safarizoneentrance-yellow.asm @@ -64,9 +64,8 @@ ld a,D_UP ld c,3 call SafariZoneEntranceAutoWalk - ld hl,wd790 - set 7,[hl] - res 6,[hl] + SetEvent EVENT_IN_SAFARI_ZONE + ResetEventReuseHL EVENT_SAFARI_GAME_OVER ld a,3 ld [W_SAFARIZONEENTRANCECURSCRIPT],a jr .done diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index ab54dd8a..6ed62fd1 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -74,11 +74,9 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) .SafariZoneEntranceScript5 ld a, PLAYER_DIR_DOWN ld [wPlayerMovingDirection], a - ld hl, wd790 - bit 6, [hl] - res 6, [hl] + CheckAndResetEvent EVENT_SAFARI_GAME_OVER jr z, .asm_7527f - res 7, [hl] + ResetEventReuseHL EVENT_IN_SAFARI_ZONE call UpdateSprites ld a, $f0 ld [wJoyIgnore], a @@ -191,9 +189,8 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) ld a,D_UP ld c,3 call SafariZoneEntranceAutoWalk - ld hl,wd790 - set 7,[hl] - res 6,[hl] + SetEvent EVENT_IN_SAFARI_ZONE + ResetEventReuseHL EVENT_SAFARI_GAME_OVER ld a,3 ld [W_SAFARIZONEENTRANCECURSCRIPT],a jr .done @@ -238,9 +235,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) ld a, D_DOWN ld c, $3 call SafariZoneEntranceAutoWalk - ld hl, wd790 - res 6, [hl] - res 7, [hl] + ResetEvents EVENT_SAFARI_GAME_OVER, EVENT_IN_SAFARI_ZONE ld a, $0 ld [wcf0d], a jr .asm_753b3 diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index b1dd95d3..48992d94 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -6,8 +6,7 @@ SafariZoneSecretHouseTextPointers: ; 4a31a (12:631a) SafariZoneSecretHouseText1: ; 4a31c (12:631c) TX_ASM - ld a, [wd857] - bit 0, a + CheckEvent EVENT_880 jr nz, .asm_20a9b ld hl, SafariZoneSecretHouseText_4a350 call PrintText @@ -16,8 +15,7 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) jr nc, .BagFull ld hl, ReceivedHM03Text call PrintText - ld hl, wd857 - set 0, [hl] + SetEvent EVENT_880 jr .asm_8f1fc .BagFull ld hl, HM03NoRoomText diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index 349eda5e..4e2115c3 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -46,16 +46,14 @@ SaffronGymText_5d068: ; 5d068 (17:5068) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd7b3 - set 1, [hl] + SetEvent EVENT_361 ld bc, (TM_46 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $b ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd7b3 - set 0, [hl] + SetEvent EVENT_360 jr .asm_5d091 .BagFull ld a, $c @@ -68,11 +66,7 @@ SaffronGymText_5d068: ; 5d068 (17:5068) set 5, [hl] ; deactivate gym trainers - ld a, [wd7b3] - or %11111100 - ld [wd7b3], a - ld hl, wd7b4 - set 0, [hl] + SetEventRange EVENT_BEAT_SAFFRON_GYM_TRAINER_0, EVENT_BEAT_SAFFRON_GYM_TRAINER_6 jp SaffronGymText_5d048 @@ -92,63 +86,63 @@ SaffronGymTextPointers: ; 5d0ab (17:50ab) SaffronGymTrainerHeaders: ; 5d0c3 (17:50c3) SaffronGymTrainerHeader0: ; 5d0c3 (17:50c3) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_0 dw SaffronGymBattleText1 ; TextBeforeBattle dw SaffronGymAfterBattleText1 ; TextAfterBattle dw SaffronGymEndBattleText1 ; TextEndBattle dw SaffronGymEndBattleText1 ; TextEndBattle SaffronGymTrainerHeader1: ; 5d0cf (17:50cf) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_1 dw SaffronGymBattleText2 ; TextBeforeBattle dw SaffronGymAfterBattleText2 ; TextAfterBattle dw SaffronGymEndBattleText2 ; TextEndBattle dw SaffronGymEndBattleText2 ; TextEndBattle SaffronGymTrainerHeader2: ; 5d0db (17:50db) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_2 dw SaffronGymBattleText3 ; TextBeforeBattle dw SaffronGymAfterBattleText3 ; TextAfterBattle dw SaffronGymEndBattleText3 ; TextEndBattle dw SaffronGymEndBattleText3 ; TextEndBattle SaffronGymTrainerHeader3: ; 5d0e7 (17:50e7) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_3 dw SaffronGymBattleText4 ; TextBeforeBattle dw SaffronGymAfterBattleText4 ; TextAfterBattle dw SaffronGymEndBattleText4 ; TextEndBattle dw SaffronGymEndBattleText4 ; TextEndBattle SaffronGymTrainerHeader4: ; 5d0f3 (17:50f3) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_4 dw SaffronGymBattleText5 ; TextBeforeBattle dw SaffronGymAfterBattleText5 ; TextAfterBattle dw SaffronGymEndBattleText5 ; TextEndBattle dw SaffronGymEndBattleText5 ; TextEndBattle SaffronGymTrainerHeader5: ; 5d0ff (17:50ff) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_5 dw SaffronGymBattleText6 ; TextBeforeBattle dw SaffronGymAfterBattleText6 ; TextAfterBattle dw SaffronGymEndBattleText6 ; TextEndBattle dw SaffronGymEndBattleText6 ; TextEndBattle SaffronGymTrainerHeader6: ; 5d10b (17:510b) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1 dw SaffronGymBattleText7 ; TextBeforeBattle dw SaffronGymAfterBattleText7 ; TextAfterBattle dw SaffronGymEndBattleText7 ; TextEndBattle @@ -158,10 +152,9 @@ SaffronGymTrainerHeader6: ; 5d10b (17:510b) SaffronGymText1: ; 5d118 (17:5118) TX_ASM - ld a, [wd7b3] - bit 1, a + CheckEvent EVENT_361 jr z, .asm_5d134 - bit 0, a + CheckEventReuseA EVENT_360 jr nz, .asm_5d12c call z, SaffronGymText_5d068 call DisableWaitingAfterTextDisplay @@ -262,8 +255,7 @@ SaffronGymText8: ; 5d1c3 (17:51c3) SaffronGymText9: ; 5d1cd (17:51cd) TX_ASM - ld a, [wd7b3] - bit 1, a + CheckEvent EVENT_361 jr nz, .asm_5d1dd ld hl, SaffronGymText_5d1e6 call PrintText diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index b7d8ed26..68300183 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -6,8 +6,7 @@ SaffronHouse2TextPointers: ; 1de3f (7:5e3f) SaffronHouse2Text1: ; 1de41 (7:5e41) TX_ASM - ld a, [wd7bd] - bit 0, a + CheckEvent EVENT_3B0 jr nz, .asm_9e72b ld hl, TM29PreReceiveText call PrintText @@ -16,8 +15,7 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) jr nc, .BagFull ld hl, ReceivedTM29Text call PrintText - ld hl, wd7bd - set 0, [hl] + SetEvent EVENT_3B0 jr .asm_fe4e1 .BagFull ld hl, TM29NoRoomText diff --git a/scripts/seafoamislands1.asm b/scripts/seafoamislands1.asm index f71fc648..89972aca 100755 --- a/scripts/seafoamislands1.asm +++ b/scripts/seafoamislands1.asm @@ -1,7 +1,6 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) call EnableAutoTextBoxDrawing - ld hl, wd7e7 - set 0, [hl] + SetEvent EVENT_500 ld hl, wFlags_0xcd60 bit 7, [hl] res 7, [hl] @@ -9,18 +8,18 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) ld hl, Seafoam1HolesCoords call CheckBoulderCoords ret nc - ld hl, wd7e8 + EventFlagAddress hl, EVENT_50E ld a, [wCoordIndex] cp $1 jr nz, .asm_44819 - set 6, [hl] + SetEventReuseHL EVENT_50E ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd07a], a jr .asm_44825 .asm_44819 - set 7, [hl] + SetEventAfterBranchReuseHL EVENT_50F, EVENT_50E ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 diff --git a/scripts/seafoamislands2.asm b/scripts/seafoamislands2.asm index a62d6bda..c24ba601 100755 --- a/scripts/seafoamislands2.asm +++ b/scripts/seafoamislands2.asm @@ -7,18 +7,18 @@ SeafoamIslands2Script: ; 46315 (11:6315) ld hl, Seafoam2HolesCoords call CheckBoulderCoords ret nc - ld hl, wd87f + EventFlagAddress hl, EVENT_9C0 ld a, [wCoordIndex] cp $1 jr nz, .asm_46340 - set 0, [hl] + SetEventReuseHL EVENT_9C0 ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd07a], a jr .asm_4634c .asm_46340 - set 1, [hl] + SetEventAfterBranchReuseHL EVENT_9C1, EVENT_9C0 ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 diff --git a/scripts/seafoamislands3.asm b/scripts/seafoamislands3.asm index 0b650135..f117c2a7 100755 --- a/scripts/seafoamislands3.asm +++ b/scripts/seafoamislands3.asm @@ -7,18 +7,18 @@ SeafoamIslands3Script: ; 46451 (11:6451) ld hl, Seafoam3HolesCoords call CheckBoulderCoords ret nc - ld hl, wd880 + EventFlagAddress hl, EVENT_9C8 ld a, [wCoordIndex] cp $1 jr nz, .asm_4647c - set 0, [hl] + SetEventReuseHL EVENT_9C8 ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_3 ld [wd07a], a jr .asm_46488 .asm_4647c - set 1, [hl] + SetEventAfterBranchReuseHL EVENT_9C9, EVENT_9C8 ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_4 diff --git a/scripts/seafoamislands4.asm b/scripts/seafoamislands4.asm index f16ab2c6..031f9d13 100755 --- a/scripts/seafoamislands4.asm +++ b/scripts/seafoamislands4.asm @@ -7,18 +7,18 @@ SeafoamIslands4Script: ; 4658d (11:658d) ld hl, Seafoam4HolesCoords call CheckBoulderCoords ret nc - ld hl, wd881 + EventFlagAddress hl, EVENT_9D0 ld a, [wCoordIndex] cp $1 jr nz, .asm_465b8 - set 0, [hl] + SetEventReuseHL EVENT_9D0 ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_1 ld [wd07a], a jr .asm_465c4 .asm_465b8 - set 1, [hl] + SetEventAfterBranchReuseHL EVENT_9D1, EVENT_9D0 ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_2 @@ -56,9 +56,7 @@ SeafoamIslands4ScriptPointers: ; 465fb (11:65fb) dw SeafoamIslands4Script3 SeafoamIslands4Script0: ; 46603 (11:6603) - ld a, [wd880] - and $3 - cp $3 + CheckBothEventsSet EVENT_9C8, EVENT_9C9 ret z ld a, [W_YCOORD] cp $8 @@ -93,9 +91,7 @@ SeafoamIslands4Script1: ; 46639 (11:6639) ret SeafoamIslands4Script2: ; 46644 (11:6644) - ld a, [wd880] - and $3 - cp $3 + CheckBothEventsSet EVENT_9C8, EVENT_9C9 ret z ld a, [W_XCOORD] cp $12 diff --git a/scripts/seafoamislands5.asm b/scripts/seafoamislands5.asm index ab303728..9324a187 100755 --- a/scripts/seafoamislands5.asm +++ b/scripts/seafoamislands5.asm @@ -27,9 +27,7 @@ SeafoamIslands5Script4: ; 467b7 (11:67b7) ret SeafoamIslands5Script0: ; 467c7 (11:67c7) - ld a, [wd880] - and $3 - cp $3 + CheckBothEventsSet EVENT_9C8, EVENT_9C9 ret z ld hl, CoordsData_467fe call ArePlayerCoordsInArray @@ -72,9 +70,7 @@ SeafoamIslands5Script1: ; 46807 (11:6807) ret SeafoamIslands5Script2: ; 46816 (11:6816) - ld a, [wd881] - and $3 - cp $3 + CheckBothEventsSet EVENT_9D0, EVENT_9D1 ld a, $0 jr z, .asm_46849 ld hl, CoordsData_4684d @@ -143,9 +139,9 @@ SeafoamIslands5TextPointers: ; 4687c (11:687c) SeafoamIslands5TrainerHeaders: ; 46886 (11:6886) SeafoamIslands5TrainerHeader0: ; 46886 (11:6886) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SEAFOAM_ISLANDS_5_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd882 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SEAFOAM_ISLANDS_5_TRAINER_0 dw SeafoamIslands5BattleText2 ; TextBeforeBattle dw SeafoamIslands5BattleText2 ; TextAfterBattle dw SeafoamIslands5BattleText2 ; TextEndBattle diff --git a/scripts/silphco1.asm b/scripts/silphco1.asm index 8a399a4c..26c8c888 100755 --- a/scripts/silphco1.asm +++ b/scripts/silphco1.asm @@ -1,11 +1,8 @@ SilphCo1Script: ; 5d44e (17:544e) call EnableAutoTextBoxDrawing - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ret z - ld hl, wd7b9 - bit 7, [hl] - set 7, [hl] + CheckAndSetEvent EVENT_397 ret nz ld a, HS_SILPH_CO_1F_1 ld [wcc4d], a diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index 47700664..7c7bf785 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -16,8 +16,7 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f) ld hl, DataTable_5a173 call SilphCo2Script_59d43 call SilphCo10Text_5a176 - ld a, [wd836] - bit 0, a + CheckEvent EVENT_778 ret nz ld a, $54 ld [wd09f], a @@ -31,8 +30,7 @@ SilphCo10Text_5a176: ; 5a176 (16:6176) ld a, [$ffe0] and a ret z - ld hl, wd836 - set 0, [hl] + SetEvent EVENT_778 ret SilphCo10ScriptPointers: ; 5a180 (16:6180) @@ -50,18 +48,18 @@ SilphCo10TextPointers: ; 5a186 (16:6186) SilphCo10TrainerHeaders: ; 5a192 (16:6192) SilphCo10TrainerHeader0: ; 5a192 (16:6192) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd835 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_0 dw SilphCo10BattleText1 ; TextBeforeBattle dw SilphCo10AfterBattleText1 ; TextAfterBattle dw SilphCo10EndBattleText1 ; TextEndBattle dw SilphCo10EndBattleText1 ; TextEndBattle SilphCo10TrainerHeader1: ; 5a19e (16:619e) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd835 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_1 dw SilphCo10BattleText2 ; TextBeforeBattle dw SilphCo10AfterBattleText2 ; TextAfterBattle dw SilphCo10EndBattleText2 ; TextEndBattle @@ -83,8 +81,7 @@ SilphCo10Text2: ; 5a1b5 (16:61b5) SilphCo10Text3: ; 5a1bf (16:61bf) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SilphCo10Text_5a1d8 jr nz, .asm_cf85f ld hl, SilphCo10Text_5a1d3 diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index 62591476..b855e6d0 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -16,8 +16,7 @@ SilphCo11Script_62110: ; 62110 (18:6110) ld hl, DataTable_62134 call SilphCo11Script_62137 call SilphCo11Script_62163 - ld a, [wd838] - bit 0, a + CheckEvent EVENT_788 ret nz ld a, $20 ld [wd09f], a @@ -67,8 +66,7 @@ SilphCo11Script_62163: ; 62163 (18:6163) ld a, [$ffe0] and a ret z - ld hl, wd838 - set 0, [hl] + SetEvent EVENT_788 ret SilphCo11Script_6216d: ; 6216d (18:616d) @@ -164,8 +162,7 @@ SilphCo11ScriptPointers: ; 621cf (18:61cf) dw SilphCo11Script5 SilphCo11Script0: ; 621db (18:61db) - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ret nz ld hl, CoordsData_62211 call ArePlayerCoordsInArray @@ -231,8 +228,7 @@ SilphCo11Script5: ; 62227 (18:6227) call UpdateSprites call Delay3 call GBFadeInFromBlack - ld hl, wd838 - set 7, [hl] + SetEvent EVENT_78F xor a ld [wJoyIgnore], a jp SilphCo11Script_621c8 @@ -285,18 +281,18 @@ SilphCo11TextPointers: ; 622b7 (18:62b7) SilphCo11TrainerHeaders: ; 622c3 (18:62c3) SilphCo11TrainerHeader0: ; 622c3 (18:62c3) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd837 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_0 dw SilphCo11BattleText1 ; TextBeforeBattle dw SilphCo11AfterBattleText1 ; TextAfterBattle dw SilphCo11EndBattleText1 ; TextEndBattle dw SilphCo11EndBattleText1 ; TextEndBattle SilphCo11TrainerHeader1: ; 622cf (18:62cf) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd837 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_1 dw SilphCo11BattleText2 ; TextBeforeBattle dw SilphCo11AfterBattleText2 ; TextAfterBattle dw SilphCo11EndBattleText2 ; TextEndBattle @@ -306,8 +302,7 @@ SilphCo11TrainerHeader1: ; 622cf (18:62cf) SilphCo11Text1: ; 622dc (18:62dc) TX_ASM - ld a, [wd838] - bit 5, a + CheckEvent EVENT_78D jp nz, .asm_62308 ld hl, SilphCoPresidentText call PrintText @@ -316,8 +311,7 @@ SilphCo11Text1: ; 622dc (18:62dc) jr nc, .BagFull ld hl, ReceivedSilphCoMasterBallText call PrintText - ld hl, wd838 - set 5, [hl] + SetEvent EVENT_78D jr .asm_6230e .BagFull ld hl, SilphCoMasterBallNoRoomText diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index ee0bd150..eb6b1b8e 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -16,8 +16,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) ld hl, DataTable_59d3e call SilphCo2Script_59d43 call SilphCo2Script_59d6f - ld a, [wd826] - bit 5, a + CheckEvent EVENT_6FD jr nz, .asm_59d2e push af ld a, $54 @@ -73,16 +72,16 @@ SilphCo2Script_59d43: ; 59d43 (16:5d43) ret SilphCo2Script_59d6f: ; 59d6f (16:5d6f) - ld hl, wd826 + EventFlagAddress hl, EVENT_6FD ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_59d7d - set 5, [hl] + jr nz, .next + SetEventReuseHL EVENT_6FD ret -.asm_59d7d - set 6, [hl] +.next + SetEventAfterBranchReuseHL EVENT_6FE, EVENT_6FD ret SilphCo2ScriptPointers: ; 59d80 (16:5d80) @@ -99,36 +98,36 @@ SilphCo2TextPointers: ; 59d86 (16:5d86) SilphCo2TrainerHeaders: ; 59d90 (16:5d90) SilphCo2TrainerHeader0: ; 59d90 (16:5d90) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd825 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_0 dw SilphCo2BattleText1 ; TextBeforeBattle dw SilphCo2AfterBattleText1 ; TextAfterBattle dw SilphCo2EndBattleText1 ; TextEndBattle dw SilphCo2EndBattleText1 ; TextEndBattle SilphCo2TrainerHeader1: ; 59d9c (16:5d9c) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd825 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_1 dw SilphCo2BattleText2 ; TextBeforeBattle dw SilphCo2AfterBattleText2 ; TextAfterBattle dw SilphCo2EndBattleText2 ; TextEndBattle dw SilphCo2EndBattleText2 ; TextEndBattle SilphCo2TrainerHeader2: ; 59da8 (16:5da8) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd825 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_2 dw SilphCo2BattleText3 ; TextBeforeBattle dw SilphCo2AfterBattleText3 ; TextAfterBattle dw SilphCo2EndBattleText3 ; TextEndBattle dw SilphCo2EndBattleText3 ; TextEndBattle SilphCo2TrainerHeader3: ; 59db4 (16:5db4) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd825 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_3 dw SilphCo2BattleText4 ; TextBeforeBattle dw SilphCo2AfterBattleText4 ; TextAfterBattle dw SilphCo2EndBattleText4 ; TextEndBattle @@ -138,8 +137,7 @@ SilphCo2TrainerHeader3: ; 59db4 (16:5db4) SilphCo2Text1: ; 59dc1 (16:5dc1) TX_ASM - ld a, [wd826] - bit 7, a + CheckEvent EVENT_6FF jr nz, .asm_59de4 ld hl, SilphCo2Text_59ded call PrintText @@ -147,8 +145,7 @@ SilphCo2Text1: ; 59dc1 (16:5dc1) call GiveItem ld hl, TM36NoRoomText jr nc, .asm_59de7 - ld hl, wd826 - set 7, [hl] + SetEvent EVENT_6FF ld hl, ReceivedTM36Text jr .asm_59de7 .asm_59de4 diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index 4bd1edd1..0cb54726 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -16,8 +16,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) ld hl, DataTable_59fa8 call SilphCo2Script_59d43 call SilphCo3Script_59fad - ld a, [wd828] - bit 0, a + CheckEvent EVENT_708 jr nz, .asm_59f98 push af ld a, $5f @@ -37,16 +36,16 @@ DataTable_59fa8: ; 59fa8 (16:5fa8) db $04,$04,$04,$08,$FF SilphCo3Script_59fad: ; 59fad (16:5fad) - ld hl, wd828 + EventFlagAddress hl, EVENT_708 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_59fbb - set 0, [hl] + jr nz, .next + SetEventReuseHL EVENT_708 ret -.asm_59fbb - set 1, [hl] +.next + SetEventAfterBranchReuseHL EVENT_709, EVENT_708 ret SilphCo3ScriptPointers: ; 59fbe (16:5fbe) @@ -62,18 +61,18 @@ SilphCo3TextPointers: ; 59fc4 (16:5fc4) SilphCo3TrainerHeaders: ; 59fcc (16:5fcc) SilphCo3TrainerHeader0: ; 59fcc (16:5fcc) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd827 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_0 dw SilphCo3BattleText1 ; TextBeforeBattle dw SilphCo3AfterBattleText1 ; TextAfterBattle dw SilphCo3EndBattleText1 ; TextEndBattle dw SilphCo3EndBattleText1 ; TextEndBattle SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd827 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_1 dw SilphCo3BattleText2 ; TextBeforeBattle dw SilphCo3AfterBattleText2 ; TextAfterBattle dw SilphCo3EndBattleText2 ; TextEndBattle @@ -83,8 +82,7 @@ SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) SilphCo3Text1: ; 59fe5 (16:5fe5) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SilphCo3Text_59ffe jr nz, .asm_59fee ld hl, SilphCo3Text_59ff9 diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index a3953e27..aff77e4a 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -16,8 +16,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) ld hl, SilphCo4Data19d58 call SilphCo4Script_19d5d call SilphCo4Script_19d89 - ld a, [wd82a] - bit 0, a + CheckEvent EVENT_718 jr nz, .asm_19d48 push af ld a, $54 @@ -73,16 +72,16 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ret SilphCo4Script_19d89: ; 19d89 (6:5d89) - ld hl, wd82a + EventFlagAddress hl, EVENT_718 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_19d97 - set 0, [hl] + jr nz, .next + SetEventReuseHL EVENT_718 ret -.asm_19d97 - set 1, [hl] +.next + SetEventAfterBranchReuseHL EVENT_719, EVENT_718 ret SilphCo4ScriptPointers: ; 19d9a (6:5d9a) @@ -101,27 +100,27 @@ SilphCo4TextPointers: ; 19da0 (6:5da0) SilphCo4TrainerHeaders: ; 19dae (6:5dae) SilphCo4TrainerHeader0: ; 19dae (6:5dae) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd829 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_0 dw SilphCo4BattleText2 ; TextBeforeBattle dw SilphCo4AfterBattleText2 ; TextAfterBattle dw SilphCo4EndBattleText2 ; TextEndBattle dw SilphCo4EndBattleText2 ; TextEndBattle SilphCo4TrainerHeader2: ; 19dba (6:5dba) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd829 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_2 dw SilphCo4BattleText3 ; TextBeforeBattle dw SilphCo4AfterBattleText3 ; TextAfterBattle dw SilphCo4EndBattleText3 ; TextEndBattle dw SilphCo4EndBattleText3 ; TextEndBattle SilphCo4TrainerHeader3: ; 19dc6 (6:5dc6) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd829 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_3 dw SilphCo4BattleText4 ; TextBeforeBattle dw SilphCo4AfterBattleText4 ; TextAfterBattle dw SilphCo4EndBattleText4 ; TextEndBattle diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index 1ed6006f..cd220b3e 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -16,8 +16,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) ld hl, SilphCo5Coords call SilphCo4Script_19d5d call SilphCo5Script_19f9e - ld a, [wd82c] - bit 0, a + CheckEvent EVENT_728 jr nz, .asm_19f74 push af ld a, $5f @@ -46,21 +45,21 @@ SilphCo5Coords: ; 19f97 (6:5f97) db $02, $03, $06, $03, $05, $07, $ff SilphCo5Script_19f9e: ; 19f9e (6:5f9e) - ld hl, wd82c + EventFlagAddress hl, EVENT_728 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_19fac - set 0, [hl] + jr nz, .next1 + SetEventReuseHL EVENT_728 ret -.asm_19fac +.next1 cp $2 - jr nz, .asm_19fb3 - set 1, [hl] + jr nz, .next2 + SetEventAfterBranchReuseHL EVENT_729, EVENT_728 ret -.asm_19fb3 - set 2, [hl] +.next2 + SetEventAfterBranchReuseHL EVENT_72A, EVENT_728 ret SilphCo5ScriptPointers: ; 19fb6 (6:5fb6) @@ -83,36 +82,36 @@ SilphCo5TextPointers: ; 19fbc (6:5fbc) SilphCo5TrainerHeaders: ; 19fd2 (6:5fd2) Silphco5TrainerHeader0: ; 19fd2 (6:5fd2) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_0 db ($1 << 4) ; trainer's view range - dw wd82b ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_0 dw SilphCo5BattleText2 ; TextBeforeBattle dw SilphCo5AfterBattleText2 ; TextAfterBattle dw SilphCo5EndBattleText2 ; TextEndBattle dw SilphCo5EndBattleText2 ; TextEndBattle Silphco5TrainerHeader2: ; 19fde (6:5fde) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd82b ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_2 dw SilphCo5BattleText3 ; TextBeforeBattle dw SilphCo5AfterBattleText3 ; TextAfterBattle dw SilphCo5EndBattleText3 ; TextEndBattle dw SilphCo5EndBattleText3 ; TextEndBattle Silphco5TrainerHeader3: ; 19fea (6:5fea) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd82b ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_3 dw SilphCo5BattleText4 ; TextBeforeBattle dw SilphCo5AfterBattleText4 ; TextAfterBattle dw SilphCo5EndBattleText4 ; TextEndBattle dw SilphCo5EndBattleText4 ; TextEndBattle Silphco5TrainerHeader4: ; 19ff6 (6:5ff6) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd82b ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_4 dw SilphCo5BattleText5 ; TextBeforeBattle dw SilphCo5AfterBattleText5 ; TextAfterBattle dw SilphCo5EndBattleText5 ; TextEndBattle diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index fe1e6224..ca52d05c 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -16,8 +16,7 @@ SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) ld hl, SilphCo6Coords1 call SilphCo4Script_19d5d call SilphCo6Script_1a1e6 - ld a, [wd82e] - bit 7, a + CheckEvent EVENT_73F ret nz ld a, $5f ld [wd09f], a @@ -32,8 +31,7 @@ SilphCo6Script_1a1e6: ; 1a1e6 (6:61e6) ld a, [$ffe0] and a ret z - ld hl, wd82e - set 7, [hl] + SetEvent EVENT_73F ret SilphCo6ScriptPointers: ; 1a1f0 (6:61f0) @@ -55,27 +53,27 @@ SilphCo6TextPointers: ; 1a1f6 (6:61f6) SilphCo6TrainerHeaders: ; 1a20a (6:620a) SilphCo6TrainerHeader0: ; 1a20a (6:620a) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd82d ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_0 dw SilphCo6BattleText2 ; TextBeforeBattle dw SilphCo6AfterBattleText2 ; TextAfterBattle dw SilphCo6EndBattleText2 ; TextEndBattle dw SilphCo6EndBattleText2 ; TextEndBattle SilphCo6TrainerHeader2: ; 1a216 (6:6216) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd82d ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_2 dw SilphCo6BattleText3 ; TextBeforeBattle dw SilphCo6AfterBattleText3 ; TextAfterBattle dw SilphCo6EndBattleText3 ; TextEndBattle dw SilphCo6EndBattleText3 ; TextEndBattle SilphCo6TrainerHeader3: ; 1a222 (6:6222) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_3, 1 db ($2 << 4) ; trainer's view range - dw wd82d ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_3, 1 dw SilphCo6BattleText4 ; TextBeforeBattle dw SilphCo6AfterBattleText4 ; TextAfterBattle dw SilphCo6EndBattleText4 ; TextEndBattle @@ -84,8 +82,7 @@ SilphCo6TrainerHeader3: ; 1a222 (6:6222) db $ff SilphCo6Script_1a22f: ; 1a22f (6:622f) - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F jr nz, .asm_1a238 jr .asm_1a23a .asm_1a238 diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 78d6e0d7..64c79c3a 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -16,8 +16,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) ld hl, DataTable_51bc1 call SilphCo7Text_51bc8 call SilphCo7Text_51bf4 - ld a, [wd830] - bit 4, a + CheckEvent EVENT_74C jr nz, .asm_51b9e push af ld a, $54 @@ -82,21 +81,21 @@ SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) ret SilphCo7Text_51bf4: ; 51bf4 (14:5bf4) - ld hl, wd830 + EventFlagAddress hl, EVENT_74C ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_51c02 - set 4, [hl] + jr nz, .next1 + SetEventReuseHL EVENT_74C ret -.asm_51c02 +.next1 cp $2 - jr nz, .asm_51c09 - set 5, [hl] + jr nz, .next2 + SetEventAfterBranchReuseHL EVENT_74D, EVENT_74C ret -.asm_51c09 - set 6, [hl] +.next2 + SetEventAfterBranchReuseHL EVENT_74E, EVENT_74C ret SilphCo7Text_51c0c: ; 51c0c (14:5c0c) @@ -117,8 +116,7 @@ SilphCo7ScriptPointers: ; 51c17 (14:5c17) dw SilphCo7Script5 SilphCo7Script0: ; 51c23 (14:5c23) - ld a, [wd82f] - bit 0, a + CheckEvent EVENT_740 jp nz, CheckFightingMapTrainers ld hl, CoordsData_51c78 call ArePlayerCoordsInArray @@ -207,8 +205,7 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) jp z, SilphCo7Text_51c0c ld a, $f0 ld [wJoyIgnore], a - ld hl, wd82f - set 0, [hl] + SetEvent EVENT_740 ld a, PLAYER_DIR_DOWN ld [wPlayerMovingDirection], a ld a, $9 @@ -281,36 +278,36 @@ SilphCo7TextPointers: ; 51d3f (14:5d3f) SilphCo7TrainerHeaders: ; 51d5d (14:5d5d) SilphCo7TrainerHeader0: ; 51d5d (14:5d5d) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd82f ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_0 dw SilphCo7BattleText1 ; TextBeforeBattle dw SilphCo7AfterBattleText1 ; TextAfterBattle dw SilphCo7EndBattleText1 ; TextEndBattle dw SilphCo7EndBattleText1 ; TextEndBattle SilphCo7TrainerHeader2: ; 51d69 (14:5d69) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd82f ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_2 dw SilphCo7BattleText2 ; TextBeforeBattle dw SilphCo7AfterBattleText2 ; TextAfterBattle dw SilphCo7EndBattleText2 ; TextEndBattle dw SilphCo7EndBattleText2 ; TextEndBattle SilphCo7TrainerHeader3: ; 51d75 (14:5d75) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd82f ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_3 dw SilphCo7BattleText3 ; TextBeforeBattle dw SilphCo7AfterBattleText3 ; TextAfterBattle dw SilphCo7EndBattleText3 ; TextEndBattle dw SilphCo7EndBattleText3 ; TextEndBattle SilphCo7TrainerHeader4: ; 51d81 (14:5d81) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_4, 1 db ($4 << 4) ; trainer's view range - dw wd82f ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_4, 1 dw SilphCo7BattleText4 ; TextBeforeBattle dw SilphCo7AfterBattleText4 ; TextAfterBattle dw SilphCo7EndBattleText4 ; TextEndBattle @@ -324,8 +321,7 @@ SilphCo7Text1: ld a, [wd72e] bit 0, a ; got lapras? jr z, .givelapras - ld a, [wd838] - bit 7, a ; saved silph? + CheckEvent EVENT_78F jr nz, .savedsilph ld hl, .LaprasGuyText call PrintText @@ -369,8 +365,7 @@ SilphCo7Text1: SilphCo7Text2: TX_ASM - ld a, [wd838] - bit 7, a ; saved silph? + CheckEvent EVENT_78F jr nz, .savedsilph ld hl, .rockettext call PrintText @@ -391,8 +386,7 @@ SilphCo7Text2: SilphCo7Text3: TX_ASM - ld a, [wd838] - bit 7, a ; saved silph? + CheckEvent EVENT_78F jr nz, .savedsilph ld hl, .rockettext call PrintText @@ -413,8 +407,7 @@ SilphCo7Text3: SilphCo7Text4: TX_ASM - ld a, [wd838] - bit 7, a ; saved silph? + CheckEvent EVENT_78F jr nz, .savedsilph ld hl, .rockettext call PrintText diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index 95a1096d..ec54ea8e 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -16,8 +16,7 @@ SilphCo8Script_5651a: ; 5651a (15:651a) ld hl, DataTable_5653e call SilphCo8Script_56541 call SilphCo8Script_5656d - ld a, [wd832] - bit 0, a + CheckEvent EVENT_758 ret nz ld a, $5f ld [wd09f], a @@ -67,8 +66,7 @@ SilphCo8Script_5656d: ; 5656d (15:656d) ld a, [$ffe0] and a ret z - ld hl, wd832 - set 0, [hl] + SetEvent EVENT_758 ret SilphCo8ScriptPointers: ; 56577 (15:6577) @@ -84,27 +82,27 @@ SilphCo8TextPointers: ; 5657d (15:657d) SilphCo8TrainerHeaders: ; 56585 (15:6585) SilphCo8TrainerHeader0: ; 56585 (15:6585) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd831 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_0 dw SilphCo8BattleText1 ; TextBeforeBattle dw SilphCo8AfterBattleText1 ; TextAfterBattle dw SilphCo8EndBattleText1 ; TextEndBattle dw SilphCo8EndBattleText1 ; TextEndBattle SilphCo8TrainerHeader1: ; 56591 (15:6591) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd831 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_1 dw SilphCo8BattleText2 ; TextBeforeBattle dw SilphCo8AfterBattleText2 ; TextAfterBattle dw SilphCo8EndBattleText2 ; TextEndBattle dw SilphCo8EndBattleText2 ; TextEndBattle SilphCo8TrainerHeader2: ; 5659d (15:659d) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd831 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_2 dw SilphCo8BattleText3 ; TextBeforeBattle dw SilphCo8AfterBattleText3 ; TextAfterBattle dw SilphCo8EndBattleText3 ; TextEndBattle @@ -114,8 +112,7 @@ SilphCo8TrainerHeader2: ; 5659d (15:659d) SilphCo8Text1: ; 565aa (15:65aa) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SilphCo8Text_565c3 jr nz, .asm_565b8 ld hl, SilphCo8Text_565be diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index b19dbde4..2c41e019 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -16,8 +16,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) ld hl, DataTable_5d82e call SilphCo9Script_5d837 call SilphCo9Script_5d863 - ld a, [wd834] - bit 0, a + CheckEvent EVENT_768 jr nz, .asm_5d7f8 push af ld a, $5f @@ -91,28 +90,28 @@ SilphCo9Script_5d837: ; 5d837 (17:5837) ret SilphCo9Script_5d863: ; 5d863 (17:5863) - ld hl, wd834 + EventFlagAddress hl, EVENT_768 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_5d871 - set 0, [hl] + jr nz, .next1 + SetEventReuseHL EVENT_768 ret -.asm_5d871 +.next1 cp $2 - jr nz, .asm_5d878 - set 1, [hl] + jr nz, .next2 + SetEventAfterBranchReuseHL EVENT_769, EVENT_768 ret -.asm_5d878 +.next2 cp $3 - jr nz, .asm_5d87f - set 2, [hl] + jr nz, .next3 + SetEventAfterBranchReuseHL EVENT_76A, EVENT_768 ret -.asm_5d87f +.next3 cp $4 ret nz - set 3, [hl] + SetEventAfterBranchReuseHL EVENT_76B, EVENT_768 ret SilphCo9ScriptPointers: ; 5d885 (17:5885) @@ -128,27 +127,27 @@ SilphCo9TextPointers: ; 5d88b (17:588b) SilphCo9TrainerHeaders: ; 5d893 (17:5893) SilphCo9TrainerHeader0: ; 5d893 (17:5893) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd833 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_0 dw SilphCo9BattleText1 ; TextBeforeBattle dw SilphCo9AfterBattleText1 ; TextAfterBattle dw SilphCo9EndBattleText1 ; TextEndBattle dw SilphCo9EndBattleText1 ; TextEndBattle SilphCo9TrainerHeader1: ; 5d89f (17:589f) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd833 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_1 dw SilphCo9BattleText2 ; TextBeforeBattle dw SilphCo9AfterBattleText2 ; TextAfterBattle dw SilphCo9EndBattleText2 ; TextEndBattle dw SilphCo9EndBattleText2 ; TextEndBattle SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd833 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_2 dw SilphCo9BattleText3 ; TextBeforeBattle dw SilphCo9AfterBattleText3 ; TextAfterBattle dw SilphCo9EndBattleText3 ; TextEndBattle @@ -158,8 +157,7 @@ SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) SilphCo9Text1: ; 5d8b8 (17:58b8) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F jr nz, .asm_5d8dc ld hl, SilphCo9Text_5d8e5 call PrintText diff --git a/scripts/ssanne10.asm b/scripts/ssanne10.asm index 031315c3..3b53b961 100755 --- a/scripts/ssanne10.asm +++ b/scripts/ssanne10.asm @@ -27,54 +27,54 @@ SSAnne10TextPointers: ; 61d6e (18:5d6e) SSAnne10TrainerHeaders: ; 61d84 (18:5d84) SSAnne10TrainerHeader0: ; 61d84 (18:5d84) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_0 dw SSAnne10BattleText1 ; TextBeforeBattle dw SSAnne10AfterBattleText1 ; TextAfterBattle dw SSAnne10EndBattleText1 ; TextEndBattle dw SSAnne10EndBattleText1 ; TextEndBattle SSAnne10TrainerHeader1: ; 61d90 (18:5d90) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_1 dw SSAnne10BattleText2 ; TextBeforeBattle dw SSAnne10AfterBattleText2 ; TextAfterBattle dw SSAnne10EndBattleText2 ; TextEndBattle dw SSAnne10EndBattleText2 ; TextEndBattle SSAnne10TrainerHeader2: ; 61d9c (18:5d9c) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_2 dw SSAnne10BattleText3 ; TextBeforeBattle dw SSAnne10AfterBattleText3 ; TextAfterBattle dw SSAnne10EndBattleText3 ; TextEndBattle dw SSAnne10EndBattleText3 ; TextEndBattle SSAnne10TrainerHeader3: ; 61da8 (18:5da8) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_3 dw SSAnne10BattleText4 ; TextBeforeBattle dw SSAnne10AfterBattleText4 ; TextAfterBattle dw SSAnne10EndBattleText4 ; TextEndBattle dw SSAnne10EndBattleText4 ; TextEndBattle SSAnne10TrainerHeader4: ; 61db4 (18:5db4) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_4 dw SSAnne10BattleText5 ; TextBeforeBattle dw SSAnne10AfterBattleText5 ; TextAfterBattle dw SSAnne10EndBattleText5 ; TextEndBattle dw SSAnne10EndBattleText5 ; TextEndBattle SSAnne10TrainerHeader5: ; 61dc0 (18:5dc0) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_5 dw SSAnne10BattleText6 ; TextBeforeBattle dw SSAnne10AfterBattleText6 ; TextAfterBattle dw SSAnne10EndBattleText6 ; TextEndBattle diff --git a/scripts/ssanne5.asm b/scripts/ssanne5.asm index 063ccbb8..76553563 100755 --- a/scripts/ssanne5.asm +++ b/scripts/ssanne5.asm @@ -21,18 +21,18 @@ SSAnne5TextPointers: ; 616c7 (18:56c7) SSAnne5TrainerHeaders: ; 616d1 (18:56d1) SSAnne5TrainerHeader0: ; 616d1 (18:56d1) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_5_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7ff ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_5_TRAINER_0 dw SSAnne5BattleText1 ; TextBeforeBattle dw SSAnne5AfterBattleText1 ; TextAfterBattle dw SSAnne5EndBattleText1 ; TextEndBattle dw SSAnne5EndBattleText1 ; TextEndBattle SSAnne5TrainerHeader1: ; 616dd (18:56dd) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_5_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7ff ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_5_TRAINER_1 dw SSAnne5BattleText2 ; TextBeforeBattle dw SSAnne5AfterBattleText2 ; TextAfterBattle dw SSAnne5EndBattleText2 ; TextEndBattle diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index a1fd791a..a47cc069 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -3,8 +3,7 @@ SSAnne7Script: ; 61895 (18:5895) jp EnableAutoTextBoxDrawing SSAnne7Script_6189b: ; 6189b (18:589b) - ld a, [wd803] - bit 1, a + CheckEvent EVENT_5E1 ret nz ld hl, wd72d set 5, [hl] @@ -17,8 +16,7 @@ SSAnne7TextPointers: ; 618a7 (18:58a7) SSAnne7Text1: ; 618ad (18:58ad) TX_ASM - ld a, [wd803] - bit 0, a + CheckEvent EVENT_5E0 jr nz, .asm_797c4 ld hl, SSAnne7RubText call PrintText @@ -29,8 +27,7 @@ SSAnne7Text1: ; 618ad (18:58ad) jr nc, .BagFull ld hl, ReceivedHM01Text call PrintText - ld hl, wd803 - set 0, [hl] + SetEvent EVENT_5E0 jr .asm_0faf5 .BagFull ld hl, HM01NoRoomText @@ -65,8 +62,7 @@ SSAnne7RubText: ; 618ec (18:58ec) cp MUSIC_PKMN_HEALED jr z, .asm_61910 call PlayDefaultMusic - ld hl, wd803 - set 1, [hl] + SetEvent EVENT_5E1 ld hl, wd72d res 5, [hl] jp TextScriptEnd diff --git a/scripts/ssanne8.asm b/scripts/ssanne8.asm index 7885135b..195c9a81 100755 --- a/scripts/ssanne8.asm +++ b/scripts/ssanne8.asm @@ -27,36 +27,36 @@ SSAnne8TextPointers: ; 6198f (18:598f) SSAnne8TrainerHeaders: ; 619a5 (18:59a5) SSAnne8TrainerHeader0: ; 619a5 (18:59a5) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd805 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_0 dw SSAnne8BattleText1 ; TextBeforeBattle dw SSAnne8AfterBattleText1 ; TextAfterBattle dw SSAnne8EndBattleText1 ; TextEndBattle dw SSAnne8EndBattleText1 ; TextEndBattle SSAnne8TrainerHeader1: ; 619b1 (18:59b1) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd805 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_1 dw SSAnne8BattleText2 ; TextBeforeBattle dw SSAnne8AfterBattleText2 ; TextAfterBattle dw SSAnne8EndBattleText2 ; TextEndBattle dw SSAnne8EndBattleText2 ; TextEndBattle SSAnne8TrainerHeader2: ; 619bd (18:59bd) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd805 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_2 dw SSAnne8BattleText3 ; TextBeforeBattle dw SSAnne8AfterBattleText3 ; TextAfterBattle dw SSAnne8EndBattleText3 ; TextEndBattle dw SSAnne8EndBattleText3 ; TextEndBattle SSAnne8TrainerHeader3: ; 619c9 (18:59c9) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd805 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_3 dw SSAnne8BattleText4 ; TextBeforeBattle dw SSAnne8AfterBattleText4 ; TextAfterBattle dw SSAnne8EndBattleText4 ; TextEndBattle diff --git a/scripts/ssanne9.asm b/scripts/ssanne9.asm index 0cee1e08..525a2964 100755 --- a/scripts/ssanne9.asm +++ b/scripts/ssanne9.asm @@ -32,36 +32,36 @@ SSAnne9TextPointers: ; 61b6a (18:5b6a) SSAnne9TrainerHeaders: ; 61b84 (18:5b84) SSAnne9TrainerHeader0: ; 61b84 (18:5b84) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd807 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_0 dw SSAnne9BattleText1 ; TextBeforeBattle dw SSAnne9AfterBattleText1 ; TextAfterBattle dw SSAnne9EndBattleText1 ; TextEndBattle dw SSAnne9EndBattleText1 ; TextEndBattle SSAnne9TrainerHeader1: ; 61b90 (18:5b90) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd807 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_1 dw SSAnne9BattleText2 ; TextBeforeBattle dw SSAnne9AfterBattleText2 ; TextAfterBattle dw SSAnne9EndBattleText2 ; TextEndBattle dw SSAnne9EndBattleText2 ; TextEndBattle SSAnne9TrainerHeader2: ; 61b9c (18:5b9c) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd807 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_2 dw SSAnne9BattleText3 ; TextBeforeBattle dw SSAnne9AfterBattleText3 ; TextAfterBattle dw SSAnne9EndBattleText3 ; TextEndBattle dw SSAnne9EndBattleText3 ; TextEndBattle SSAnne9TrainerHeader3: ; 61ba8 (18:5ba8) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd807 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_3 dw SSAnne9BattleText4 ; TextBeforeBattle dw SSAnne9AfterBattleText4 ; TextAfterBattle dw SSAnne9EndBattleText4 ; TextEndBattle diff --git a/scripts/unknowndungeon3.asm b/scripts/unknowndungeon3.asm index 1c87aa39..42459766 100755 --- a/scripts/unknowndungeon3.asm +++ b/scripts/unknowndungeon3.asm @@ -19,9 +19,9 @@ UnknownDungeon3TextPointers: ; 45f09 (11:5f09) UnknownDungeon3TrainerHeaders: ; 45f0f (11:5f0f) UnknownDungeon3TrainerHeader0: ; 45f0f (11:5f0f) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_UNKNOWN_DUNGEON_3_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd85f ; flag's byte + dwEventFlagAddress EVENT_BEAT_UNKNOWN_DUNGEON_3_TRAINER_0 dw UnknownDungeon3MewtwoText ; TextBeforeBattle dw UnknownDungeon3MewtwoText ; TextAfterBattle dw UnknownDungeon3MewtwoText ; TextEndBattle diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 6b9f94f7..0d6ccbee 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -21,11 +21,10 @@ VermilionCityScript_197c0: ; 197c0 (6:57c0) ret VermilionCityScript_197cb: ; 197cb (6:57cb) - ld hl, wd803 - bit 2, [hl] + CheckEventHL EVENT_SS_ANNE_LEFT ret z - bit 3, [hl] - set 3, [hl] + CheckEventReuseHL EVENT_5E3 + SetEventReuseHL EVENT_5E3 ret nz ld a, $2 ld [W_VERMILIONCITYCURSCRIPT], a @@ -51,8 +50,7 @@ VermilionCityScript0: ; 197e6 (6:57e6) ld a, $3 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld a, [wd803] - bit 2, a + CheckEvent EVENT_SS_ANNE_LEFT jr nz, .asm_19810 ld b, S_S__TICKET predef IsItemInBag_ @@ -136,8 +134,7 @@ VermilionCityText1: ; 19889 (6:5889) VermilionCityText2: ; 1988e (6:588e) TX_ASM - ld a, [wd803] - bit 2, a + CheckEvent EVENT_SS_ANNE_LEFT jr nz, .asm_1989e ld hl, VermilionCityText_198a7 call PrintText @@ -158,8 +155,7 @@ VermilionCityText_198ac: ; 198ac (6:58ac) VermilionCityText3: ; 198b1 (6:58b1) TX_ASM - ld a, [wd803] - bit 2, a + CheckEvent EVENT_SS_ANNE_LEFT jr nz, .asm_198f6 ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_RIGHT diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index 7c2fb656..20288102 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -1,16 +1,15 @@ VermilionDockScript: ; 1db52 (7:5b52) call EnableAutoTextBoxDrawing - ld hl, wd803 - bit 4, [hl] + CheckEventHL EVENT_5E4 jr nz, .asm_1db8d - bit 0, [hl] + CheckEventReuseHL EVENT_5E0 ret z ld a, [wDestinationWarpID] cp $1 ret nz - bit 2, [hl] + CheckEventReuseHL EVENT_SS_ANNE_LEFT jp z, VermilionDock_1db9b - set 4, [hl] + SetEventReuseHL EVENT_5E4 call Delay3 ld hl, wd730 set 7, [hl] @@ -28,17 +27,17 @@ VermilionDockScript: ; 1db52 (7:5b52) ld [wJoyIgnore], a ret .asm_1db8d - bit 5, [hl] + CheckEventAfterBranchReuseHL EVENT_5E5, EVENT_5E4 ret nz ld a, [wSimulatedJoypadStatesIndex] and a ret nz ld [wJoyIgnore], a - set 5, [hl] + SetEventReuseHL EVENT_5E5 ret VermilionDock_1db9b: ; 1db9b (7:5b9b) - set 2, [hl] + SetEventForceReuseHL EVENT_SS_ANNE_LEFT ld a, $ff ld [wJoyIgnore], a ld [wc0ee], a diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index 614e0b4d..31f736cd 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -28,8 +28,7 @@ Gym3LeaderName: ; 5ca64 (17:4a64) db "LT.SURGE@" VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d) - ld a, [wd773] - bit 0, a + CheckEvent EVENT_2ND_LOCK_OPENED jr nz, .asm_5ca78 ld a, $24 jr .asm_5ca7f @@ -66,16 +65,14 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) ld a, $6 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd773 - set 7, [hl] + SetEvent EVENT_167 ld bc, (TM_24 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $7 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd773 - set 6, [hl] + SetEvent EVENT_166 jr .asm_5cad3 .BagFull ld a, $8 @@ -88,9 +85,7 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) set 2, [hl] ; deactivate gym trainers - ld a, [wd773] - or %00011100 - ld [wd773], a + SetEventRange EVENT_BEAT_VERMILION_GYM_TRAINER_0, EVENT_BEAT_VERMILION_GYM_TRAINER_2 jp VermilionGymScript_5ca8a @@ -106,27 +101,27 @@ VermilionGymTextPointers: ; 5cae8 (17:4ae8) VermilionGymTrainerHeaders: ; 5caf8 (17:4af8) VermilionGymTrainerHeader0: ; 5caf8 (17:4af8) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd773 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_0 dw VermilionGymBattleText1 ; TextBeforeBattle dw VermilionGymAfterBattleText1 ; TextAfterBattle dw VermilionGymEndBattleText1 ; TextEndBattle dw VermilionGymEndBattleText1 ; TextEndBattle VermilionGymTrainerHeader1: ; 5cb04 (17:4b04) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd773 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_1 dw VermilionGymBattleText2 ; TextBeforeBattle dw VermilionGymAfterBattleText2 ; TextAfterBattle dw VermilionGymEndBattleText2 ; TextEndBattle dw VermilionGymEndBattleText2 ; TextEndBattle VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd773 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_2 dw VermilionGymBattleText3 ; TextBeforeBattle dw VermilionGymAfterBattleText3 ; TextAfterBattle dw VermilionGymEndBattleText3 ; TextEndBattle @@ -136,10 +131,9 @@ VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) VermilionGymText1: ; 5cb1d (17:4b1d) TX_ASM - ld a, [wd773] - bit 7, a + CheckEvent EVENT_167 jr z, .asm_5cb39 - bit 6, a + CheckEventReuseA EVENT_166 jr nz, .asm_5cb31 call z, VermilionGymScript_5caaa call DisableWaitingAfterTextDisplay diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index 4f1df52f..e8b90e05 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -11,8 +11,7 @@ VictoryRoad1Script: ; 5da0a (17:5a0a) ld [W_VICTORYROAD1CURSCRIPT], a ret .next - ld a, [wd869] - bit 7, a + CheckEvent EVENT_917 ret z ld a, $1d ld [wd09f], a @@ -25,16 +24,14 @@ VictoryRoad1ScriptPointers: ; 5da3a (17:5a3a) dw EndTrainerBattle VictoryRoad1Script0: ; 5da40 (17:5a40) - ld a, [wd869] - bit 7, a + CheckEvent EVENT_917 jp nz, CheckFightingMapTrainers ld hl, CoordsData_5da5c call CheckBoulderCoords jp nc, CheckFightingMapTrainers ld hl, wd126 set 5, [hl] - ld hl, wd869 - set 7, [hl] + SetEvent EVENT_917 ret CoordsData_5da5c: ; 5da5c (17:5a5c) @@ -51,18 +48,18 @@ VictoryRoad1TextPointers: ; 5da5f (17:5a5f) VictoryRoad1TrainerHeaders: ; 5da6d (17:5a6d) VictoryRoad1TrainerHeader0: ; 5da6d (17:5a6d) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd869 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0 dw VictoryRoad1BattleText1 ; TextBeforeBattle dw VictoryRoad1AfterBattleText1 ; TextAfterBattle dw VictoryRoad1EndBattleText1 ; TextEndBattle dw VictoryRoad1EndBattleText1 ; TextEndBattle VictoryRoad1TrainerHeader1: ; 5da79 (17:5a79) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd869 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1 dw VictoryRoad1BattleText2 ; TextBeforeBattle dw VictoryRoad1AfterBattleText2 ; TextAfterBattle dw VictoryRoad1EndBattleText2 ; TextEndBattle diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index fd095638..46755c46 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -16,12 +16,10 @@ VictoryRoad2Script: ; 5179d (14:579d) ret VictoryRoad2Script_517c4: ; 517c4 (14:57c4) - ld hl, wd869 - res 7, [hl] + ResetEvent EVENT_917 VictoryRoad2Script_517c9: ; 517c9 (14:57c9) - ld a, [wd7ee] - bit 0, a + CheckEvent EVENT_538 jr z, .asm_517da push af ld a, $15 @@ -48,17 +46,17 @@ VictoryRoad2Script0: ; 517f1 (14:57f1) ld hl, CoordsData_51816 call CheckBoulderCoords jp nc, CheckFightingMapTrainers - ld hl, wd7ee + EventFlagAddress hl, EVENT_538 ld a, [wCoordIndex] cp $2 jr z, .asm_5180b - bit 0, [hl] - set 0, [hl] + CheckEventReuseHL EVENT_538 + SetEventReuseHL EVENT_538 ret nz jr .asm_51810 .asm_5180b - bit 7, [hl] - set 7, [hl] + CheckEventAfterBranchReuseHL EVENT_53F, EVENT_538 + SetEventReuseHL EVENT_53F ret nz .asm_51810 ld hl, wd126 @@ -87,54 +85,54 @@ VictoryRoad2TextPointers: ; 5181b (14:581b) VictoryRoad2TrainerHeaders: ; 51835 (14:5835) VictoryRoad2TrainerHeader0: ; 51835 (14:5835) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 dw VictoryRoad2BattleText1 ; TextBeforeBattle dw VictoryRoad2AfterBattleText1 ; TextAfterBattle dw VictoryRoad2EndBattleText1 ; TextEndBattle dw VictoryRoad2EndBattleText1 ; TextEndBattle VictoryRoad2TrainerHeader2: ; 51841 (14:5841) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 dw VictoryRoad2BattleText2 ; TextBeforeBattle dw VictoryRoad2AfterBattleText2 ; TextAfterBattle dw VictoryRoad2EndBattleText2 ; TextEndBattle dw VictoryRoad2EndBattleText2 ; TextEndBattle VictoryRoad2TrainerHeader3: ; 5184d (14:584d) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 dw VictoryRoad2BattleText3 ; TextBeforeBattle dw VictoryRoad2AfterBattleText3 ; TextAfterBattle dw VictoryRoad2EndBattleText3 ; TextEndBattle dw VictoryRoad2EndBattleText3 ; TextEndBattle VictoryRoad2TrainerHeader4: ; 51859 (14:5859) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 db ($1 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 dw VictoryRoad2BattleText4 ; TextBeforeBattle dw VictoryRoad2AfterBattleText4 ; TextAfterBattle dw VictoryRoad2EndBattleText4 ; TextEndBattle dw VictoryRoad2EndBattleText4 ; TextEndBattle VictoryRoad2TrainerHeader5: ; 51865 (14:5865) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 dw VictoryRoad2BattleText5 ; TextBeforeBattle dw VictoryRoad2AfterBattleText5 ; TextAfterBattle dw VictoryRoad2EndBattleText5 ; TextEndBattle dw VictoryRoad2EndBattleText5 ; TextEndBattle VictoryRoad2TrainerHeader6: ; 51871 (14:5871) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 db ($0 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 dw VictoryRoad2BattleText6 ; TextBeforeBattle dw VictoryRoad2BattleText6 ; TextAfterBattle dw VictoryRoad2BattleText6 ; TextEndBattle diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index 14b6895d..bbb64272 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -13,8 +13,7 @@ VictoryRoad3Script_44996: ; 44996 (11:4996) bit 5, [hl] res 5, [hl] ret z - ld hl, wd813 - bit 0, [hl] + CheckEventHL EVENT_660 ret z ld a, $1d ld [wd09f], a @@ -39,13 +38,10 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) jr nz, .asm_449dc ld hl, wd126 set 5, [hl] - ld hl, wd813 - set 0, [hl] + SetEvent EVENT_660 ret .asm_449dc - ld hl, wd813 - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_666 jr nz, .asm_449fe ld a, HS_VICTORY_ROAD_3_BOULDER ld [wcc4d], a @@ -92,36 +88,36 @@ VictoryRoad3TextPointers: ; 44a24 (11:4a24) VictoryRoad3TrainerHeaders: ; 44a38 (11:4a38) VictoryRoad3TrainerHeader0: ; 44a38 (11:4a38) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 db ($1 << 4) ; trainer's view range - dw wd813 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 dw VictoryRoad3BattleText2 ; TextBeforeBattle dw VictoryRoad3AfterBattleText2 ; TextAfterBattle dw VictoryRoad3EndBattleText2 ; TextEndBattle dw VictoryRoad3EndBattleText2 ; TextEndBattle VictoryRoad3TrainerHeader2: ; 44a44 (11:4a44) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd813 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 dw VictoryRoad3BattleText3 ; TextBeforeBattle dw VictoryRoad3AfterBattleText3 ; TextAfterBattle dw VictoryRoad3EndBattleText3 ; TextEndBattle dw VictoryRoad3EndBattleText3 ; TextEndBattle VictoryRoad3TrainerHeader3: ; 44a50 (11:4a50) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd813 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 dw VictoryRoad3BattleText4 ; TextBeforeBattle dw VictoryRoad3AfterBattleText4 ; TextAfterBattle dw VictoryRoad3EndBattleText4 ; TextEndBattle dw VictoryRoad3EndBattleText4 ; TextEndBattle VictoryRoad3TrainerHeader4: ; 44a5c (11:4a5c) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd813 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 dw VictoryRoad3BattleText5 ; TextBeforeBattle dw VictoryRoad3AfterBattleText5 ; TextAfterBattle dw VictoryRoad3EndBattleText5 ; TextEndBattle diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index c358e961..f7884c9b 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -15,14 +15,12 @@ ViridianCityScript0: ; 19005 (6:5005) jp ViridianCityScript_1903d ViridianCityScript_1900b: ; 1900b (6:500b) - ld a, [wd74c] - bit 0, a + CheckEvent EVENT_028 ret nz ld a, [W_OBTAINEDBADGES] cp %01111111 jr nz, .asm_1901e - ld hl, wd74c - set 0, [hl] + SetEvent EVENT_028 ret .asm_1901e ld a, [W_YCOORD] @@ -42,8 +40,7 @@ ViridianCityScript_1900b: ; 1900b (6:500b) ret ViridianCityScript_1903d: ; 1903d (6:503d) - ld a, [wd74b] - bit 5, a + CheckEvent EVENT_GOT_POKEDEX ret nz ld a, [W_YCOORD] cp $9 @@ -154,8 +151,7 @@ ViridianCityText2: ; 19107 (6:5107) cp %01111111 ld hl, ViridianCityText_19127 jr z, .asm_ae9fe - ld a, [wd751] - bit 1, a + CheckEvent EVENT_051 jr nz, .asm_ae9fe ld hl, ViridianCityText_19122 .asm_ae9fe @@ -201,8 +197,7 @@ ViridianCityText_19157: ; 19157 (6:5157) ViridianCityText4: ; 1915c (6:515c) TX_ASM - ld a, [wd74b] - bit 5, a + CheckEvent EVENT_GOT_POKEDEX jr nz, .asm_83894 ld hl, ViridianCityText_19175 call PrintText @@ -236,8 +231,7 @@ ViridianCityText_19191: ; 19191 (6:5191) ViridianCityText6: ; 19196 (6:5196) TX_ASM - ld a, [wd74c] - bit 1, a + CheckEvent EVENT_029 jr nz, .asm_4e5a0 ld hl, ViridianCityText_191ca call PrintText @@ -246,8 +240,7 @@ ViridianCityText6: ; 19196 (6:5196) jr nc, .BagFull ld hl, ReceivedTM42Text call PrintText - ld hl, wd74c - set 1, [hl] + SetEvent EVENT_029 jr .asm_3c73c .BagFull ld hl, TM42NoRoomText diff --git a/scripts/viridianforest.asm b/scripts/viridianforest.asm index 554c2125..892eeef2 100755 --- a/scripts/viridianforest.asm +++ b/scripts/viridianforest.asm @@ -30,27 +30,27 @@ ViridianForestTextPointers: ; 61126 (18:5126) ViridianForestTrainerHeaders: ; 61142 (18:5142) ViridianForestTrainerHeader0: ; 61142 (18:5142) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7f3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 dw ViridianForestBattleText1 ; TextBeforeBattle dw ViridianForestAfterBattleText1 ; TextAfterBattle dw ViridianForestEndBattleText1 ; TextEndBattle dw ViridianForestEndBattleText1 ; TextEndBattle ViridianForestTrainerHeader1: ; 6114e (18:514e) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7f3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 dw ViridianForestBattleText2 ; TextBeforeBattle dw ViridianForestAfterBattleText2 ; TextAfterBattle dw ViridianForestEndBattleText2 ; TextEndBattle dw ViridianForestEndBattleText2 ; TextEndBattle ViridianForestTrainerHeader2: ; 6115a (18:515a) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 db ($1 << 4) ; trainer's view range - dw wd7f3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 dw ViridianForestBattleText3 ; TextBeforeBattle dw ViridianForestAfterBattleText3 ; TextAfterBattle dw ViridianForestEndBattleText3 ; TextEndBattle diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 40484d21..9047b80a 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -140,16 +140,14 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, $c ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd751 - set 1, [hl] + SetEvent EVENT_051 ld bc, (TM_27 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $d ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd751 - set 0, [hl] + SetEvent EVENT_050 jr .asm_749be .BagFull ld a, $e @@ -162,19 +160,12 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) set 7, [hl] ; deactivate gym trainers - ld a, [wd751] - or %11111100 - ld [wd751], a - ld a, [wd752] - or %00000011 - ld [wd752], a + SetEventRange EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0, EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7 ld a, HS_ROUTE_22_RIVAL_2 ld [wcc4d], a predef ShowObject - ld hl, wd7eb - set 1, [hl] - set 7, [hl] + SetEvents EVENT_521, EVENT_527 jp ViridianGymScript_748d6 ViridianGymTextPointers: ; 749ec (1d:49ec) @@ -195,72 +186,72 @@ ViridianGymTextPointers: ; 749ec (1d:49ec) ViridianGymTrainerHeaders: ; 74a08 (1d:4a08) ViridianGymTrainerHeader0: ; 74a08 (1d:4a08) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 dw ViridianGymBattleText1 ; TextBeforeBattle dw ViridianGymAfterBattleText1 ; TextAfterBattle dw ViridianGymEndBattleText1 ; TextEndBattle dw ViridianGymEndBattleText1 ; TextEndBattle ViridianGymTrainerHeader1: ; 74a14 (1d:4a14) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 dw ViridianGymBattleText2 ; TextBeforeBattle dw ViridianGymAfterBattleText2 ; TextAfterBattle dw ViridianGymEndBattleText2 ; TextEndBattle dw ViridianGymEndBattleText2 ; TextEndBattle ViridianGymTrainerHeader2: ; 74a20 (1d:4a20) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 dw ViridianGymBattleText3 ; TextBeforeBattle dw ViridianGymAfterBattleText3 ; TextAfterBattle dw ViridianGymEndBattleText3 ; TextEndBattle dw ViridianGymEndBattleText3 ; TextEndBattle ViridianGymTrainerHeader3: ; 74a2c (1d:4a2c) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 dw ViridianGymBattleText4 ; TextBeforeBattle dw ViridianGymAfterBattleText4 ; TextAfterBattle dw ViridianGymEndBattleText4 ; TextEndBattle dw ViridianGymEndBattleText4 ; TextEndBattle ViridianGymTrainerHeader4: ; 74a38 (1d:4a38) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 dw ViridianGymBattleText5 ; TextBeforeBattle dw ViridianGymAfterBattleText5 ; TextAfterBattle dw ViridianGymEndBattleText5 ; TextEndBattle dw ViridianGymEndBattleText5 ; TextEndBattle ViridianGymTrainerHeader5: ; 74a44 (1d:4a44) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 dw ViridianGymBattleText6 ; TextBeforeBattle dw ViridianGymAfterBattleText6 ; TextAfterBattle dw ViridianGymEndBattleText6 ; TextEndBattle dw ViridianGymEndBattleText6 ; TextEndBattle ViridianGymTrainerHeader6: ; 74a50 (1d:4a50) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1 db ($3 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1 dw ViridianGymBattleText7 ; TextBeforeBattle dw ViridianGymAfterBattleText7 ; TextAfterBattle dw ViridianGymEndBattleText7 ; TextEndBattle dw ViridianGymEndBattleText7 ; TextEndBattle ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1 dw ViridianGymBattleText8 ; TextBeforeBattle dw ViridianGymAfterBattleText8 ; TextAfterBattle dw ViridianGymEndBattleText8 ; TextEndBattle @@ -270,10 +261,9 @@ ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) ViridianGymText1: ; 74a69 (1d:4a69) TX_ASM - ld a, [wd751] - bit 1, a + CheckEvent EVENT_051 jr z, .asm_6de66 - bit 0, a + CheckEventReuseA EVENT_050 jr nz, .asm_9fc95 call z, ViridianGymScript3_74995 call DisableWaitingAfterTextDisplay @@ -485,8 +475,7 @@ ViridianGymAfterBattleText8: ; 74bb6 (1d:4bb6) ViridianGymText10: ; 74bbb (1d:4bbb) TX_ASM - ld a, [wd751] - bit 1, a + CheckEvent EVENT_051 jr nz, .asm_1abd1 ld hl, ViridianGymText_74bd4 call PrintText diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index b6621684..7008ba5b 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -6,8 +6,7 @@ ViridianMartScript: ; 1d46e (7:546e) jp CallFunctionInTable ViridianMartScript_1d47d: ; 1d47d (7:547d) - ld a, [wd74e] - bit 0, a + CheckEvent EVENT_038 jr nz, .asm_1d489 ld hl, ViridianMartTextPointers jr .asm_1d48c @@ -55,8 +54,7 @@ ViridianMartScript1: ; 1d4c0 (7:54c0) call DisplayTextID ld bc, (OAKS_PARCEL << 8) + 1 call GiveItem - ld hl, wd74e - set 1, [hl] + SetEvent EVENT_039 ld a, $2 ld [W_VIRIDIANMARKETCURSCRIPT], a ; fallthrough diff --git a/wram.asm b/wram.asm index b43f3845..767cc0d4 100755 --- a/wram.asm +++ b/wram.asm @@ -2575,142 +2575,9 @@ wCardKeyDoorX:: ; d740 wd743:: ds 1 ; used with surge gym trash cans wd744:: ds 3 ; also used with surge gym trash cans -wd747:: ds 3 ; and we're getting to flags, which I'm not going to bother commenting -wd74a:: ds 1 - -wd74b:: ; d74b -; bit 0: Prof. Oak has lead the player to the north end of his lab -; bit 1: Prof. Oak has asked the player to choose a pokemon -; bit 2: the player and the rival have received their pokemon -; bit 3: the player has battled the rival in Oak's lab -; bit 4: Prof. Oak has given the player 5 pokeballs -; bit 5: received pokedex - ds 1 - -wd74c:: ds 2 -wd74e:: ds 3 -wd751:: ds 1 -wd752:: ds 2 -wd754:: ds 1 -wd755:: ds 5 -wd75a:: ds 1 -wd75b:: ds 3 -wd75e:: ds 1 -wd75f:: ds 5 -wd764:: ds 1 -wd765:: ds 1 -wd766:: ds 1 -wd767:: ds 1 -wd768:: ds 1 -wd769:: ds 3 -wd76c:: ds 5 -wd771:: ds 2 -wd773:: ds 4 -wd777:: ds 1 -wd778:: ds 4 -wd77c:: ds 1 -wd77d:: ds 1 -wd77e:: ds 5 -wd783:: ds 11 -wd78e:: ds 2 -wd790:: ds 2 -wd792:: ds 4 -wd796:: ds 2 -wd798:: ds 2 -wd79a:: ds 1 -wd79b:: ds 1 -wd79c:: ds 5 -wd7a1:: ds 2 -wd7a3:: ds 12 -wd7af:: ds 2 -wd7b1:: ds 2 -wd7b3:: ds 1 -wd7b4:: ds 5 -wd7b9:: ds 4 -wd7bd:: ds 2 -wd7bf:: ds 3 -wd7c2:: ds 1 -wd7c3:: ds 2 -wd7c5:: ds 1 -wd7c6:: ds 3 -wd7c9:: ds 4 -wd7cd:: ds 2 -wd7cf:: ds 2 -wd7d1:: ds 1 -wd7d2:: ds 1 -wd7d3:: ds 2 -wd7d5:: ds 1 -wd7d6:: ds 1 -wd7d7:: ds 1 -wd7d8:: ds 1 -wd7d9:: ds 2 -wd7db:: ds 2 -wd7dd:: ds 2 -wd7df:: ds 1 -wd7e0:: ds 1 -wd7e1:: ds 2 -wd7e3:: ds 2 -wd7e5:: ds 2 -wd7e7:: ds 1 -wd7e8:: ds 1 -wd7e9:: ds 2 -wd7eb:: ds 2 -wd7ed:: ds 1 -wd7ee:: ds 1 -wd7ef:: ds 1 -wd7f0:: ds 1 -wd7f1:: ds 1 -wd7f2:: ds 1 -wd7f3:: ds 2 -wd7f5:: ds 1 -wd7f6:: ds 9 -wd7ff:: ds 4 -wd803:: ds 2 -wd805:: ds 2 -wd807:: ds 2 -wd809:: ds 10 -wd813:: ds 2 -wd815:: ds 1 -wd816:: ds 1 -wd817:: ds 2 -wd819:: ds 2 -wd81b:: ds 10 -wd825:: ds 1 -wd826:: ds 1 -wd827:: ds 1 -wd828:: ds 1 -wd829:: ds 1 -wd82a:: ds 1 -wd82b:: ds 1 -wd82c:: ds 1 -wd82d:: ds 1 -wd82e:: ds 1 -wd82f:: ds 1 -wd830:: ds 1 -wd831:: ds 1 -wd832:: ds 1 -wd833:: ds 1 -wd834:: ds 1 -wd835:: ds 1 -wd836:: ds 1 -wd837:: ds 1 -wd838:: ds 15 -wd847:: ds 2 -wd849:: ds 2 -wd84b:: ds 12 -wd857:: ds 8 -wd85f:: ds 4 -wd863:: ds 1 -wd864:: ds 1 -wd865:: ds 1 -wd866:: ds 1 -wd867:: ds 2 -wd869:: ds 20 -wd87d:: ds 2 -wd87f:: ds 1 -wd880:: ds 1 -wd881:: ds 1 -wd882:: ds 5 + +wEventFlags:: ; d747 + ds 320 wLinkEnemyTrainerName:: ; d887 ; linked game's trainer name -- cgit v1.3.1-sl0p From 73171bfff573fa8900563319c014f3e626db6b3e Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 10:36:03 -0700 Subject: named most of the used events --- constants/event_constants.asm | 268 +++++++++++++++++------------------ constants/event_macros.asm | 24 +++- constants/hide_show_constants.asm | 2 +- engine/hidden_object_functions18.asm | 2 +- engine/hidden_object_functions7.asm | 8 +- engine/items/items.asm | 2 +- engine/menu/bills_pc.asm | 2 +- engine/menu/pc.asm | 2 +- engine/overworld/cinnabar_lab.asm | 2 +- main.asm | 2 +- scripts/agatha.asm | 2 +- scripts/bikeshop.asm | 6 +- scripts/billshouse.asm | 12 +- scripts/blueshouse.asm | 6 +- scripts/bruno.asm | 2 +- scripts/celadoncity.asm | 4 +- scripts/celadondiner.asm | 4 +- scripts/celadongamecorner.asm | 16 +-- scripts/celadonmart3.asm | 4 +- scripts/celadonmartroof.asm | 12 +- scripts/ceruleancity.asm | 12 +- scripts/cinnabarisland.asm | 4 +- scripts/copycatshouse2f.asm | 4 +- scripts/fanclub.asm | 12 +- scripts/fightingdojo.asm | 18 +-- scripts/fuchsiacity.asm | 4 +- scripts/fuchsiahouse2.asm | 8 +- scripts/gary.asm | 4 +- scripts/halloffameroom.asm | 2 +- scripts/indigoplateaulobby.asm | 4 +- scripts/lab3.asm | 4 +- scripts/lab4.asm | 8 +- scripts/lance.asm | 8 +- scripts/lavenderhouse1.asm | 8 +- scripts/lavenderhouse2.asm | 2 +- scripts/lavendermart.asm | 2 +- scripts/lorelei.asm | 2 +- scripts/mansion1.asm | 6 +- scripts/mansion2.asm | 6 +- scripts/mansion3.asm | 2 +- scripts/mansion4.asm | 2 +- scripts/mtmoon3.asm | 16 +-- scripts/museum1f.asm | 10 +- scripts/oakslab.asm | 34 ++--- scripts/pallettown.asm | 15 +- scripts/pewtercity.asm | 2 +- scripts/pewtergym.asm | 2 +- scripts/pokemontower2.asm | 13 +- scripts/pokemontower5.asm | 4 +- scripts/pokemontower6.asm | 4 +- scripts/pokemontower7.asm | 4 +- scripts/rockethideout4.asm | 13 +- scripts/route1.asm | 2 +- scripts/route11gateupstairs.asm | 4 +- scripts/route12gateupstairs.asm | 4 +- scripts/route15gateupstairs.asm | 4 +- scripts/route16house.asm | 4 +- scripts/route20.asm | 6 +- scripts/route22.asm | 18 +-- scripts/route23.asm | 24 ++-- scripts/route24.asm | 14 +- scripts/route25.asm | 10 +- scripts/route2gate.asm | 4 +- scripts/safarizonesecrethouse.asm | 4 +- scripts/saffronhouse2.asm | 4 +- scripts/seafoamislands1.asm | 8 +- scripts/seafoamislands2.asm | 6 +- scripts/seafoamislands3.asm | 6 +- scripts/seafoamislands4.asm | 10 +- scripts/seafoamislands5.asm | 4 +- scripts/silphco1.asm | 6 +- scripts/silphco10.asm | 6 +- scripts/silphco11.asm | 12 +- scripts/silphco2.asm | 14 +- scripts/silphco3.asm | 12 +- scripts/silphco4.asm | 10 +- scripts/silphco5.asm | 14 +- scripts/silphco6.asm | 6 +- scripts/silphco7.asm | 26 ++-- scripts/silphco8.asm | 6 +- scripts/silphco9.asm | 20 +-- scripts/ssanne7.asm | 8 +- scripts/vermilioncity.asm | 4 +- scripts/vermiliondock.asm | 12 +- scripts/victoryroad1.asm | 6 +- scripts/victoryroad2.asm | 14 +- scripts/victoryroad3.asm | 6 +- scripts/viridiancity.asm | 8 +- scripts/viridiangym.asm | 2 +- scripts/viridianmart.asm | 4 +- 90 files changed, 485 insertions(+), 468 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/constants/event_constants.asm b/constants/event_constants.asm index 072a90b8..c5ca0b39 100755 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -1,12 +1,12 @@ const_value = 0 - const EVENT_STOPPED_FROM_LEAVING_PALLET + const EVENT_FOLLOWED_OAK_INTO_LAB const EVENT_001 const EVENT_002 const EVENT_003 const EVENT_004 const EVENT_005 - const EVENT_006 + const EVENT_PALLET_AFTER_GETTING_POKEBALLS const EVENT_007 const EVENT_008 const EVENT_009 @@ -24,24 +24,24 @@ const_value = 0 const EVENT_015 const EVENT_016 const EVENT_017 - const EVENT_018 - const EVENT_019 - const EVENT_01A + const EVENT_GOT_TOWN_MAP + const EVENT_ENTERED_BLUES_HOUSE + const EVENT_DAISY_WALKING const EVENT_01B const EVENT_01C const EVENT_01D const EVENT_01E const EVENT_01F - const EVENT_FOLLOWED_OAK_INSIDE_LAB + const EVENT_FOLLOWED_OAK_INTO_LAB_2 const EVENT_OAK_ASKED_TO_CHOOSE_MON const EVENT_GOT_STARTER const EVENT_BATTLED_RIVAL_IN_OAKS_LAB const EVENT_GOT_POKEBALLS_FROM_OAK const EVENT_GOT_POKEDEX - const EVENT_026 - const EVENT_027 - const EVENT_028 - const EVENT_029 + const EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 + const EVENT_OAK_APPEARED_IN_PALLET + const EVENT_VIRIDIAN_GYM_OPEN + const EVENT_GOT_TM42 const EVENT_02A const EVENT_02B const EVENT_02C @@ -56,8 +56,8 @@ const_value = 0 const EVENT_035 const EVENT_036 const EVENT_037 - const EVENT_038 - const EVENT_039 + const EVENT_OAK_GOT_PARCEL + const EVENT_GOT_OAKS_PARCEL const EVENT_03A const EVENT_03B const EVENT_03C @@ -104,8 +104,8 @@ const_value = 0 const EVENT_065 const EVENT_066 const EVENT_067 - const EVENT_068 - const EVENT_069 + const EVENT_BOUGHT_MUSEUM_TICKET + const EVENT_GOT_OLD_AMBER const EVENT_06A const EVENT_06B const EVENT_06C @@ -152,7 +152,7 @@ const_value = 0 const EVENT_095 const EVENT_096 const EVENT_097 - const EVENT_098 + const EVENT_BEAT_CERULEAN_RIVAL const EVENT_099 const EVENT_09A const EVENT_09B @@ -167,7 +167,7 @@ const_value = 0 const EVENT_0A4 const EVENT_0A5 const EVENT_0A6 - const EVENT_0A7 + const EVENT_BEAT_CERULEAN_ROCKET_THIEF const EVENT_0A8 const EVENT_0A9 const EVENT_0AA @@ -192,7 +192,7 @@ const_value = 0 const EVENT_0BD const EVENT_GOT_TM11 const EVENT_BEAT_MISTY - const EVENT_0C0 + const EVENT_GOT_BICYCLE const EVENT_0C1 const EVENT_0C2 const EVENT_0C3 @@ -238,8 +238,8 @@ const_value = 0 const EVENT_0EB const EVENT_0EC const EVENT_0ED - const EVENT_0EE - const EVENT_0EF + const EVENT_POKEMON_TOWER_RIVAL_ON_LEFT + const EVENT_BEAT_POKEMON_TOWER_RIVAL const EVENT_0F0 const EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 const EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 @@ -263,7 +263,7 @@ const_value = 0 const EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 const EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 const EVENT_106 - const EVENT_107 + const EVENT_IN_PURIFIED_ZONE const EVENT_108 const EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 const EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 @@ -271,7 +271,7 @@ const_value = 0 const EVENT_10C const EVENT_10D const EVENT_10E - const EVENT_10F + const EVENT_BEAT_GHOST_MAROWAK const EVENT_110 const EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 const EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 @@ -279,7 +279,7 @@ const_value = 0 const EVENT_114 const EVENT_115 const EVENT_116 - const EVENT_117 + const EVENT_RESCUED_MR_FUJI_2 const EVENT_118 const EVENT_119 const EVENT_11A @@ -296,7 +296,7 @@ const_value = 0 const EVENT_125 const EVENT_126 const EVENT_127 - const EVENT_128 + const EVENT_GOT_POKE_FLUTE const EVENT_129 const EVENT_12A const EVENT_12B @@ -342,8 +342,8 @@ const_value = 0 const EVENT_153 const EVENT_154 const EVENT_155 - const EVENT_156 - const EVENT_157 + const EVENT_SEEL_FAN_BOAST + const EVENT_PIKACHU_FAN_BOAST const EVENT_158 const EVENT_159 const EVENT_15A @@ -384,7 +384,7 @@ const_value = 0 const EVENT_17D const EVENT_17E const EVENT_17F - const EVENT_180 + const EVENT_GOT_TM41 const EVENT_181 const EVENT_182 const EVENT_183 @@ -396,10 +396,10 @@ const_value = 0 const EVENT_189 const EVENT_18A const EVENT_18B - const EVENT_18C - const EVENT_18D - const EVENT_18E - const EVENT_18F + const EVENT_GOT_TM13 + const EVENT_GOT_TM48 + const EVENT_GOT_TM49 + const EVENT_GOT_TM18 const EVENT_190 const EVENT_191 const EVENT_192 @@ -441,10 +441,10 @@ const_value = 0 const EVENT_1B6 const EVENT_1B7 const EVENT_1B8 - const EVENT_1B9 - const EVENT_1BA - const EVENT_1BB - const EVENT_1BC + const EVENT_FOUND_ROCKET_HIDEOUT + const EVENT_GOT_10_COINS + const EVENT_GOT_20_COINS + const EVENT_GOT_20_COINS_2 const EVENT_1BD const EVENT_1BE const EVENT_1BF @@ -480,7 +480,7 @@ const_value = 0 const EVENT_1DD const EVENT_1DE const EVENT_1DF - const EVENT_1E0 + const EVENT_GOT_COIN_CASE const EVENT_1E1 const EVENT_1E2 const EVENT_1E3 @@ -568,8 +568,8 @@ const_value = 0 const EVENT_235 const EVENT_236 const EVENT_237 - const EVENT_238 - const EVENT_239 + const EVENT_GOT_HM04 + const EVENT_GAVE_GOLD_TEETH const EVENT_23A const EVENT_23B const EVENT_23C @@ -632,7 +632,7 @@ const_value = 0 const EVENT_275 const EVENT_276 const EVENT_277 - const EVENT_278 + const EVENT_MANSION_SWITCH_ON const EVENT_279 const EVENT_27A const EVENT_27B @@ -727,7 +727,7 @@ const_value = 0 const EVENT_2D4 const EVENT_2D5 const EVENT_2D6 - const EVENT_2D7 + const EVENT_GOT_TM35 const EVENT_2D8 const EVENT_2D9 const EVENT_2DA @@ -736,9 +736,9 @@ const_value = 0 const EVENT_2DD const EVENT_2DE const EVENT_2DF - const EVENT_2E0 - const EVENT_2E1 - const EVENT_2E2 + const EVENT_GAVE_FOSSIL_TO_LAB + const EVENT_LAB_STILL_REVIVING_FOSSIL + const EVENT_LAB_HANDING_OVER_FOSSIL_MON const EVENT_2E3 const EVENT_2E4 const EVENT_2E5 @@ -832,7 +832,7 @@ const_value = 0 const EVENT_33D const EVENT_33E const EVENT_33F - const EVENT_340 + const EVENT_GOT_TM31 const EVENT_341 const EVENT_342 const EVENT_343 @@ -848,14 +848,14 @@ const_value = 0 const EVENT_34D const EVENT_34E const EVENT_34F - const EVENT_350 - const EVENT_351 + const EVENT_DEFEATED_FIGHTING_DOJO + const EVENT_BEAT_KARATE_MASTER const EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 const EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 const EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 const EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 - const EVENT_356 - const EVENT_357 + const EVENT_GOT_HITMONLEE + const EVENT_GOT_HITMONCHAN const EVENT_358 const EVENT_359 const EVENT_35A @@ -919,7 +919,7 @@ const_value = 0 const EVENT_394 const EVENT_395 const EVENT_396 - const EVENT_397 + const EVENT_SILPH_CO_RECEPTIONIST_AT_DESK const EVENT_398 const EVENT_399 const EVENT_39A @@ -944,7 +944,7 @@ const_value = 0 const EVENT_3AD const EVENT_3AE const EVENT_3AF - const EVENT_3B0 + const EVENT_GOT_TM29 const EVENT_3B1 const EVENT_3B2 const EVENT_3B3 @@ -960,7 +960,7 @@ const_value = 0 const EVENT_3BD const EVENT_3BE const EVENT_3BF - const EVENT_3C0 + const EVENT_GOT_POTION_SAMPLE const EVENT_3C1 const EVENT_3C2 const EVENT_3C3 @@ -984,7 +984,7 @@ const_value = 0 const EVENT_3D5 const EVENT_3D6 const EVENT_3D7 - const EVENT_3D8 + const EVENT_GOT_HM05 const EVENT_3D9 const EVENT_3DA const EVENT_3DB @@ -1151,8 +1151,8 @@ const_value = 0 const EVENT_47C const EVENT_47D const EVENT_47E - const EVENT_47F - const EVENT_480 + const EVENT_GOT_ITEMFINDER + const EVENT_GOT_TM39 const EVENT_481 const EVENT_BEAT_ROUTE_12_TRAINER_0 const EVENT_BEAT_ROUTE_12_TRAINER_1 @@ -1200,7 +1200,7 @@ const_value = 0 const EVENT_4AD const EVENT_4AE const EVENT_4AF - const EVENT_4B0 + const EVENT_GOT_EXP_ALL const EVENT_BEAT_ROUTE_15_TRAINER_0 const EVENT_BEAT_ROUTE_15_TRAINER_1 const EVENT_BEAT_ROUTE_15_TRAINER_2 @@ -1230,8 +1230,8 @@ const_value = 0 const EVENT_4CB const EVENT_4CC const EVENT_4CD - const EVENT_4CE - const EVENT_4CF + const EVENT_GOT_HM02 + const EVENT_RESCUED_MR_FUJI const EVENT_4D0 const EVENT_BEAT_ROUTE_17_TRAINER_0 const EVENT_BEAT_ROUTE_17_TRAINER_1 @@ -1280,7 +1280,7 @@ const_value = 0 const EVENT_4FD const EVENT_4FE const EVENT_4FF - const EVENT_500 + const EVENT_IN_SEAFOAM_ISLANDS const EVENT_BEAT_ROUTE_20_TRAINER_0 const EVENT_BEAT_ROUTE_20_TRAINER_2 const EVENT_BEAT_ROUTE_20_TRAINER_3 @@ -1294,8 +1294,8 @@ const_value = 0 const EVENT_50B const EVENT_50C const EVENT_50D - const EVENT_50E - const EVENT_50F + const EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE + const EVENT_SEAFOAM1_BOULDER2_DOWN_HOLE const EVENT_510 const EVENT_BEAT_ROUTE_21_TRAINER_0 const EVENT_BEAT_ROUTE_21_TRAINER_1 @@ -1312,14 +1312,14 @@ const_value = 0 const EVENT_51D const EVENT_51E const EVENT_51F - const EVENT_520 - const EVENT_521 + const EVENT_1ST_ROUTE22_RIVAL_BATTLE + const EVENT_2ND_ROUTE22_RIVAL_BATTLE const EVENT_522 const EVENT_523 const EVENT_524 - const EVENT_525 - const EVENT_526 - const EVENT_527 + const EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT + const EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT + const EVENT_ROUTE22_RIVAL_WANTS_FIGHT const EVENT_528 const EVENT_529 const EVENT_52A @@ -1328,24 +1328,24 @@ const_value = 0 const EVENT_52D const EVENT_52E const EVENT_52F - const EVENT_530 - const EVENT_531 - const EVENT_532 - const EVENT_533 - const EVENT_534 - const EVENT_535 - const EVENT_536 + const EVENT_PASSED_CASCADEBADGE_CHECK + const EVENT_PASSED_THUNDERBADGE_CHECK + const EVENT_PASSED_RAINBOWBADGE_CHECK + const EVENT_PASSED_SOULBADGE_CHECK + const EVENT_PASSED_MARSHBADGE_CHECK + const EVENT_PASSED_VOLCANOBADGE_CHECK + const EVENT_PASSED_EARTHBADGE_CHECK const EVENT_537 - const EVENT_538 + const EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 - const EVENT_53F - const EVENT_540 - const EVENT_541 + const EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 + const EVENT_GOT_NUGGET + const EVENT_BEAT_ROUTE24_ROCKET const EVENT_BEAT_ROUTE_24_TRAINER_0 const EVENT_BEAT_ROUTE_24_TRAINER_2 const EVENT_BEAT_ROUTE_24_TRAINER_3 @@ -1353,14 +1353,14 @@ const_value = 0 const EVENT_BEAT_ROUTE_24_TRAINER_5 const EVENT_BEAT_ROUTE_24_TRAINER_6 const EVENT_548 - const EVENT_549 + const EVENT_NUGGET_REWARD_AVAILABLE const EVENT_54A const EVENT_54B const EVENT_54C const EVENT_54D const EVENT_54E const EVENT_54F - const EVENT_550 + const EVENT_MET_BILL const EVENT_BEAT_ROUTE_25_TRAINER_0 const EVENT_BEAT_ROUTE_25_TRAINER_2 const EVENT_BEAT_ROUTE_25_TRAINER_3 @@ -1371,11 +1371,11 @@ const_value = 0 const EVENT_BEAT_ROUTE_25_TRAINER_8 const EVENT_BEAT_ROUTE_25_TRAINER_9 const EVENT_55A - const EVENT_55B - const EVENT_55C - const EVENT_55D - const EVENT_55E - const EVENT_55F + const EVENT_USED_CELL_SEPARATOR_ON_BILL + const EVENT_GOT_SS_TICKET + const EVENT_MET_BILL_2 + const EVENT_BILL_SAID_USE_CELL_SEPARATOR + const EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING const EVENT_560 const EVENT_561 const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 @@ -1401,13 +1401,13 @@ const_value = 0 const EVENT_BEAT_MT_MOON_1_TRAINER_6 const EVENT_BEAT_MT_MOON_1_TRAINER_7 const EVENT_578 - const EVENT_579 + const EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD const EVENT_BEAT_MT_MOON_3_TRAINER_0 const EVENT_BEAT_MT_MOON_3_TRAINER_2 const EVENT_BEAT_MT_MOON_3_TRAINER_3 const EVENT_BEAT_MT_MOON_3_TRAINER_4 - const EVENT_57E - const EVENT_57F + const EVENT_GOT_DOME_FOSSIL + const EVENT_GOT_HELIX_FOSSIL const EVENT_580 const EVENT_581 const EVENT_582 @@ -1504,12 +1504,12 @@ const_value = 0 const EVENT_5DD const EVENT_5DE const EVENT_5DF - const EVENT_5E0 - const EVENT_5E1 + const EVENT_GOT_HM01 + const EVENT_RUBBED_CAPTAINS_BACK const EVENT_SS_ANNE_LEFT - const EVENT_5E3 - const EVENT_5E4 - const EVENT_5E5 + const EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT + const EVENT_STARTED_WALKING_OUT_OF_DOCK + const EVENT_WALKED_OUT_OF_DOCK const EVENT_5E6 const EVENT_5E7 const EVENT_5E8 @@ -1632,13 +1632,13 @@ const_value = 0 const EVENT_65D const EVENT_65E const EVENT_65F - const EVENT_660 + const EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 const EVENT_665 - const EVENT_666 + const EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2 const EVENT_667 const EVENT_668 const EVENT_669 @@ -1701,9 +1701,9 @@ const_value = 0 const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 - const EVENT_6A5 - const EVENT_6A6 - const EVENT_6A7 + const EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED + const EVENT_ROCKET_DROPPED_LIFT_KEY + const EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI const EVENT_6A8 const EVENT_6A9 const EVENT_6AA @@ -1789,9 +1789,9 @@ const_value = 0 const EVENT_6FA const EVENT_6FB const EVENT_6FC - const EVENT_6FD - const EVENT_6FE - const EVENT_6FF + const EVENT_SILPH_CO_2_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_2_UNLOCKED_DOOR2 + const EVENT_GOT_TM36 const EVENT_700 const EVENT_701 const EVENT_BEAT_SILPH_CO_3F_TRAINER_0 @@ -1800,8 +1800,8 @@ const_value = 0 const EVENT_705 const EVENT_706 const EVENT_707 - const EVENT_708 - const EVENT_709 + const EVENT_SILPH_CO_3_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_3_UNLOCKED_DOOR2 const EVENT_70A const EVENT_70B const EVENT_70C @@ -1816,8 +1816,8 @@ const_value = 0 const EVENT_715 const EVENT_716 const EVENT_717 - const EVENT_718 - const EVENT_719 + const EVENT_SILPH_CO_4_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_4_UNLOCKED_DOOR2 const EVENT_71A const EVENT_71B const EVENT_71C @@ -1832,9 +1832,9 @@ const_value = 0 const EVENT_BEAT_SILPH_CO_5F_TRAINER_4 const EVENT_726 const EVENT_727 - const EVENT_728 - const EVENT_729 - const EVENT_72A + const EVENT_SILPH_CO_5_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_5_UNLOCKED_DOOR2 + const EVENT_SILPH_CO_5_UNLOCKED_DOOR3 const EVENT_72B const EVENT_72C const EVENT_72D @@ -1855,8 +1855,8 @@ const_value = 0 const EVENT_73C const EVENT_73D const EVENT_73E - const EVENT_73F - const EVENT_740 + const EVENT_SILPH_CO_6_UNLOCKED_DOOR + const EVENT_BEAT_SILPH_CO_RIVAL const EVENT_741 const EVENT_742 const EVENT_743 @@ -1868,9 +1868,9 @@ const_value = 0 const EVENT_749 const EVENT_74A const EVENT_74B - const EVENT_74C - const EVENT_74D - const EVENT_74E + const EVENT_SILPH_CO_7_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_7_UNLOCKED_DOOR2 + const EVENT_SILPH_CO_7_UNLOCKED_DOOR3 const EVENT_74F const EVENT_750 const EVENT_751 @@ -1880,7 +1880,7 @@ const_value = 0 const EVENT_755 const EVENT_756 const EVENT_757 - const EVENT_758 + const EVENT_SILPH_CO_8_UNLOCKED_DOOR const EVENT_759 const EVENT_75A const EVENT_75B @@ -1896,10 +1896,10 @@ const_value = 0 const EVENT_765 const EVENT_766 const EVENT_767 - const EVENT_768 - const EVENT_769 - const EVENT_76A - const EVENT_76B + const EVENT_SILPH_CO_9_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_9_UNLOCKED_DOOR2 + const EVENT_SILPH_CO_9_UNLOCKED_DOOR3 + const EVENT_SILPH_CO_9_UNLOCKED_DOOR4 const EVENT_76C const EVENT_76D const EVENT_76E @@ -1912,7 +1912,7 @@ const_value = 0 const EVENT_775 const EVENT_776 const EVENT_777 - const EVENT_778 + const EVENT_SILPH_CO_10_UNLOCKED_DOOR const EVENT_779 const EVENT_77A const EVENT_77B @@ -1928,14 +1928,14 @@ const_value = 0 const EVENT_BEAT_SILPH_CO_11F_TRAINER_1 const EVENT_786 const EVENT_787 - const EVENT_788 + const EVENT_SILPH_CO_11_UNLOCKED_DOOR const EVENT_789 const EVENT_78A const EVENT_78B const EVENT_78C - const EVENT_78D + const EVENT_GOT_MASTER_BALL const EVENT_78E - const EVENT_78F + const EVENT_BEAT_SILPH_CO_GIOVANNI const EVENT_790 const EVENT_791 const EVENT_792 @@ -2176,7 +2176,7 @@ const_value = 0 const EVENT_87D const EVENT_87E const EVENT_87F - const EVENT_880 + const EVENT_GOT_HM03 const EVENT_881 const EVENT_882 const EVENT_883 @@ -2272,13 +2272,13 @@ const_value = 0 const EVENT_8DD const EVENT_8DE const EVENT_8DF - const EVENT_8E0 + const EVENT_ELITE4_EVENTS_START const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 const EVENT_8E2 const EVENT_8E3 const EVENT_8E4 const EVENT_8E5 - const EVENT_8E6 + const EVENT_AUTOWALKED_INTO_LORELEIS_ROOM const EVENT_8E7 const EVENT_8E8 const EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 @@ -2286,7 +2286,7 @@ const_value = 0 const EVENT_8EB const EVENT_8EC const EVENT_8ED - const EVENT_8EE + const EVENT_AUTOWALKED_INTO_BRUNOS_ROOM const EVENT_8EF const EVENT_8F0 const EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 @@ -2294,7 +2294,7 @@ const_value = 0 const EVENT_8F3 const EVENT_8F4 const EVENT_8F5 - const EVENT_8F6 + const EVENT_AUTOWALKED_INTO_AGATHAS_ROOM const EVENT_8F7 const EVENT_8F8 const EVENT_BEAT_LANCES_ROOM_TRAINER_0 @@ -2302,10 +2302,10 @@ const_value = 0 const EVENT_8FB const EVENT_8FC const EVENT_8FD - const EVENT_8FE - const EVENT_8FF + const EVENT_BEAT_LANCE + const EVENT_LANCES_ROOM_LOCK_DOOR const EVENT_900 - const EVENT_901 + const EVENT_BEAT_CHAMPION_RIVAL const EVENT_902 const EVENT_903 const EVENT_904 @@ -2327,7 +2327,7 @@ const_value = 0 const EVENT_914 const EVENT_915 const EVENT_916 - const EVENT_917 + const EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH const EVENT_918 const EVENT_919 const EVENT_91A @@ -2496,24 +2496,24 @@ const_value = 0 const EVENT_9BD const EVENT_9BE const EVENT_9BF - const EVENT_9C0 - const EVENT_9C1 + const EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE + const EVENT_SEAFOAM2_BOULDER2_DOWN_HOLE const EVENT_9C2 const EVENT_9C3 const EVENT_9C4 const EVENT_9C5 const EVENT_9C6 const EVENT_9C7 - const EVENT_9C8 - const EVENT_9C9 + const EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE + const EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE const EVENT_9CA const EVENT_9CB const EVENT_9CC const EVENT_9CD const EVENT_9CE const EVENT_9CF - const EVENT_9D0 - const EVENT_9D1 + const EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE + const EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE const EVENT_9D2 const EVENT_9D3 const EVENT_9D4 diff --git a/constants/event_macros.asm b/constants/event_macros.asm index 8daaea28..cc7c03f5 100755 --- a/constants/event_macros.asm +++ b/constants/event_macros.asm @@ -19,7 +19,19 @@ event_byte = ((\1) / 8) ;\1 = event index CheckEventReuseA: MACRO -IF event_byte != ((\1) / 8) + IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + ENDC + + bit (\1) % 8, a + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +CheckEventAfterBranchReuseA: MACRO +event_byte = ((\2) / 8) + IF event_byte != ((\1) / 8) event_byte = ((\1) / 8) ld a, [wEventFlags + event_byte] ENDC @@ -355,11 +367,17 @@ event_fill_count = event_fill_count + 1 ENDM ; returns whether both events are set in Z flag +; This is counter-intuitive because the other event checks set the Z flag when +; the event is not set, but this sets the Z flag when the event is set. ;\1 = event index 1 ;\2 = event index 2 +;\3 = try to reuse a (optional) CheckBothEventsSet: MACRO IF ((\1) / 8) == ((\2) / 8) - ld a, [wEventFlags + ((\1) / 8)] + IF (_NARG < 3) || (((\1) / 8) != event_byte) +event_byte = ((\1) / 8) + ld a, [wEventFlags + ((\1) / 8)] + ENDC and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) ELSE @@ -422,4 +440,4 @@ AdjustEventBit: MACRO IF ((\1) % 8) != (\2) add ((\1) % 8) - (\2) ENDC - ENDM \ No newline at end of file + ENDM diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index 1c5beb77..2afe9914 100755 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -82,7 +82,7 @@ const_value = 0 const HS_MANSION_1_ITEM_2 ; 49 X const HS_FIGHTING_DOJO_GIFT_1 ; 4A const HS_FIGHTING_DOJO_GIFT_2 ; 4B - const HS_SILPH_CO_1F_1 ; 4C + const HS_SILPH_CO_1F_RECEPTIONIST ; 4C const HS_VOLTORB_1 ; 4D X const HS_VOLTORB_2 ; 4E X const HS_VOLTORB_3 ; 4F X diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index cf18799d..00744c5d 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -152,7 +152,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SaffronCityPokecenterBenchGuyText2 jr nz, .asm_624f2 ld hl, SaffronCityPokecenterBenchGuyText1 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index d4a0ce88..90de784f 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -322,11 +322,11 @@ BillsHousePC: ; 1eb6e (7:6b6e) ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_UP ret nz - CheckEvent EVENT_55F + CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING jr nz, .asm_1ebd2 - CheckEventReuseA EVENT_55B + CheckEventReuseA EVENT_USED_CELL_SEPARATOR_ON_BILL jr nz, .asm_1eb86 - CheckEventReuseA EVENT_55E + CheckEventReuseA EVENT_BILL_SAID_USE_CELL_SEPARATOR jr nz, .asm_1eb8b .asm_1eb86 tx_pre_jump BillsHouseMonitorText @@ -355,7 +355,7 @@ BillsHousePC: ; 1eb6e (7:6b6e) call PlaySound call WaitForSoundToFinish call PlayDefaultMusic - SetEvent EVENT_55B + SetEvent EVENT_USED_CELL_SEPARATOR_ON_BILL ret .asm_1ebd2 ld a, $1 diff --git a/engine/items/items.asm b/engine/items/items.asm index a7c731c2..eb9f5663 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -432,7 +432,7 @@ ItemUseBall: ; d687 (3:5687) call ClearSprites call SendNewMonToBox ld hl,ItemUseBallText07 - CheckEvent EVENT_550 + CheckEvent EVENT_MET_BILL jr nz,.sendToBox2 ld hl,ItemUseBallText08 .sendToBox2 diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index f9df345f..a810afd2 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -28,7 +28,7 @@ DisplayPCMainMenu:: ; 213c8 (8:53c8) call UpdateSprites ld a, 3 ld [wMaxMenuItem], a - CheckEvent EVENT_550 + CheckEvent EVENT_MET_BILL jr nz, .metBill coord hl, 2, 2 ld de, SomeonesPCText diff --git a/engine/menu/pc.asm b/engine/menu/pc.asm index 43bd8452..a804abb2 100755 --- a/engine/menu/pc.asm +++ b/engine/menu/pc.asm @@ -74,7 +74,7 @@ BillsPC: ; 17ee4 (5:7ee4) ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - CheckEvent EVENT_550 + CheckEvent EVENT_MET_BILL jr nz, .billsPC ;if you've met bill, use that bill's instead of someone's ld hl, AccessedSomeonesPCText jr .printText diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm index 5cc5536c..1b96b4c6 100755 --- a/engine/overworld/cinnabar_lab.asm +++ b/engine/overworld/cinnabar_lab.asm @@ -65,7 +65,7 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) callba RemoveItemByID ld hl, LabFossil_610b8 call PrintText - SetEvents EVENT_2E0, EVENT_2E1 + SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL ret .asm_610a7 ld hl, LabFossil_610bd diff --git a/main.asm b/main.asm index ea13bd64..ed1dfe25 100755 --- a/main.asm +++ b/main.asm @@ -2760,7 +2760,7 @@ CheckForForcedBikeSurf: ; cdc0 (3:4dc0) ld a, [W_CURMAP] cp SEAFOAM_ISLANDS_5 ret nz - CheckBothEventsSet EVENT_9D0, EVENT_9D1 + CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE ret z ld hl, CoordsData_cdf7 call ArePlayerCoordsInArray diff --git a/scripts/agatha.asm b/scripts/agatha.asm index c9df27d2..f0607785 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -69,7 +69,7 @@ AgathaScript0: ; 76490 (1d:6490) ld a, [wCoordIndex] cp $3 jr c, .asm_764b4 - CheckAndSetEvent EVENT_8F6 + CheckAndSetEvent EVENT_AUTOWALKED_INTO_AGATHAS_ROOM jr z, AgathaScript_76474 .asm_764b4 ld a, $2 diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index bdae3536..f0bdf615 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -8,7 +8,7 @@ BikeShopTextPointers: ; 1d73f (7:573f) BikeShopText1: ; 1d745 (7:5745) TX_ASM - CheckEvent EVENT_0C0 + CheckEvent EVENT_GOT_BICYCLE jr z, .asm_260d4 ld hl, BikeShopText_1d82f call PrintText @@ -25,7 +25,7 @@ BikeShopText1: ; 1d745 (7:5745) ld a, BIKE_VOUCHER ld [$ffdb], a callba RemoveItemByID - SetEvent EVENT_0C0 + SetEvent EVENT_GOT_BICYCLE ld hl, BikeShopText_1d824 call PrintText jr .Done @@ -129,7 +129,7 @@ BikeShopText_1d843: ; 1d843 (7:5843) BikeShopText3: ; 1d848 (7:5848) TX_ASM - CheckEvent EVENT_0C0 + CheckEvent EVENT_GOT_BICYCLE ld hl, BikeShopText_1d861 jr nz, .asm_34d2d ld hl, BikeShopText_1d85c diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index b7e85f9a..71e61603 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -51,7 +51,7 @@ BillsHouseScript2: ; 1e7a6 (7:67a6) ld a, HS_BILL_POKEMON ld [wcc4d], a predef HideObject - SetEvent EVENT_55E + SetEvent EVENT_BILL_SAID_USE_CELL_SEPARATOR xor a ld [wJoyIgnore], a ld a, $3 @@ -59,7 +59,7 @@ BillsHouseScript2: ; 1e7a6 (7:67a6) ret BillsHouseScript3: ; 1e7c5 (7:67c5) - CheckEvent EVENT_55B + CheckEvent EVENT_USED_CELL_SEPARATOR_ON_BILL ret z ld a, $f0 ld [wJoyIgnore], a @@ -101,8 +101,8 @@ BillsHouseScript4: ; 1e80d (7:680d) ret nz xor a ld [wJoyIgnore], a - SetEvent EVENT_55D - SetEvent EVENT_550 + SetEvent EVENT_MET_BILL_2 ; this event seems redundant + SetEvent EVENT_MET_BILL ld a, $0 ld [W_BILLSHOUSECURSCRIPT], a ret @@ -159,7 +159,7 @@ BillsHouseText_1e86f: ; 1e86f (7:686f) BillsHouseText2: ; 1e874 (7:6874) TX_ASM - CheckEvent EVENT_55C + CheckEvent EVENT_GOT_SS_TICKET jr nz, .asm_1e8a9 ld hl, BillThankYouText call PrintText @@ -168,7 +168,7 @@ BillsHouseText2: ; 1e874 (7:6874) jr nc, .BagFull ld hl, SSTicketReceivedText call PrintText - SetEvent EVENT_55C + SetEvent EVENT_GOT_SS_TICKET ld a, HS_CERULEAN_GUARD_1 ld [wcc4d], a predef ShowObject diff --git a/scripts/blueshouse.asm b/scripts/blueshouse.asm index 17b182f5..12ca9106 100755 --- a/scripts/blueshouse.asm +++ b/scripts/blueshouse.asm @@ -9,7 +9,7 @@ BluesHouseScriptPointers: ; 19b47 (6:5b47) dw BluesHouseScript1 BluesHouseScript0: ; 19b4b (6:5b4b) - SetEvent EVENT_019 + SetEvent EVENT_ENTERED_BLUES_HOUSE ; trigger the next script ld a,1 @@ -26,7 +26,7 @@ BluesHouseTextPointers: ; 19b57 (6:5b57) BluesHouseText1: ; 19b5d (6:5b5d) TX_ASM - CheckEvent EVENT_018 + CheckEvent EVENT_GOT_TOWN_MAP jr nz,.GotMap CheckEvent EVENT_GOT_POKEDEX jr nz,.GiveMap @@ -44,7 +44,7 @@ BluesHouseText1: ; 19b5d (6:5b5d) predef HideObject ; hide table map object ld hl,GotMapText call PrintText - SetEvent EVENT_018 + SetEvent EVENT_GOT_TOWN_MAP jr .done .GotMap ld hl,DaisyUseMapText diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 9cd55193..1aae7d19 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -69,7 +69,7 @@ BrunoScript0: ; 76339 (1d:6339) ld a, [wCoordIndex] cp $3 jr c, .asm_7635d - CheckAndSetEvent EVENT_8EE + CheckAndSetEvent EVENT_AUTOWALKED_INTO_BRUNOS_ROOM jr z, BrunoScript_7631d .asm_7635d ld a, $2 diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index 65e71cca..ce0c4731 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -42,7 +42,7 @@ CeladonCityText4: ; 19999 (6:5999) CeladonCityText5: ; 1999e (6:599e) TX_ASM - CheckEvent EVENT_180 + CheckEvent EVENT_GOT_TM41 jr nz, .asm_7053f ld hl, TM41PreText call PrintText @@ -55,7 +55,7 @@ CeladonCityText5: ; 1999e (6:599e) .Success ld hl, ReceivedTM41Text call PrintText - SetEvent EVENT_180 + SetEvent EVENT_GOT_TM41 jr .Done .asm_7053f ld hl, TM41ExplanationText diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index d4d4b84b..a37bc558 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -27,14 +27,14 @@ CeladonDinerText4: ; 4916e (12:516e) CeladonDinerText5: ; 49173 (12:5173) TX_ASM - CheckEvent EVENT_1E0 + CheckEvent EVENT_GOT_COIN_CASE jr nz, .asm_eb14d ld hl, CeladonDinerText_491a7 call PrintText ld bc, (COIN_CASE << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_1E0 + SetEvent EVENT_GOT_COIN_CASE ld hl, ReceivedCoinCaseText call PrintText jr .asm_68b61 diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index ef4b4760..48264603 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -28,7 +28,7 @@ CeladonGameCornerScript_48bec: ; 48bec (12:4bec) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_1B9 + CheckEvent EVENT_FOUND_ROCKET_HIDEOUT ret nz ld a, $2a ld [wd09f], a @@ -226,7 +226,7 @@ CeladonGameCornerText4: ; 48d45 (12:4d45) CeladonGameCornerText5: ; 48d4a (12:4d4a) TX_ASM - CheckEvent EVENT_1BA + CheckEvent EVENT_GOT_10_COINS jr nz, .asm_48d89 ld hl, CeladonGameCornerText_48d9c call PrintText @@ -244,7 +244,7 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - SetEvent EVENT_1BA + SetEvent EVENT_GOT_10_COINS ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, Received10CoinsText @@ -305,7 +305,7 @@ CeladonGameCornerText8: ; 48dd4 (12:4dd4) CeladonGameCornerText9: ; 48dd9 (12:4dd9) TX_ASM - CheckEvent EVENT_1BC + CheckEvent EVENT_GOT_20_COINS_2 jr nz, .asm_48e13 ld hl, CeladonGameCornerText_48e26 call PrintText @@ -323,7 +323,7 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - SetEvent EVENT_1BC + SetEvent EVENT_GOT_20_COINS_2 ld hl, Received20CoinsText jr .asm_48e20 .asm_48e13 @@ -356,7 +356,7 @@ CeladonGameCornerText_48e36: ; 48e36 (12:4e36) CeladonGameCornerText10: ; 48e3b (12:4e3b) TX_ASM - CheckEvent EVENT_1BB + CheckEvent EVENT_GOT_20_COINS jr nz, .asm_48e75 ld hl, CeladonGameCornerText_48e88 call PrintText @@ -374,7 +374,7 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - SetEvent EVENT_1BB + SetEvent EVENT_GOT_20_COINS ld hl, CeladonGameCornerText_48e8d jr .asm_48e82 .asm_48e75 @@ -449,7 +449,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) ld a, SFX_GO_INSIDE call PlaySound call WaitForSoundToFinish - SetEvent EVENT_1B9 + SetEvent EVENT_FOUND_ROCKET_HIDEOUT ld a, $43 ld [wd09f], a ld bc, $0208 diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index 6e17ac77..f525d0af 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -22,14 +22,14 @@ CeladonMart3TextPointers: ; 48228 (12:4228) CeladonMart3Text1: ; 4824a (12:424a) TX_ASM - CheckEvent EVENT_18F + CheckEvent EVENT_GOT_TM18 jr nz, .asm_a5463 ld hl, TM18PreReceiveText call PrintText ld bc, (TM_18 << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_18F + SetEvent EVENT_GOT_TM18 ld hl, ReceivedTM18Text jr .asm_81359 .BagFull diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index e509ffeb..113044cd 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -83,7 +83,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr z, .asm_484b6 cp SODA_POP jr z, .asm_48492 - CheckEvent EVENT_18E + CheckEvent EVENT_GOT_TM49 jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48515 call PrintText @@ -93,10 +93,10 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, ReceivedTM49Text call PrintText - SetEvent EVENT_18E + SetEvent EVENT_GOT_TM49 ret .asm_48492 - CheckEvent EVENT_18D + CheckEvent EVENT_GOT_TM48 jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48504 call PrintText @@ -106,10 +106,10 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_4850a call PrintText - SetEvent EVENT_18D + SetEvent EVENT_GOT_TM48 ret .asm_484b6 - CheckEvent EVENT_18C + CheckEvent EVENT_GOT_TM13 jr nz, .asm_484e0 ld hl, CeladonMartRoofText_484f3 call PrintText @@ -119,7 +119,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_484f9 call PrintText - SetEvent EVENT_18C + SetEvent EVENT_GOT_TM13 ret .BagFull ld hl, CeladonMartRoofText_48526 diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index b009ca95..5da549f3 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -25,7 +25,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) jp z, CeruleanCityScript_1948c ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_0A7 + SetEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -35,7 +35,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) ret CeruleanCityScript0: ; 194c8 (6:54c8) - CheckEvent EVENT_0A7 + CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF jr nz, .asm_194f7 ld hl, CeruleanCityCoords1 call ArePlayerCoordsInArray @@ -56,7 +56,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld [hSpriteIndexOrTextID], a jp DisplayTextID .asm_194f7 - CheckEvent EVENT_098 + CheckEvent EVENT_BEAT_CERULEAN_RIVAL ret nz ld hl, CeruleanCityCoords2 call ArePlayerCoordsInArray @@ -167,7 +167,7 @@ CeruleanCityScript2: ; 195b1 (6:55b1) call CeruleanCityScript_1955d ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_098 + SetEvent EVENT_BEAT_CERULEAN_RIVAL ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -248,7 +248,7 @@ CeruleanCityTextPointers: ; 1962d (6:562d) CeruleanCityText1: ; 1964f (6:564f) TX_ASM - CheckEvent EVENT_098 + CheckEvent EVENT_BEAT_CERULEAN_RIVAL ; do pre-battle text jr z, .PreBattleText ; or talk about bill @@ -279,7 +279,7 @@ CeruleanCityText_19677: ; 19677 (6:5677) CeruleanCityText2: ; 1967c (6:567c) TX_ASM - CheckEvent EVENT_0A7 + CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF jr nz, .asm_4ca20 ld hl, CeruleanCityText_196d9 call PrintText diff --git a/scripts/cinnabarisland.asm b/scripts/cinnabarisland.asm index 2fc0503f..c06c784c 100755 --- a/scripts/cinnabarisland.asm +++ b/scripts/cinnabarisland.asm @@ -2,8 +2,8 @@ CinnabarIslandScript: ; 1ca19 (7:4a19) call EnableAutoTextBoxDrawing ld hl, wd126 set 5, [hl] - ResetEvent EVENT_278 - ResetEvent EVENT_2E1 + ResetEvent EVENT_MANSION_SWITCH_ON + ResetEvent EVENT_LAB_STILL_REVIVING_FOSSIL ld hl, CinnabarIslandScriptPointers ld a, [W_CINNABARISLANDCURSCRIPT] jp CallFunctionInTable diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index d6a330f3..953c7126 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -12,7 +12,7 @@ CopycatsHouse2FTextPointers: ; 5cc74 (17:4c74) CopycatsHouse2FText1: ; 5cc82 (17:4c82) TX_ASM - CheckEvent EVENT_340 + CheckEvent EVENT_GOT_TM31 jr nz, .asm_7ccf3 ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -31,7 +31,7 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) ld a, POKE_DOLL ld [$ffdb], a callba RemoveItemByID - SetEvent EVENT_340 + SetEvent EVENT_GOT_TM31 jr .asm_62ecd .BagFull ld hl, TM31NoRoomText diff --git a/scripts/fanclub.asm b/scripts/fanclub.asm index 45298c0b..adde809f 100755 --- a/scripts/fanclub.asm +++ b/scripts/fanclub.asm @@ -24,16 +24,16 @@ FanClubTextPointers: ; 59b84 (16:5b84) FanClubText1: ; pikachu fan TX_ASM - CheckEvent EVENT_157 + CheckEvent EVENT_PIKACHU_FAN_BOAST jr nz, .mineisbetter ld hl, .normaltext call PrintText - SetEvent EVENT_156 + SetEvent EVENT_SEEL_FAN_BOAST jr .done .mineisbetter ld hl, .bettertext call PrintText - ResetEvent EVENT_157 + ResetEvent EVENT_PIKACHU_FAN_BOAST .done jp TextScriptEnd @@ -48,16 +48,16 @@ FanClubText1: FanClubText2: ; seel fan TX_ASM - CheckEvent EVENT_156 + CheckEvent EVENT_SEEL_FAN_BOAST jr nz, .mineisbetter ld hl, .normaltext call PrintText - SetEvent EVENT_157 + SetEvent EVENT_PIKACHU_FAN_BOAST jr .done .mineisbetter ld hl, .bettertext call PrintText - ResetEvent EVENT_156 + ResetEvent EVENT_SEEL_FAN_BOAST .done jp TextScriptEnd diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index e27baf57..91d8a484 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -21,13 +21,13 @@ FightingDojoScriptPointers: ; 5cd7b (17:4d7b) dw FightingDojoScript3 FightingDojoScript1: ; 5cd83 (17:4d83) - CheckEvent EVENT_350 + CheckEvent EVENT_DEFEATED_FIGHTING_DOJO ret nz call CheckFightingMapTrainers ld a, [wTrainerHeaderFlagBit] and a ret nz - CheckEvent EVENT_351 + CheckEvent EVENT_BEAT_KARATE_MASTER ret nz xor a ld [hJoyHeld], a @@ -70,7 +70,7 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6) .asm_5cde4 ld a, $f0 ld [wJoyIgnore], a - SetEventRange EVENT_351, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 + SetEventRange EVENT_BEAT_KARATE_MASTER, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 ld a, $8 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -131,9 +131,9 @@ FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) FightingDojoText1: ; 5ce44 (17:4e44) TX_ASM - CheckEvent EVENT_350 + CheckEvent EVENT_DEFEATED_FIGHTING_DOJO jp nz, .continue1 - CheckEventReuseA EVENT_351 + CheckEventReuseA EVENT_BEAT_KARATE_MASTER jp nz, .continue2 ld hl, FightingDojoText_5ce8e call PrintText @@ -252,7 +252,7 @@ FightingDojoAfterBattleText4: ; 5cf01 (17:4f01) FightingDojoText6: ; 5cf06 (17:4f06) ; Hitmonlee Poké Ball TX_ASM - CheckEitherEventSet EVENT_356, EVENT_357 + CheckEitherEventSet EVENT_GOT_HITMONLEE, EVENT_GOT_HITMONCHAN jr z, .GetMon ld hl, OtherHitmonText call PrintText @@ -276,7 +276,7 @@ FightingDojoText6: ; 5cf06 (17:4f06) ld a, HS_FIGHTING_DOJO_GIFT_1 ld [wcc4d], a predef HideObject - SetEvents EVENT_356, EVENT_350 + SetEvents EVENT_GOT_HITMONLEE, EVENT_DEFEATED_FIGHTING_DOJO .done jp TextScriptEnd @@ -287,7 +287,7 @@ WantHitmonleeText: ; 5cf49 (17:4f49) FightingDojoText7: ; 5cf4e (17:4f4e) ; Hitmonchan Poké Ball TX_ASM - CheckEitherEventSet EVENT_356, EVENT_357 + CheckEitherEventSet EVENT_GOT_HITMONLEE, EVENT_GOT_HITMONCHAN jr z, .GetMon ld hl, OtherHitmonText call PrintText @@ -306,7 +306,7 @@ FightingDojoText7: ; 5cf4e (17:4f4e) ld c,30 call GivePokemon jr nc, .done - SetEvents EVENT_357, EVENT_350 + SetEvents EVENT_GOT_HITMONCHAN, EVENT_DEFEATED_FIGHTING_DOJO ; once Poké Ball is taken, hide sprite ld a, HS_FIGHTING_DOJO_GIFT_2 diff --git a/scripts/fuchsiacity.asm b/scripts/fuchsiacity.asm index b314b983..cdf8e203 100755 --- a/scripts/fuchsiacity.asm +++ b/scripts/fuchsiacity.asm @@ -135,9 +135,9 @@ FuchsiaCityLaprasText: ; 19aef (6:5aef) FuchsiaCityText24: ; 19af4 (6:5af4) TX_ASM - CheckEvent EVENT_57E + CheckEvent EVENT_GOT_DOME_FOSSIL jr nz, .asm_3b4e8 - CheckEventReuseA EVENT_57F + CheckEventReuseA EVENT_GOT_HELIX_FOSSIL jr nz, .asm_667d5 ld hl, FuchsiaCityText_19b2a call PrintText diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index b755b3bc..37aebd23 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -10,12 +10,12 @@ FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8) FuchsiaHouse2Text1: ; 750c2 (1d:50c2) TX_ASM - CheckEvent EVENT_238 + CheckEvent EVENT_GOT_HM04 jr nz, .subtract ld b,GOLD_TEETH call IsItemInBag jr nz, .asm_3f30f - CheckEvent EVENT_239 + CheckEvent EVENT_GAVE_GOLD_TEETH jr nz, .asm_60cba ld hl, WardenGibberishText1 call PrintText @@ -34,7 +34,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) ld a, GOLD_TEETH ld [$ffdb], a callba RemoveItemByID - SetEvent EVENT_239 + SetEvent EVENT_GAVE_GOLD_TEETH .asm_60cba ld hl, WardenThankYouText call PrintText @@ -43,7 +43,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) jr nc, .BagFull ld hl, ReceivedHM04Text call PrintText - SetEvent EVENT_238 + SetEvent EVENT_GOT_HM04 jr .asm_52039 .subtract ld hl, HM04ExplanationText diff --git a/scripts/gary.asm b/scripts/gary.asm index ab991942..24a2d2de 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -94,7 +94,7 @@ GaryScript3: ; 75fbb (1d:5fbb) cp $ff jp z, GaryScript_75f29 call UpdateSprites - SetEvent EVENT_901 + SetEvent EVENT_BEAT_CHAMPION_RIVAL ld a, $f0 ld [wJoyIgnore], a ld a, $1 @@ -248,7 +248,7 @@ GaryTextPointers: ; 760d6 (1d:60d6) GaryText1: ; 760e0 (1d:60e0) TX_ASM - CheckEvent EVENT_901 + CheckEvent EVENT_BEAT_CHAMPION_RIVAL ld hl, GaryText_760f4 jr z, .asm_17e9f ld hl, GaryText_76103 diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index 136061d8..503327f3 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -40,7 +40,7 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) ld [W_LANCECURSCRIPT], a ld [W_HALLOFFAMEROOMCURSCRIPT], a ; Elite 4 events - ResetEventRange EVENT_8E0, EVENT_907, 1 + ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_907, 1 xor a ld [W_HALLOFFAMEROOMCURSCRIPT], a ld a, PALLET_TOWN diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm index 8cde0854..e4a64ce6 100755 --- a/scripts/indigoplateaulobby.asm +++ b/scripts/indigoplateaulobby.asm @@ -5,13 +5,13 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) bit 6, [hl] res 6, [hl] ret z - ResetEvent EVENT_917 + ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH ld hl, wd734 bit 1, [hl] res 1, [hl] ret z ; Elite 4 events - ResetEventRange EVENT_8E0, EVENT_8FF + ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR ret IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f) diff --git a/scripts/lab3.asm b/scripts/lab3.asm index 0351038d..59b04b8c 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -10,7 +10,7 @@ Lab3TextPointers: ; 75c8a (1d:5c8a) Lab3Text1: ; 75c94 (1d:5c94) TX_ASM - CheckEvent EVENT_2D7 + CheckEvent EVENT_GOT_TM35 jr nz, .asm_e551a ld hl, TM35PreReceiveText call PrintText @@ -19,7 +19,7 @@ Lab3Text1: ; 75c94 (1d:5c94) jr nc, .BagFull ld hl, ReceivedTM35Text call PrintText - SetEvent EVENT_2D7 + SetEvent EVENT_GOT_TM35 jr .asm_eb896 .BagFull ld hl, TM35NoRoomText diff --git a/scripts/lab4.asm b/scripts/lab4.asm index 44dcb2c3..f2c4d8d7 100755 --- a/scripts/lab4.asm +++ b/scripts/lab4.asm @@ -49,7 +49,7 @@ FossilsList: ; 75d68 (1d:5d68) Lab4Text1: ; 75d6c (1d:5d6c) TX_ASM - CheckEvent EVENT_2E0 + CheckEvent EVENT_GAVE_FOSSIL_TO_LAB jr nz, .asm_75d96 ld hl, Lab4Text_75dc6 call PrintText @@ -65,7 +65,7 @@ Lab4Text1: ; 75d6c (1d:5d6c) .asm_75d93 jp TextScriptEnd .asm_75d96 - bit 1, a + CheckEventAfterBranchReuseA EVENT_LAB_STILL_REVIVING_FOSSIL, EVENT_GAVE_FOSSIL_TO_LAB jr z, .asm_75da2 ld hl, Lab4Text_75dd0 call PrintText @@ -74,13 +74,13 @@ Lab4Text1: ; 75d6c (1d:5d6c) call LoadFossilItemAndMonNameBank1D ld hl, Lab4Text_75dd5 call PrintText - SetEvent EVENT_2E2 + SetEvent EVENT_LAB_HANDING_OVER_FOSSIL_MON ld a, [W_FOSSILMON] ld b, a ld c, 30 call GivePokemon jr nc, .asm_75d93 - ResetEvents EVENT_2E0, EVENT_2E1, EVENT_2E2 + ResetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL, EVENT_LAB_HANDING_OVER_FOSSIL_MON jr .asm_75d93 Lab4Text_75dc6: ; 75dc6 (1d:5dc6) diff --git a/scripts/lance.asm b/scripts/lance.asm index 9d3a2f99..4d0072be 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -13,7 +13,7 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_8FF + CheckEvent EVENT_LANCES_ROOM_LOCK_DOOR jr nz, .asm_5a2da ld a, $31 ld b, $32 @@ -51,7 +51,7 @@ LanceScript4: ; 5a304 (16:6304) ret LanceScript0: ; 5a305 (16:6305) - CheckEvent EVENT_8FE + CheckEvent EVENT_BEAT_LANCE ret nz ld hl, CoordsData_5a33e call ArePlayerCoordsInArray @@ -67,7 +67,7 @@ LanceScript0: ; 5a305 (16:6305) .asm_5a325 cp $5 jr z, LanceScript_5a35b - CheckAndSetEvent EVENT_8FF + CheckAndSetEvent EVENT_LANCES_ROOM_LOCK_DOOR ret nz ld hl, wd126 set 5, [hl] @@ -156,5 +156,5 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText TX_ASM - SetEvent EVENT_8FE + SetEvent EVENT_BEAT_LANCE jp TextScriptEnd diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index 21e67013..556e94a3 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -12,7 +12,7 @@ LavenderHouse1TextPointers: ; 1d8ac (7:58ac) LavenderHouse1Text1: ; 1d8b8 (7:58b8) TX_ASM - CheckEvent EVENT_4CF + CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_72e5d ld hl, LavenderHouse1Text_1d8d1 call PrintText @@ -33,7 +33,7 @@ LavenderHouse1Text_1d8d6: ; 1d8d6 (7:58d6) LavenderHouse1Text2: ; 1d8db (7:58db) TX_ASM - CheckEvent EVENT_4CF + CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_06470 ld hl, LavenderHouse1Text_1d8f4 call PrintText @@ -68,7 +68,7 @@ LavenderHouse1Text4: ; 1d90b (7:590b) LavenderHouse1Text5: ; 1d918 (7:5918) TX_ASM - CheckEvent EVENT_128 + CheckEvent EVENT_GOT_POKE_FLUTE jr nz, .asm_15ac2 ld hl, LavenderHouse1Text_1d94c call PrintText @@ -77,7 +77,7 @@ LavenderHouse1Text5: ; 1d918 (7:5918) jr nc, .BagFull ld hl, ReceivedFluteText call PrintText - SetEvent EVENT_128 + SetEvent EVENT_GOT_POKE_FLUTE jr .asm_da749 .BagFull ld hl, FluteNoRoomText diff --git a/scripts/lavenderhouse2.asm b/scripts/lavenderhouse2.asm index 4c3ad333..fe0b3ee2 100755 --- a/scripts/lavenderhouse2.asm +++ b/scripts/lavenderhouse2.asm @@ -15,7 +15,7 @@ LavenderHouse2Text1: ; 1d9b6 (7:59b6) LavenderHouse2Text2: ; 1d9c3 (7:59c3) TX_ASM - CheckEvent EVENT_4CF + CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_65711 ld hl, LavenderHouse2Text_1d9dc call PrintText diff --git a/scripts/lavendermart.asm b/scripts/lavendermart.asm index ababf70d..85518fd2 100755 --- a/scripts/lavendermart.asm +++ b/scripts/lavendermart.asm @@ -12,7 +12,7 @@ LavenderMartText2: ; 5c935 (17:4935) LavenderMartText3: ; 5c93a (17:493a) TX_ASM - CheckEvent EVENT_4CF + CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_c88d4 ld hl, LavenderMart_5c953 call PrintText diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index a8e0cb5b..fe136784 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -70,7 +70,7 @@ LoreleiScript0: ; 761e2 (1d:61e2) ld a, [wCoordIndex] cp $3 jr c, .asm_76206 - CheckAndSetEvent EVENT_8E6 + CheckAndSetEvent EVENT_AUTOWALKED_INTO_LORELEIS_ROOM jr z, LoreleiScript_761c6 .asm_76206 ld a, $2 diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index ff8707e0..7d349276 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -13,7 +13,7 @@ Mansion1Subscript1: ; 442c5 (11:42c5) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_278 + CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_442ec ld bc, $060c call Mansion1Script_4430b @@ -112,9 +112,9 @@ Mansion1Text4: ; 4435a (11:435a) call PrintText ld a, SFX_GO_INSIDE call PlaySound - CheckAndSetEvent EVENT_278 + CheckAndSetEvent EVENT_MANSION_SWITCH_ON jr z, .asm_44392 - ResetEventReuseHL EVENT_278 + ResetEventReuseHL EVENT_MANSION_SWITCH_ON jr .asm_44392 .asm_4438c ld hl, MansionSwitchNotPressedText diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index 6e1a26c0..4f5aac9f 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -13,7 +13,7 @@ Mansion2Script_51fee: ; 51fee (14:5fee) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_278 + CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_52016 ld a, $e ld bc, $204 @@ -118,9 +118,9 @@ Mansion2Text5: ; 52087 (14:6087) call PrintText ld a, SFX_GO_INSIDE call PlaySound - CheckAndSetEvent EVENT_278 + CheckAndSetEvent EVENT_MANSION_SWITCH_ON jr z, .asm_520bf - ResetEventReuseHL EVENT_278 + ResetEventReuseHL EVENT_MANSION_SWITCH_ON jr .asm_520bf .asm_520b9 ld hl, Mansion2Text_520cc diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index 0aec82b3..e49667ef 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -13,7 +13,7 @@ Mansion3Script_52204: ; 52204 (14:6204) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_278 + CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_52224 ld a, $e ld bc, $207 diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index 98c55a76..59ee3704 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -13,7 +13,7 @@ Mansion4Script_523cf: ; 523cf (14:63cf) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_278 + CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_523ff ld a, $e ld bc, $80d diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index dfa92260..4542cc53 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -5,7 +5,7 @@ MtMoon3Script: ; 49d0b (12:5d0b) ld a, [W_MTMOON3CURSCRIPT] call ExecuteCurMapScriptInTable ld [W_MTMOON3CURSCRIPT], a - CheckEvent EVENT_579 + CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD ret z ld hl, CoordsData_49d37 call ArePlayerCoordsInArray @@ -53,7 +53,7 @@ MtMoon3ScriptPointers: ; 49d63 (12:5d63) dw MtMoon3Script5 MtMoon3Script0: ; 49d6f (12:5d6f) - CheckEvent EVENT_579 + CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD jp nz, MtMoon3Script_49d91 ld a, [W_YCOORD] cp $8 @@ -68,7 +68,7 @@ MtMoon3Script0: ; 49d6f (12:5d6f) jp DisplayTextID MtMoon3Script_49d91: ; 49d91 (12:5d91) - CheckEitherEventSet EVENT_57E, EVENT_57F + CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL jp z, CheckFightingMapTrainers ret @@ -78,7 +78,7 @@ MtMoon3Script3: ; 49d9a (12:5d9a) jp z, MtMoon3Script_49d58 call UpdateSprites call Delay3 - SetEvent EVENT_579 + SetEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD xor a ld [wJoyIgnore], a ld a, $0 @@ -138,7 +138,7 @@ MtMoon3Script5: ; 49dfb (12:5dfb) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - CheckEvent EVENT_57E + CheckEvent EVENT_GOT_DOME_FOSSIL jr z, .asm_49e1d ld a, HS_MT_MOON_3_FOSSIL_2 jr .asm_49e1f @@ -207,7 +207,7 @@ MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) MtMoon3Text1: ; 49e79 (12:5e79) TX_ASM - CheckEvent EVENT_579 + CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD jr z, .asm_49e8d and $c0 jr nz, .asm_49eb8 @@ -278,7 +278,7 @@ MtMoon3Text6: ; 49ee9 (12:5ee9) ld a, HS_MT_MOON_3_FOSSIL_1 ld [wcc4d], a predef HideObject - SetEvent EVENT_57E + SetEvent EVENT_GOT_DOME_FOSSIL ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -306,7 +306,7 @@ MtMoon3Text7: ; 49f29 (12:5f29) ld a, HS_MT_MOON_3_FOSSIL_2 ld [wcc4d], a predef HideObject - SetEvent EVENT_57F + SetEvent EVENT_GOT_HELIX_FOSSIL ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 2acf1af5..77c7f270 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -54,13 +54,13 @@ Museum1FText1: ; 5c135 (17:4135) cp $c jp z, Museum1FScript_5c1f9 .asm_d49e7 - CheckEvent EVENT_068 + CheckEvent EVENT_BOUGHT_MUSEUM_TICKET jr nz, .asm_31a16 ld hl, Museum1FText_5c23d call PrintText jp Museum1FScriptEnd .asm_b8709 - CheckEvent EVENT_068 + CheckEvent EVENT_BOUGHT_MUSEUM_TICKET jr z, .asm_3ded4 .asm_31a16 ld hl, Museum1FText_5c242 @@ -91,7 +91,7 @@ Museum1FText1: ; 5c135 (17:4135) .asm_0f3e3 ld hl, Museum1FText_5c224 call PrintText - SetEvent EVENT_068 + SetEvent EVENT_BOUGHT_MUSEUM_TICKET xor a ld [wPriceTemp], a ld [wPriceTemp + 1], a @@ -187,14 +187,14 @@ Museum1FText_5c251: ; 5c251 (17:4251) Museum1FText3: ; 5c256 (17:4256) TX_ASM - CheckEvent EVENT_069 + CheckEvent EVENT_GOT_OLD_AMBER jr nz, .asm_5c285 ld hl, Museum1FText_5c28e call PrintText ld bc, (OLD_AMBER << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_069 + SetEvent EVENT_GOT_OLD_AMBER ld a, HS_OLD_AMBER ld [wcc4d], a predef HideObject diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 6f51aca0..620923ad 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -1,5 +1,5 @@ OaksLabScript: ; 1cb0e (7:4b0e) - CheckEvent EVENT_026 + CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 call nz, OaksLabScript_1d076 ld a, $1 ld [wAutoTextBoxDrawingControl], a @@ -31,7 +31,7 @@ OaksLabScriptPointers: ; 1cb28 (7:4b28) dw OaksLabScript18 OaksLabScript0: ; 1cb4e (7:4b4e) - CheckEvent EVENT_027 + CheckEvent EVENT_OAK_APPEARED_IN_PALLET ret z ld a, [wNPCMovementScriptFunctionNum] and a @@ -108,8 +108,8 @@ OaksLabScript4: ; 1cbd2 (7:4bd2) ld a, [wSimulatedJoypadStatesIndex] and a ret nz - SetEvent EVENT_STOPPED_FROM_LEAVING_PALLET - SetEvent EVENT_FOLLOWED_OAK_INSIDE_LAB + SetEvent EVENT_FOLLOWED_OAK_INTO_LAB + SetEvent EVENT_FOLLOWED_OAK_INTO_LAB_2 ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP @@ -597,7 +597,7 @@ OaksLabScript16: ; 1cf12 (7:4f12) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_POKEDEX - SetEvent EVENT_038 + SetEvent EVENT_OAK_GOT_PARCEL ld a, HS_LYING_OLD_MAN ld [wcc4d], a predef HideObject @@ -632,9 +632,9 @@ OaksLabScript17: ; 1cfd4 (7:4fd4) ld a, HS_OAKS_LAB_RIVAL ld [wcc4d], a predef HideObject - SetEvent EVENT_520 - ResetEventReuseHL EVENT_521 - SetEventReuseHL EVENT_527 + SetEvent EVENT_1ST_ROUTE22_RIVAL_BATTLE + ResetEventReuseHL EVENT_2ND_ROUTE22_RIVAL_BATTLE + SetEventReuseHL EVENT_ROUTE22_RIVAL_WANTS_FIGHT ld a, HS_ROUTE_22_RIVAL_1 ld [wcc4d], a predef ShowObject @@ -650,19 +650,19 @@ OaksLabScript17: ; 1cfd4 (7:4fd4) OaksLabScript18: ; 1d009 (7:5009) ret -OaksLabScript_1d00a: ; 1d00a (7:500a) +OaksLabScript_RemoveParcel: ; 1d00a (7:500a) ld hl, wBagItems ld bc, $0000 -.asm_1d010 +.loop ld a, [hli] cp $ff ret z cp OAKS_PARCEL - jr z, .GotParcel + jr z, .foundParcel inc hl inc c - jr .asm_1d010 -.GotParcel + jr .loop +.foundParcel ld hl, wNumBagItems ld a, c ld [wWhichPokemon], a @@ -762,7 +762,7 @@ OaksLabTextPointers: ; 1d082 (7:5082) OaksLabText28: ; 1d0ce (7:50ce) OaksLabText1: ; 1d0ce (7:50ce) TX_ASM - CheckEvent EVENT_FOLLOWED_OAK_INSIDE_LAB + CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB_2 jr nz, .asm_1d0de ld hl, OaksLabGaryText1 call PrintText @@ -964,7 +964,7 @@ OaksLabLastMonText: ; 1d243 (7:5243) OaksLabText32: ; 1d248 (7:5248) OaksLabText5: ; 1d248 (7:5248) TX_ASM - CheckEvent EVENT_006 + CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS jr nz, .asm_1d266 ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned @@ -985,7 +985,7 @@ OaksLabText5: ; 1d248 (7:5248) ld b,POKE_BALL call IsItemInBag jr nz, .asm_1d2e7 - CheckEvent EVENT_525 + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT jr nz, .asm_1d2d0 CheckEvent EVENT_GOT_POKEDEX jr nz, .asm_1d2c8 @@ -1011,7 +1011,7 @@ OaksLabText5: ; 1d248 (7:5248) .asm_1d2b8 ld hl, OaksLabDeliverParcelText call PrintText - call OaksLabScript_1d00a + call OaksLabScript_RemoveParcel ld a, $f ld [W_OAKSLABCURSCRIPT], a jr .asm_1d2ed diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index 15956e7b..0fd7300e 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -1,7 +1,7 @@ PalletTownScript: ; 18e5b (6:4e5b) CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK jr z,.next - SetEvent EVENT_006 + SetEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS .next call EnableAutoTextBoxDrawing ld hl,PalletTownScriptPointers @@ -18,7 +18,7 @@ PalletTownScriptPointers: ; 18e73 (6:4e73) dw PalletTownScript6 PalletTownScript0: ; 18e81 (6:4e81) - CheckEvent EVENT_STOPPED_FROM_LEAVING_PALLET + CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB ret nz ld a,[W_YCOORD] cp 1 ; is player near north exit? @@ -35,7 +35,7 @@ PalletTownScript0: ; 18e81 (6:4e81) call PlayMusic ld a,$FC ld [wJoyIgnore],a - SetEvent EVENT_027 + SetEvent EVENT_OAK_APPEARED_IN_PALLET ; trigger the next script ld a,1 @@ -130,12 +130,11 @@ PalletTownScript4: ; 18f4b (6:4f4b) ret PalletTownScript5: ; 18f56 (6:4f56) - CheckEvent EVENT_01A + CheckEvent EVENT_DAISY_WALKING jr nz,.next - and 3 - cp 3 + CheckBothEventsSet EVENT_GOT_TOWN_MAP, EVENT_ENTERED_BLUES_HOUSE, 1 jr nz,.next - SetEvent EVENT_01A + SetEvent EVENT_DAISY_WALKING ld a,HS_DAISY_SITTING ld [wcc4d],a predef HideObject @@ -145,7 +144,7 @@ PalletTownScript5: ; 18f56 (6:4f56) .next CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK ret z - SetEvent EVENT_026 + SetEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 PalletTownScript6: ; 18f87 (6:4f87) ret diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index 8e72ee4b..77da14f8 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -16,7 +16,7 @@ PewterCityScriptPointers: ; 19243 (6:5243) PewterCityScript0: ; 19251 (6:5251) xor a ld [W_MUSEUM1FCURSCRIPT], a - ResetEvent EVENT_068 + ResetEvent EVENT_BOUGHT_MUSEUM_TICKET call PewterCityScript_1925e ret diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 03a1c218..186d0176 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -72,7 +72,7 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld [wcc4d], a predef HideObject - ResetEvents EVENT_520, EVENT_527 + ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT ; deactivate gym trainers SetEvent EVENT_BEAT_PEWTER_GYM_TRAINER_0 diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index a9619170..c7b94c4f 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -17,7 +17,7 @@ PokemonTower2ScriptPointers: ; 60509 (18:4509) dw PokemonTower2Script2 PokemonTower2Script0: ; 6050f (18:450f) - CheckEvent EVENT_0EF + CheckEvent EVENT_BEAT_POKEMON_TOWER_RIVAL ret nz ld hl, CoordsData_6055e call ArePlayerCoordsInArray @@ -28,13 +28,14 @@ PokemonTower2Script0: ; 6050f (18:450f) ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ResetEvent EVENT_0EE + ResetEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT ld a, [wCoordIndex] cp $1 ld a, PLAYER_DIR_UP ld b, SPRITE_FACING_DOWN jr nz, .asm_60544 - SetEvent EVENT_0EE +; the rival is on the left side and the player is on the right side + SetEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT ld a, PLAYER_DIR_LEFT ld b, SPRITE_FACING_RIGHT .asm_60544 @@ -63,12 +64,12 @@ PokemonTower2Script1: ; 60563 (18:4563) jp z, PokemonTower2Script_604fe ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_0EF + SetEvent EVENT_BEAT_POKEMON_TOWER_RIVAL ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID ld de, MovementData_605b2 - CheckEvent EVENT_0EE + CheckEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT jr nz, .asm_60589 ld de, MovementData_605a9 .asm_60589 @@ -127,7 +128,7 @@ PokemonTower2TextPointers: ; 605db (18:45db) PokemonTower2Text1: ; 605df (18:45df) TX_ASM - CheckEvent EVENT_0EF + CheckEvent EVENT_BEAT_POKEMON_TOWER_RIVAL jr z, .asm_16f24 ld hl, PokemonTower2Text_6063c call PrintText diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index b418b361..c4e9eed9 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -18,10 +18,10 @@ PokemonTower5Script0: ; 6094b (18:494b) jr c, .asm_60960 ld hl, wd72e res 4, [hl] - ResetEvent EVENT_107 + ResetEvent EVENT_IN_PURIFIED_ZONE jp CheckFightingMapTrainers .asm_60960 - CheckAndSetEvent EVENT_107 + CheckAndSetEvent EVENT_IN_PURIFIED_ZONE ret nz xor a ld [hJoyHeld], a diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index 68260484..37ca1b33 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -22,7 +22,7 @@ PokemonTower6ScriptPointers: ; 60b0d (18:4b0d) dw PokemonTower6Script4 PokemonTower6Script0: ; 60b17 (18:4b17) - CheckEvent EVENT_10F + CheckEvent EVENT_BEAT_GHOST_MAROWAK jp nz, CheckFightingMapTrainers ld hl, CoordsData_60b45 call ArePlayerCoordsInArray @@ -59,7 +59,7 @@ PokemonTower6Script4: ; 60b48 (18:4b48) ld a, [wBattleResult] and a jr nz, .asm_60b82 - SetEvent EVENT_10F + SetEvent EVENT_BEAT_GHOST_MAROWAK ld a, $7 ld [hSpriteIndexOrTextID], a call DisplayTextID diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index c2fe1508..3698f4ee 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -256,8 +256,8 @@ PokemonTower7FujiText: TX_ASM ld hl, TowerRescueFujiText call PrintText - SetEvent EVENT_4CF - SetEvent EVENT_117 + SetEvent EVENT_RESCUED_MR_FUJI + SetEvent EVENT_RESCUED_MR_FUJI_2 ld a, HS_LAVENDER_HOUSE_1_MR_FUJI ld [wcc4d], a predef ShowObject diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index e6ba430b..3c312d4c 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -13,17 +13,16 @@ RocketHideout4Script_45473: ; 45473 (11:5473) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_6A5 + CheckEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED jr nz, .asm_45496 - and $c - cp $c + CheckBothEventsSet EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0, EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2, 1 jr z, .asm_4548c ld a, $2d jr .asm_45498 .asm_4548c ld a, SFX_GO_INSIDE call PlaySound - SetEvent EVENT_6A5 + SetEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED .asm_45496 ld a, $e .asm_45498 @@ -51,7 +50,7 @@ RocketHideout4Script3: ; 454b6 (11:54b6) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_6A7 + SetEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -117,7 +116,7 @@ RocketHideout4TrainerHeader3: ; 4552d (11:552d) RocketHideout4Text1: ; 4553a (11:553a) TX_ASM - CheckEvent EVENT_6A7 + CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI jp nz, .asm_545571 ld hl, RocketHideout4Text_4557a call PrintText @@ -209,7 +208,7 @@ RocketHideout4AfterBattleText4: ; 455cf (11:55cf) TX_ASM ld hl, RocketHideout4Text_455ec call PrintText - CheckAndSetEvent EVENT_6A6 + CheckAndSetEvent EVENT_ROCKET_DROPPED_LIFT_KEY jr nz, .asm_455e9 ld a, HS_ROCKET_HIDEOUT_4_ITEM_5 ld [wcc4d], a diff --git a/scripts/route1.asm b/scripts/route1.asm index d1e39c06..6c00e555 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -8,7 +8,7 @@ Route1TextPointers: ; 1cab2 (7:4ab2) Route1Text1: ; 1cab8 (7:4ab8) TX_ASM - CheckAndSetEvent EVENT_3C0 + CheckAndSetEvent EVENT_GOT_POTION_SAMPLE jr nz, .asm_1cada ld hl, Route1ViridianMartSampleText call PrintText diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index 7720b176..9bae1398 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -17,7 +17,7 @@ Route11GateUpstairsScriptEnd: ; 49469 (12:5469) Route11GateUpstairsText2: ; 4946c (12:546c) TX_ASM - CheckEvent EVENT_47F, 1 + CheckEvent EVENT_GOT_ITEMFINDER, 1 jr c, .asm_4949b ld a, 30 ; pokemon needed ld [$ffdb], a @@ -34,7 +34,7 @@ Route11GateUpstairsText2: ; 4946c (12:546c) ld a, [$ffdb] dec a jr nz, .asm_494a1 - SetEvent EVENT_47F + SetEvent EVENT_GOT_ITEMFINDER .asm_4949b ld hl, Route11GateUpstairsText_494a3 call PrintText diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index e1f8901f..f651d373 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -8,7 +8,7 @@ Route12GateUpstairsTextPointers: ; 49563 (12:5563) Route12GateUpstairsText1: ; 49569 (12:5569) TX_ASM - CheckEvent EVENT_480, 1 + CheckEvent EVENT_GOT_TM39, 1 jr c, .asm_0ad3c ld hl, TM39PreReceiveText call PrintText @@ -17,7 +17,7 @@ Route12GateUpstairsText1: ; 49569 (12:5569) jr nc, .BagFull ld hl, ReceivedTM39Text call PrintText - SetEvent EVENT_480 + SetEvent EVENT_GOT_TM39 jr .asm_4ba56 .BagFull ld hl, TM39NoRoomText diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index e3a3cf3b..cedabdc0 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -7,7 +7,7 @@ Route15GateUpstairsTextPointers: ; 4964d (12:564d) Route15GateUpstairsText1: ; 49651 (12:5651) TX_ASM - CheckEvent EVENT_4B0 + CheckEvent EVENT_GOT_EXP_ALL jr nz, .asm_49683 ld a, 50 ; pokemon needed ld [$ffdb], a @@ -23,7 +23,7 @@ Route15GateUpstairsText1: ; 49651 (12:5651) ld a, [$ffdb] cp $1 jr nz, .asm_49689 - SetEvent EVENT_4B0 + SetEvent EVENT_GOT_EXP_ALL .asm_49683 ld hl, Route15GateUpstairsText_4968c call PrintText diff --git a/scripts/route16house.asm b/scripts/route16house.asm index d01465cb..4a0ac0c3 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -7,7 +7,7 @@ Route16HouseTextPointers: ; 1e5fb (7:65fb) Route16HouseText1: ; 1e5ff (7:65ff) TX_ASM - CheckEvent EVENT_4CE + CheckEvent EVENT_GOT_HM02 ld hl, HM02ExplanationText jr nz, .asm_13616 ld hl, Route16HouseText3 @@ -15,7 +15,7 @@ Route16HouseText1: ; 1e5ff (7:65ff) ld bc, (HM_02 << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_4CE + SetEvent EVENT_GOT_HM02 ld hl, ReceivedHM02Text jr .asm_13616 .BagFull diff --git a/scripts/route20.asm b/scripts/route20.asm index f4690732..2ef51da9 100755 --- a/scripts/route20.asm +++ b/scripts/route20.asm @@ -1,5 +1,5 @@ Route20Script: ; 50ca9 (14:4ca9) - CheckAndResetEvent EVENT_500 + CheckAndResetEvent EVENT_IN_SEAFOAM_ISLANDS call nz, Route20Script_50cc6 call EnableAutoTextBoxDrawing ld hl, Route20TrainerHeader0 @@ -10,7 +10,7 @@ Route20Script: ; 50ca9 (14:4ca9) ret Route20Script_50cc6: ; 50cc6 (14:4cc6) - CheckBothEventsSet EVENT_9C8, EVENT_9C9 + CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE jr z, .asm_50cef ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 call Route20Script_50d0c @@ -36,7 +36,7 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) db $FF .asm_50cef - CheckBothEventsSet EVENT_9D0, EVENT_9D1 + CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE ret z ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 call Route20Script_50d0c diff --git a/scripts/route22.asm b/scripts/route22.asm index dec8afd6..73fe2f55 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -55,7 +55,7 @@ Route22RivalMovementData: ; 50efb (14:4efb) db $FF Route22Script0: ; 50f00 (14:4f00) - CheckEvent EVENT_527 + CheckEvent EVENT_ROUTE22_RIVAL_WANTS_FIGHT ret z ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray @@ -68,9 +68,9 @@ Route22Script0: ; 50f00 (14:4f00) ld [wJoyIgnore], a ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a - CheckEvent EVENT_520 + CheckEvent EVENT_1ST_ROUTE22_RIVAL_BATTLE jr nz, .firstRivalBattle - CheckEventReuseA EVENT_521 ; is this the rival at the end of the game? + CheckEventReuseA EVENT_2ND_ROUTE22_RIVAL_BATTLE ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret @@ -163,7 +163,7 @@ Route22Script2: ; 50fb5 (14:4fb5) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_525 + SetEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -227,7 +227,7 @@ Route22Script3: ; 5102a (14:502a) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ResetEvents EVENT_520, EVENT_527 + ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT ld a, $0 ld [W_ROUTE22CURSCRIPT], a ret @@ -322,7 +322,7 @@ Route22Script5: ; 510df (14:50df) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_526 + SetEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -372,7 +372,7 @@ Route22Script6: ; 51151 (14:5151) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ResetEvents EVENT_521, EVENT_527 + ResetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT ld a, $7 ld [W_ROUTE22CURSCRIPT], a ret @@ -384,7 +384,7 @@ Route22TextPointers: ; 51175 (14:5175) Route22Text1: ; 5117b (14:517b) TX_ASM - CheckEvent EVENT_525 + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText @@ -397,7 +397,7 @@ Route22Text1: ; 5117b (14:517b) Route22Text2: ; 51194 (14:5194) TX_ASM - CheckEvent EVENT_526 + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText diff --git a/scripts/route23.asm b/scripts/route23.asm index e17b7d23..adc631d8 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -10,8 +10,8 @@ Route23Script_511e9: ; 511e9 (14:51e9) bit 6, [hl] res 6, [hl] ret z - ResetEvents EVENT_538, EVENT_53F - ResetEvents EVENT_660, EVENT_666 + ResetEvents EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 + ResetEvents EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1, EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2 ld a, HS_VICTORY_ROAD_3_BOULDER ld [wcc4d], a predef ShowObject @@ -29,7 +29,7 @@ Route23Script0: ; 51219 (14:5219) ld a, [W_YCOORD] ld b, a ld e, $0 - EventFlagBit c, EVENT_536 + 1, EVENT_530 + EventFlagBit c, EVENT_PASSED_EARTHBADGE_CHECK + 1, EVENT_PASSED_CASCADEBADGE_CHECK .asm_51224 ld a, [hli] cp $ff @@ -49,7 +49,7 @@ Route23Script0: ; 51219 (14:5219) ld a, c ld [wWhichBadge], a ld b, FLAG_TEST - EventFlagAddress hl, EVENT_530 + EventFlagAddress hl, EVENT_PASSED_CASCADEBADGE_CHECK predef FlagActionPredef ld a, c and a @@ -143,43 +143,43 @@ Route23TextPointers: ; 512f7 (14:52f7) Route23Text1: ; 51307 (14:5307) TX_ASM - EventFlagBit a, EVENT_536, EVENT_530 + EventFlagBit a, EVENT_PASSED_EARTHBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text2: ; 51310 (14:5310) TX_ASM - EventFlagBit a, EVENT_535, EVENT_530 + EventFlagBit a, EVENT_PASSED_VOLCANOBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text3: ; 51319 (14:5319) TX_ASM - EventFlagBit a, EVENT_534, EVENT_530 + EventFlagBit a, EVENT_PASSED_MARSHBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text4: ; 51322 (14:5322) TX_ASM - EventFlagBit a, EVENT_533, EVENT_530 + EventFlagBit a, EVENT_PASSED_SOULBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text5: ; 5132b (14:532b) TX_ASM - EventFlagBit a, EVENT_532, EVENT_530 + EventFlagBit a, EVENT_PASSED_RAINBOWBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text6: ; 51334 (14:5334) TX_ASM - EventFlagBit a, EVENT_531, EVENT_530 + EventFlagBit a, EVENT_PASSED_THUNDERBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text7: ; 5133d (14:533d) TX_ASM - EventFlagBit a, EVENT_530 + EventFlagBit a, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd @@ -207,7 +207,7 @@ Route23Script_51346: ; 51346 (14:5346) ld a, [wWhichBadge] ld c, a ld b, FLAG_SET - EventFlagAddress hl, EVENT_530 + EventFlagAddress hl, EVENT_PASSED_CASCADEBADGE_CHECK predef FlagActionPredef ld a, $2 ld [W_ROUTE23CURSCRIPT], a diff --git a/scripts/route24.asm b/scripts/route24.asm index c946159c..4e83a5cd 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -22,7 +22,7 @@ Route24ScriptPointers: ; 513cb (14:53cb) dw Route24Script4 Route24Script0: ; 513d5 (14:53d5) - CheckEvent EVENT_540 + CheckEvent EVENT_GOT_NUGGET jp nz, CheckFightingMapTrainers ld hl, CoordsData_5140e call ArePlayerCoordsInArray @@ -32,7 +32,7 @@ Route24Script0: ; 513d5 (14:53d5) ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID - CheckAndResetEvent EVENT_549 + CheckAndResetEvent EVENT_NUGGET_REWARD_AVAILABLE ret z ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a @@ -64,7 +64,7 @@ Route24Script3: ; 51422 (14:5422) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_541 + SetEvent EVENT_BEAT_ROUTE24_ROCKET ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -144,15 +144,15 @@ Route24TrainerHeader6: ; 51497 (14:5497) Route24Text1: ; 514a4 (14:54a4) TX_ASM - ResetEvent EVENT_549 - CheckEvent EVENT_540 + ResetEvent EVENT_NUGGET_REWARD_AVAILABLE + CheckEvent EVENT_GOT_NUGGET jr nz, .asm_514f9 ld hl, Route24Text_51510 call PrintText ld bc, (NUGGET << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_540 + SetEvent EVENT_GOT_NUGGET ld hl, Route24Text_5151a call PrintText ld hl, Route24Text_51526 @@ -180,7 +180,7 @@ Route24Text1: ; 514a4 (14:54a4) .BagFull ld hl, Route24Text_51521 call PrintText - SetEvent EVENT_549 + SetEvent EVENT_NUGGET_REWARD_AVAILABLE jp TextScriptEnd Route24Text_51510: ; 51510 (14:5510) diff --git a/scripts/route25.asm b/scripts/route25.asm index 6bbb5e26..a123d74a 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -13,18 +13,18 @@ Route25Script_515e1: ; 515e1 (14:55e1) bit 6, [hl] res 6, [hl] ret z - CheckEventHL EVENT_55F + CheckEventHL EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING ret nz - CheckEventReuseHL EVENT_55D + CheckEventReuseHL EVENT_MET_BILL_2 jr nz, .asm_515ff - ResetEventReuseHL EVENT_55E + ResetEventReuseHL EVENT_BILL_SAID_USE_CELL_SEPARATOR ld a, HS_BILL_POKEMON ld [wcc4d], a predef_jump ShowObject .asm_515ff - CheckEventAfterBranchReuseHL EVENT_55C, EVENT_55D + CheckEventAfterBranchReuseHL EVENT_GOT_SS_TICKET, EVENT_MET_BILL_2 ret z - SetEventReuseHL EVENT_55F + SetEventReuseHL EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING ld a, HS_NUGGET_BRIDGE_GUY ld [wcc4d], a predef HideObject diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index 49c28e02..789482dc 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -7,7 +7,7 @@ Route2GateTextPointers: ; 5d5d7 (17:55d7) Route2GateText1: ; 5d5db (17:55db) TX_ASM - CheckEvent EVENT_3D8 + CheckEvent EVENT_GOT_HM05 jr nz, .asm_5d60d ld a, 10 ; pokemon needed ld [$ffdb], a @@ -23,7 +23,7 @@ Route2GateText1: ; 5d5db (17:55db) ld a, [$ffdb] cp $1 jr nz, .asm_5d613 - SetEvent EVENT_3D8 + SetEvent EVENT_GOT_HM05 .asm_5d60d ld hl, Route2GateText_5d616 call PrintText diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index 48992d94..6cf17b9d 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -6,7 +6,7 @@ SafariZoneSecretHouseTextPointers: ; 4a31a (12:631a) SafariZoneSecretHouseText1: ; 4a31c (12:631c) TX_ASM - CheckEvent EVENT_880 + CheckEvent EVENT_GOT_HM03 jr nz, .asm_20a9b ld hl, SafariZoneSecretHouseText_4a350 call PrintText @@ -15,7 +15,7 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) jr nc, .BagFull ld hl, ReceivedHM03Text call PrintText - SetEvent EVENT_880 + SetEvent EVENT_GOT_HM03 jr .asm_8f1fc .BagFull ld hl, HM03NoRoomText diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index 68300183..f3ec4c99 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -6,7 +6,7 @@ SaffronHouse2TextPointers: ; 1de3f (7:5e3f) SaffronHouse2Text1: ; 1de41 (7:5e41) TX_ASM - CheckEvent EVENT_3B0 + CheckEvent EVENT_GOT_TM29 jr nz, .asm_9e72b ld hl, TM29PreReceiveText call PrintText @@ -15,7 +15,7 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) jr nc, .BagFull ld hl, ReceivedTM29Text call PrintText - SetEvent EVENT_3B0 + SetEvent EVENT_GOT_TM29 jr .asm_fe4e1 .BagFull ld hl, TM29NoRoomText diff --git a/scripts/seafoamislands1.asm b/scripts/seafoamislands1.asm index 89972aca..542afe18 100755 --- a/scripts/seafoamislands1.asm +++ b/scripts/seafoamislands1.asm @@ -1,6 +1,6 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) call EnableAutoTextBoxDrawing - SetEvent EVENT_500 + SetEvent EVENT_IN_SEAFOAM_ISLANDS ld hl, wFlags_0xcd60 bit 7, [hl] res 7, [hl] @@ -8,18 +8,18 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) ld hl, Seafoam1HolesCoords call CheckBoulderCoords ret nc - EventFlagAddress hl, EVENT_50E + EventFlagAddress hl, EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE ld a, [wCoordIndex] cp $1 jr nz, .asm_44819 - SetEventReuseHL EVENT_50E + SetEventReuseHL EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd07a], a jr .asm_44825 .asm_44819 - SetEventAfterBranchReuseHL EVENT_50F, EVENT_50E + SetEventAfterBranchReuseHL EVENT_SEAFOAM1_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 diff --git a/scripts/seafoamislands2.asm b/scripts/seafoamislands2.asm index c24ba601..bf81a467 100755 --- a/scripts/seafoamislands2.asm +++ b/scripts/seafoamislands2.asm @@ -7,18 +7,18 @@ SeafoamIslands2Script: ; 46315 (11:6315) ld hl, Seafoam2HolesCoords call CheckBoulderCoords ret nc - EventFlagAddress hl, EVENT_9C0 + EventFlagAddress hl, EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE ld a, [wCoordIndex] cp $1 jr nz, .asm_46340 - SetEventReuseHL EVENT_9C0 + SetEventReuseHL EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd07a], a jr .asm_4634c .asm_46340 - SetEventAfterBranchReuseHL EVENT_9C1, EVENT_9C0 + SetEventAfterBranchReuseHL EVENT_SEAFOAM2_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 diff --git a/scripts/seafoamislands3.asm b/scripts/seafoamislands3.asm index f117c2a7..8f66a0ca 100755 --- a/scripts/seafoamislands3.asm +++ b/scripts/seafoamislands3.asm @@ -7,18 +7,18 @@ SeafoamIslands3Script: ; 46451 (11:6451) ld hl, Seafoam3HolesCoords call CheckBoulderCoords ret nc - EventFlagAddress hl, EVENT_9C8 + EventFlagAddress hl, EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE ld a, [wCoordIndex] cp $1 jr nz, .asm_4647c - SetEventReuseHL EVENT_9C8 + SetEventReuseHL EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_3 ld [wd07a], a jr .asm_46488 .asm_4647c - SetEventAfterBranchReuseHL EVENT_9C9, EVENT_9C8 + SetEventAfterBranchReuseHL EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_4 diff --git a/scripts/seafoamislands4.asm b/scripts/seafoamislands4.asm index 031f9d13..dc198123 100755 --- a/scripts/seafoamislands4.asm +++ b/scripts/seafoamislands4.asm @@ -7,18 +7,18 @@ SeafoamIslands4Script: ; 4658d (11:658d) ld hl, Seafoam4HolesCoords call CheckBoulderCoords ret nc - EventFlagAddress hl, EVENT_9D0 + EventFlagAddress hl, EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE ld a, [wCoordIndex] cp $1 jr nz, .asm_465b8 - SetEventReuseHL EVENT_9D0 + SetEventReuseHL EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_1 ld [wd07a], a jr .asm_465c4 .asm_465b8 - SetEventAfterBranchReuseHL EVENT_9D1, EVENT_9D0 + SetEventAfterBranchReuseHL EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_2 @@ -56,7 +56,7 @@ SeafoamIslands4ScriptPointers: ; 465fb (11:65fb) dw SeafoamIslands4Script3 SeafoamIslands4Script0: ; 46603 (11:6603) - CheckBothEventsSet EVENT_9C8, EVENT_9C9 + CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE ret z ld a, [W_YCOORD] cp $8 @@ -91,7 +91,7 @@ SeafoamIslands4Script1: ; 46639 (11:6639) ret SeafoamIslands4Script2: ; 46644 (11:6644) - CheckBothEventsSet EVENT_9C8, EVENT_9C9 + CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE ret z ld a, [W_XCOORD] cp $12 diff --git a/scripts/seafoamislands5.asm b/scripts/seafoamislands5.asm index 9324a187..eca361f3 100755 --- a/scripts/seafoamislands5.asm +++ b/scripts/seafoamislands5.asm @@ -27,7 +27,7 @@ SeafoamIslands5Script4: ; 467b7 (11:67b7) ret SeafoamIslands5Script0: ; 467c7 (11:67c7) - CheckBothEventsSet EVENT_9C8, EVENT_9C9 + CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE ret z ld hl, CoordsData_467fe call ArePlayerCoordsInArray @@ -70,7 +70,7 @@ SeafoamIslands5Script1: ; 46807 (11:6807) ret SeafoamIslands5Script2: ; 46816 (11:6816) - CheckBothEventsSet EVENT_9D0, EVENT_9D1 + CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE ld a, $0 jr z, .asm_46849 ld hl, CoordsData_4684d diff --git a/scripts/silphco1.asm b/scripts/silphco1.asm index 26c8c888..71b59d72 100755 --- a/scripts/silphco1.asm +++ b/scripts/silphco1.asm @@ -1,10 +1,10 @@ SilphCo1Script: ; 5d44e (17:544e) call EnableAutoTextBoxDrawing - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ret z - CheckAndSetEvent EVENT_397 + CheckAndSetEvent EVENT_SILPH_CO_RECEPTIONIST_AT_DESK ret nz - ld a, HS_SILPH_CO_1F_1 + ld a, HS_SILPH_CO_1F_RECEPTIONIST ld [wcc4d], a predef_jump ShowObject diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index 7c7bf785..326b0aeb 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -16,7 +16,7 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f) ld hl, DataTable_5a173 call SilphCo2Script_59d43 call SilphCo10Text_5a176 - CheckEvent EVENT_778 + CheckEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret nz ld a, $54 ld [wd09f], a @@ -30,7 +30,7 @@ SilphCo10Text_5a176: ; 5a176 (16:6176) ld a, [$ffe0] and a ret z - SetEvent EVENT_778 + SetEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret SilphCo10ScriptPointers: ; 5a180 (16:6180) @@ -81,7 +81,7 @@ SilphCo10Text2: ; 5a1b5 (16:61b5) SilphCo10Text3: ; 5a1bf (16:61bf) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo10Text_5a1d8 jr nz, .asm_cf85f ld hl, SilphCo10Text_5a1d3 diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index b855e6d0..8f37b57f 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -16,7 +16,7 @@ SilphCo11Script_62110: ; 62110 (18:6110) ld hl, DataTable_62134 call SilphCo11Script_62137 call SilphCo11Script_62163 - CheckEvent EVENT_788 + CheckEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR ret nz ld a, $20 ld [wd09f], a @@ -66,7 +66,7 @@ SilphCo11Script_62163: ; 62163 (18:6163) ld a, [$ffe0] and a ret z - SetEvent EVENT_788 + SetEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR ret SilphCo11Script_6216d: ; 6216d (18:616d) @@ -162,7 +162,7 @@ SilphCo11ScriptPointers: ; 621cf (18:61cf) dw SilphCo11Script5 SilphCo11Script0: ; 621db (18:61db) - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ret nz ld hl, CoordsData_62211 call ArePlayerCoordsInArray @@ -228,7 +228,7 @@ SilphCo11Script5: ; 62227 (18:6227) call UpdateSprites call Delay3 call GBFadeInFromBlack - SetEvent EVENT_78F + SetEvent EVENT_BEAT_SILPH_CO_GIOVANNI xor a ld [wJoyIgnore], a jp SilphCo11Script_621c8 @@ -302,7 +302,7 @@ SilphCo11TrainerHeader1: ; 622cf (18:62cf) SilphCo11Text1: ; 622dc (18:62dc) TX_ASM - CheckEvent EVENT_78D + CheckEvent EVENT_GOT_MASTER_BALL jp nz, .asm_62308 ld hl, SilphCoPresidentText call PrintText @@ -311,7 +311,7 @@ SilphCo11Text1: ; 622dc (18:62dc) jr nc, .BagFull ld hl, ReceivedSilphCoMasterBallText call PrintText - SetEvent EVENT_78D + SetEvent EVENT_GOT_MASTER_BALL jr .asm_6230e .BagFull ld hl, SilphCoMasterBallNoRoomText diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index eb6b1b8e..a8d0fa56 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -16,7 +16,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) ld hl, DataTable_59d3e call SilphCo2Script_59d43 call SilphCo2Script_59d6f - CheckEvent EVENT_6FD + CheckEvent EVENT_SILPH_CO_2_UNLOCKED_DOOR1 jr nz, .asm_59d2e push af ld a, $54 @@ -25,7 +25,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) predef ReplaceTileBlock pop af .asm_59d2e - bit 6, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_2_UNLOCKED_DOOR2, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ret nz ld a, $54 ld [wd09f], a @@ -72,16 +72,16 @@ SilphCo2Script_59d43: ; 59d43 (16:5d43) ret SilphCo2Script_59d6f: ; 59d6f (16:5d6f) - EventFlagAddress hl, EVENT_6FD + EventFlagAddress hl, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next - SetEventReuseHL EVENT_6FD + SetEventReuseHL EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ret .next - SetEventAfterBranchReuseHL EVENT_6FE, EVENT_6FD + SetEventAfterBranchReuseHL EVENT_SILPH_CO_2_UNLOCKED_DOOR2, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ret SilphCo2ScriptPointers: ; 59d80 (16:5d80) @@ -137,7 +137,7 @@ SilphCo2TrainerHeader3: ; 59db4 (16:5db4) SilphCo2Text1: ; 59dc1 (16:5dc1) TX_ASM - CheckEvent EVENT_6FF + CheckEvent EVENT_GOT_TM36 jr nz, .asm_59de4 ld hl, SilphCo2Text_59ded call PrintText @@ -145,7 +145,7 @@ SilphCo2Text1: ; 59dc1 (16:5dc1) call GiveItem ld hl, TM36NoRoomText jr nc, .asm_59de7 - SetEvent EVENT_6FF + SetEvent EVENT_GOT_TM36 ld hl, ReceivedTM36Text jr .asm_59de7 .asm_59de4 diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index 0cb54726..b55cc5eb 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -16,7 +16,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) ld hl, DataTable_59fa8 call SilphCo2Script_59d43 call SilphCo3Script_59fad - CheckEvent EVENT_708 + CheckEvent EVENT_SILPH_CO_3_UNLOCKED_DOOR1 jr nz, .asm_59f98 push af ld a, $5f @@ -25,7 +25,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) predef ReplaceTileBlock pop af .asm_59f98 - bit 1, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ret nz ld a, $5f ld [wd09f], a @@ -36,16 +36,16 @@ DataTable_59fa8: ; 59fa8 (16:5fa8) db $04,$04,$04,$08,$FF SilphCo3Script_59fad: ; 59fad (16:5fad) - EventFlagAddress hl, EVENT_708 + EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next - SetEventReuseHL EVENT_708 + SetEventReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ret .next - SetEventAfterBranchReuseHL EVENT_709, EVENT_708 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ret SilphCo3ScriptPointers: ; 59fbe (16:5fbe) @@ -82,7 +82,7 @@ SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) SilphCo3Text1: ; 59fe5 (16:5fe5) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo3Text_59ffe jr nz, .asm_59fee ld hl, SilphCo3Text_59ff9 diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index aff77e4a..815170ff 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -16,7 +16,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) ld hl, SilphCo4Data19d58 call SilphCo4Script_19d5d call SilphCo4Script_19d89 - CheckEvent EVENT_718 + CheckEvent EVENT_SILPH_CO_4_UNLOCKED_DOOR1 jr nz, .asm_19d48 push af ld a, $54 @@ -25,7 +25,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) predef ReplaceTileBlock pop af .asm_19d48 - bit 1, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret nz ld a, $54 ld [wd09f], a @@ -72,16 +72,16 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ret SilphCo4Script_19d89: ; 19d89 (6:5d89) - EventFlagAddress hl, EVENT_718 + EventFlagAddress hl, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next - SetEventReuseHL EVENT_718 + SetEventReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret .next - SetEventAfterBranchReuseHL EVENT_719, EVENT_718 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret SilphCo4ScriptPointers: ; 19d9a (6:5d9a) diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index cd220b3e..ecc57537 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -16,7 +16,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) ld hl, SilphCo5Coords call SilphCo4Script_19d5d call SilphCo5Script_19f9e - CheckEvent EVENT_728 + CheckEvent EVENT_SILPH_CO_5_UNLOCKED_DOOR1 jr nz, .asm_19f74 push af ld a, $5f @@ -25,7 +25,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) predef ReplaceTileBlock pop af .asm_19f74 - bit 1, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR2, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 jr nz, .asm_19f87 push af ld a, $5f @@ -34,7 +34,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) predef ReplaceTileBlock pop af .asm_19f87 - bit 2, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR2 ret nz ld a, $5f ld [wd09f], a @@ -45,21 +45,21 @@ SilphCo5Coords: ; 19f97 (6:5f97) db $02, $03, $06, $03, $05, $07, $ff SilphCo5Script_19f9e: ; 19f9e (6:5f9e) - EventFlagAddress hl, EVENT_728 + EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next1 - SetEventReuseHL EVENT_728 + SetEventReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ret .next1 cp $2 jr nz, .next2 - SetEventAfterBranchReuseHL EVENT_729, EVENT_728 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR2, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ret .next2 - SetEventAfterBranchReuseHL EVENT_72A, EVENT_728 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ret SilphCo5ScriptPointers: ; 19fb6 (6:5fb6) diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index ca52d05c..a84f0dc4 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -16,7 +16,7 @@ SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) ld hl, SilphCo6Coords1 call SilphCo4Script_19d5d call SilphCo6Script_1a1e6 - CheckEvent EVENT_73F + CheckEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR ret nz ld a, $5f ld [wd09f], a @@ -31,7 +31,7 @@ SilphCo6Script_1a1e6: ; 1a1e6 (6:61e6) ld a, [$ffe0] and a ret z - SetEvent EVENT_73F + SetEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR ret SilphCo6ScriptPointers: ; 1a1f0 (6:61f0) @@ -82,7 +82,7 @@ SilphCo6TrainerHeader3: ; 1a222 (6:6222) db $ff SilphCo6Script_1a22f: ; 1a22f (6:622f) - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .asm_1a238 jr .asm_1a23a .asm_1a238 diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 64c79c3a..26d9e62f 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -16,7 +16,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) ld hl, DataTable_51bc1 call SilphCo7Text_51bc8 call SilphCo7Text_51bf4 - CheckEvent EVENT_74C + CheckEvent EVENT_SILPH_CO_7_UNLOCKED_DOOR1 jr nz, .asm_51b9e push af ld a, $54 @@ -25,7 +25,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) predef ReplaceTileBlock pop af .asm_51b9e - bit 5, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_7_UNLOCKED_DOOR2, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 jr nz, .asm_51bb1 push af ld a, $54 @@ -34,7 +34,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) predef ReplaceTileBlock pop af .asm_51bb1 - bit 6, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_7_UNLOCKED_DOOR3, EVENT_SILPH_CO_7_UNLOCKED_DOOR2 ret nz ld a, $54 ld [wd09f], a @@ -81,21 +81,21 @@ SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) ret SilphCo7Text_51bf4: ; 51bf4 (14:5bf4) - EventFlagAddress hl, EVENT_74C + EventFlagAddress hl, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next1 - SetEventReuseHL EVENT_74C + SetEventReuseHL EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ret .next1 cp $2 jr nz, .next2 - SetEventAfterBranchReuseHL EVENT_74D, EVENT_74C + SetEventAfterBranchReuseHL EVENT_SILPH_CO_7_UNLOCKED_DOOR2, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ret .next2 - SetEventAfterBranchReuseHL EVENT_74E, EVENT_74C + SetEventAfterBranchReuseHL EVENT_SILPH_CO_7_UNLOCKED_DOOR3, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ret SilphCo7Text_51c0c: ; 51c0c (14:5c0c) @@ -116,7 +116,7 @@ SilphCo7ScriptPointers: ; 51c17 (14:5c17) dw SilphCo7Script5 SilphCo7Script0: ; 51c23 (14:5c23) - CheckEvent EVENT_740 + CheckEvent EVENT_BEAT_SILPH_CO_RIVAL jp nz, CheckFightingMapTrainers ld hl, CoordsData_51c78 call ArePlayerCoordsInArray @@ -205,7 +205,7 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) jp z, SilphCo7Text_51c0c ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_740 + SetEvent EVENT_BEAT_SILPH_CO_RIVAL ld a, PLAYER_DIR_DOWN ld [wPlayerMovingDirection], a ld a, $9 @@ -321,7 +321,7 @@ SilphCo7Text1: ld a, [wd72e] bit 0, a ; got lapras? jr z, .givelapras - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph ld hl, .LaprasGuyText call PrintText @@ -365,7 +365,7 @@ SilphCo7Text1: SilphCo7Text2: TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph ld hl, .rockettext call PrintText @@ -386,7 +386,7 @@ SilphCo7Text2: SilphCo7Text3: TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph ld hl, .rockettext call PrintText @@ -407,7 +407,7 @@ SilphCo7Text3: SilphCo7Text4: TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph ld hl, .rockettext call PrintText diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index ec54ea8e..26a89355 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -16,7 +16,7 @@ SilphCo8Script_5651a: ; 5651a (15:651a) ld hl, DataTable_5653e call SilphCo8Script_56541 call SilphCo8Script_5656d - CheckEvent EVENT_758 + CheckEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR ret nz ld a, $5f ld [wd09f], a @@ -66,7 +66,7 @@ SilphCo8Script_5656d: ; 5656d (15:656d) ld a, [$ffe0] and a ret z - SetEvent EVENT_758 + SetEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR ret SilphCo8ScriptPointers: ; 56577 (15:6577) @@ -112,7 +112,7 @@ SilphCo8TrainerHeader2: ; 5659d (15:659d) SilphCo8Text1: ; 565aa (15:65aa) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo8Text_565c3 jr nz, .asm_565b8 ld hl, SilphCo8Text_565be diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index 2c41e019..8960c290 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -16,7 +16,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) ld hl, DataTable_5d82e call SilphCo9Script_5d837 call SilphCo9Script_5d863 - CheckEvent EVENT_768 + CheckEvent EVENT_SILPH_CO_9_UNLOCKED_DOOR1 jr nz, .asm_5d7f8 push af ld a, $5f @@ -25,7 +25,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) predef ReplaceTileBlock pop af .asm_5d7f8 - bit 1, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR2, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 jr nz, .asm_5d80b push af ld a, $54 @@ -34,7 +34,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) predef ReplaceTileBlock pop af .asm_5d80b - bit 2, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR3, EVENT_SILPH_CO_9_UNLOCKED_DOOR2 jr nz, .asm_5d81e push af ld a, $54 @@ -43,7 +43,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) predef ReplaceTileBlock pop af .asm_5d81e - bit 3, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR3 ret nz ld a, $5f ld [wd09f], a @@ -90,28 +90,28 @@ SilphCo9Script_5d837: ; 5d837 (17:5837) ret SilphCo9Script_5d863: ; 5d863 (17:5863) - EventFlagAddress hl, EVENT_768 + EventFlagAddress hl, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next1 - SetEventReuseHL EVENT_768 + SetEventReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret .next1 cp $2 jr nz, .next2 - SetEventAfterBranchReuseHL EVENT_769, EVENT_768 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR2, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret .next2 cp $3 jr nz, .next3 - SetEventAfterBranchReuseHL EVENT_76A, EVENT_768 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR3, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret .next3 cp $4 ret nz - SetEventAfterBranchReuseHL EVENT_76B, EVENT_768 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret SilphCo9ScriptPointers: ; 5d885 (17:5885) @@ -157,7 +157,7 @@ SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) SilphCo9Text1: ; 5d8b8 (17:58b8) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .asm_5d8dc ld hl, SilphCo9Text_5d8e5 call PrintText diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index a47cc069..a445ad46 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -3,7 +3,7 @@ SSAnne7Script: ; 61895 (18:5895) jp EnableAutoTextBoxDrawing SSAnne7Script_6189b: ; 6189b (18:589b) - CheckEvent EVENT_5E1 + CheckEvent EVENT_RUBBED_CAPTAINS_BACK ret nz ld hl, wd72d set 5, [hl] @@ -16,7 +16,7 @@ SSAnne7TextPointers: ; 618a7 (18:58a7) SSAnne7Text1: ; 618ad (18:58ad) TX_ASM - CheckEvent EVENT_5E0 + CheckEvent EVENT_GOT_HM01 jr nz, .asm_797c4 ld hl, SSAnne7RubText call PrintText @@ -27,7 +27,7 @@ SSAnne7Text1: ; 618ad (18:58ad) jr nc, .BagFull ld hl, ReceivedHM01Text call PrintText - SetEvent EVENT_5E0 + SetEvent EVENT_GOT_HM01 jr .asm_0faf5 .BagFull ld hl, HM01NoRoomText @@ -62,7 +62,7 @@ SSAnne7RubText: ; 618ec (18:58ec) cp MUSIC_PKMN_HEALED jr z, .asm_61910 call PlayDefaultMusic - SetEvent EVENT_5E1 + SetEvent EVENT_RUBBED_CAPTAINS_BACK ld hl, wd72d res 5, [hl] jp TextScriptEnd diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 0d6ccbee..7448e8f9 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -23,8 +23,8 @@ VermilionCityScript_197c0: ; 197c0 (6:57c0) VermilionCityScript_197cb: ; 197cb (6:57cb) CheckEventHL EVENT_SS_ANNE_LEFT ret z - CheckEventReuseHL EVENT_5E3 - SetEventReuseHL EVENT_5E3 + CheckEventReuseHL EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT + SetEventReuseHL EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT ret nz ld a, $2 ld [W_VERMILIONCITYCURSCRIPT], a diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index 20288102..a65b3603 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -1,20 +1,20 @@ VermilionDockScript: ; 1db52 (7:5b52) call EnableAutoTextBoxDrawing - CheckEventHL EVENT_5E4 + CheckEventHL EVENT_STARTED_WALKING_OUT_OF_DOCK jr nz, .asm_1db8d - CheckEventReuseHL EVENT_5E0 + CheckEventReuseHL EVENT_GOT_HM01 ret z ld a, [wDestinationWarpID] cp $1 ret nz CheckEventReuseHL EVENT_SS_ANNE_LEFT jp z, VermilionDock_1db9b - SetEventReuseHL EVENT_5E4 + SetEventReuseHL EVENT_STARTED_WALKING_OUT_OF_DOCK call Delay3 ld hl, wd730 set 7, [hl] ld hl, wSimulatedJoypadStatesEnd - ld a, $40 + ld a, D_UP ld [hli], a ld [hli], a ld [hl], a @@ -27,13 +27,13 @@ VermilionDockScript: ; 1db52 (7:5b52) ld [wJoyIgnore], a ret .asm_1db8d - CheckEventAfterBranchReuseHL EVENT_5E5, EVENT_5E4 + CheckEventAfterBranchReuseHL EVENT_WALKED_OUT_OF_DOCK, EVENT_STARTED_WALKING_OUT_OF_DOCK ret nz ld a, [wSimulatedJoypadStatesIndex] and a ret nz ld [wJoyIgnore], a - SetEventReuseHL EVENT_5E5 + SetEventReuseHL EVENT_WALKED_OUT_OF_DOCK ret VermilionDock_1db9b: ; 1db9b (7:5b9b) diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index e8b90e05..91e20ad3 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -11,7 +11,7 @@ VictoryRoad1Script: ; 5da0a (17:5a0a) ld [W_VICTORYROAD1CURSCRIPT], a ret .next - CheckEvent EVENT_917 + CheckEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH ret z ld a, $1d ld [wd09f], a @@ -24,14 +24,14 @@ VictoryRoad1ScriptPointers: ; 5da3a (17:5a3a) dw EndTrainerBattle VictoryRoad1Script0: ; 5da40 (17:5a40) - CheckEvent EVENT_917 + CheckEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH jp nz, CheckFightingMapTrainers ld hl, CoordsData_5da5c call CheckBoulderCoords jp nc, CheckFightingMapTrainers ld hl, wd126 set 5, [hl] - SetEvent EVENT_917 + SetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH ret CoordsData_5da5c: ; 5da5c (17:5a5c) diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index 46755c46..b7aa40b5 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -16,10 +16,10 @@ VictoryRoad2Script: ; 5179d (14:579d) ret VictoryRoad2Script_517c4: ; 517c4 (14:57c4) - ResetEvent EVENT_917 + ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH VictoryRoad2Script_517c9: ; 517c9 (14:57c9) - CheckEvent EVENT_538 + CheckEvent EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 jr z, .asm_517da push af ld a, $15 @@ -46,17 +46,17 @@ VictoryRoad2Script0: ; 517f1 (14:57f1) ld hl, CoordsData_51816 call CheckBoulderCoords jp nc, CheckFightingMapTrainers - EventFlagAddress hl, EVENT_538 + EventFlagAddress hl, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 ld a, [wCoordIndex] cp $2 jr z, .asm_5180b - CheckEventReuseHL EVENT_538 - SetEventReuseHL EVENT_538 + CheckEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 + SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 ret nz jr .asm_51810 .asm_5180b - CheckEventAfterBranchReuseHL EVENT_53F, EVENT_538 - SetEventReuseHL EVENT_53F + CheckEventAfterBranchReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 + SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 ret nz .asm_51810 ld hl, wd126 diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index bbb64272..2984e4ae 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -13,7 +13,7 @@ VictoryRoad3Script_44996: ; 44996 (11:4996) bit 5, [hl] res 5, [hl] ret z - CheckEventHL EVENT_660 + CheckEventHL EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 ret z ld a, $1d ld [wd09f], a @@ -38,10 +38,10 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) jr nz, .asm_449dc ld hl, wd126 set 5, [hl] - SetEvent EVENT_660 + SetEvent EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 ret .asm_449dc - CheckAndSetEvent EVENT_666 + CheckAndSetEvent EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2 jr nz, .asm_449fe ld a, HS_VICTORY_ROAD_3_BOULDER ld [wcc4d], a diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index 2d55cc44..7cdf5ad8 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -15,12 +15,12 @@ ViridianCityScript0: ; 19005 (6:5005) jp ViridianCityScript_1903d ViridianCityScript_1900b: ; 1900b (6:500b) - CheckEvent EVENT_028 + CheckEvent EVENT_VIRIDIAN_GYM_OPEN ret nz ld a, [W_OBTAINEDBADGES] cp %01111111 jr nz, .asm_1901e - SetEvent EVENT_028 + SetEvent EVENT_VIRIDIAN_GYM_OPEN ret .asm_1901e ld a, [W_YCOORD] @@ -231,7 +231,7 @@ ViridianCityText_19191: ; 19191 (6:5191) ViridianCityText6: ; 19196 (6:5196) TX_ASM - CheckEvent EVENT_029 + CheckEvent EVENT_GOT_TM42 jr nz, .asm_4e5a0 ld hl, ViridianCityText_191ca call PrintText @@ -240,7 +240,7 @@ ViridianCityText6: ; 19196 (6:5196) jr nc, .BagFull ld hl, ReceivedTM42Text call PrintText - SetEvent EVENT_029 + SetEvent EVENT_GOT_TM42 jr .asm_3c73c .BagFull ld hl, TM42NoRoomText diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 1dd736cf..2124d965 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -165,7 +165,7 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, HS_ROUTE_22_RIVAL_2 ld [wcc4d], a predef ShowObject - SetEvents EVENT_521, EVENT_527 + SetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT jp ViridianGymScript_748d6 ViridianGymTextPointers: ; 749ec (1d:49ec) diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index 7008ba5b..986ac8f1 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -6,7 +6,7 @@ ViridianMartScript: ; 1d46e (7:546e) jp CallFunctionInTable ViridianMartScript_1d47d: ; 1d47d (7:547d) - CheckEvent EVENT_038 + CheckEvent EVENT_OAK_GOT_PARCEL jr nz, .asm_1d489 ld hl, ViridianMartTextPointers jr .asm_1d48c @@ -54,7 +54,7 @@ ViridianMartScript1: ; 1d4c0 (7:54c0) call DisplayTextID ld bc, (OAKS_PARCEL << 8) + 1 call GiveItem - SetEvent EVENT_039 + SetEvent EVENT_GOT_OAKS_PARCEL ld a, $2 ld [W_VIRIDIANMARKETCURSCRIPT], a ; fallthrough -- cgit v1.3.1-sl0p From dcc7f3bc9f41f2d5e0f7448b4688c1058da0040b Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 14:21:14 -0700 Subject: named more constants --- constants/event_constants.asm | 34 +++++++++++++++--------------- engine/hall_of_fame.asm | 2 +- engine/hidden_object_functions7.asm | 42 +++++++++++++++++++------------------ engine/pokedex_rating.asm | 2 +- home.asm | 4 ++-- scripts/cinnabargym.asm | 40 +++++++++++++++++------------------ scripts/halloffameroom.asm | 2 +- scripts/indigoplateaulobby.asm | 4 ++-- scripts/lorelei.asm | 2 +- wram.asm | 5 ++++- 10 files changed, 71 insertions(+), 66 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/constants/event_constants.asm b/constants/event_constants.asm index 1eb68941..4e3a2849 100755 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -3,7 +3,7 @@ const_value = 0 const EVENT_FOLLOWED_OAK_INTO_LAB ; 000, (D747, bit 0) const EVENT_001 ; 001, (D747, bit 1) const EVENT_002 ; 002, (D747, bit 2) - const EVENT_003 ; 003, (D747, bit 3) + const EVENT_HALL_OF_FAME_DEX_RATING ; 003, (D747, bit 3) const EVENT_004 ; 004, (D747, bit 4) const EVENT_005 ; 005, (D747, bit 5) const EVENT_PALLET_AFTER_GETTING_POKEBALLS ; 006, (D747, bit 6) @@ -666,13 +666,13 @@ const_value = 0 const EVENT_297 ; 297, (D799, bit 7) const EVENT_GOT_TM38 ; 298, (D79A, bit 0) const EVENT_BEAT_BLAINE ; 299, (D79A, bit 1) - const EVENT_29A ; 29A, (D79A, bit 2) - const EVENT_29B ; 29B, (D79A, bit 3) - const EVENT_29C ; 29C, (D79A, bit 4) - const EVENT_29D ; 29D, (D79A, bit 5) - const EVENT_29E ; 29E, (D79A, bit 6) - const EVENT_29F ; 29F, (D79A, bit 7) - const EVENT_2A0 ; 2A0, (D79B, bit 0) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_0 ; 29A, (D79A, bit 2) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_1 ; 29B, (D79A, bit 3) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_2 ; 29C, (D79A, bit 4) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_3 ; 29D, (D79A, bit 5) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_4 ; 29E, (D79A, bit 6) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_5 ; 29F, (D79A, bit 7) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_6 ; 2A0, (D79B, bit 0) const EVENT_2A1 ; 2A1, (D79B, bit 1) const EVENT_2A2 ; 2A2, (D79B, bit 2) const EVENT_2A3 ; 2A3, (D79B, bit 3) @@ -680,13 +680,13 @@ const_value = 0 const EVENT_2A5 ; 2A5, (D79B, bit 5) const EVENT_2A6 ; 2A6, (D79B, bit 6) const EVENT_2A7 ; 2A7, (D79B, bit 7) - const EVENT_2A8 ; 2A8, (D79C, bit 0) - const EVENT_2A9 ; 2A9, (D79C, bit 1) - const EVENT_2AA ; 2AA, (D79C, bit 2) - const EVENT_2AB ; 2AB, (D79C, bit 3) - const EVENT_2AC ; 2AC, (D79C, bit 4) - const EVENT_2AD ; 2AD, (D79C, bit 5) - const EVENT_2AE ; 2AE, (D79C, bit 6) + const EVENT_CINNABAR_GYM_GATE0_UNLOCKED ; 2A8, (D79C, bit 0) doesn't exist, but the bit is set + const EVENT_CINNABAR_GYM_GATE1_UNLOCKED ; 2A9, (D79C, bit 1) + const EVENT_CINNABAR_GYM_GATE2_UNLOCKED ; 2AA, (D79C, bit 2) + const EVENT_CINNABAR_GYM_GATE3_UNLOCKED ; 2AB, (D79C, bit 3) + const EVENT_CINNABAR_GYM_GATE4_UNLOCKED ; 2AC, (D79C, bit 4) + const EVENT_CINNABAR_GYM_GATE5_UNLOCKED ; 2AD, (D79C, bit 5) + const EVENT_CINNABAR_GYM_GATE6_UNLOCKED ; 2AE, (D79C, bit 6) const EVENT_2AF ; 2AF, (D79C, bit 7) const EVENT_2B0 ; 2B0, (D79D, bit 0) const EVENT_2B1 ; 2B1, (D79D, bit 1) @@ -2272,7 +2272,7 @@ const_value = 0 const EVENT_8DD ; 8DD, (D862, bit 5) const EVENT_8DE ; 8DE, (D862, bit 6) const EVENT_8DF ; 8DF, (D862, bit 7) - const EVENT_ELITE4_EVENTS_START ; 8E0, (D863, bit 0) + const ELITE4_EVENTS_START ; 8E0, (D863, bit 0) const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 ; 8E1, (D863, bit 1) const EVENT_8E2 ; 8E2, (D863, bit 2) const EVENT_8E3 ; 8E3, (D863, bit 3) @@ -2311,7 +2311,7 @@ const_value = 0 const EVENT_904 ; 904, (D867, bit 4) const EVENT_905 ; 905, (D867, bit 5) const EVENT_906 ; 906, (D867, bit 6) - const EVENT_907 ; 907, (D867, bit 7) + const ELITE4_CHAMPION_EVENTS_END ; 907, (D867, bit 7) const EVENT_908 ; 908, (D868, bit 0) const EVENT_909 ; 909, (D868, bit 1) const EVENT_90A ; 90A, (D868, bit 2) diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm index 7361fea2..1fc2c5c5 100755 --- a/engine/hall_of_fame.asm +++ b/engine/hall_of_fame.asm @@ -207,7 +207,7 @@ HoFLoadMonPlayerPicTileIDs: ; 7036d (1c:436d) predef_jump CopyTileIDsFromList HoFDisplayPlayerStats: ; 70377 (1c:4377) - SetEvent EVENT_003 + SetEvent EVENT_HALL_OF_FAME_DEX_RATING predef DisplayDexRating coord hl, 0, 4 ld b, $6 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 90de784f..08aadf02 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -188,8 +188,8 @@ CinnabarQuizQuestionsText6: ; 1ea85 (7:6a85) TX_FAR _CinnabarQuizQuestionsText6 db "@" -CinnabarGymQuiz_1ea8a: ; 1ea8a (7:6a8a) - EventFlagAddress hl, EVENT_2A8 +CinnabarGymGateFlagAction: ; 1ea8a (7:6a8a) + EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED predef_jump FlagActionPredef CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) @@ -206,11 +206,11 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld hl, CinnabarGymQuizCorrectText call PrintText ld a, [$ffe0] - AdjustEventBit EVENT_2A8, 0 + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a ld b, FLAG_SET - call CinnabarGymQuiz_1ea8a - jp CinnabarGymQuiz_1eb0a + call CinnabarGymGateFlagAction + jp UpdateCinnabarGymGateTileBlocks_ .asm_1eab8 call WaitForSoundToFinish ld a, SFX_DENIED @@ -220,10 +220,10 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) call PrintText ld a, [$ffdb] add $2 - AdjustEventBit EVENT_29A, 2 + AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a ld b, FLAG_TEST - EventFlagAddress hl, EVENT_29A + EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0 predef FlagActionPredef ld a, c and a @@ -240,10 +240,10 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) TX_ASM ld a, [$ffe0] - AdjustEventBit EVENT_2A8, 0 + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a ld b, FLAG_TEST - call CinnabarGymQuiz_1ea8a + call CinnabarGymGateFlagAction ld a, c and a jp nz, TextScriptEnd @@ -257,15 +257,17 @@ CinnabarGymQuizIncorrectText: ; 1eb05 (7:6b05) TX_FAR _CinnabarGymQuizIncorrectText db "@" -CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) - ld a, $6 +UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a) +; Update the overworld map with open floor blocks or locked gate blocks +; depending on event flags. + ld a, 6 ld [$ffdb], a -.asm_1eb0e +.loop ld a, [$ffdb] dec a add a add a - ld d, $0 + ld d, 0 ld e, a ld hl, CinnabarGymGateCoords add hl, de @@ -278,24 +280,24 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) push bc ld a, [$ffdb] ld [$ffe0], a - AdjustEventBit EVENT_2A8, 0 + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a ld b, FLAG_TEST - call CinnabarGymQuiz_1ea8a + call CinnabarGymGateFlagAction ld a, c and a - jr nz, .asm_1eb36 + jr nz, .unlocked ld a, [wd12f] - jr .asm_1eb38 -.asm_1eb36 + jr .next +.unlocked ld a, $e -.asm_1eb38 +.next pop bc ld [wd09f], a predef ReplaceTileBlock ld hl, $ffdb dec [hl] - jr nz, .asm_1eb0e + jr nz, .loop ret CinnabarGymGateCoords: ; 1eb48 (7:6b48) diff --git a/engine/pokedex_rating.asm b/engine/pokedex_rating.asm index 2d7073df..ca88673f 100755 --- a/engine/pokedex_rating.asm +++ b/engine/pokedex_rating.asm @@ -23,7 +23,7 @@ DisplayDexRating: ; 44169 (11:4169) ld a, [hli] ld h, [hl] ld l, a ; load text pointer into hl - CheckAndResetEventA EVENT_003 + CheckAndResetEventA EVENT_HALL_OF_FAME_DEX_RATING jr nz, .label3 push hl ld hl, PokedexRatingText_441cc diff --git a/home.asm b/home.asm index 6bb54df2..f58f6c16 100644 --- a/home.asm +++ b/home.asm @@ -4590,8 +4590,8 @@ Random:: INCLUDE "home/predef.asm" -Func_3ead:: ; 3ead (0:3ead) - jpba CinnabarGymQuiz_1eb0a +UpdateCinnabarGymGateTileBlocks:: ; 3ead (0:3ead) + jpba UpdateCinnabarGymGateTileBlocks_ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ; 3eb5 (0:3eb5) ld a, [H_LOADEDROMBANK] diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index f5c07317..18737d2b 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -14,7 +14,7 @@ CinnabarGymScript_75759: ; 75759 (1d:5759) pop hl bit 5, [hl] res 5, [hl] - call nz, Func_3ead + call nz, UpdateCinnabarGymGateTileBlocks ResetEvent EVENT_2A7 ret CinnabarGymScript_75772: ; 75772 (1d:5772) @@ -88,7 +88,7 @@ CinnabarGymScript1: ; 757dc (1d:57dc) ld [hSpriteIndexOrTextID], a jp DisplayTextID -CinnabarGymScript_757f1: ; 757f1 (1d:57f1) +CinnabarGymFlagAction: ; 757f1 (1d:57f1) predef_jump FlagActionPredef CinnabarGymScript2: ; 757f6 (1d:57f6) @@ -97,11 +97,11 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) jp z, CinnabarGymScript_75792 ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a - AdjustEventBit EVENT_29A, 2 + AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a ld b, FLAG_TEST - EventFlagAddress hl, EVENT_29A - call CinnabarGymScript_757f1 + EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0 + call CinnabarGymFlagAction ld a, c and a jr nz, .asm_7581b @@ -112,19 +112,19 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) .asm_7581b ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a - AdjustEventBit EVENT_29A, 2 + AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a ld b, FLAG_SET - EventFlagAddress hl, EVENT_29A - call CinnabarGymScript_757f1 + EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0 + call CinnabarGymFlagAction ld a, [wTrainerHeaderFlagBit] sub $2 - AdjustEventBit EVENT_2A8, 0 + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a ld b, FLAG_SET - EventFlagAddress hl, EVENT_2A8 - call CinnabarGymScript_757f1 - call Func_3ead + EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED + call CinnabarGymFlagAction + call UpdateCinnabarGymGateTileBlocks xor a ld [wJoyIgnore], a ld [wda38], a @@ -163,7 +163,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) set 6, [hl] ; deactivate gym trainers - SetEventRange EVENT_29A, EVENT_2A0 + SetEventRange EVENT_BEAT_CINNABAR_GYM_TRAINER_0, EVENT_BEAT_CINNABAR_GYM_TRAINER_6 ld hl, wd126 set 5, [hl] @@ -258,7 +258,7 @@ TM38NoRoomText: ; 75934 (1d:5934) CinnabarGymText2: ; 75939 (1d:5939) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29A + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_0 jr nz, .asm_46bb4 ld hl, CinnabarGymText_7595f call PrintText @@ -286,7 +286,7 @@ CinnabarGymText_75969: ; 75969 (1d:5969) CinnabarGymText3: ; 7596e (1d:596e) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29B + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_1 jr nz, .asm_4b406 ld hl, CinnabarGymText_75994 call PrintText @@ -314,7 +314,7 @@ CinnabarGymText_7599e: ; 7599e (1d:599e) CinnabarGymText4: ; 759a3 (1d:59a3) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29C + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_2 jr nz, .asm_c0673 ld hl, CinnabarGymText_759c9 call PrintText @@ -342,7 +342,7 @@ CinnabarGymText_759d3: ; 759d3 (1d:59d3) CinnabarGymText5: ; 759d8 (1d:59d8) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29D + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_3 jr nz, .asm_5cfd7 ld hl, CinnabarGymText_759fe call PrintText @@ -370,7 +370,7 @@ CinnabarGymText_75a08: ; 75a08 (1d:5a08) CinnabarGymText6: ; 75a0d (1d:5a0d) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29E + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_4 jr nz, .asm_776b4 ld hl, CinnabarGymText_75a33 call PrintText @@ -398,7 +398,7 @@ CinnabarGymText_75a3d: ; 75a3d (1d:5a3d) CinnabarGymText7: ; 75a42 (1d:5a42) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29F + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_5 jr nz, .asm_2f755 ld hl, CinnabarGymText_75a68 call PrintText @@ -426,7 +426,7 @@ CinnabarGymText_75a72: ; 75a72 (1d:5a72) CinnabarGymText8: ; 75a77 (1d:5a77) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_2A0 + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_6 jr nz, .asm_d87be ld hl, CinnabarGymText_75a9d call PrintText diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index 503327f3..9a5b595a 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -40,7 +40,7 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) ld [W_LANCECURSCRIPT], a ld [W_HALLOFFAMEROOMCURSCRIPT], a ; Elite 4 events - ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_907, 1 + ResetEventRange ELITE4_EVENTS_START, ELITE4_CHAMPION_EVENTS_END, 1 xor a ld [W_HALLOFFAMEROOMCURSCRIPT], a ld a, PALLET_TOWN diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm index e4a64ce6..7655d8c7 100755 --- a/scripts/indigoplateaulobby.asm +++ b/scripts/indigoplateaulobby.asm @@ -6,12 +6,12 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) res 6, [hl] ret z ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH - ld hl, wd734 + ld hl, wBeatLorelei bit 1, [hl] res 1, [hl] ret z ; Elite 4 events - ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR + ResetEventRange ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR ret IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f) diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index fe136784..4a245d93 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -13,7 +13,7 @@ LoreleiScript_76191: ; 76191 (1d:6191) bit 5, [hl] res 5, [hl] ret z - ld hl, wd734 + ld hl, wBeatLorelei set 1, [hl] CheckEvent EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 jr z, .asm_761a9 diff --git a/wram.asm b/wram.asm index 767cc0d4..275ccc40 100755 --- a/wram.asm +++ b/wram.asm @@ -2547,7 +2547,10 @@ W_FLAGS_D733:: ; d733 ; bit 7: used fly out of battle ds 1 -wd734:: ds 2 ; flag for indigo plateau and lorelei (not sure what it's for) +wBeatLorelei:: ; d734 +; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby +; the game uses this to tell when Elite 4 events need to be reset + ds 2 wd736:: ; d736 ; bit 0: check if the player is standing on a door and make him walk down a step if so -- cgit v1.3.1-sl0p From 82512e449115aa9d004e24a3d1526dd32570c56d Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 24 Jul 2015 14:39:45 -0700 Subject: named animation functions/variables --- constants/move_animation_constants.asm | 6 +- data/animations.asm | 16 +- engine/HoF_room_pc.asm | 10 +- engine/battle/animations.asm | 906 ++++++++++++++++++--------------- engine/battle/battle_transitions.asm | 76 +-- engine/battle/core.asm | 2 +- engine/battle/ghost_marowak_anim.asm | 4 +- engine/hidden_object_functions7.asm | 2 +- engine/intro.asm | 18 +- engine/items/items.asm | 2 +- engine/overworld/card_key.asm | 2 +- engine/overworld/cut.asm | 125 ++--- engine/overworld/cut2.asm | 76 +-- engine/overworld/ssanne.asm | 6 +- engine/slot_machine.asm | 6 +- engine/trade.asm | 12 +- home.asm | 12 +- scripts/agatha.asm | 2 +- scripts/bruno.asm | 2 +- scripts/celadongamecorner.asm | 4 +- scripts/lance.asm | 4 +- scripts/lorelei.asm | 2 +- scripts/mansion1.asm | 4 +- scripts/mansion2.asm | 2 +- scripts/rockethideout1.asm | 2 +- scripts/rockethideout4.asm | 2 +- scripts/silphco10.asm | 2 +- scripts/silphco11.asm | 2 +- scripts/silphco2.asm | 4 +- scripts/silphco3.asm | 4 +- scripts/silphco4.asm | 4 +- scripts/silphco5.asm | 6 +- scripts/silphco6.asm | 2 +- scripts/silphco7.asm | 6 +- scripts/silphco8.asm | 2 +- scripts/silphco9.asm | 8 +- scripts/vermiliongym.asm | 2 +- scripts/victoryroad1.asm | 2 +- scripts/victoryroad2.asm | 2 +- scripts/victoryroad3.asm | 2 +- wram.asm | 70 ++- 41 files changed, 781 insertions(+), 642 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/constants/move_animation_constants.asm b/constants/move_animation_constants.asm index 61e25212..6d8f33ca 100644 --- a/constants/move_animation_constants.asm +++ b/constants/move_animation_constants.asm @@ -6,7 +6,7 @@ const_value = $D8 const SE_WAVY_SCREEN ; $D8 used in Psywave/Night Shade/Psychic etc. const SE_SUBSTITUTE_MON ; $D9 used in Substitute (turns the pokemon into a mini sprite) const SE_SHAKE_BACK_AND_FORTH ; $DA used in Double Team - const SE_SLIDE_ENEMY_MON_OUT ; $DB used in Whirlwind + const SE_SLIDE_ENEMY_MON_OFF ; $DB used in Whirlwind const SE_SHOW_ENEMY_MON_PIC ; $DC used in Seismic Toss const SE_SHOW_MON_PIC ; $DD used in Low Kick/Quick Attack/Seismic Toss etc. const SE_BLINK_ENEMY_MON ; $DE used in Seismic Toss @@ -16,7 +16,7 @@ const_value = $D8 const SE_SPIRAL_BALLS_INWARD ; $E2 used in Growth/Focus Energy/Hyper Beam etc. const SE_SHAKE_ENEMY_HUD_2 ; $E3 unused const SE_SHAKE_ENEMY_HUD ; $E4 - const SE_SLIDE_MON_HALF_LEFT ; $E5 used in Softboiled + const SE_SLIDE_MON_HALF_OFF ; $E5 used in Softboiled const SE_PETALS_FALLING ; $E6 used in Petal Dance const SE_LEAVES_FALLING ; $E7 used in Razor Leaf const SE_TRANSFORM_MON ; $E8 used in Transform @@ -31,7 +31,7 @@ const_value = $D8 const SE_RESET_MON_POSITION ; $F1 used in Tackle/Body Slam/etc. const SE_MOVE_MON_HORIZONTALLY ; $F2 used in Tackle/Body Slam/etc. const SE_BLINK_MON ; $F3 used in Recover - const SE_SLIDE_MON_OUT ; $F4 used in Seismic Toss/Low Kick/etc. + const SE_SLIDE_MON_OFF ; $F4 used in Seismic Toss/Low Kick/etc. const SE_FLASH_MON_PIC ; $F5 const SE_SLIDE_MON_DOWN ; $F6 used in Withdraw/Waterfall/fainting const SE_SLIDE_MON_UP ; $F7 used in Dig/Waterfall/etc. diff --git a/data/animations.asm b/data/animations.asm index a9d22e54..cf6dc150 100755 --- a/data/animations.asm +++ b/data/animations.asm @@ -296,7 +296,7 @@ WingAttackAnim: ; 7a277 (1e:6277) WhirlwindAnim: ; 7a27b (1e:627b) db $46,$11,$10 - db SE_SLIDE_ENEMY_MON_OUT, $FF + db SE_SLIDE_ENEMY_MON_OFF, $FF db $FF FlyAnim: ; 7a281 (1e:6281) @@ -550,19 +550,19 @@ DrillPeckAnim: ; 7a3c8 (1e:63c8) db $FF SubmissionAnim: ; 7a3cc (1e:63cc) - db SE_SLIDE_MON_OUT, $41 + db SE_SLIDE_MON_OFF, $41 db $06,$FF,$01 db SE_SHOW_MON_PIC, $FF db $FF LowKickAnim: ; 7a3d4 (1e:63d4) - db SE_SLIDE_MON_OUT, $42 + db SE_SLIDE_MON_OFF, $42 db $46,$FF,$04 db SE_SHOW_MON_PIC, $FF db $FF CounterAnim: ; 7a3dc (1e:63dc) - db SE_SLIDE_MON_OUT, $43 + db SE_SLIDE_MON_OFF, $43 db $46,$FF,$04 db SE_SHOW_MON_PIC, $FF db $FF @@ -571,7 +571,7 @@ SeismicTossAnim: ; 7a3e4 (1e:63e4) db SE_BLINK_ENEMY_MON, $FF db $41,$8B,$4E db SE_HIDE_ENEMY_MON_PIC, $FF - db SE_SLIDE_MON_OUT, $FF + db SE_SLIDE_MON_OFF, $FF db $42,$44,$4F db SE_DELAY_ANIMATION_10, $FF db SE_DELAY_ANIMATION_10, $FF @@ -736,7 +736,7 @@ AgilityAnim: ; 7a4c3 (1e:64c3) db $FF QuickAttackAnim: ; 7a4c8 (1e:64c8) - db SE_SLIDE_MON_OUT, $61 + db SE_SLIDE_MON_OFF, $61 db $46,$FF,$04 db SE_SHOW_MON_PIC, $FF db $FF @@ -960,7 +960,7 @@ KinesisAnim: ; 7a5fa (1e:65fa) db $FF SoftboiledAnim: ; 7a5fe (1e:65fe) - db SE_SLIDE_MON_HALF_LEFT, $48 + db SE_SLIDE_MON_HALF_OFF, $48 db $08,$86,$4C db SE_LIGHT_SCREEN_PALETTE, $FF db SE_SPIRAL_BALLS_INWARD, $FF @@ -1119,7 +1119,7 @@ SlashAnim: ; 7a6cd (1e:66cd) db $FF SubstituteAnim: ; 7a6d1 (1e:66d1) - db SE_SLIDE_MON_OUT, $A3 + db SE_SLIDE_MON_OFF, $A3 db $08,$FF,$47 db SE_SUBSTITUTE_MON, $FF db $FF diff --git a/engine/HoF_room_pc.asm b/engine/HoF_room_pc.asm index 104d32ff..15ea1524 100755 --- a/engine/HoF_room_pc.asm +++ b/engine/HoF_room_pc.asm @@ -65,16 +65,16 @@ DisplayCreditsMon: ; 740cb (1d:40cb) call GetMonHeader call LoadFrontSpriteByMonIndex ld hl,vBGMap0 + $c - call CopyTileMapToVRAM + call CreditsCopyTileMapToVRAM xor a ld [H_AUTOBGTRANSFERENABLED],a call LoadScreenTilesFromBuffer1 ld hl,vBGMap0 - call CopyTileMapToVRAM + call CreditsCopyTileMapToVRAM ld a,$A7 ld [rWX],a ld hl,vBGMap1 - call CopyTileMapToVRAM + call CreditsCopyTileMapToVRAM call FillMiddleOfScreenWithWhite ld a,%11111100 ; make the mon a black silhouette ld [rBGP],a @@ -136,12 +136,12 @@ HoFGBPalettes: ; 74160 (1d:4160) db %11100000 db %11110000 -CopyTileMapToVRAM: ; 74164 (1d:4164) +CreditsCopyTileMapToVRAM: ; 74164 (1d:4164) ld a, l ld [H_AUTOBGTRANSFERDEST], a ld a, h ld [H_AUTOBGTRANSFERDEST + 1], a - ld a, $1 + ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a jp Delay3 diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 73d152b8..424190d3 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -223,7 +223,7 @@ PlayAnimation: ; 780f1 (1e:40f1) rla sla c rla - ld [wd09f],a ; tile select + ld [wWhichBattleAnimTileset],a ld a,[hli] ; sound ld [wAnimSoundID],a ; store sound ld a,[hli] ; subanimation ID @@ -243,7 +243,7 @@ PlayAnimation: ; 780f1 (1e:40f1) push hl ld a,[rOBP0] push af - ld a,[wcc79] + ld a,[wAnimPalette] ld [rOBP0],a call LoadAnimationTileset call LoadSubanimation @@ -328,7 +328,7 @@ GetSubanimationTransform2: ; 781ca (1e:41ca) ; loads tile patterns for battle animations LoadAnimationTileset: ; 781d2 (1e:41d2) - ld a,[wd09f] ; tileset select + ld a,[wWhichBattleAnimTileset] add a add a ld hl,AnimationTilesetPointers @@ -412,7 +412,7 @@ MoveAnimation: ; 78d5e (1e:4d5e) call WaitForSoundToFinish xor a ld [W_SUBANIMSUBENTRYADDR],a - ld [wd09b],a + ld [wUnusedD09B],a ld [W_SUBANIMTRANSFORM],a dec a ld [wAnimSoundID],a @@ -472,16 +472,16 @@ AnimationTypePointerTable: ; 78dcf (1e:4dcf) ShakeScreenVertically: ; 78ddb (1e:4ddb) call PlayApplyingAttackSound - ld b, $8 + ld b, 8 jp AnimationShakeScreenVertically ShakeScreenHorizontallyHeavy: ; 78de3 (1e:4de3) call PlayApplyingAttackSound - ld b, $8 + ld b, 8 jp AnimationShakeScreenHorizontallyFast ShakeScreenHorizontallySlow: ; 78deb (1e:4deb) - ld bc, $602 + lb bc, 6, 2 jr AnimationShakeScreenHorizontallySlow BlinkEnemyMonSprite: ; 78df0 (1e:4df0) @@ -490,32 +490,32 @@ BlinkEnemyMonSprite: ; 78df0 (1e:4df0) ShakeScreenHorizontallyLight: ; 78df6 (1e:4df6) call PlayApplyingAttackSound - ld b, $2 + ld b, 2 jp AnimationShakeScreenHorizontallyFast ShakeScreenHorizontallySlow2: ; 78dfe (1e:4dfe) - ld bc, $302 + lb bc, 3, 2 AnimationShakeScreenHorizontallySlow: ; 78e01 (1e:4e01) push bc push bc -.asm_78e03 +.loop1 ld a, [rWX] inc a ld [rWX], a ld c, 2 call DelayFrames dec b - jr nz, .asm_78e03 + jr nz, .loop1 pop bc -.asm_78e11 +.loop2 ld a, [rWX] dec a ld [rWX], a ld c, 2 call DelayFrames dec b - jr nz, .asm_78e11 + jr nz, .loop2 pop bc dec c jr nz, AnimationShakeScreenHorizontallySlow @@ -525,25 +525,25 @@ SetAnimationPalette: ; 78e23 (1e:4e23) ld a, [wOnSGB] and a ld a, $e4 - jr z, .asm_78e47 + jr z, .notSGB ld a, $f0 - ld [wcc79], a + ld [wAnimPalette], a ld b, $e4 ld a, [W_ANIMATIONID] cp TRADE_BALL_DROP_ANIM - jr c, .asm_78e3f + jr c, .next cp TRADE_BALL_POOF_ANIM + 1 - jr nc, .asm_78e3f + jr nc, .next ld b, $f0 -.asm_78e3f +.next ld a, b ld [rOBP0], a ld a, $6c ld [rOBP1], a ret -.asm_78e47 +.notSGB ld a, $e4 - ld [wcc79], a + ld [wAnimPalette], a ld [rOBP0], a ld a, $6c ld [rOBP1], a @@ -761,11 +761,11 @@ DoBallTossSpecialEffects: ; 78f3e (1e:4f3e) .moveGhostMarowakLeft coord hl, 17, 0 ld de,20 - ld bc,$0707 ; 7 rows and 7 columns + lb bc, 7, 7 .loop push hl push bc - call Func_79862 ; move row of tiles left + call AnimCopyRowRight ; move row of tiles left pop bc pop hl add hl,de @@ -891,8 +891,8 @@ TradeHidePokemon: ; 79041 (1e:5041) ld a,[W_SUBANIMCOUNTER] cp a,6 ret nz - ld a,$2F - jp Func_7980c ; make pokemon disappear + ld a,2 * SCREEN_WIDTH + 7 + jp ClearMonPicFromTileMap ; make pokemon disappear ; function to make a shaking pokeball jump up at the end of the animation TradeShakePokeball: ; 7904c (1e:504c) @@ -1010,8 +1010,8 @@ SpecialEffectPointers: ; 790da (1e:50da) dw AnimationSlideMonDown db SE_FLASH_MON_PIC ; $F5 dw AnimationFlashMonPic - db SE_SLIDE_MON_OUT ; $F4 - dw AnimationSlideMonOut + db SE_SLIDE_MON_OFF ; $F4 + dw AnimationSlideMonOff db SE_BLINK_MON ; $F3 dw AnimationBlinkMon db SE_MOVE_MON_HORIZONTALLY ; $F2 @@ -1040,8 +1040,8 @@ SpecialEffectPointers: ; 790da (1e:50da) dw AnimationLeavesFalling db SE_PETALS_FALLING ; $E6 dw AnimationPetalsFalling - db SE_SLIDE_MON_HALF_LEFT ; $E5 - dw AnimationSlideMonHalfLeft + db SE_SLIDE_MON_HALF_OFF ; $E5 + dw AnimationSlideMonHalfOff db SE_SHAKE_ENEMY_HUD ; $E4 dw AnimationShakeEnemyHUD db SE_SHAKE_ENEMY_HUD_2 ; unused--same pointer as SE_SHAKE_ENEMY_HUD ($E4) @@ -1060,8 +1060,8 @@ SpecialEffectPointers: ; 790da (1e:50da) dw AnimationShowMonPic db SE_SHOW_ENEMY_MON_PIC ; $DC dw AnimationShowEnemyMonPic - db SE_SLIDE_ENEMY_MON_OUT ; $DB - dw AnimationSlideEnemyMonOut + db SE_SLIDE_ENEMY_MON_OFF ; $DB + dw AnimationSlideEnemyMonOff db SE_SHAKE_BACK_AND_FORTH ; $DA dw AnimationShakeBackAndForth db SE_SUBSTITUTE_MON ; $D9 @@ -1092,7 +1092,7 @@ CallWithTurnFlipped: ; 79155 (1e:5155) ; flashes the screen for an extended period (48 frames) AnimationFlashScreenLong: ; 79165 (1e:5165) ld a,3 ; cycle through the palettes 3 times - ld [wd08a],a + ld [wFlashScreenLongCounter],a ld a,[wOnSGB] ; running on SGB? and a ld hl,FlashScreenLongMonochrome @@ -1108,9 +1108,9 @@ AnimationFlashScreenLong: ; 79165 (1e:5165) call FlashScreenLongDelay jr .innerLoop .endOfPalettes - ld a,[wd08a] + ld a,[wFlashScreenLongCounter] dec a - ld [wd08a],a + ld [wFlashScreenLongCounter],a pop hl jr nz,.loop ret @@ -1150,8 +1150,8 @@ FlashScreenLongSGB: ; 7919b (1e:519b) ; causes a delay of 2 frames for the first cycle ; causes a delay of 1 frame for the second and third cycles FlashScreenLongDelay: ; 791a8 (1e:51a8) - ld a,[wd08a] - cp a,4 ; never true since [wd08a] starts at 3 + ld a,[wFlashScreenLongCounter] + cp a,4 ; never true since [wFlashScreenLongCounter] starts at 3 ld c,4 jr z,.delayFrames cp a,3 @@ -1179,46 +1179,46 @@ AnimationFlashScreen: ; 791be (1e:51be) AnimationDarkScreenPalette: ; 791d6 (1e:51d6) ; Changes the screen's palette to a dark palette. - ld bc, $6f6f + lb bc, $6f, $6f jr SetAnimationBGPalette AnimationDarkenMonPalette: ; 791db (1e:51db) ; Darkens the mon sprite's palette. - ld bc, $f9f4 + lb bc, $f9, $f4 jr SetAnimationBGPalette AnimationUnusedPalette1: ; 791e0 (1e:51e0) - ld bc, $fef8 + lb bc, $fe, $f8 jr SetAnimationBGPalette AnimationUnusedPalette2: ; 791e5 (1e:51e5) - ld bc, $ffff + lb bc, $ff, $ff jr SetAnimationBGPalette AnimationResetScreenPalette: ; 791ea (1e:51ea) ; Restores the screen's palette to the normal palette. - ld bc, $e4e4 + lb bc, $e4, $e4 jr SetAnimationBGPalette AnimationUnusedPalette3: ; 791ef (1e:51ef) - ld bc, $0000 + lb bc, $00, $00 jr SetAnimationBGPalette AnimationLightScreenPalette: ; 791f4 (1e:51f4) ; Changes the screen to use a palette with light colors. - ld bc, $9090 + lb bc, $90, $90 jr SetAnimationBGPalette AnimationUnusedPalette4: ; 791f9 (1e:51f9) - ld bc, $4040 + lb bc, $40, $40 SetAnimationBGPalette: ; 791fc (1e:51fc) ld a, [wOnSGB] and a ld a, b - jr z, .asm_79204 + jr z, .next ld a, c -.asm_79204 +.next ld [rBGP], a ret @@ -1239,75 +1239,75 @@ AnimationWaterDropletsEverywhere: ; 79215 (1e:5215) ; scroll. It's hard to describe, but it's the main animation ; in Surf/Mist/Toxic. xor a - ld [wd09f], a + ld [wWhichBattleAnimTileset], a call LoadAnimationTileset - ld d, $20 - ld a, $f0 + ld d, 32 + ld a, -16 ld [W_BASECOORDX], a ld a, $71 - ld [wd09f], a -.asm_79228 - ld a, $10 + ld [wDropletTile], a +.loop + ld a, 16 ld [W_BASECOORDY], a - ld a, $0 - ld [wd08a], a + ld a, 0 + ld [wUnusedD08A], a call _AnimationWaterDroplets - ld a, $18 + ld a, 24 ld [W_BASECOORDY], a - ld a, $20 - ld [wd08a], a + ld a, 32 + ld [wUnusedD08A], a call _AnimationWaterDroplets dec d - jr nz, .asm_79228 + jr nz, .loop ret _AnimationWaterDroplets: ; 79246 (1e:5246) ld hl, wOAMBuffer -.asm_79249 +.loop ld a, [W_BASECOORDY] - ld [hli], a + ld [hli], a ; Y ld a, [W_BASECOORDX] - add $1b + add 27 ld [W_BASECOORDX], a - ld [hli], a - ld a, [wd09f] - ld [hli], a + ld [hli], a ; X + ld a, [wDropletTile] + ld [hli], a ; tile xor a - ld [hli], a + ld [hli], a ; attribute ld a, [W_BASECOORDX] - cp $90 - jr c, .asm_79249 - sub $a8 + cp 144 + jr c, .loop + sub 168 ld [W_BASECOORDX], a ld a, [W_BASECOORDY] - add $10 + add 16 ld [W_BASECOORDY], a - cp $70 - jr c, .asm_79249 + cp 112 + jr c, .loop call AnimationCleanOAM jp DelayFrame AnimationSlideMonUp: ; 7927a (1e:527a) ; Slides the mon's sprite upwards. - ld c, $7 + ld c, 7 ld a, [H_WHOSETURN] and a coord hl, 1, 6 coord de, 1, 5 ld a, $30 - jr z, .asm_79291 + jr z, .next coord hl, 12, 1 coord de, 12, 0 ld a, $ff -.asm_79291 - ld [wd09f], a +.next + ld [wSlideMonUpBottomRowLeftTile], a jp _AnimationSlideMonUp AnimationSlideMonDown: ; 79297 (1e:5297) ; Slides the mon's sprite down out of the screen. xor a call GetTileIDList -.asm_7929b +.loop call GetMonSpriteTileMapPointerFromRowCount push bc push de @@ -1317,54 +1317,63 @@ AnimationSlideMonDown: ; 79297 (1e:5297) pop de pop bc dec b - jr nz, .asm_7929b + jr nz, .loop ret -AnimationSlideMonOut: ; 792af (1e:52af) -; Slides the mon's sprite out of the screen horizontally. - ld e, $8 - ld a, $3 - ld [W_SUBANIMTRANSFORM], a - jp AnimationSlideMonLeft +AnimationSlideMonOff: ; 792af (1e:52af) +; Slides the mon's sprite off the screen horizontally. + ld e, 8 + ld a, 3 + ld [wSlideMonDelay], a + jp _AnimationSlideMonOff -AnimationSlideEnemyMonOut: ; 792b9 (1e:52b9) -; Slides the enemy mon out of the screen horizontally. - ld hl, AnimationSlideMonOut +AnimationSlideEnemyMonOff: ; 792b9 (1e:52b9) +; Slides the enemy mon off the screen horizontally. + ld hl, AnimationSlideMonOff jp CallWithTurnFlipped _AnimationSlideMonUp: ; 792bf (1e:52bf) push de push hl push bc - ld b, $6 -.asm_792c4 + +; In each iteration, slide up all rows but the top one (which is overwritten). + ld b, 6 +.slideLoop push bc push de push hl - ld bc, $0007 + ld bc, 7 call CopyData +; Note that de and hl are popped in the same order they are pushed, swapping +; their values. When CopyData is called, hl points to a tile 1 row below +; the one de points to. To maintain this relationship, after swapping, we add 2 +; rows to hl so that it is 1 row below again. pop de pop hl ld bc, SCREEN_WIDTH * 2 add hl, bc pop bc dec b - jr nz, .asm_792c4 + jr nz, .slideLoop + +; Fill in the bottom row of the mon pic with the next row's tile IDs. ld a, [H_WHOSETURN] and a coord hl, 1, 11 - jr z, .asm_792e2 + jr z, .next coord hl, 12, 6 -.asm_792e2 - ld a, [wd09f] +.next + ld a, [wSlideMonUpBottomRowLeftTile] inc a - ld [wd09f], a - ld c, $7 -.asm_792eb + ld [wSlideMonUpBottomRowLeftTile], a + ld c, 7 +.fillBottomRowLoop ld [hli], a - add $7 + add 7 dec c - jr nz, .asm_792eb + jr nz, .fillBottomRowLoop + ld c, 2 call DelayFrames pop bc @@ -1374,35 +1383,41 @@ _AnimationSlideMonUp: ; 792bf (1e:52bf) jr nz, _AnimationSlideMonUp ret -_AnimationShakeEnemyHUD: ; 792fd (1e:52fd) +ShakeEnemyHUD_WritePlayerMonPicOAM: ; 792fd (1e:52fd) +; Writes the OAM entries for a copy of the player mon's pic in OAM. +; The top 5 rows are reproduced in OAM, although only 2 are actually needed. ld a, $10 ld [W_BASECOORDX], a ld a, $30 ld [W_BASECOORDY], a ld hl, wOAMBuffer - ld d, $0 - ld c, $7 -.asm_7930e + ld d, 0 + ld c, 7 +.loop ld a, [W_BASECOORDY] ld e, a - ld b, $5 -.asm_79314 - call Animations_79329 + ld b, 5 +.innerLoop + call BattleAnimWriteOAMEntry inc d dec b - jr nz, .asm_79314 + jr nz, .innerLoop dec c ret z inc d inc d ld a, [W_BASECOORDX] - add $8 + add 8 ld [W_BASECOORDX], a - jr .asm_7930e + jr .loop -Animations_79329: ; 79329 (1e:5329) +BattleAnimWriteOAMEntry: ; 79329 (1e:5329) +; Y coordinate = e (increased by 8 each call, before the write to OAM) +; X coordinate = [W_BASECOORDX] +; tile = d +; attributes = 0 ld a, e - add $8 + add 8 ld e, a ld [hli], a ld a, [W_BASECOORDX] @@ -1418,16 +1433,17 @@ AdjustOAMBlockXPos: ; 79337 (1e:5337) ld h, d AdjustOAMBlockXPos2: ; 79339 (1e:5339) - ld de, $4 + ld de, 4 .loop - ld a, [wd08a] + ld a, [wCoordAdjustmentAmount] ld b, a ld a, [hl] add b - cp $a8 + cp 168 jr c, .skipPuttingEntryOffScreen +; put off-screen if X >= 168 dec hl - ld a, $a0 + ld a, 160 ld [hli], a .skipPuttingEntryOffScreen ld [hl], a @@ -1441,16 +1457,16 @@ AdjustOAMBlockYPos: ; 79350 (1e:5350) ld h, d AdjustOAMBlockYPos2: ; 79352 (1e:5352) - ld de, $4 + ld de, 4 .loop - ld a, [wd08a] + ld a, [wCoordAdjustmentAmount] ld b, a ld a, [hl] add b - cp $70 + cp 112 jr c, .skipSettingPreviousEntrysAttribute dec hl - ld a, $a0 ; bug, sets previous OAM entry's attribute + ld a, 160 ; bug, sets previous OAM entry's attribute ld [hli], a .skipSettingPreviousEntrysAttribute ld [hl], a @@ -1467,8 +1483,8 @@ AnimationBlinkEnemyMon: ; 79369 (1e:5369) AnimationBlinkMon: ; 7936f (1e:536f) ; Make the mon's sprite blink on and off for a second or two. push af - ld c, $6 -.asm_79372 + ld c, 6 +.loop push bc call AnimationHideMonPic ld c, 5 @@ -1478,17 +1494,17 @@ AnimationBlinkMon: ; 7936f (1e:536f) call DelayFrames pop bc dec c - jr nz, .asm_79372 + jr nz, .loop pop af ret AnimationFlashMonPic: ; 79389 (1e:5389) ; Flashes the mon's sprite on and off ld a, [wBattleMonSpecies] - ld [wHPBarMaxHP + 1], a + ld [wChangeMonPicPlayerTurnSpecies], a ld a, [wEnemyMonSpecies] - ld [wHPBarMaxHP], a - jp Func_79793 + ld [wChangeMonPicEnemyTurnSpecies], a + jp ChangeMonPic AnimationFlashEnemyMonPic: ; 79398 (1e:5398) ; Flashes the enemy mon's sprite on and off @@ -1515,14 +1531,14 @@ AnimationShakeBackAndForth: ; 793b1 (1e:53b1) and a coord hl, 0, 5 coord de, 2, 5 - jr z, .asm_793c2 + jr z, .next coord hl, 11, 0 coord de, 13, 0 -.asm_793c2 +.next xor a ld c, $10 -.asm_793c5 +.loop push af push bc push de @@ -1537,7 +1553,7 @@ AnimationShakeBackAndForth: ; 793b1 (1e:53b1) call CopyPicTiles call Delay3 pop hl - ld bc, $0709 + lb bc, 7, 9 call ClearScreenArea pop af call GetTileIDList @@ -1545,14 +1561,14 @@ AnimationShakeBackAndForth: ; 793b1 (1e:53b1) call CopyPicTiles call Delay3 pop hl - ld bc, $0709 + lb bc, 7, 9 call ClearScreenArea pop hl pop de pop bc pop af dec c - jr nz, .asm_793c5 + jr nz, .loop ret AnimationMoveMonHorizontally: ; 793f9 (1e:53f9) @@ -1562,9 +1578,9 @@ AnimationMoveMonHorizontally: ; 793f9 (1e:53f9) ld a, [H_WHOSETURN] and a coord hl, 2, 5 - jr z, .asm_79407 + jr z, .next coord hl, 11, 0 -.asm_79407 +.next xor a push hl call GetTileIDList @@ -1577,70 +1593,70 @@ AnimationResetMonPosition: ; 79415 (1e:5415) ; Resets the mon's sprites to be located at the normal coordinates. ld a, [H_WHOSETURN] and a - ld a, $66 - jr z, .asm_7941e - ld a, $b -.asm_7941e - call Func_7980c + ld a, 5 * SCREEN_WIDTH + 2 + jr z, .next + ld a, 11 +.next + call ClearMonPicFromTileMap jp AnimationShowMonPic AnimationSpiralBallsInward: ; 79424 (1e:5424) -; Creates an effect that looks like energy balls sprialing into the +; Creates an effect that looks like energy balls spiralling into the ; player mon's sprite. Used in Focus Energy, for example. ld a, [H_WHOSETURN] and a - jr z, .asm_79435 - ld a, $d8 - ld [wd08a], a - ld a, $50 - ld [W_SUBANIMTRANSFORM], a - jr .asm_7943c -.asm_79435 + jr z, .playerTurn + ld a, -40 + ld [wSpiralBallsBaseY], a + ld a, 80 + ld [wSpiralBallsBaseX], a + jr .next +.playerTurn xor a - ld [wd08a], a - ld [W_SUBANIMTRANSFORM], a -.asm_7943c - ld d, $7a - ld c, $3 + ld [wSpiralBallsBaseY], a + ld [wSpiralBallsBaseX], a +.next + ld d, $7a ; ball tile + ld c, 3 ; number of balls xor a - call Func_797e8 + call InitMultipleObjectsOAM ld hl, SpiralBallAnimationCoordinates -.asm_79447 +.loop push hl - ld c, $3 + ld c, 3 ld de, wOAMBuffer -.asm_7944d +.innerLoop ld a, [hl] cp $ff - jr z, .asm_7946f - ld a, [wd08a] + jr z, .done + ld a, [wSpiralBallsBaseY] add [hl] - ld [de], a + ld [de], a ; Y inc de inc hl - ld a, [W_SUBANIMTRANSFORM] + ld a, [wSpiralBallsBaseX] add [hl] - ld [de], a + ld [de], a ; X inc hl inc de inc de inc de dec c - jr nz, .asm_7944d + jr nz, .innerLoop ld c, 5 call DelayFrames pop hl inc hl inc hl - jr .asm_79447 -.asm_7946f + jr .loop +.done pop hl call AnimationCleanOAM jp AnimationFlashScreen SpiralBallAnimationCoordinates: ; 79476 (1e:5476) ; y, x pairs -; This is the sequence of screen coordinates that the spiraling +; This is the sequence of screen coordinates that the spiralling ; balls are positioned at. db $38, $28 db $40, $18 @@ -1668,57 +1684,57 @@ SpiralBallAnimationCoordinates: ; 79476 (1e:5476) AnimationSquishMonPic: ; 794a1 (1e:54a1) ; Squishes the mon's sprite horizontally making it ; disappear. Used by Teleport/Sky Attack animations. - ld c, $4 -.asm_794a3 + ld c, 4 +.loop push bc ld a, [H_WHOSETURN] and a - jr z, .asm_794b1 + jr z, .playerTurn coord hl, 16, 0 coord de, 14, 0 - jr .asm_794b7 -.asm_794b1 + jr .next +.playerTurn coord hl, 5, 5 coord de, 3, 5 -.asm_794b7 +.next push de - xor a - ld [wd09f], a + xor a ; left + ld [wSquishMonCurrentDirection], a call _AnimationSquishMonPic pop hl - ld a, $1 - ld [wd09f], a + ld a, 1 ; right + ld [wSquishMonCurrentDirection], a call _AnimationSquishMonPic pop bc dec c - jr nz, .asm_794a3 + jr nz, .loop call AnimationHideMonPic - ld c, $2 + ld c, 2 jp DelayFrame _AnimationSquishMonPic: ; 794d4 (1e:54d4) - ld c, $7 -.asm_794d6 + ld c, 7 +.loop push bc push hl - ld c, $3 - ld a, [wd09f] - cp $0 - jr nz, .asm_794e7 - call Func_7985b + ld c, 3 + ld a, [wSquishMonCurrentDirection] + cp 0 + jr nz, .right + call AnimCopyRowLeft dec hl - jr .asm_794eb -.asm_794e7 - call Func_79862 + jr .next +.right + call AnimCopyRowRight inc hl -.asm_794eb +.next ld [hl], " " pop hl ld de, SCREEN_WIDTH add hl, de pop bc dec c - jr nz, .asm_794d6 + jr nz, .loop jp Delay3 AnimationShootBallsUpward: ; 794f9 (1e:54f9) @@ -1726,67 +1742,68 @@ AnimationShootBallsUpward: ; 794f9 (1e:54f9) ; animations. ld a, [H_WHOSETURN] and a - jr z, .asm_79503 - ld bc, $80 - jr .asm_79506 -.asm_79503 - ld bc, $3028 -.asm_79506 + jr z, .playerTurn + lb bc, 0, 16 * 8 + jr .next +.playerTurn + lb bc, 6 * 8, 5 * 8 +.next ld a, b ld [W_BASECOORDY], a ld a, c ld [W_BASECOORDX], a - ld bc, $501 + lb bc, 5, 1 call _AnimationShootBallsUpward jp AnimationCleanOAM _AnimationShootBallsUpward: ; 79517 (1e:5517) push bc xor a - ld [wd09f], a + ld [wWhichBattleAnimTileset], a call LoadAnimationTileset pop bc - ld d, $7a + ld d, $7a ; ball tile ld hl, wOAMBuffer push bc ld a, [W_BASECOORDY] ld e, a -.asm_7952a - call Animations_79329 +.initOAMLoop + call BattleAnimWriteOAMEntry dec b - jr nz, .asm_7952a + jr nz, .initOAMLoop call DelayFrame pop bc ld a, b - ld [wd08a], a -.asm_79538 + ld [wNumShootingBalls], a +.loop push bc ld hl, wOAMBuffer -.asm_7953c +.innerLoop ld a, [W_BASECOORDY] - add $8 + add 8 ld e, a ld a, [hl] - cp e - jr z, .asm_7954b - add $fc + cp e ; has the ball reached the top? + jr z, .reachedTop + add -4 ; ball hasn't reached the top. move it up 4 pixels ld [hl], a - jr .asm_79554 -.asm_7954b - ld [hl], $0 - ld a, [wd08a] + jr .next +.reachedTop +; remove the ball once it has reached the top + ld [hl], 0 ; put it off-screen + ld a, [wNumShootingBalls] dec a - ld [wd08a], a -.asm_79554 - ld de, $4 - add hl, de + ld [wNumShootingBalls], a +.next + ld de, 4 + add hl, de ; next OAM entry dec b - jr nz, .asm_7953c + jr nz, .innerLoop call DelayFrames pop bc - ld a, [wd08a] + ld a, [wNumShootingBalls] and a - jr nz, .asm_79538 + jr nz, .loop ret AnimationShootManyBallsUpward: ; 79566 (1e:5566) @@ -1799,15 +1816,15 @@ AnimationShootManyBallsUpward: ; 79566 (1e:5566) ld hl, UpwardBallsAnimXCoordinatesEnemyTurn ld a, $28 ; y coordinate for "energy" ball pillar .player - ld [wTrainerSpriteOffset], a + ld [wSavedY], a .loop - ld a, [wTrainerSpriteOffset] + ld a, [wSavedY] ld [W_BASECOORDY], a ld a, [hli] cp $ff jp z, AnimationCleanOAM ld [W_BASECOORDX], a - ld bc, $0401 + lb bc, 4, 1 push hl call _AnimationShootBallsUpward pop hl @@ -1838,14 +1855,14 @@ AnimationMinimizeMon: ; 7959f (1e:559f) add hl, de ld de, MinimizedMonSprite ld c, $5 -.asm_795b4 +.loop ld a, [de] ld [hli], a ld [hli], a inc de dec c - jr nz, .asm_795b4 - call Func_79652 + jr nz, .loop + call CopyTempPicToMonPic call Delay3 jp AnimationShowMonPic @@ -1856,7 +1873,7 @@ AnimationSlideMonDownAndHide: ; 795c9 (1e:55c9) ; Slides the mon's sprite down and disappears. Used in Acid Armor. ld a, $1 ld c, $2 -.asm_795cd +.loop push bc push af call AnimationHideMonPic @@ -1871,87 +1888,101 @@ AnimationSlideMonDownAndHide: ; 795c9 (1e:55c9) inc a pop bc dec c - jr nz, .asm_795cd + jr nz, .loop call AnimationHideMonPic ld hl, wTempPic ld bc, $0310 xor a call FillMemory - jp Func_79652 + jp CopyTempPicToMonPic -AnimationSlideMonLeft: ; 795f8 (1e:55f8) +_AnimationSlideMonOff: ; 795f8 (1e:55f8) +; Slides the mon's sprite off the screen horizontally by e tiles and waits +; [wSlideMonDelay] V-blanks each time the pic is slid by one tile. ld a, [H_WHOSETURN] and a - jr z, .asm_79602 + jr z, .playerTurn coord hl, 12, 0 - jr .asm_79605 -.asm_79602 + jr .next +.playerTurn coord hl, 0, 5 -.asm_79605 - ld d, $8 -.asm_79607 +.next + ld d, 8 ; d's value is unused +.slideLoop ; iterates once for each time the pic slides by one tile push hl - ld b, $7 -.asm_7960a - ld c, $8 -.asm_7960c + ld b, 7 +.rowLoop ; iterates once for each row + ld c, 8 +.tileLoop ; iterates once for each tile in the row ld a, [H_WHOSETURN] and a - jr z, .asm_79616 - call Func_7963c - jr .asm_79619 -.asm_79616 - call Func_79633 -.asm_79619 + jr z, .playerTurn2 + call .EnemyNextTile + jr .next2 +.playerTurn2 + call .PlayerNextTile +.next2 ld [hli], a dec c - jr nz, .asm_7960c + jr nz, .tileLoop push de - ld de, $c + ld de, SCREEN_WIDTH - 8 add hl, de pop de dec b - jr nz, .asm_7960a - ld a, [W_SUBANIMTRANSFORM] + jr nz, .rowLoop + ld a, [wSlideMonDelay] ld c, a call DelayFrames pop hl dec d dec e - jr nz, .asm_79607 + jr nz, .slideLoop ret -Func_79633: ; 79633 (1e:5633) +; Since mon pic tile numbers go from top to bottom, left to right in order, +; adding the height of the mon pic in tiles to a tile number gives the tile +; number of the tile one column to the right (and thus subtracting the height +; gives the reverse). If the next tile would be past the edge of the pic, the 2 +; functions below catch it by checking if the tile number is within the valid +; range and if not, replacing it with a blank tile. + +.PlayerNextTile ; 79633 (1e:5633) ld a, [hl] - add $7 + add 7 +; This is a bug. The lower right corner tile of the mon back pic is blanked +; while the mon is sliding off the screen. It should compare with the max tile +; plus one instead. cp $61 ret c - ld a, $7f + ld a, " " ret -Func_7963c: ; 7963c (1e:563c) +.EnemyNextTile ; 7963c (1e:563c) ld a, [hl] - sub $7 + sub 7 +; This has the same problem as above, but it has no visible effect because +; the lower right tile is in the first column to slide off the screen. cp $30 ret c - ld a, $7f + ld a, " " ret -AnimationSlideMonHalfLeft: ; 79645 (1e:5645) -; Slides the mon's sprite halfway out of the screen. It's used in Softboiled. - ld e, $4 - ld a, $4 - ld [W_SUBANIMTRANSFORM], a - call AnimationSlideMonLeft +AnimationSlideMonHalfOff: ; 79645 (1e:5645) +; Slides the mon's sprite halfway off the screen. It's used in Softboiled. + ld e, 4 + ld a, 4 + ld [wSlideMonDelay], a + call _AnimationSlideMonOff jp Delay3 -Func_79652: ; 79652 (1e:5652) +CopyTempPicToMonPic: ; 79652 (1e:5652) ld a, [H_WHOSETURN] and a - ld hl, vBackPic - jr z, .asm_7965d - ld hl, vFrontPic -.asm_7965d + ld hl, vBackPic ; player turn + jr z, .next + ld hl, vFrontPic ; enemy turn +.next ld de, wTempPic ld bc, 7 * 7 jp CopyVideoData @@ -1959,55 +1990,55 @@ Func_79652: ; 79652 (1e:5652) AnimationWavyScreen: ; 79666 (1e:5666) ; used in Psywave/Psychic etc. ld hl, vBGMap0 - call Func_79e0d + call BattleAnimCopyTileMapToVRAM call Delay3 xor a ld [H_AUTOBGTRANSFERENABLED], a - ld a, $90 + ld a, SCREEN_HEIGHT_PIXELS ld [hWY], a - ld d, $80 - ld e, $8f + ld d, $80 ; terminator + ld e, SCREEN_HEIGHT_PIXELS - 1 ld c, $ff ld hl, WavyScreenLineOffsets -.asm_7967f +.loop push hl -.asm_79680 - call Func_796ae +.innerLoop + call WavyScreen_SetSCX ld a, [rLY] - cp e - jr nz, .asm_79680 + cp e ; is it the last visible line in the frame? + jr nz, .innerLoop ; keep going if not pop hl inc hl ld a, [hl] - cp d - jr nz, .asm_79691 - ld hl, WavyScreenLineOffsets -.asm_79691 + cp d ; have we reached the end? + jr nz, .next + ld hl, WavyScreenLineOffsets ; go back to the beginning if so +.next dec c - jr nz, .asm_7967f + jr nz, .loop xor a ld [hWY], a call SaveScreenTilesToBuffer2 call ClearScreen - ld a, $1 + ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 call LoadScreenTilesFromBuffer2 ld hl, vBGMap1 - call Func_79e0d + call BattleAnimCopyTileMapToVRAM ret -Func_796ae: ; 796ae (1e:56ae) +WavyScreen_SetSCX: ; 796ae (1e:56ae) ld a, [rSTAT] - and $3 - jr nz, Func_796ae + and $3 ; is it H-blank? + jr nz, WavyScreen_SetSCX ; wait until it's H-blank ld a, [hl] ld [rSCX], a inc hl ld a, [hl] - cp d + cp d ; have we reached the end? ret nz - ld hl, WavyScreenLineOffsets + ld hl, WavyScreenLineOffsets ; go back to the beginning if so ret WavyScreenLineOffsets: ; 796bf (1e:56bf) @@ -2023,9 +2054,9 @@ AnimationSubstitute: ; 796e0 (1e:56e0) xor a ld bc, $0310 call FillMemory - ld a, [$fff3] + ld a, [H_WHOSETURN] and a - jr z, .asm_79715 + jr z, .playerTurn ld hl, SlowbroSprite ; facing down sprite ld de, wTempPic + $120 call CopySlowbroSpriteData @@ -2038,8 +2069,8 @@ AnimationSubstitute: ; 796e0 (1e:56e0) ld hl, SlowbroSprite + $30 ld de, wTempPic + $120 + $10 + $70 call CopySlowbroSpriteData - jr .asm_79739 -.asm_79715 + jr .next +.playerTurn ld hl, SlowbroSprite + $40 ; facing up sprite ld de, wTempPic + $120 + $70 call CopySlowbroSpriteData @@ -2052,8 +2083,8 @@ AnimationSubstitute: ; 796e0 (1e:56e0) ld hl, SlowbroSprite + $70 ld de, wTempPic + $120 + $f0 call CopySlowbroSpriteData -.asm_79739 - call Func_79652 +.next + call CopyTempPicToMonPic jp AnimationShowMonPic CopySlowbroSpriteData: ; 7973f (1e:573f) @@ -2077,7 +2108,7 @@ HideSubstituteShowMonAnim: ; 79747 (1e:5747) call AnimationSlideMonDown jr .next2 .substituteStillUp - call AnimationSlideMonOut + call AnimationSlideMonOff .next2 pop hl ld a, [hl] @@ -2087,35 +2118,35 @@ HideSubstituteShowMonAnim: ; 79747 (1e:5747) jp AnimationShowMonPic ReshowSubstituteAnim: ; 79771 (1e:5771) - call AnimationSlideMonOut + call AnimationSlideMonOff call AnimationSubstitute jp AnimationShowMonPic AnimationBoundUpAndDown: ; 7977a (1e:577a) ; Bounces the mon's sprite up and down several times. It is used ; by Splash's animation. - ld c, $5 -.asm_7977c + ld c, 5 +.loop push bc call AnimationSlideMonDown pop bc dec c - jr nz, .asm_7977c + jr nz, .loop jp AnimationShowMonPic AnimationTransformMon: ; 79787 (1e:5787) ; Redraws this mon's sprite as the back/front sprite of the opposing mon. ; Used in Transform. ld a, [wEnemyMonSpecies] - ld [wHPBarMaxHP + 1], a + ld [wChangeMonPicPlayerTurnSpecies], a ld a, [wBattleMonSpecies] - ld [wHPBarMaxHP], a + ld [wChangeMonPicEnemyTurnSpecies], a -Func_79793: ; 79793 (1e:5793) +ChangeMonPic: ; 79793 (1e:5793) ld a, [H_WHOSETURN] and a - jr z, .asm_797b0 - ld a, [wHPBarMaxHP] + jr z, .playerTurn + ld a, [wChangeMonPicEnemyTurnSpecies] ld [wcf91], a ld [wd0b5], a xor a @@ -2123,11 +2154,11 @@ Func_79793: ; 79793 (1e:5793) call GetMonHeader coord hl, 12, 0 call LoadFrontSpriteByMonIndex - jr .asm_797d3 -.asm_797b0 + jr .done +.playerTurn ld a, [wBattleMonSpecies2] push af - ld a, [wHPBarMaxHP + 1] + ld a, [wChangeMonPicPlayerTurnSpecies] ld [wBattleMonSpecies2], a ld [wd0b5], a call GetMonHeader @@ -2138,7 +2169,7 @@ Func_79793: ; 79793 (1e:5793) call CopyPicTiles pop af ld [wBattleMonSpecies2], a -.asm_797d3 +.done ld b, $1 jp GoPAL_SET @@ -2152,10 +2183,14 @@ AnimationHideEnemyMonPic: ; 797d8 (1e:57d8) ld [H_AUTOBGTRANSFERENABLED], a jp Delay3 -Func_797e8: ; 797e8 (1e:57e8) +InitMultipleObjectsOAM: ; 797e8 (1e:57e8) +; Writes c OAM entries with tile d. +; Sets their Y coordinates to sequential multiples of 8, starting from 0. +; Sets their X coordinates to 0. +; Loads animation tileset a. push bc push de - ld [wd09f], a + ld [wWhichBattleAnimTileset], a call LoadAnimationTileset pop de pop bc @@ -2163,31 +2198,31 @@ Func_797e8: ; 797e8 (1e:57e8) ld e, a ld [W_BASECOORDX], a ld hl, wOAMBuffer -.asm_797fa - call Animations_79329 +.loop + call BattleAnimWriteOAMEntry dec c - jr nz, .asm_797fa + jr nz, .loop ret AnimationHideMonPic: ; 79801 (1e:5801) ; Hides the mon's sprite. ld a, [H_WHOSETURN] and a - jr z, .asm_7980a - ld a, $c - jr Func_7980c -.asm_7980a - ld a, $65 + jr z, .playerTurn + ld a, 12 + jr ClearMonPicFromTileMap +.playerTurn + ld a, 5 * SCREEN_WIDTH + 1 -Func_7980c: ; 7980c (1e:580c) +ClearMonPicFromTileMap: ; 7980c (1e:580c) push hl push de push bc ld e, a - ld d, $0 + ld d, 0 coord hl, 0, 0 add hl, de - ld bc, $707 + lb bc, 7, 7 call ClearScreenArea pop bc pop de @@ -2251,20 +2286,22 @@ GetTileIDList: ; 79842 (1e:5842) ld b, a ret -Func_7985b: ; 7985b (1e:585b) +AnimCopyRowLeft: ; 7985b (1e:585b) +; copy a row of c tiles 1 tile left ld a, [hld] ld [hli], a inc hl dec c - jr nz, Func_7985b + jr nz, AnimCopyRowLeft ret -Func_79862: ; 79862 (1e:5862) +AnimCopyRowRight: ; 79862 (1e:5862) +; copy a row of c tiles 1 tile right ld a, [hli] ld [hld], a dec hl dec c - jr nz, Func_79862 + jr nz, AnimCopyRowRight ret ; get the sound of the move id in b @@ -2649,12 +2686,12 @@ AnimationLeavesFalling: ; 79c74 (1e:5c74) ; in Razor Leaf's animation. ld a, [rOBP0] push af - ld a, [wcc79] + ld a, [wAnimPalette] ld [rOBP0], a - ld d, $37 - ld a, $3 - ld [W_SUBANIMTRANSFORM], a - call Func_79c97 + ld d, $37 ; leaf tile + ld a, 3 ; number of leaves + ld [wNumFallingObjects], a + call AnimationFallingObjects pop af ld [rOBP0], a ret @@ -2662,115 +2699,120 @@ AnimationLeavesFalling: ; 79c74 (1e:5c74) AnimationPetalsFalling: ; 79c8a (1e:5c8a) ; Makes lots of petals fall down from the top of the screen. It's used in ; the animation for Petal Dance. - ld d, $71 - ld a, $14 - ld [W_SUBANIMTRANSFORM], a - call Func_79c97 + ld d, $71 ; petal tile + ld a, 20 ; number of petals + ld [wNumFallingObjects], a + call AnimationFallingObjects jp ClearSprites -Func_79c97: ; 79c97 (1e:5c97) +AnimationFallingObjects: ; 79c97 (1e:5c97) ld c, a - ld a, $1 - call Func_797e8 - call Func_79d2a - call Func_79d52 + ld a, 1 + call InitMultipleObjectsOAM + call FallingObjects_InitXCoords + call FallingObjects_InitMovementData ld hl, wOAMBuffer - ld [hl], $0 -.asm_79ca8 - ld hl, wTrainerSpriteOffset - ld de, $0000 - ld a, [W_SUBANIMTRANSFORM] + ld [hl], 0 +.loop + ld hl, wFallingObjectsMovementData + ld de, 0 + ld a, [wNumFallingObjects] ld c, a -.asm_79cb2 +.innerLoop push bc push hl push de ld a, [hl] - ld [wd08a], a - call Func_79d16 - call Func_79cdb + ld [wFallingObjectMovementByte], a + call FallingObjects_UpdateMovementByte + call FallingObjects_UpdateOAMEntry pop de - ld hl, $0004 + ld hl, 4 add hl, de ld e, l ld d, h pop hl - ld a, [wd08a] + ld a, [wFallingObjectMovementByte] ld [hli], a pop bc dec c - jr nz, .asm_79cb2 + jr nz, .innerLoop call Delay3 ld hl, wOAMBuffer - ld a, [hl] - cp $68 - jr nz, .asm_79ca8 + ld a, [hl] ; Y + cp 104 ; has the top falling object reached 104 yet? + jr nz, .loop ; keep moving the falling objects down until it does ret -Func_79cdb: ; 79cdb (1e:5cdb) +FallingObjects_UpdateOAMEntry: ; 79cdb (1e:5cdb) +; Increases Y by 2 pixels and adjusts X and X flip based on the falling object's +; movement byte. ld hl, wOAMBuffer add hl, de ld a, [hl] inc a inc a - cp $70 - jr c, .asm_79ce8 - ld a, $a0 -.asm_79ce8 - ld [hli], a - ld a, [wd08a] + cp 112 + jr c, .next + ld a, 160 ; if Y >= 112, put it off-screen +.next + ld [hli], a ; Y + ld a, [wFallingObjectMovementByte] ld b, a - ld de, Unknown_79d0d + ld de, FallingObjects_DeltaXs and $7f add e - jr nc, .asm_79cf6 + jr nc, .noCarry inc d -.asm_79cf6 +.noCarry ld e, a ld a, b and $80 - jr nz, .asm_79d03 + jr nz, .movingLeft +; moving right ld a, [de] add [hl] - ld [hli], a + ld [hli], a ; X inc hl - xor a - jr .asm_79d0b -.asm_79d03 + xor a ; no horizontal flip + jr .next2 +.movingLeft ld a, [de] ld b, a ld a, [hl] sub b - ld [hli], a + ld [hli], a ; X inc hl - ld a, $20 -.asm_79d0b - ld [hl], a + ld a, (1 << OAM_X_FLIP) +.next2 + ld [hl], a ; attribute ret -Unknown_79d0d: ; 79d0d (1e:5d0d) - db $00,$01,$03,$05,$07,$09,$0B,$0D,$0F +FallingObjects_DeltaXs: ; 79d0d (1e:5d0d) + db 0, 1, 3, 5, 7, 9, 11, 13, 15 -Func_79d16: ; 79d16 (1e:5d16) - ld a, [wd08a] +FallingObjects_UpdateMovementByte: ; 79d16 (1e:5d16) + ld a, [wFallingObjectMovementByte] inc a ld b, a and $7f - cp $9 + cp 9 ; have we reached the end of the delta-Xs? ld a, b - jr nz, .asm_79d26 + jr nz, .next +; We've reached the end of the delta-Xs, so wrap to the start and change +; direction from right to left or vice versa. and $80 xor $80 -.asm_79d26 - ld [wd08a], a +.next + ld [wFallingObjectMovementByte], a ret -Func_79d2a: ; 79d2a (1e:5d2a) +FallingObjects_InitXCoords: ; 79d2a (1e:5d2a) ld hl, wOAMBuffer + $01 - ld de, Unknown_79d3e - ld a, [W_SUBANIMTRANSFORM] + ld de, FallingObjects_InitialXCoords + ld a, [wNumFallingObjects] ld c, a -.asm_79d34 +.loop ld a, [de] ld [hli], a inc hl @@ -2778,66 +2820,98 @@ Func_79d2a: ; 79d2a (1e:5d2a) inc hl inc de dec c - jr nz, .asm_79d34 + jr nz, .loop ret -Unknown_79d3e: ; 79d3e (1e:5d3e) +FallingObjects_InitialXCoords: ; 79d3e (1e:5d3e) db $38,$40,$50,$60,$70,$88,$90,$56,$67,$4A,$77,$84,$98,$32,$22,$5C,$6C,$7D,$8E,$99 -Func_79d52: ; 79d52 (1e:5d52) - ld hl, wTrainerSpriteOffset - ld de, Unknown_79d63 - ld a, [W_SUBANIMTRANSFORM] +FallingObjects_InitMovementData: ; 79d52 (1e:5d52) + ld hl, wFallingObjectsMovementData + ld de, FallingObjects_InitialMovementData + ld a, [wNumFallingObjects] ld c, a -.asm_79d5c +.loop ld a, [de] ld [hli], a inc de dec c - jr nz, .asm_79d5c + jr nz, .loop ret -Unknown_79d63: ; 79d63 (1e:5d63) +FallingObjects_InitialMovementData: ; 79d63 (1e:5d63) db $00,$84,$06,$81,$02,$88,$01,$83,$05,$89,$09,$80,$07,$87,$03,$82,$04,$85,$08,$86 AnimationShakeEnemyHUD: ; 79d77 (1e:5d77) +; Shakes the enemy HUD. + +; Make a copy of the back pic's tile patterns in sprite tile pattern VRAM. ld de, vBackPic ld hl, vSprites ld bc, 7 * 7 call CopyVideoData + xor a ld [hSCX], a + +; Copy wTileMap to BG map 0. The regular BG (not the window) is set to use +; map 0 and can be scrolled with SCX, which allows a shaking effect. ld hl, vBGMap0 - call Func_79e0d - ld a, $90 + call BattleAnimCopyTileMapToVRAM + +; Now that the regular BG is showing the same thing the window was, move the +; window off the screen so that we can modify its contents below. + ld a, SCREEN_HEIGHT_PIXELS ld [hWY], a - ld hl, vBGMap0 + $320 - call Func_79e0d - ld a, $38 + +; Copy wTileMap to VRAM such that the row below the enemy HUD (in wTileMap) is +; lined up with row 0 of the window. + ld hl, vBGMap1 - $20 * 7 + call BattleAnimCopyTileMapToVRAM + +; Move the window so that the row below the enemy HUD (in BG map 0) lines up +; with the top row of the window on the screen. This makes it so that the window +; covers everything below the enemy HD with a copy that looks just like what +; was there before. + ld a, 7 * 8 ld [hWY], a - call _AnimationShakeEnemyHUD + +; Write OAM entries so that the copy of the back pic from the top of this +; function shows up on screen. We need this because the back pic's Y coordinates +; range overlaps with that of the enemy HUD and we don't want to shake the top +; of the back pic when we shake the enemy HUD. The OAM copy won't be affected +; by SCX. + call ShakeEnemyHUD_WritePlayerMonPicOAM + ld hl, vBGMap0 - call Func_79e0d + call BattleAnimCopyTileMapToVRAM + +; Remove the back pic from the BG map. call AnimationHideMonPic call Delay3 - ld de, $0208 - call Func_79de9 + +; Use SCX to shake the regular BG. The window and the back pic OAM copy are +; not affected. + lb de, 2, 8 + call ShakeEnemyHUD_ShakeBG + +; Restore the original graphics. call AnimationShowMonPic call ClearSprites - ld a, $90 + ld a, SCREEN_HEIGHT_PIXELS ld [hWY], a ld hl, vBGMap1 - call Func_79e0d + call BattleAnimCopyTileMapToVRAM xor a ld [hWY], a call SaveScreenTilesToBuffer1 ld hl, vBGMap0 - call Func_79e0d + call BattleAnimCopyTileMapToVRAM call ClearScreen call Delay3 call LoadScreenTilesFromBuffer1 ld hl, vBGMap1 - jp Func_79e0d + jp BattleAnimCopyTileMapToVRAM ; b = tile ID list index ; c = base tile ID @@ -2851,27 +2925,27 @@ CopyTileIDsFromList: ; 79dda (1e:5dda) pop hl jp CopyTileIDs -Func_79de9: ; 79de9 (1e:5de9) +ShakeEnemyHUD_ShakeBG: ; 79de9 (1e:5de9) ld a, [hSCX] - ld [wTrainerSpriteOffset], a -.asm_79dee - ld a, [wTrainerSpriteOffset] + ld [wTempSCX], a +.loop + ld a, [wTempSCX] add d ld [hSCX], a ld c, 2 call DelayFrames - ld a, [wTrainerSpriteOffset] + ld a, [wTempSCX] sub d ld [hSCX], a ld c, 2 call DelayFrames dec e - jr nz, .asm_79dee - ld a, [wTrainerSpriteOffset] + jr nz, .loop + ld a, [wTempSCX] ld [hSCX], a ret -Func_79e0d: ; 79e0d (1e:5e0d) +BattleAnimCopyTileMapToVRAM: ; 79e0d (1e:5e0d) ld a, h ld [H_AUTOBGTRANSFERDEST + 1], a ld a, l @@ -2942,19 +3016,19 @@ PlayApplyingAttackSound: ; 79e6a (1e:5e6a) ld a, [wDamageMultipliers] and $7f ret z - cp $a + cp 10 ld a, $20 ld b, $30 ld c, SFX_DAMAGE - jr z, .asm_79e8b + jr z, .playSound ld a, $e0 ld b, $ff ld c, SFX_SUPER_EFFECTIVE - jr nc, .asm_79e8b + jr nc, .playSound ld a, $50 ld b, $1 ld c, SFX_NOT_VERY_EFFECTIVE -.asm_79e8b +.playSound ld [wc0f1], a ld a, b ld [wc0f2], a diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 056c55ea..e64cbabb 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -210,28 +210,28 @@ BattleTransition_Spiral: ; 70a72 (1c:4a72) .outwardSpiral coord hl, 10, 10 ld a, $3 - ld [wd09f], a + ld [wOutwardSpiralCurrentDirection], a ld a, l - ld [wd09b], a + ld [wOutwardSpiralTileMapPointer + 1], a ld a, h - ld [wd09a], a - ld b, $78 -.loop1 - ld c, $3 -.loop2 + ld [wOutwardSpiralTileMapPointer], a + ld b, 120 +.loop + ld c, 3 +.innerLoop push bc call BattleTransition_OutwardSpiral_ pop bc dec c - jr nz, .loop2 + jr nz, .innerLoop call DelayFrame dec b - jr nz, .loop1 + jr nz, .loop .done call BattleTransition_BlackScreen xor a - ld [wd09b], a - ld [wd09a], a + ld [wOutwardSpiralTileMapPointer + 1], a + ld [wOutwardSpiralTileMapPointer], a ret BattleTransition_InwardSpiral: ; 70aaa (1c:4aaa) @@ -286,69 +286,69 @@ BattleTransition_InwardSpiral_: ; 70ae0 (1c:4ae0) BattleTransition_OutwardSpiral_: ; 70af9 (1c:4af9) ld bc, -SCREEN_WIDTH ld de, SCREEN_WIDTH - ld a, [wd09b] + ld a, [wOutwardSpiralTileMapPointer + 1] ld l, a - ld a, [wd09a] + ld a, [wOutwardSpiralTileMapPointer] ld h, a - ld a, [wd09f] + ld a, [wOutwardSpiralCurrentDirection] cp $0 - jr z, .zero + jr z, .up cp $1 - jr z, .one + jr z, .left cp $2 - jr z, .two + jr z, .down cp $3 - jr z, .three -.done1 + jr z, .right +.keepSameDirection ld [hl], $ff -.done2_ +.done ld a, l - ld [wd09b], a + ld [wOutwardSpiralTileMapPointer + 1], a ld a, h - ld [wd09a], a + ld [wOutwardSpiralTileMapPointer], a ret -.zero +.up dec hl ld a, [hl] cp $ff - jr nz, .done2 + jr nz, .changeDirection inc hl add hl, bc - jr .done1 -.one + jr .keepSameDirection +.left add hl, de ld a, [hl] cp $ff - jr nz, .done2 + jr nz, .changeDirection add hl, bc dec hl - jr .done1 -.two + jr .keepSameDirection +.down inc hl ld a, [hl] cp $ff - jr nz, .done2 + jr nz, .changeDirection dec hl add hl, de - jr .done1 -.three + jr .keepSameDirection +.right add hl, bc ld a, [hl] cp $ff - jr nz, .done2 + jr nz, .changeDirection add hl, de inc hl - jr .done1 -.done2 + jr .keepSameDirection +.changeDirection ld [hl], $ff - ld a, [wd09f] + ld a, [wOutwardSpiralCurrentDirection] inc a cp $4 jr nz, .skip xor a .skip - ld [wd09f], a - jr .done2_ + ld [wOutwardSpiralCurrentDirection], a + jr .done FlashScreen: BattleTransition_FlashScreen_: ; 70b5d (1c:4b5d) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 2be2f78a..0406fe7b 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -357,7 +357,7 @@ EnemyRan: ; 3c202 (f:4202) call PlaySoundWaitForCurrent xor a ld [H_WHOSETURN], a - jpab AnimationSlideEnemyMonOut + jpab AnimationSlideEnemyMonOff WildRanText: ; 3c229 (f:4229) TX_FAR _WildRanText diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index e3b3f42c..96e65f70 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -12,10 +12,10 @@ MarowakAnim: ; 708ca (1c:48ca) ld [H_AUTOBGTRANSFERENABLED], a ; disable BG transfer so we don't see the Marowak too soon ; replace ghost pic with Marowak in BG ld a, MAROWAK - ld [wHPBarMaxHP], a + ld [wChangeMonPicEnemyTurnSpecies], a ld a, $1 ld [H_WHOSETURN], a - callab Func_79793 + callab ChangeMonPic ; alternate between black and light grey 8 times. ; this makes the ghost's body appear to flash ld d, $80 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 283bf32f..4e76d996 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -293,7 +293,7 @@ UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a) ld a, $e .next pop bc - ld [wd09f], a + ld [wNewTileBlockID], a predef ReplaceTileBlock ld hl, $ffdb dec [hl] diff --git a/engine/intro.asm b/engine/intro.asm index 6b5c46c9..c7c4a04d 100755 --- a/engine/intro.asm +++ b/engine/intro.asm @@ -38,7 +38,7 @@ PlayIntroScene: ; 4169d (10:569d) ld a, SFX_INTRO_HIP call PlaySound xor a - ld [wd09f], a + ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation1 call AnimateIntroNidorino ; hop @@ -86,7 +86,7 @@ PlayIntroScene: ; 4169d (10:569d) ld a, SFX_INTRO_HIP call PlaySound ld a, $24 - ld [wd09f], a + ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation3 call AnimateIntroNidorino ld c, $1e @@ -105,7 +105,7 @@ PlayIntroScene: ; 4169d (10:569d) ld a, SFX_INTRO_HIP call PlaySound xor a - ld [wd09f], a + ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation4 call AnimateIntroNidorino ; hop @@ -118,7 +118,7 @@ PlayIntroScene: ; 4169d (10:569d) ret c ld a, $24 - ld [wd09f], a + ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation6 call AnimateIntroNidorino ld c, $1e @@ -129,7 +129,7 @@ PlayIntroScene: ; 4169d (10:569d) ld a, SFX_INTRO_LUNGE call PlaySound ld a, $48 - ld [wd09f], a + ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation7 jp AnimateIntroNidorino @@ -152,17 +152,17 @@ AnimateIntroNidorino: ; 41793 (10:5793) UpdateIntroNidorinoOAM: ; 417ae (10:57ae) ld hl, wOAMBuffer - ld a, [wd09f] + ld a, [wIntroNidorinoBaseTile] ld d, a .loop ld a, [W_BASECOORDY] add [hl] - ld [hli], a + ld [hli], a ; Y ld a, [W_BASECOORDX] add [hl] - ld [hli], a + ld [hli], a ; X ld a, d - ld [hli], a + ld [hli], a ; tile inc hl inc d dec c diff --git a/engine/items/items.asm b/engine/items/items.asm index a60d765a..b0013b46 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -319,7 +319,7 @@ ItemUseBall: ; d687 (3:5687) ld a,TOSS_ANIM ld [W_ANIMATIONID],a xor a - ld [$fff3],a + ld [H_WHOSETURN],a ld [wAnimationType],a ld [wDamageMultipliers],a ld a,[wWhichPokemon] diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm index 0bb2e1b4..cc9fe3a7 100755 --- a/engine/overworld/card_key.asm +++ b/engine/overworld/card_key.asm @@ -47,7 +47,7 @@ PrintCardKeyText: ; 52673 (14:6673) .notSilphCo11F ld a, $e .replaceCardKeyDoorTileBlock - ld [wd09f], a + ld [wNewTileBlockID], a predef ReplaceTileBlock ld hl, wd126 set 5, [hl] diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 293daee7..2056bbb0 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -3,21 +3,21 @@ UsedCut: ; ef54 (3:6f54) ld [wActionResultOrTookBattleTurn], a ; initialise to failure value ld a, [W_CURMAPTILESET] and a ; OVERWORLD - jr z, .asm_ef6b + jr z, .overworld cp GYM - jr nz, .asm_ef77 + jr nz, .nothingToCut ld a, [wTileInFrontOfPlayer] cp $50 ; gym cut tree - jr nz, .asm_ef77 - jr .asm_ef82 -.asm_ef6b + jr nz, .nothingToCut + jr .canCut +.overworld dec a ld a, [wTileInFrontOfPlayer] cp $3d ; cut tree - jr z, .asm_ef82 + jr z, .canCut cp $52 ; grass - jr z, .asm_ef82 -.asm_ef77 + jr z, .canCut +.nothingToCut ld hl, .NothingToCutText jp PrintText @@ -25,9 +25,9 @@ UsedCut: ; ef54 (3:6f54) TX_FAR _NothingToCutText db "@" -.asm_ef82 +.canCut ld [wCutTile], a - ld a, $1 + ld a, 1 ld [wActionResultOrTookBattleTurn], a ; used cut ld a, [wWhichPokemon] ld hl, wPartyMonNicks @@ -37,7 +37,7 @@ UsedCut: ; ef54 (3:6f54) call GBPalWhiteOutWithDelay3 call ClearSprites call RestoreScreenTilesAndReloadTilePatterns - ld a, $90 + ld a, SCREEN_HEIGHT_PIXELS ld [hWY], a call Delay3 call LoadGBPal @@ -53,11 +53,11 @@ UsedCut: ; ef54 (3:6f54) res 6, [hl] ld a, $ff ld [wUpdateSpritesEnabled], a - call AnimateCutTree + call InitCutAnimOAM ld de, CutTreeBlockSwaps - call Func_f09f + call ReplaceTreeTileBlock call RedrawMapView - callba Func_79e96 + callba AnimCut ld a, $1 ld [wUpdateSpritesEnabled], a ld a, SFX_CUT @@ -71,14 +71,15 @@ UsedCutText: ; eff2 (3:6ff2) TX_FAR _UsedCutText db "@" -AnimateCutTree: ; eff7 (3:6ff7) +InitCutAnimOAM: ; eff7 (3:6ff7) xor a ld [wWhichAnimationOffsets], a ld a, $e4 ld [rOBP1], a ld a, [wCutTile] cp $52 - jr z, .asm_f020 + jr z, .grass +; tree ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row ld hl, vChars1 + $7c0 ld bc, (BANK(Overworld_GFX) << 8) + $02 @@ -87,45 +88,45 @@ AnimateCutTree: ; eff7 (3:6ff7) ld hl, vChars1 + $7e0 ld bc, (BANK(Overworld_GFX) << 8) + $02 call CopyVideoData - jr WriteCutTreeBoulderDustAnimationOAMBlock -.asm_f020 + jr WriteCutOrBoulderDustAnimationOAMBlock +.grass ld hl, vChars1 + $7c0 - call LoadCutTreeAnimationTilePattern + call LoadCutGrassAnimationTilePattern ld hl, vChars1 + $7d0 - call LoadCutTreeAnimationTilePattern + call LoadCutGrassAnimationTilePattern ld hl, vChars1 + $7e0 - call LoadCutTreeAnimationTilePattern + call LoadCutGrassAnimationTilePattern ld hl, vChars1 + $7f0 - call LoadCutTreeAnimationTilePattern - call WriteCutTreeBoulderDustAnimationOAMBlock + call LoadCutGrassAnimationTilePattern + call WriteCutOrBoulderDustAnimationOAMBlock ld hl, wOAMBuffer + $93 - ld de, $4 + ld de, 4 ld a, $30 ld c, e -.asm_f044 +.loop ld [hl], a add hl, de xor $60 dec c - jr nz, .asm_f044 + jr nz, .loop ret -LoadCutTreeAnimationTilePattern: ; f04c (3:704c) +LoadCutGrassAnimationTilePattern: ; f04c (3:704c) ld de, AnimationTileset2 + $60 ; tile depicting a leaf ld bc, (BANK(AnimationTileset2) << 8) + $01 jp CopyVideoData -WriteCutTreeBoulderDustAnimationOAMBlock: ; f055 (3:7055) - call GetCutTreeBoulderDustAnimationOffsets +WriteCutOrBoulderDustAnimationOAMBlock: ; f055 (3:7055) + call GetCutOrBoulderDustAnimationOffsets ld a, $9 - ld de, CutTreeBoulderDustAnimationTilesAndAttributes + ld de, CutOrBoulderDustAnimationTilesAndAttributes jp WriteOAMBlock -CutTreeBoulderDustAnimationTilesAndAttributes: ; f060 (3:7060) +CutOrBoulderDustAnimationTilesAndAttributes: ; f060 (3:7060) db $FC,$10,$FD,$10 db $FE,$10,$FF,$10 -GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068) +GetCutOrBoulderDustAnimationOffsets: ; f068 (3:7068) ld hl, wSpriteStateData1 + 4 ld a, [hli] ; player's sprite screen Y position ld b, a @@ -140,10 +141,10 @@ GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068) ld d, $0 ; de holds direction (00: down, 02: up, 04: left, 06: right) ld a, [wWhichAnimationOffsets] and a - ld hl, CutTreeAnimationOffsets - jr z, .asm_f084 + ld hl, CutAnimationOffsets + jr z, .next ld hl, BoulderDustAnimationOffsets -.asm_f084 +.next add hl, de ld e, [hl] inc hl @@ -156,7 +157,7 @@ GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068) ld c, a ret -CutTreeAnimationOffsets: ; f08f (3:708f) +CutAnimationOffsets: ; f08f (3:708f) ; Each pair represents the x and y pixels offsets from the player of where the cut tree animation should be drawn db 8, 36 ; player is facing down db 8, 4 ; player is facing up @@ -171,75 +172,79 @@ BoulderDustAnimationOffsets: ; f097 (3:7097) db -24, 20 ; player is facing left db 40, 20 ; player is facing right -Func_f09f: ; f09f (3:709f) +ReplaceTreeTileBlock: ; f09f (3:709f) +; Determine the address of the tile block that contains the tile in front of the +; player (i.e. where the tree is) and replace it with the corresponding tile +; block that doesn't have the tree. push de ld a, [W_CURMAPWIDTH] - add $6 + add 6 ld c, a - ld b, $0 - ld d, $0 + ld b, 0 + ld d, 0 ld hl, wCurrentTileBlockMapViewPointer ld a, [hli] ld h, [hl] ld l, a add hl, bc - ld a, [wSpriteStateData1 + 9] + ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction and a jr z, .down cp SPRITE_FACING_UP jr z, .up cp SPRITE_FACING_LEFT jr z, .left +; right ld a, [W_XBLOCKCOORD] and a - jr z, .asm_f0e0 - jr .asm_f0ec + jr z, .centerTileBlock + jr .rightOfCenter .down ld a, [W_YBLOCKCOORD] and a - jr z, .asm_f0e0 - jr .asm_f0df + jr z, .centerTileBlock + jr .belowCenter .up ld a, [W_YBLOCKCOORD] and a - jr z, .asm_f0e1 - jr .asm_f0e0 + jr z, .aboveCenter + jr .centerTileBlock .left ld a, [W_XBLOCKCOORD] and a - jr z, .asm_f0e6 - jr .asm_f0e0 -.asm_f0df + jr z, .leftOfCenter + jr .centerTileBlock +.belowCenter add hl, bc -.asm_f0e0 +.centerTileBlock add hl, bc -.asm_f0e1 +.aboveCenter ld e, $2 add hl, de - jr .asm_f0f0 -.asm_f0e6 + jr .next +.leftOfCenter ld e, $1 add hl, bc add hl, de - jr .asm_f0f0 -.asm_f0ec + jr .next +.rightOfCenter ld e, $3 add hl, bc add hl, de -.asm_f0f0 +.next pop de ld a, [hl] ld c, a -.asm_f0f3 +.loop ; find the matching tile block in the array ld a, [de] inc de inc de cp $ff ret z cp c - jr nz, .asm_f0f3 + jr nz, .loop dec de - ld a, [de] + ld a, [de] ; replacement tile block from matching array entry ld [hl], a ret diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm index 3194b39b..1cf832b5 100755 --- a/engine/overworld/cut2.asm +++ b/engine/overworld/cut2.asm @@ -1,19 +1,19 @@ -Func_79e96: ; 79e96 (1e:5e96) +AnimCut: ; 79e96 (1e:5e96) ld a, [wCutTile] cp $52 - jr z, .asm_79ec8 + jr z, .grass ld c, $8 -.asm_79e9f +.cutTreeLoop push bc ld hl, wOAMBuffer + $91 - ld a, $1 - ld [wd08a], a - ld c, $2 + ld a, 1 + ld [wCoordAdjustmentAmount], a + ld c, 2 call AdjustOAMBlockXPos2 ld hl, wOAMBuffer + $99 - ld a, $ff - ld [wd08a], a - ld c, $2 + ld a, -1 + ld [wCoordAdjustmentAmount], a + ld c, 2 call AdjustOAMBlockXPos2 ld a, [rOBP1] xor $64 @@ -21,49 +21,49 @@ Func_79e96: ; 79e96 (1e:5e96) call DelayFrame pop bc dec c - jr nz, .asm_79e9f + jr nz, .cutTreeLoop ret -.asm_79ec8 - ld c, $2 -.asm_79eca +.grass + ld c, 2 +.cutGrassLoop push bc ld c, $8 - call Func_79eed - call Func_79f30 + call AnimCutGrass_UpdateOAMEntries + call AnimCutGrass_SwapOAMEntries ld c, $8 - call Func_79eed - call Func_79f30 + call AnimCutGrass_UpdateOAMEntries + call AnimCutGrass_SwapOAMEntries ld hl, wOAMBuffer + $90 - ld a, $2 - ld [wd08a], a - ld c, $4 + ld a, 2 + ld [wCoordAdjustmentAmount], a + ld c, 4 call AdjustOAMBlockYPos2 pop bc dec c - jr nz, .asm_79eca + jr nz, .cutGrassLoop ret -Func_79eed: ; 79eed (1e:5eed) +AnimCutGrass_UpdateOAMEntries: ; 79eed (1e:5eed) push bc ld hl, wOAMBuffer + $91 - ld a, $1 - ld [wd08a], a - ld c, $1 + ld a, 1 + ld [wCoordAdjustmentAmount], a + ld c, 1 call AdjustOAMBlockXPos2 ld hl, wOAMBuffer + $95 - ld a, $2 - ld [wd08a], a - ld c, $1 + ld a, 2 + ld [wCoordAdjustmentAmount], a + ld c, 1 call AdjustOAMBlockXPos2 ld hl, wOAMBuffer + $99 - ld a, $fe - ld [wd08a], a - ld c, $1 + ld a, -2 + ld [wCoordAdjustmentAmount], a + ld c, 1 call AdjustOAMBlockXPos2 ld hl, wOAMBuffer + $9d - ld a, $ff - ld [wd08a], a - ld c, $1 + ld a, -1 + ld [wCoordAdjustmentAmount], a + ld c, 1 call AdjustOAMBlockXPos2 ld a, [rOBP1] xor $64 @@ -71,19 +71,19 @@ Func_79eed: ; 79eed (1e:5eed) call DelayFrame pop bc dec c - jr nz, Func_79eed + jr nz, AnimCutGrass_UpdateOAMEntries ret -Func_79f30: ; 79f30 (1e:5f30) +AnimCutGrass_SwapOAMEntries: ; 79f30 (1e:5f30) ld hl, wOAMBuffer + $90 - ld de, wHPBarMaxHP + ld de, wBuffer ld bc, $8 call CopyData ld hl, wOAMBuffer + $98 ld de, wOAMBuffer + $90 ld bc, $8 call CopyData - ld hl, wHPBarMaxHP + ld hl, wBuffer ld de, wOAMBuffer + $98 ld bc, $8 jp CopyData diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm index a59ae794..8c5485e2 100755 --- a/engine/overworld/ssanne.asm +++ b/engine/overworld/ssanne.asm @@ -8,14 +8,14 @@ AnimateBoulderDust: ; 79f54 (1e:5f54) ld a, %11100100 ld [rOBP1], a call LoadSmokeTileFourTimes - callba WriteCutTreeBoulderDustAnimationOAMBlock + callba WriteCutOrBoulderDustAnimationOAMBlock ld c, 8 ; number of steps in animation .loop push bc call GetMoveBoulderDustFunctionPointer ld bc, .returnAddress push bc - ld c, $4 + ld c, 4 jp [hl] .returnAddress ld a, [rOBP1] @@ -36,7 +36,7 @@ GetMoveBoulderDustFunctionPointer: ; 79f92 (1e:5f92) ld b, $0 add hl, bc ld a, [hli] - ld [wd08a], a + ld [wCoordAdjustmentAmount], a ld a, [hli] ld e, a ld a, [hli] diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index 990687ff..8e98f662 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -711,12 +711,12 @@ SlotMachine_PayCoinsToPlayer: ; 3776b (d:776b) SlotMachine_PutOutLitBalls: ; 377ce (d:77ce) ld a, $23 - ld [wd08a], a + ld [wNewSlotMachineBallTile], a jr SlotMachine_UpdateThreeCoinBallTiles SlotMachine_LightBalls: ; 377d5 (d:77d5) ld a, $14 - ld [wd08a], a + ld [wNewSlotMachineBallTile], a ld a, [wSlotMachineBet] dec a jr z, SlotMachine_UpdateOneCoinBallTiles @@ -739,7 +739,7 @@ SlotMachine_UpdateOneCoinBallTiles: ; 377fb (d:77fb) coord hl, 3, 6 SlotMachine_UpdateBallTiles: ; 377fe (d:77fe) - ld a, [wd08a] + ld a, [wNewSlotMachineBallTile] ld [hl], a ld bc, 13 add hl, bc diff --git a/engine/trade.asm b/engine/trade.asm index ba8de4ff..74fd3434 100755 --- a/engine/trade.asm +++ b/engine/trade.asm @@ -304,25 +304,25 @@ Trade_AnimateBallEnteringLinkCable: ; 412d2 (10:52d2) ld a, %11100100 ld [rOBP0], a xor a - ld [wd09f], a + ld [wLinkCableAnimBulgeToggle], a ld bc, $2060 .moveBallInsideLinkCableLoop push bc xor a ld de, Trade_BallInsideLinkCableOAM call WriteOAMBlock - ld a, [wd09f] + ld a, [wLinkCableAnimBulgeToggle] xor $1 - ld [wd09f], a + ld [wLinkCableAnimBulgeToggle], a add $7e ld hl, wOAMBuffer + $02 - ld de, $4 + ld de, 4 ld c, e -.cycleSpriteFramesLoop +.cycleLinkCableBulgeTile ld [hl], a add hl, de dec c - jr nz, .cycleSpriteFramesLoop + jr nz, .cycleLinkCableBulgeTile call Delay3 pop bc ld a, c diff --git a/home.asm b/home.asm index d5961082..8226e352 100644 --- a/home.asm +++ b/home.asm @@ -411,12 +411,12 @@ HandlePartyMenuInput:: ; 145a (0:145a) ld a,1 ld [wMenuWrappingEnabled],a ld a,$40 - ld [wd09b],a - call HandleMenuInputPokemonSelection + ld [wPartyMenuAnimMonEnabled],a + call HandleMenuInput_ call PlaceUnfilledArrowMenuCursor ld b,a xor a - ld [wd09b],a + ld [wPartyMenuAnimMonEnabled],a ld a,[wCurrentMenuItem] ld [wPartyAndBillsPCSavedMenuItem],a ld hl,wd730 @@ -3897,9 +3897,9 @@ WriteOAMBlock:: ; 3a97 (0:3a97) HandleMenuInput:: ; 3abe (0:3abe) xor a - ld [wd09b],a + ld [wPartyMenuAnimMonEnabled],a -HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2) +HandleMenuInput_:: ; 3ac2 (0:3ac2) ld a,[H_DOWNARROWBLINKCNT1] push af ld a,[H_DOWNARROWBLINKCNT2] @@ -3915,7 +3915,7 @@ HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2) call Delay3 .loop2 push hl - ld a,[wd09b] + ld a,[wPartyMenuAnimMonEnabled] and a ; is it a pokemon selection menu? jr z,.getJoypadState callba AnimatePartyMon ; shake mini sprite of selected pokemon diff --git a/scripts/agatha.asm b/scripts/agatha.asm index f0607785..60ddf606 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -21,7 +21,7 @@ AgathaScript_76443: ; 76443 (1d:6443) ld a, $3b AgathaScript_76459: ; 76459 (1d:6459) - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $2 predef_jump ReplaceTileBlock diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 1aae7d19..c39656b9 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -21,7 +21,7 @@ BrunoScript_762ec: ; 762ec (1d:62ec) ld a, $24 BrunoScript_76302: ; 76302 (1d:6302) - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $2 predef_jump ReplaceTileBlock diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index 48264603..84919b64 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -31,7 +31,7 @@ CeladonGameCornerScript_48bec: ; 48bec (12:4bec) CheckEvent EVENT_FOUND_ROCKET_HIDEOUT ret nz ld a, $2a - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0208 predef_jump ReplaceTileBlock @@ -451,7 +451,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) call WaitForSoundToFinish SetEvent EVENT_FOUND_ROCKET_HIDEOUT ld a, $43 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0208 predef ReplaceTileBlock jp TextScriptEnd diff --git a/scripts/lance.asm b/scripts/lance.asm index 4d0072be..9fa621da 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -24,12 +24,12 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) LanceScript_5a2de: ; 5a2de (16:62de) push bc - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $602 call LanceScript_5a2f0 pop bc ld a, b - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $603 LanceScript_5a2f0: ; 5a2f0 (16:62f0) diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index 4a245d93..3c639d1e 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -22,7 +22,7 @@ LoreleiScript_76191: ; 76191 (1d:6191) .asm_761a9 ld a, $24 .asm_761ab - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $2 predef_jump ReplaceTileBlock diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index 7d349276..88bdd3ed 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -35,12 +35,12 @@ Mansion1Subscript1: ; 442c5 (11:42c5) Mansion1Script_44304: ; 44304 (11:4304) ld a, $2d - ld [wd09f], a + ld [wNewTileBlockID], a jr Mansion1ReplaceBlock Mansion1Script_4430b: ; 4430b (11:430b) ld a, $e - ld [wd09f], a + ld [wNewTileBlockID], a Mansion1ReplaceBlock: ; 44310 (11:4310) predef ReplaceTileBlock ret diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index 4f5aac9f..cb697b94 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -38,7 +38,7 @@ Mansion2Script_51fee: ; 51fee (14:5fee) ret Mansion2Script_5202f: ; 5202f (14:602f) - ld [wd09f], a + ld [wNewTileBlockID], a predef_jump ReplaceTileBlock Mansion2Script_Switches: ; 52037 (14:6037) diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index ccf40cb4..c658596e 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -26,7 +26,7 @@ RocketHideout1Script_44be0: ; 44be0 (11:4be0) .asm_44c01 ld a, $e .asm_44c03 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $080c predef_jump ReplaceTileBlock diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index 3c312d4c..ed2bb61d 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -26,7 +26,7 @@ RocketHideout4Script_45473: ; 45473 (11:5473) .asm_45496 ld a, $e .asm_45498 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $050c predef_jump ReplaceTileBlock diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index 326b0aeb..fb419a22 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -19,7 +19,7 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f) CheckEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret nz ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $405 predef_jump ReplaceTileBlock diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index 8f37b57f..5de025f0 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -19,7 +19,7 @@ SilphCo11Script_62110: ; 62110 (18:6110) CheckEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR ret nz ld a, $20 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $603 predef_jump ReplaceTileBlock diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index a8d0fa56..b758455e 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -20,7 +20,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) jr nz, .asm_59d2e push af ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0202 predef ReplaceTileBlock pop af @@ -28,7 +28,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) CheckEventAfterBranchReuseA EVENT_SILPH_CO_2_UNLOCKED_DOOR2, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ret nz ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0502 predef_jump ReplaceTileBlock diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index b55cc5eb..f693ea33 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -20,7 +20,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) jr nz, .asm_59f98 push af ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $404 predef ReplaceTileBlock pop af @@ -28,7 +28,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) CheckEventAfterBranchReuseA EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ret nz ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $408 predef_jump ReplaceTileBlock diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index 815170ff..0ea2c8c8 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -20,7 +20,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) jr nz, .asm_19d48 push af ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0602 predef ReplaceTileBlock pop af @@ -28,7 +28,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) CheckEventAfterBranchReuseA EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret nz ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0406 predef_jump ReplaceTileBlock diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index ecc57537..d6f35993 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -20,7 +20,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) jr nz, .asm_19f74 push af ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0203 predef ReplaceTileBlock pop af @@ -29,7 +29,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) jr nz, .asm_19f87 push af ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0603 predef ReplaceTileBlock pop af @@ -37,7 +37,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR2 ret nz ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0507 predef_jump ReplaceTileBlock diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index a84f0dc4..25fbcef9 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -19,7 +19,7 @@ SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) CheckEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR ret nz ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $0602 predef_jump ReplaceTileBlock diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 26d9e62f..7169f0c0 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -20,7 +20,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) jr nz, .asm_51b9e push af ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $305 predef ReplaceTileBlock pop af @@ -29,7 +29,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) jr nz, .asm_51bb1 push af ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $20a predef ReplaceTileBlock pop af @@ -37,7 +37,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) CheckEventAfterBranchReuseA EVENT_SILPH_CO_7_UNLOCKED_DOOR3, EVENT_SILPH_CO_7_UNLOCKED_DOOR2 ret nz ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $60a predef_jump ReplaceTileBlock diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index 26a89355..7545f359 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -19,7 +19,7 @@ SilphCo8Script_5651a: ; 5651a (15:651a) CheckEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR ret nz ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $403 predef_jump ReplaceTileBlock diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index 8960c290..557ce1f1 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -20,7 +20,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) jr nz, .asm_5d7f8 push af ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $401 predef ReplaceTileBlock pop af @@ -29,7 +29,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) jr nz, .asm_5d80b push af ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $209 predef ReplaceTileBlock pop af @@ -38,7 +38,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) jr nz, .asm_5d81e push af ld a, $54 - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $509 predef ReplaceTileBlock pop af @@ -46,7 +46,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR3 ret nz ld a, $5f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $605 predef_jump ReplaceTileBlock diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index 8c400b5f..0282e340 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -37,7 +37,7 @@ VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d) call PlaySound ld a, $5 .asm_5ca7f - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $202 predef_jump ReplaceTileBlock diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index 91e20ad3..dbb69a64 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -14,7 +14,7 @@ VictoryRoad1Script: ; 5da0a (17:5a0a) CheckEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH ret z ld a, $1d - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $604 predef_jump ReplaceTileBlock diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index b7aa40b5..41fe0212 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -33,7 +33,7 @@ VictoryRoad2Script_517c9: ; 517c9 (14:57c9) ld bc, $70b VictoryRoad2Script_517e2: ; 517e2 (14:57e2) - ld [wd09f], a + ld [wNewTileBlockID], a predef ReplaceTileBlock ret diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index 2984e4ae..33a29e44 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -16,7 +16,7 @@ VictoryRoad3Script_44996: ; 44996 (11:4996) CheckEventHL EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 ret z ld a, $1d - ld [wd09f], a + ld [wNewTileBlockID], a ld bc, $503 predef_jump ReplaceTileBlock diff --git a/wram.asm b/wram.asm index da981d22..14f3c5af 100755 --- a/wram.asm +++ b/wram.asm @@ -409,7 +409,11 @@ wSlotMachineSavedROMBank:: ; cc5e ds 12 wcc6b:: ds 14 ; doesn't seem to be used for anything, probably just more storage -wcc79:: ds 30 ; used in battle animations + +wAnimPalette:: ; cc79 + ds 1 + + ds 29 wNPCMovementDirections2:: ; cc97 @@ -647,6 +651,13 @@ wOverrideSimulatedJoypadStatesMask:: ; cd3b ds 1 +wFallingObjectsMovementData:: ; cd3d +; up to 20 bytes (one byte for each falling object) + +wSavedY:: ; cd3d + +wTempSCX:: ; cd3d + wBattleTransitionCircleScreenQuadrantY:: ; cd3d ; 0 = upper half (Y < 9) ; 1 = lower half (Y >= 9) @@ -1050,9 +1061,13 @@ wLearningMovesFromDayCare:: ; cee9 ; whether WriteMonMoves is being used to make a mon learn moves from day care ; non-zero if so +wChangeMonPicEnemyTurnSpecies:: ; cee9 + wHPBarMaxHP:: ; cee9 ds 1 +wChangeMonPicPlayerTurnSpecies:: ; ceea + wEvoNewSpecies:: ; ceea ds 1 @@ -1554,12 +1569,34 @@ W_NUMFBTILES:: ; d089 ; number of tiles in current battle animation frame block ds 1 +wFlashScreenLongCounter:: ; d08a + +wSpiralBallsBaseY:: ; d08a + +wFallingObjectMovementByte:: ; d08a +; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8) +; bit 7: direction; 0 = right, 1 = left + +wNumShootingBalls:: ; d08a + wTradedMonMovingRight:: ; d08a ; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa wOptionsInitialized:: ; d08a -wd08a:: ds 1 ; used with sprites and displaying the option menu on the main menu screen? +wNewSlotMachineBallTile:: ; d08a + +wCoordAdjustmentAmount:: ; d08a +; how much to add to the X/Y coord + +wUnusedD08A:: ; d08a + ds 1 + +wSpiralBallsBaseX:: ; d08b + +wNumFallingObjects:: ; d08b + +wSlideMonDelay:: ; d08b wAnimCounter:: ; d08b ; generic counter variable for various animations @@ -1601,13 +1638,17 @@ W_SUBANIMSUBENTRYADDR:: ; d096 ds 2 -wd09a:: ds 1 ; used with the battle transition screen when entering a battle (screen slowly draws into black) +wOutwardSpiralTileMapPointer:: ; d09a + ds 1 + +wPartyMenuAnimMonEnabled:: ; d09b wTownMapSpriteBlinkingEnabled:: ; d09b ; non-zero when enabled. causes nest locations to blink on and off. ; the town selection cursor will blink regardless of what this value is -wd09b:: ds 1 ; also used with battle transition screen and move animations +wUnusedD09B:: ; d09b + ds 1 W_FBDESTADDR:: ; d09c ; current destination address in OAM for frame blocks (big endian) @@ -1625,9 +1666,28 @@ W_FBMODE:: ; d09e ; contain the upper and lower bit of each of the 8 pixels, respectively ds 1 +wLinkCableAnimBulgeToggle:: ; d09f +; 0 = small +; 1 = big + +wIntroNidorinoBaseTile:: ; d09f + +wOutwardSpiralCurrentDirection:: ; d09f + +wDropletTile:: ; d09f + wNewTileBlockID:: ; d09f -wd09f:: ds 1 ; used with predef ReplaceTileBlock +wWhichBattleAnimTileset:: ; d09f + +wSquishMonCurrentDirection:: ; d09f +; 0 = left +; 1 = right + +wSlideMonUpBottomRowLeftTile:: ; d09f +; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_ + ds 1 + wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank W_SPRITECURPOSX:: ; d0a1 -- cgit v1.3.1-sl0p From f8a9c37a0019eb085c22c6e3ae53b16ff0cd4f6a Mon Sep 17 00:00:00 2001 From: dannye Date: Wed, 5 Aug 2015 16:20:29 -0500 Subject: Use more lb and other clean up --- engine/HoF_room_pc.asm | 4 +-- engine/battle/battle_transitions.asm | 2 +- engine/battle/core.asm | 58 ++++++++++++++++----------------- engine/battle/draw_hud_pokeball_gfx.asm | 2 +- engine/battle/ghost_marowak_anim.asm | 4 +-- engine/battle/trainer_ai.asm | 2 +- engine/cable_club.asm | 6 ++-- engine/clear_save.asm | 2 +- engine/evolution.asm | 2 +- engine/evos_moves.asm | 2 +- engine/gamefreak.asm | 8 ++--- engine/hall_of_fame.asm | 4 +-- engine/hidden_object_functions17.asm | 2 +- engine/hp_bar.asm | 2 +- engine/in_game_trades.asm | 18 +++++----- engine/intro.asm | 2 +- engine/items/items.asm | 32 +++++++++--------- engine/learn_move.asm | 6 ++-- engine/load_pokedex_tiles.asm | 4 +-- engine/menu/bills_pc.asm | 2 +- engine/menu/diploma.asm | 4 +-- engine/menu/league_pc.asm | 2 +- engine/menu/naming_screen.asm | 18 +++++----- engine/menu/pokedex.asm | 12 +++---- engine/menu/start_sub_menus.asm | 20 ++++++------ engine/menu/status_screen.asm | 16 ++++----- engine/oak_speech.asm | 18 +++++----- engine/oak_speech2.asm | 2 +- engine/overworld/cut.asm | 6 ++-- engine/overworld/emotion_bubbles.asm | 2 +- engine/overworld/healing_machine.asm | 2 +- engine/overworld/ledges.asm | 4 +-- engine/overworld/player_animations.asm | 8 ++--- engine/overworld/pokemart.asm | 6 ++-- engine/overworld/ssanne.asm | 2 +- engine/save.asm | 6 ++-- engine/slot_machine.asm | 2 +- engine/titlescreen.asm | 4 +-- engine/town_map.asm | 18 +++++----- engine/trade.asm | 10 +++--- home.asm | 41 +++++++++++------------ home/copy2.asm | 4 +-- home/overworld.asm | 4 +-- home/text.asm | 4 +-- main.asm | 22 ++++++------- scripts/agatha.asm | 2 +- scripts/bikeshop.asm | 2 +- scripts/billshouse.asm | 2 +- scripts/blueshouse.asm | 2 +- scripts/bruno.asm | 2 +- scripts/celadoncity.asm | 2 +- scripts/celadondiner.asm | 2 +- scripts/celadongamecorner.asm | 8 ++--- scripts/celadongym.asm | 2 +- scripts/celadonmansion5.asm | 2 +- scripts/celadonmart3.asm | 2 +- scripts/celadonmartroof.asm | 6 ++-- scripts/ceruleancity.asm | 2 +- scripts/ceruleangym.asm | 2 +- scripts/cinnabargym.asm | 2 +- scripts/copycatshouse2f.asm | 2 +- scripts/fanclub.asm | 2 +- scripts/fuchsiagym.asm | 2 +- scripts/fuchsiahouse2.asm | 2 +- scripts/fuchsiahouse3.asm | 2 +- scripts/lab3.asm | 2 +- scripts/lance.asm | 4 +-- scripts/lavenderhouse1.asm | 2 +- scripts/lorelei.asm | 2 +- scripts/mansion1.asm | 16 ++++----- scripts/mansion2.asm | 12 +++---- scripts/mtmoon3.asm | 4 +-- scripts/mtmoonpokecenter.asm | 2 +- scripts/museum1f.asm | 2 +- scripts/oakslab.asm | 2 +- scripts/pewtergym.asm | 2 +- scripts/rockethideout1.asm | 2 +- scripts/rockethideout4.asm | 2 +- scripts/route1.asm | 2 +- scripts/route12gateupstairs.asm | 2 +- scripts/route12house.asm | 2 +- scripts/route16house.asm | 2 +- scripts/route24.asm | 2 +- scripts/safarizoneentrance-yellow.asm | 2 +- scripts/safarizonesecrethouse.asm | 2 +- scripts/saffrongym.asm | 2 +- scripts/saffronhouse2.asm | 2 +- scripts/silphco10.asm | 9 ++--- scripts/silphco11.asm | 11 ++++--- scripts/silphco2.asm | 14 ++++---- scripts/silphco3.asm | 12 ++++--- scripts/silphco4.asm | 12 ++++--- scripts/silphco5.asm | 15 +++++---- scripts/silphco6.asm | 10 +++--- scripts/silphco7.asm | 17 ++++++---- scripts/silphco8.asm | 9 ++--- scripts/silphco9.asm | 18 ++++++---- scripts/ssanne7.asm | 2 +- scripts/vermiliongym.asm | 4 +-- scripts/vermilionhouse2.asm | 2 +- scripts/victoryroad1.asm | 2 +- scripts/victoryroad2.asm | 4 +-- scripts/victoryroad3.asm | 2 +- scripts/viridiancity.asm | 2 +- scripts/viridiangym.asm | 2 +- scripts/viridianmart.asm | 2 +- 106 files changed, 346 insertions(+), 326 deletions(-) (limited to 'scripts/lorelei.asm') diff --git a/engine/HoF_room_pc.asm b/engine/HoF_room_pc.asm index 15ea1524..704fea16 100755 --- a/engine/HoF_room_pc.asm +++ b/engine/HoF_room_pc.asm @@ -164,7 +164,7 @@ FillFourRowsWithBlack: ; 7417b (1d:417b) FillMiddleOfScreenWithWhite: ; 74183 (1d:4183) coord hl, 0, 4 ld bc, SCREEN_WIDTH * 10 - ld a, $7f ; blank white tile + ld a, " " jp FillMemory Credits: ; 7418e (1d:418e) @@ -246,7 +246,7 @@ Credits: ; 7418e (1d:418e) pop de ld de, TheEndGfx ld hl, vChars2 + $600 - ld bc, (BANK(TheEndGfx) << 8) + $0a + lb bc, BANK(TheEndGfx), $0a call CopyVideoData coord hl, 4, 8 ld de, TheEndTextString diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index e64cbabb..e9e247f9 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -184,7 +184,7 @@ DungeonMaps2: ; 70a44 (1c:4a44) LoadBattleTransitionTile: ; 70a4d (1c:4a4d) ld hl, vChars1 + $7f0 ld de, BattleTransitionTile - ld bc, (BANK(BattleTransitionTile) << 8) + $01 + lb bc, BANK(BattleTransitionTile), $01 jp CopyVideoData BattleTransitionTile: ; 70a59 (1c:4a59) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index fe7066e2..65549f7b 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -102,7 +102,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c) ld [wTextBoxID], a call DisplayTextBoxID coord hl, 1, 5 - ld bc, $307 + lb bc, 3, 7 call ClearScreenArea call DisableLCD call LoadFontTilePatterns @@ -110,7 +110,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c) ld hl, vBGMap0 ld bc, $400 .clearBackgroundLoop - ld a, $7f + ld a, " " ld [hli], a dec bc ld a, b @@ -717,8 +717,8 @@ HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ; 3c4a3 (f:44a3) ld [wHPBarMaxHP+1], a ld a, [hl] ld [wHPBarMaxHP], a - ld de, $fff2 - add hl, de ; skip back fomr max hp to current hp + ld de, wBattleMonHP - wBattleMonMaxHP + add hl, de ; skip back from max hp to current hp ld a, [hl] ld [wHPBarOldHP], a ; add bc to current HP add c @@ -852,7 +852,7 @@ FaintEnemyPokemon: ; 0x3c567 coord de, 12, 6 call SlideDownFaintedMonPic coord hl, 0, 0 - ld bc, $40b + lb bc, 4, 11 call ClearScreenArea ld a, [W_ISINBATTLE] dec a @@ -1100,7 +1100,7 @@ RemoveFaintedPlayerMon: ; 3c741 (f:4741) ld [wBattleMonStatus], a call ReadPlayerMonCurHPAndStatus coord hl, 9, 7 - ld bc, $50b + lb bc, 5, 11 call ClearScreenArea coord hl, 1, 10 coord de, 1, 11 @@ -1132,7 +1132,7 @@ DoUseNextMonDialogue: ; 3c79b (f:479b) call PrintText .displayYesNoBox coord hl, 13, 9 - ld bc, $a0e + lb bc, 10, 14 ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID @@ -1209,7 +1209,7 @@ HandlePlayerBlackOut: ; 3c837 (f:4837) cp $c8 + SONY1 jr nz, .notSony1Battle coord hl, 0, 0 ; sony 1 battle - ld bc, $815 + lb bc, 8, 21 call ClearScreenArea call ScrollTrainerPicAfterBattle ld c, 40 @@ -1449,7 +1449,7 @@ EnemySendOutFirstMon: ; 3c92a (f:492a) ld hl, TrainerAboutToUseText call PrintText coord hl, 0, 7 - ld bc,$0801 + lb bc, 8, 1 ld a,TWO_OPTION_MENU ld [wTextBoxID],a call DisplayTextBoxID @@ -1484,7 +1484,7 @@ EnemySendOutFirstMon: ; 3c92a (f:492a) .next4 call ClearSprites coord hl, 0, 0 - ld bc,$040B + lb bc, 4, 11 call ClearScreenArea ld b,1 call GoPAL_SET @@ -1886,7 +1886,7 @@ DrawPlayerHUDAndHPBar: ; 3cd60 (f:4d60) xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 9, 7 - ld bc, $50b + lb bc, 5, 11 call ClearScreenArea callab PlacePlayerHUDTiles coord hl, 18, 9 @@ -1947,7 +1947,7 @@ DrawEnemyHUDAndHPBar: ; 3cdec (f:4dec) xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 0, 0 - ld bc, $40c + lb bc, 4, 12 call ClearScreenArea callab PlaceEnemyHUDTiles ld de, wEnemyMonNick @@ -2055,11 +2055,11 @@ CenterMonName: ; 3ce9c (f:4e9c) .loop inc de ld a, [de] - cp $50 + cp "@" jr z, .done inc de ld a, [de] - cp $50 + cp "@" jr z, .done dec hl dec b @@ -2091,7 +2091,7 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3) ; the following happens for the old man tutorial ld hl, wPlayerName ld de, W_GRASSRATE - ld bc, $b + ld bc, 11 call CopyData ; temporarily save the player name in unused space, ; which is supposed to get overwritten when entering a ; map with wild Pokémon. Due to an oversight, the data @@ -2099,14 +2099,14 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3) ; Missingno. glitch can show up. ld hl, .oldManName ld de, wPlayerName - ld bc, $b + ld bc, 11 call CopyData ; the following simulates the keystrokes by drawing menus on screen coord hl, 9, 14 ld [hl], "▶" ld c, 80 call DelayFrames - ld [hl], $7f + ld [hl], " " coord hl, 9, 16 ld [hl], "▶" ld c, 50 @@ -2395,7 +2395,7 @@ PartyMenuOrRockOrRun: .partyMonDeselected coord hl, 11, 11 ld bc, $81 - ld a, $7f + ld a, " " call FillMemory xor a ; NORMAL_PARTY_MENU ld [wPartyMenuTypeOrMessageID], a @@ -2585,7 +2585,7 @@ MoveSelectionMenu: ; 3d219 (f:5219) .relearnmenu ld a, [wWhichPokemon] ld hl, wPartyMon1Moves - ld bc, $2c + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes call .loadmoves coord hl, 4, 7 @@ -2662,7 +2662,7 @@ SelectMenuItem: ; 3d2fe (f:52fe) jr z, .select coord hl, 5, 13 dec a - ld bc, $14 + ld bc, SCREEN_WIDTH call AddNTimes ld [hl], $ec .select @@ -2862,7 +2862,7 @@ SwapMovesInMenu: ; 3d435 (f:5435) push hl call .swapBytes ; swap moves pop hl - ld bc, $15 + ld bc, wPartyMon1PP - wPartyMon1Moves add hl, bc call .swapBytes ; swap move PP xor a @@ -6318,7 +6318,7 @@ LoadEnemyMonData: ; 3eb01 (f:6b01) call GetMonName ld hl, wcd6d ld de, wEnemyMonNick - ld bc, $b + ld bc, 11 call CopyData ld a, [wEnemyMonSpecies2] ld [wd11e], a @@ -6718,11 +6718,11 @@ LoadHudTilePatterns: ; 3ee5b (f:6e5b) .lcdEnabled ld de, BattleHudTiles1 ld hl, vChars2 + $6d0 - ld bc, (BANK(BattleHudTiles1) << 8) + $03 + lb bc, BANK(BattleHudTiles1), $03 call CopyVideoDataDouble ld de, BattleHudTiles2 ld hl, vChars2 + $730 - ld bc, (BANK(BattleHudTiles2) << 8) + $06 + lb bc, BANK(BattleHudTiles2), $06 jp CopyVideoDataDouble PrintEmptyString: ; 3ee94 (f:6e94) @@ -6942,10 +6942,10 @@ InitBattle_Common: ; 3efeb (f:6feb) ld [H_AUTOBGTRANSFERDEST + 1], a call LoadScreenTilesFromBuffer1 coord hl, 9, 7 - ld bc, $50a + lb bc, 5, 10 call ClearScreenArea coord hl, 1, 0 - ld bc, $40a + lb bc, 4, 10 call ClearScreenArea call ClearSprites ld a, [W_ISINBATTLE] @@ -7089,8 +7089,8 @@ LoadMonBackPic: ; 3f103 (f:7103) ld a, [wBattleMonSpecies2] ld [wcf91], a coord hl, 1, 5 - ld b, $7 - ld c, $8 + ld b, 7 + ld c, 8 call ClearScreenArea ld hl, W_MONHBACKSPRITE - W_MONHEADER call UncompressMonSprite @@ -7928,7 +7928,7 @@ FellText: ; 3f683 (f:7683) PrintStatText: ; 3f688 (f:7688) ld hl, StatsTextStrings - ld c, $50 + ld c, "@" .asm_3f68d dec b jr z, .asm_3f696 diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index 1e229b1c..7198d984 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -13,7 +13,7 @@ DrawEnemyPokeballs: ; 3a857 (e:6857) LoadPartyPokeballGfx: ; 3a85d (e:685d) ld de, PokeballTileGraphics ld hl, vSprites + $310 - ld bc, (BANK(PokeballTileGraphics) << 8) + $04 + lb bc, BANK(PokeballTileGraphics), $04 jp CopyVideoData SetupOwnPartyPokeballs: ; 3a869 (e:6869) diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index 96e65f70..d76f3f41 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -5,7 +5,7 @@ MarowakAnim: ; 708ca (1c:48ca) call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same ; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap coord hl, 12, 0 - ld bc, $707 + lb bc, 7, 7 call ClearScreenArea call Delay3 xor a @@ -59,7 +59,7 @@ CopyMonPicFromBGToSpriteVRAM: ; 7092a (1c:492a) ld a, $70 ld [W_BASECOORDX], a ld hl, wOAMBuffer - ld bc, $606 + lb bc, 6, 6 ld d, $8 .oamLoop push bc diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index fb932035..9102b2d8 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -665,7 +665,7 @@ AISwitchIfEnoughMons: ; 3a72a (e:672a) inc d .Fainted push bc - ld bc,$2C + ld bc, wEnemyMon2 - wEnemyMon1 add hl,bc pop bc dec c diff --git a/engine/cable_club.asm b/engine/cable_club.asm index 9ccffdbb..07284d13 100755 --- a/engine/cable_club.asm +++ b/engine/cable_club.asm @@ -96,7 +96,7 @@ CableClub_DoBattleOrTradeAgain: ; 5345 ld a, SERIAL_PATCH_LIST_PART_TERMINATOR ld [de], a ; end of part 1 inc de - ld bc, $100 + lb bc, 1, 0 jr .patchPartyMonsLoop .finishedPatchingPlayerData ld a, SERIAL_PATCH_LIST_PART_TERMINATOR @@ -400,7 +400,7 @@ TradeCenter_SelectMon: ld a, 1 ld [wTopMenuItemX], a coord hl, 1, 1 - ld bc, $0601 + lb bc, 6, 1 call ClearScreenArea .playerMonMenu_HandleInput ld hl, hFlags_0xFFF6 @@ -713,7 +713,7 @@ TradeCenter_Trade: call TextCommandProcessor call SaveScreenTilesToBuffer1 coord hl, 10, 7 - ld bc, $080b + lb bc, 8, 11 ld a, TRADE_CANCEL_MENU ld [wTwoOptionMenuID], a ld a, TWO_OPTION_MENU diff --git a/engine/clear_save.asm b/engine/clear_save.asm index 2febb123..d4f05071 100755 --- a/engine/clear_save.asm +++ b/engine/clear_save.asm @@ -6,7 +6,7 @@ DoClearSaveDialogue: ; 1c98a (7:498a) ld hl, ClearSaveDataText call PrintText coord hl, 14, 7 - ld bc, $80f + lb bc, 8, 15 ld a, NO_YES_MENU ld [wTwoOptionMenuID], a ld a, TWO_OPTION_MENU diff --git a/engine/evolution.asm b/engine/evolution.asm index a39f5a97..720e77cd 100755 --- a/engine/evolution.asm +++ b/engine/evolution.asm @@ -48,7 +48,7 @@ EvolveMon: ; 7bde9 (1e:7de9) call DelayFrames ld c, $1 call EvolutionSetWholeScreenPalette - ld bc, $110 + lb bc, $1, $10 .animLoop push bc call Evolution_CheckForCancel diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm index 137b75e0..16e893e5 100755 --- a/engine/evos_moves.asm +++ b/engine/evos_moves.asm @@ -278,7 +278,7 @@ RenameEvolvedMon: ; 3aef7 (e:6ef7) cp $50 jr nz, .compareNamesLoop ld a, [wWhichPokemon] - ld bc, $b + ld bc, 11 ld hl, wPartyMonNicks call AddNTimes push hl diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm index 49c938f7..73e4f074 100755 --- a/engine/gamefreak.asm +++ b/engine/gamefreak.asm @@ -5,15 +5,15 @@ LoadShootingStarGraphics: ; 70000 (1c:4000) ld [rOBP1], a ld de, AnimationTileset2 + $30 ; star tile (top left quadrant) ld hl, vChars1 + $200 - ld bc, (BANK(AnimationTileset2) << 8) + $01 + lb bc, BANK(AnimationTileset2), $01 call CopyVideoData ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant) ld hl, vChars1 + $210 - ld bc, (BANK(AnimationTileset2) << 8) + $01 + lb bc, BANK(AnimationTileset2), $01 call CopyVideoData ld de, FallingStar ld hl, vChars1 + $220 - ld bc, (BANK(FallingStar) << 8) + $01 + lb bc, BANK(FallingStar), $01 call CopyVideoData ld hl, GameFreakLogoOAMData ld de, wOAMBuffer + $60 @@ -31,7 +31,7 @@ AnimateShootingStar: ; 70044 (1c:4044) ; Move the big star down and left across the screen. ld hl, wOAMBuffer - ld bc, $a004 + lb bc, $a0, $4 .bigStarLoop push hl push bc diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm index 28f03bf5..ce1430e3 100755 --- a/engine/hall_of_fame.asm +++ b/engine/hall_of_fame.asm @@ -8,7 +8,7 @@ AnimateHallOfFame: ; 701a0 (1c:41a0) call DisableLCD ld hl,vBGMap0 ld bc, $800 - ld a, $7f + ld a, " " call FillMemory call EnableLCD ld hl, rLCDC @@ -187,7 +187,7 @@ HoFLoadPlayerPics: ; 7033e (1c:433e) ld a, BANK(RedPicFront) call UncompressSpriteFromDE ld hl, S_SPRITEBUFFER1 - ld de, $a000 + ld de, S_SPRITEBUFFER0 ld bc, $310 call CopyData ld de, vFrontPic diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index aad8c468..a2167b54 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -194,7 +194,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld hl, wd730 set 6, [hl] coord hl, 0, 0 - ld bc, $060a + lb bc, 6, 10 call TextBoxBorder coord hl, 1, 2 ld de, StatusAilmentText1 diff --git a/engine/hp_bar.asm b/engine/hp_bar.asm index 112e65a3..792661ab 100755 --- a/engine/hp_bar.asm +++ b/engine/hp_bar.asm @@ -222,7 +222,7 @@ UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5) .next add hl, de push hl - ld a, $7f + ld a, " " ld [hli], a ld [hli], a ld [hli], a diff --git a/engine/in_game_trades.asm b/engine/in_game_trades.asm index 96c37ab0..b4a73e59 100755 --- a/engine/in_game_trades.asm +++ b/engine/in_game_trades.asm @@ -17,7 +17,7 @@ DoInGameTradeDialogue: ; 71ad9 (1c:5ad9) ld a,[hli] push af ld de,wInGameTradeMonNick - ld bc,$000b + ld bc, 11 call CopyData pop af ld l,a @@ -81,7 +81,7 @@ InGameTrade_GetMonName: ; 71b6a (1c:5b6a) call GetMonName ld hl,wcd6d pop de - ld bc,$b + ld bc, 11 jp CopyData INCLUDE "data/trades.asm" @@ -105,7 +105,7 @@ InGameTrade_DoTrade: ; 71c07 (1c:5c07) jr nz,.tradeFailed ; jump if the selected mon's species is not the required one ld a,[wWhichPokemon] ld hl,wPartyMon1Level - ld bc,$002c + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ld a,[hl] ld [W_CURENEMYLVL],a @@ -168,11 +168,11 @@ InGameTrade_PrepareTradeData: ; 71cc1 (1c:5cc1) ld a, [wInGameTradeReceiveMonSpecies] ld [hl], a ; wTradedEnemyMonSpecies ld hl, wPartyMonOT - ld bc, $b + ld bc, 11 ld a, [wWhichPokemon] call AddNTimes ld de, wTradedPlayerMonOT - ld bc, $b + ld bc, 11 call InGameTrade_CopyData ld hl, InGameTrade_TrainerString ld de, wTradedEnemyMonOT @@ -201,16 +201,16 @@ InGameTrade_CopyData: ; 71d11 (1c:5d11) InGameTrade_CopyDataToReceivedMon: ; 71d19 (1c:5d19) ld hl, wPartyMonNicks - ld bc, $b + ld bc, 11 call InGameTrade_GetReceivedMonPointer ld hl, wInGameTradeMonNick - ld bc, $b + ld bc, 11 call CopyData ld hl, wPartyMonOT - ld bc, $b + ld bc, 11 call InGameTrade_GetReceivedMonPointer ld hl, InGameTrade_TrainerString - ld bc, $b + ld bc, 11 call CopyData ld hl, wPartyMon1OTID ld bc, wPartyMon2 - wPartyMon1 diff --git a/engine/intro.asm b/engine/intro.asm index c7c4a04d..154c41fd 100755 --- a/engine/intro.asm +++ b/engine/intro.asm @@ -28,7 +28,7 @@ PlayIntroScene: ; 4169d (10:569d) ld [W_BASECOORDX], a ld a, 80 ld [W_BASECOORDY], a - ld bc, $606 + lb bc, 6, 6 call InitIntroNidorinoOAM ld de, $28ff ; move Nidorino right by 80 pixels call IntroMoveMon diff --git a/engine/items/items.asm b/engine/items/items.asm index 2cbe6a02..364570da 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -734,22 +734,22 @@ ItemUseMedicine: ; dabb (3:5abb) ld bc,4 add hl,bc ; hl now points to status ld a,[wcf91] - ld bc, (ANTIDOTE_MSG << 8) | (1 << PSN) + lb bc, ANTIDOTE_MSG, 1 << PSN cp a,ANTIDOTE jr z,.checkMonStatus - ld bc, (BURN_HEAL_MSG << 8) | (1 << BRN) + lb bc, BURN_HEAL_MSG, 1 << BRN cp a,BURN_HEAL jr z,.checkMonStatus - ld bc, (ICE_HEAL_MSG << 8) | (1 << FRZ) + lb bc, ICE_HEAL_MSG, 1 << FRZ cp a,ICE_HEAL jr z,.checkMonStatus - ld bc, (AWAKENING_MSG << 8) | SLP + lb bc, AWAKENING_MSG, SLP cp a,AWAKENING jr z,.checkMonStatus - ld bc, (PARALYZ_HEAL_MSG << 8) | (1 << PAR) + lb bc, PARALYZ_HEAL_MSG, 1 << PAR cp a,PARLYZ_HEAL jr z,.checkMonStatus - ld bc, (FULL_HEAL_MSG << 8) | $ff ; Full Heal + lb bc, FULL_HEAL_MSG, $ff ; Full Heal .checkMonStatus ld a,[hl] ; pokemon's status and c ; does the pokemon have a status ailment the item can cure? @@ -1737,7 +1737,7 @@ CoinCaseNumCoinsText: ; e247 (3:6247) ItemUseOldRod: ; e24c (3:624c) call FishingInit jp c, ItemUseNotTime - ld bc, (5 << 8) | MAGIKARP + lb bc, 5, MAGIKARP ld a, $1 ; set bite jr RodResponse @@ -2088,7 +2088,7 @@ ItemUseTMHM: ; e479 (3:6479) ld hl,TeachMachineMoveText call PrintText coord hl, 14, 7 - ld bc,$080f + lb bc, 8, 15 ld a,TWO_OPTION_MENU ld [wTextBoxID],a call DisplayTextBoxID ; yes/no menu @@ -2479,7 +2479,7 @@ TossItem_: ; e6f1 (3:66f1) ld hl,IsItOKToTossItemText call PrintText coord hl, 14, 7 - ld bc,$080f + lb bc, 8, 15 ld a,TWO_OPTION_MENU ld [wTextBoxID],a call DisplayTextBoxID ; yes/no menu @@ -2578,14 +2578,14 @@ SendNewMonToBox: ; e7a4 (3:67a4) jr nz, .asm_e7b1 call GetMonHeader ld hl, wBoxMonOT - ld bc, $b + ld bc, 11 ld a, [W_NUMINBOX] dec a jr z, .asm_e7ee dec a call AddNTimes push hl - ld bc, $b + ld bc, 11 add hl, bc ld d, h ld e, l @@ -2596,7 +2596,7 @@ SendNewMonToBox: ; e7a4 (3:67a4) .asm_e7db push bc push hl - ld bc, $b + ld bc, 11 call CopyData pop hl ld d, h @@ -2609,17 +2609,17 @@ SendNewMonToBox: ; e7a4 (3:67a4) .asm_e7ee ld hl, wPlayerName ld de, wBoxMonOT - ld bc, $b + ld bc, 11 call CopyData ld a, [W_NUMINBOX] dec a jr z, .asm_e82a ld hl, wBoxMonNicks - ld bc, $b + ld bc, 11 dec a call AddNTimes push hl - ld bc, $b + ld bc, 11 add hl, bc ld d, h ld e, l @@ -2630,7 +2630,7 @@ SendNewMonToBox: ; e7a4 (3:67a4) .asm_e817 push bc push hl - ld bc, $b + ld bc, 11 call CopyData pop hl ld d, h diff --git a/engine/learn_move.asm b/engine/learn_move.asm index 66d27a40..88dedd3d 100755 --- a/engine/learn_move.asm +++ b/engine/learn_move.asm @@ -5,7 +5,7 @@ LearnMove: ; 6e43 (1:6e43) call GetPartyMonName ld hl, wcd6d ld de, wd036 - ld bc, $b + ld bc, 11 call CopyData DontAbandonLearning: ; 6e5b (1:6e5b) @@ -77,7 +77,7 @@ AbandonLearning: ; 6eda (1:6eda) ld hl, AbandonLearningText call PrintText coord hl, 14, 7 - ld bc, $80f + lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID ; yes/no menu @@ -100,7 +100,7 @@ TryingToLearn: ; 6f07 (1:6f07) ld hl, TryingToLearnText call PrintText coord hl, 14, 7 - ld bc, $80f + lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID ; yes/no menu diff --git a/engine/load_pokedex_tiles.asm b/engine/load_pokedex_tiles.asm index 5c1f1c93..f4e45247 100755 --- a/engine/load_pokedex_tiles.asm +++ b/engine/load_pokedex_tiles.asm @@ -3,9 +3,9 @@ LoadPokedexTilePatterns: ; 17840 (5:7840) call LoadHpBarAndStatusTilePatterns ld de,PokedexTileGraphics ld hl,vChars2 + $600 - ld bc,(BANK(PokedexTileGraphics) << 8) + $12 + lb bc, BANK(PokedexTileGraphics), $12 call CopyVideoData ld de,PokeballTileGraphics ld hl,vChars2 + $720 - ld bc,(BANK(PokeballTileGraphics) << 8) + $01 + lb bc, BANK(PokeballTileGraphics), $01 jp CopyVideoData ; load pokeball tile for marking caught mons diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index a810afd2..072a19d3 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -116,7 +116,7 @@ BillsPCMenu: ; 214e8 (8:54e8) ld [wCurrentMenuItem], a ld hl, vChars2 + $780 ld de, PokeballTileGraphics - ld bc, (BANK(PokeballTileGraphics) << 8) + $01 + lb bc, BANK(PokeballTileGraphics), $01 call CopyVideoData call LoadScreenTilesFromBuffer2DisableBGTransfer coord hl, 0, 0 diff --git a/engine/menu/diploma.asm b/engine/menu/diploma.asm index 56373dd3..3e28bc93 100755 --- a/engine/menu/diploma.asm +++ b/engine/menu/diploma.asm @@ -13,7 +13,7 @@ DisplayDiploma: ; 566e2 (15:66e2) ld a, BANK(CircleTile) call FarCopyData2 coord hl, 0, 0 - ld bc, $1012 + lb bc, 16, 18 predef Diploma_TextBoxBorder ld hl, DiplomaTextPointersAndCoords ld c, $5 @@ -41,7 +41,7 @@ DisplayDiploma: ; 566e2 (15:66e2) ; Move the player 33 pixels right and set the priority bit so he appears ; behind the background layer. ld hl, wOAMBuffer + $01 - ld bc, $8028 + lb bc, $80, $28 .adjustPlayerGfxLoop ld a, [hl] ; X add 33 diff --git a/engine/menu/league_pc.asm b/engine/menu/league_pc.asm index b4c7f774..21c3f9e7 100755 --- a/engine/menu/league_pc.asm +++ b/engine/menu/league_pc.asm @@ -90,7 +90,7 @@ LeaguePCShowMon: ; 76610 (1d:6610) ld a, [hli] ld [wHoFMonLevel], a ld de, wcd6d - ld bc, $000B + ld bc, 11 call CopyData ld b, $0B ld c, 0 diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm index 20745c58..967f11e8 100755 --- a/engine/menu/naming_screen.asm +++ b/engine/menu/naming_screen.asm @@ -5,8 +5,8 @@ AskName: ; 64eb (1:64eb) ld a, [W_ISINBATTLE] dec a coord hl, 0, 0 - ld b, $4 - ld c, $b + ld b, 4 + ld c, 11 call z, ClearScreenArea ; only if in wild batle ld a, [wcf91] ld [wd11e], a @@ -14,7 +14,7 @@ AskName: ; 64eb (1:64eb) ld hl, DoYouWantToNicknameText call PrintText coord hl, 14, 7 - ld bc, $80f + lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID @@ -64,10 +64,10 @@ DisplayNameRaterScreen: ; 655c (1:655c) call RestoreScreenTilesAndReloadTilePatterns call LoadGBPal ld a, [wcf4b] - cp $50 + cp "@" jr z, .playerCancelled ld hl, wPartyMonNicks - ld bc, $b + ld bc, 11 ld a, [wWhichPokemon] call AddNTimes ld e, l @@ -269,7 +269,7 @@ DisplayNamingScreen: ; 6596 (1:6596) ret z call CalcStringLength dec hl - ld [hl], $50 + ld [hl], "@" ret .pressedRight ld a, [wCurrentMenuItem] @@ -342,7 +342,7 @@ PrintAlphabet: ; 676f (1:676f) ld de, UpperCaseAlphabet .lowercase coord hl, 2, 5 - ld bc, $509 ; 5 rows, 9 columns + lb bc, 5, 9 ; 5 rows, 9 columns .outerLoop push bc .innerLoop @@ -373,7 +373,7 @@ PrintNicknameAndUnderscores: ; 680e (1:680e) ld a, c ld [wNamingScreenNameLength], a coord hl, 10, 2 - ld bc, $10a + lb bc, 1, 10 call ClearScreenArea coord hl, 10, 2 ld de, wcf4b @@ -458,7 +458,7 @@ CalcStringLength: ; 68eb (1:68eb) ld c, $0 .loop ld a, [hl] - cp $50 + cp "@" ret z inc hl inc c diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index 4b350379..ead2c359 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -120,7 +120,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d) push bc coord hl, 0, 3 ld de,20 - ld bc,$7f0d ; 13 blank tiles + lb bc, " ", 13 call DrawTileLine ; cover up the menu cursor in the pokemon list pop bc ret @@ -128,7 +128,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d) push bc coord hl, 15, 10 ld de,20 - ld bc,$7f07 ; 7 blank tiles + lb bc, " ", 7 call DrawTileLine ; cover up the menu cursor in the side menu pop bc jr .exitSideMenu @@ -212,7 +212,7 @@ HandlePokedexListMenu: ; 40111 (10:4111) xor a ld [H_AUTOBGTRANSFERENABLED],a coord hl, 4, 2 - ld bc,$0e0a + lb bc, 14, 10 call ClearScreenArea coord hl, 1, 3 ld a,[wListScrollOffset] @@ -413,14 +413,14 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) ld [hTilesetType],a coord hl, 0, 0 ld de,1 - ld bc,$6414 + lb bc, $64, SCREEN_WIDTH call DrawTileLine ; draw top border coord hl, 0, 17 - ld b,$6f + ld b, $6f call DrawTileLine ; draw bottom border coord hl, 0, 1 ld de,20 - ld bc,$6610 + lb bc, $66, $10 call DrawTileLine ; draw left border coord hl, 19, 1 ld b,$67 diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index 683930d1..f061fbf6 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -34,7 +34,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) ld [wTextBoxID],a call DisplayTextBoxID ; display pokemon menu options ld hl,wFieldMoves - ld bc,$020c ; max menu item ID, top menu item Y + lb bc, $02, $0c ; max menu item ID, top menu item Y ld e,5 .adjustMenuVariablesLoop dec e @@ -523,7 +523,7 @@ StartMenu_TrainerInfo: ; 13460 (4:7460) ; loads tile patterns and draws everything except for gym leader faces / badges DrawTrainerInfo: ; 1349a (4:749a) ld de,RedPicFront - ld bc,(BANK(RedPicFront) << 8) | $01 + lb bc, BANK(RedPicFront), $01 predef DisplayPicCenteredOrUpperRight call DisableLCD coord hl, 0, 2 @@ -632,7 +632,7 @@ TrainerInfo_BadgesText: ; 13597 (4:7597) ; [wTrainerInfoTextBoxNextRowOffset] = distance from the end of a text box row to the start of the next TrainerInfo_DrawTextBox: ; 135a0 (4:75a0) ld a,$79 ; upper left corner tile ID - ld de,$7a7b ; top edge and upper right corner tile ID's + lb de, $7a, $7b ; top edge and upper right corner tile ID's call TrainerInfo_DrawHorizontalEdge ; draw top edge call TrainerInfo_NextTextBoxRow ld a,[wTrainerInfoTextBoxWidthPlus1] @@ -647,7 +647,7 @@ TrainerInfo_DrawTextBox: ; 135a0 (4:75a0) dec c jr nz,.loop ld a,$7d ; lower left corner tile ID - ld de,$777e ; bottom edge and lower right corner tile ID's + lb de,$77, $7e ; bottom edge and lower right corner tile ID's TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3) ld [hli],a ; place left corner tile @@ -813,36 +813,36 @@ SwitchPartyMon_InitVarOrSwapData: ; 13653 (4:7653) call SkipFixedLengthTextEntries push hl ld de, wSwitchPartyMonTempBuffer - ld bc, $b + ld bc, 11 call CopyData ld hl, wPartyMonOT ld a, [wMenuItemToSwap] call SkipFixedLengthTextEntries pop de push hl - ld bc, $b + ld bc, 11 call CopyData pop de ld hl, wSwitchPartyMonTempBuffer - ld bc, $b + ld bc, 11 call CopyData ld hl, wPartyMonNicks ld a, [wCurrentMenuItem] call SkipFixedLengthTextEntries push hl ld de, wSwitchPartyMonTempBuffer - ld bc, $b + ld bc, 11 call CopyData ld hl, wPartyMonNicks ld a, [wMenuItemToSwap] call SkipFixedLengthTextEntries pop de push hl - ld bc, $b + ld bc, 11 call CopyData pop de ld hl, wSwitchPartyMonTempBuffer - ld bc, $b + ld bc, 11 call CopyData ld a, [wMenuItemToSwap] ld [wSwappedMenuItem], a diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm index c6550217..d8a504bb 100755 --- a/engine/menu/status_screen.asm +++ b/engine/menu/status_screen.asm @@ -87,34 +87,34 @@ StatusScreen: ; 12953 (4:6953) call LoadHpBarAndStatusTilePatterns ld de, BattleHudTiles1 ; source ld hl, vChars2 + $6d0 ; dest - ld bc, (BANK(BattleHudTiles1) << 8) + $03 ; bank bytes/8 + lb bc, BANK(BattleHudTiles1), $03 call CopyVideoDataDouble ; ·│ :L and halfarrow line end ld de, BattleHudTiles2 ld hl, vChars2 + $780 - ld bc, (BANK(BattleHudTiles2) << 8) + $01 + lb bc, BANK(BattleHudTiles2), $01 call CopyVideoDataDouble ; │ ld de, BattleHudTiles3 ld hl, vChars2 + $760 - ld bc, (BANK(BattleHudTiles3) << 8) + $02 + lb bc, BANK(BattleHudTiles3), $02 call CopyVideoDataDouble ; ─┘ ld de, PTile ld hl, vChars2 + $720 - ld bc,(BANK(PTile) << 8 | $01) + lb bc, BANK(PTile), $01 call CopyVideoDataDouble ; P (for PP), inline ld a, [hTilesetType] push af xor a ld [hTilesetType], a coord hl, 19, 1 - ld bc, $060a + lb bc, 6, 10 call DrawLineBox ; Draws the box around name, HP and status - ld de, $fffa + ld de, -6 add hl, de ld [hl], $f2 ; . after No ("." is a different one) dec hl ld [hl], "№" coord hl, 19, 9 - ld bc, $0806 + lb bc, 8, 6 call DrawLineBox ; Draws the box around types, ID No. and OT coord hl, 10, 9 ld de, Type1Text @@ -224,7 +224,7 @@ OKText: ; 12ac4 (4:6ac4) ; Draws a line starting from hl high b and wide c DrawLineBox: ; 0x12ac7 - ld de, $0014 ; New line + ld de, SCREEN_WIDTH ; New line .PrintVerticalLine ld [hl], $78 ; │ add hl, de diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm index 5b6c29e1..98499d7f 100755 --- a/engine/oak_speech.asm +++ b/engine/oak_speech.asm @@ -24,11 +24,11 @@ SetDefaultNames: ; 60ca (1:60ca) call z, InitOptions ld hl, NintenText ld de, wPlayerName - ld bc, $b + ld bc, 11 call CopyData ld hl, SonyText ld de, W_RIVALNAME - ld bc, $b + ld bc, 11 jp CopyData OakSpeech: ; 6115 (1:6115) @@ -57,7 +57,7 @@ OakSpeech: ; 6115 (1:6115) bit 1,a ; possibly a debug mode bit jp nz,.skipChoosingNames ld de,ProfOakPic - ld bc, (Bank(ProfOakPic) << 8) | $00 + lb bc, Bank(ProfOakPic), $00 call IntroDisplayPicCenteredOrUpperRight call FadeInIntroPic ld hl,OakSpeechText1 @@ -76,7 +76,7 @@ OakSpeech: ; 6115 (1:6115) call GBFadeOutToWhite call ClearScreen ld de,RedPicFront - ld bc,(Bank(RedPicFront) << 8) | $00 + lb bc, Bank(RedPicFront), $00 call IntroDisplayPicCenteredOrUpperRight call MovePicLeft ld hl,IntroducePlayerText @@ -85,7 +85,7 @@ OakSpeech: ; 6115 (1:6115) call GBFadeOutToWhite call ClearScreen ld de,Rival1Pic - ld bc,(Bank(Rival1Pic) << 8) | $00 + lb bc, Bank(Rival1Pic), $00 call IntroDisplayPicCenteredOrUpperRight call FadeInIntroPic ld hl,IntroduceRivalText @@ -95,7 +95,7 @@ OakSpeech: ; 6115 (1:6115) call GBFadeOutToWhite call ClearScreen ld de,RedPicFront - ld bc,(Bank(RedPicFront) << 8) | $00 + lb bc, Bank(RedPicFront), $00 call IntroDisplayPicCenteredOrUpperRight call GBFadeInFromWhite ld a,[wd72d] @@ -115,15 +115,15 @@ OakSpeech: ; 6115 (1:6115) call DelayFrames ld de,RedSprite ld hl,vSprites - ld bc,(BANK(RedSprite) << 8) | $0C + lb bc, BANK(RedSprite), $0C call CopyVideoData ld de,ShrinkPic1 - ld bc,(BANK(ShrinkPic1) << 8) | $00 + lb bc, BANK(ShrinkPic1), $00 call IntroDisplayPicCenteredOrUpperRight ld c,4 call DelayFrames ld de,ShrinkPic2 - ld bc,(BANK(ShrinkPic2) << 8) | $00 + lb bc, BANK(ShrinkPic2), $00 call IntroDisplayPicCenteredOrUpperRight call ResetPlayerSpriteData ld a,[H_LOADEDROMBANK] diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm index bdc4d38f..50e3708c 100755 --- a/engine/oak_speech2.asm +++ b/engine/oak_speech2.asm @@ -73,7 +73,7 @@ OakSpeechSlidePicLeft: ; 69ec (1:69ec) call DelayFrames pop de ld hl, wcd6d - ld bc, $b + ld bc, 11 call CopyData call Delay3 coord hl, 12, 4 diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 2056bbb0..30aedbc1 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -82,11 +82,11 @@ InitCutAnimOAM: ; eff7 (3:6ff7) ; tree ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row ld hl, vChars1 + $7c0 - ld bc, (BANK(Overworld_GFX) << 8) + $02 + lb bc, BANK(Overworld_GFX), $02 call CopyVideoData ld de, Overworld_GFX + $3d0 ; cuttable tree sprite bottom row ld hl, vChars1 + $7e0 - ld bc, (BANK(Overworld_GFX) << 8) + $02 + lb bc, BANK(Overworld_GFX), $02 call CopyVideoData jr WriteCutOrBoulderDustAnimationOAMBlock .grass @@ -113,7 +113,7 @@ InitCutAnimOAM: ; eff7 (3:6ff7) LoadCutGrassAnimationTilePattern: ; f04c (3:704c) ld de, AnimationTileset2 + $60 ; tile depicting a leaf - ld bc, (BANK(AnimationTileset2) << 8) + $01 + lb bc, BANK(AnimationTileset2), $01 jp CopyVideoData WriteCutOrBoulderDustAnimationOAMBlock: ; f055 (3:7055) diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 22dfb24f..ebd441aa 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -9,7 +9,7 @@ EmotionBubble: ; 17c47 (5:7c47) inc hl ld d, [hl] ld hl, vChars1 + $780 - ld bc, (BANK(EmotionBubblesPointerTable) << 8) + $04 + lb bc, BANK(EmotionBubblesPointerTable), $04 call CopyVideoData ld a, [wUpdateSpritesEnabled] push af diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index b123f33f..d3513b0d 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -1,7 +1,7 @@ AnimateHealingMachine: ; 70433 (1c:4433) ld de, PokeCenterFlashingMonitorAndHealBall ld hl, vChars0 + $7c0 - ld bc, (BANK(PokeCenterFlashingMonitorAndHealBall) << 8) + $03 + lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 call CopyVideoData ld hl, wUpdateSpritesEnabled ld a, [hl] diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index 51819802..5a3bfbe0 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -69,10 +69,10 @@ LedgeTiles: ; 1a6cf (6:66cf) LoadHoppingShadowOAM: ; 1a6f0 (6:66f0) ld hl, vChars1 + $7f0 ld de, LedgeHoppingShadow - ld bc, (BANK(LedgeHoppingShadow) << 8) + $01 + lb bc, BANK(LedgeHoppingShadow), $01 call CopyVideoDataDouble ld a, $9 - ld bc, $5448 ; b, c = y, x coordinates of shadow + lb bc, $54, $48 ; b, c = y, x coordinates of shadow ld de, LedgeHoppingShadowOAM call WriteOAMBlock ret diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index 1a3d374f..74762b00 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -47,7 +47,7 @@ EnterMapAnim: ; 70510 (1c:4510) pop hl ld de, BirdSprite ld hl, vNPCSprites - ld bc, (BANK(BirdSprite) << 8) + $0c + lb bc, BANK(BirdSprite), $0c call CopyVideoData call LoadBirdSpriteGraphics ld a, SFX_FLY @@ -250,11 +250,11 @@ DoFlyAnimation: ; 706ae (1c:46ae) LoadBirdSpriteGraphics: ; 706d7 (1c:46d7) ld de, BirdSprite ld hl, vNPCSprites - ld bc, (BANK(BirdSprite) << 8) + $0c + lb bc, BANK(BirdSprite), $0c call CopyVideoData ld de, BirdSprite + $c0 ; moving animation sprite ld hl, vNPCSprites2 - ld bc, (BANK(BirdSprite) << 8) + $0c + lb bc, BANK(BirdSprite), $0c jp CopyVideoData InitFacingDirectionList: ; 706ef (1c:46ef) @@ -388,7 +388,7 @@ FishingAnim: ; 707b6 (1c:47b6) set 6, [hl] ; reserve the last 4 OAM entries ld de, RedSprite ld hl, vNPCSprites - ld bc, (BANK(RedSprite) << 8) + $0c + lb bc, BANK(RedSprite), $0c call CopyVideoData ld a, $4 ld hl, RedFishingTiles diff --git a/engine/overworld/pokemart.asm b/engine/overworld/pokemart.asm index d59b2dc7..ae96c4a9 100755 --- a/engine/overworld/pokemart.asm +++ b/engine/overworld/pokemart.asm @@ -82,10 +82,10 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) inc a jr z,.sellMenuLoop ; if the player closed the choose quantity menu with the B button ld hl,PokemartTellSellPriceText - ld bc,$0e01 + lb bc, 14, 1 ; location that PrintText always prints to, this is useless call PrintText coord hl, 14, 7 - ld bc,$080f + lb bc, 08, 15 ld a,TWO_OPTION_MENU ld [wTextBoxID],a call DisplayTextBoxID ; yes/no menu @@ -163,7 +163,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) ld hl,PokemartTellBuyPriceText call PrintText coord hl, 14, 7 - ld bc,$080f + lb bc, 8, 15 ld a,TWO_OPTION_MENU ld [wTextBoxID],a call DisplayTextBoxID ; yes/no menu diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm index 8c5485e2..1dccd026 100755 --- a/engine/overworld/ssanne.asm +++ b/engine/overworld/ssanne.asm @@ -85,7 +85,7 @@ LoadSmokeTileFourTimes: ; 79fc0 (1e:5fc0) LoadSmokeTile: ; 79fd4 (1e:5fd4) ld de, SSAnneSmokePuffTile - ld bc, (BANK(SSAnneSmokePuffTile) << 8) + $01 + lb bc, BANK(SSAnneSmokePuffTile), $01 jp CopyVideoData SSAnneSmokePuffTile: ; 79fdd (1e:5fdd) diff --git a/engine/save.asm b/engine/save.asm index 70295044..dfc50616 100755 --- a/engine/save.asm +++ b/engine/save.asm @@ -155,8 +155,8 @@ SaveSAV: ; 7370a (1c:770a) .save call SaveSAVtoSRAM coord hl, 1, 13 - ld bc,$0412 - call ClearScreenArea ; clear area 4x12 starting at 13,1 + lb bc, 4, 18 + call ClearScreenArea coord hl, 1, 14 ld de,NowSavingString call PlaceString @@ -176,7 +176,7 @@ NowSavingString: SaveSAVConfirm: ; 73768 (1c:7768) call PrintText coord hl, 0, 7 - ld bc,$0801 + lb bc, 8, 1 ld a,TWO_OPTION_MENU ld [wTextBoxID],a call DisplayTextBoxID ; yes/no menu diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index 3345a9dc..3b392dde 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -134,7 +134,7 @@ MainSlotMachineLoop: ; 37395 (d:7395) ld hl, OneMoreGoSlotMachineText call PrintText coord hl, 14, 12 - ld bc, $0d0f + lb bc, 13, 15 xor a ; YES_NO_MENU ld [wTwoOptionMenuID], a ld a, TWO_OPTION_MENU diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm index 84c0cdf7..df47275b 100755 --- a/engine/titlescreen.asm +++ b/engine/titlescreen.asm @@ -1,6 +1,6 @@ ; copy text of fixed length $b (like player name, rival name, mon names, ...) CopyFixedLengthText: ; 42b1 (1:42b1) - ld bc, $b + ld bc, 11 jp CopyData SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7) @@ -377,7 +377,7 @@ LoadCopyrightAndTextBoxTiles: ; 4538 (1:4538) LoadCopyrightTiles: ; 4541 (1:4541) ld de, NintendoCopyrightLogoGraphics ld hl, vChars2 + $600 - ld bc, (BANK(NintendoCopyrightLogoGraphics) << 8) + $1c + lb bc, BANK(NintendoCopyrightLogoGraphics), $1c call CopyVideoData coord hl, 2, 7 ld de, CopyrightTextString diff --git a/engine/town_map.asm b/engine/town_map.asm index f5a047c3..037a59fa 100755 --- a/engine/town_map.asm +++ b/engine/town_map.asm @@ -20,7 +20,7 @@ DisplayTownMap: ; 70e3e (1c:4e3e) call CopyData ld hl, vSprites + $40 ld de, TownMapCursor - ld bc, (BANK(TownMapCursor) << 8) + $04 + lb bc, BANK(TownMapCursor), $04 call CopyVideoDataDouble xor a ld [wWhichTownMapLocation], a @@ -29,7 +29,7 @@ DisplayTownMap: ; 70e3e (1c:4e3e) .townMapLoop coord hl, 0, 0 - ld bc, $114 + lb bc, 1, 20 call ClearScreenArea ld hl, TownMapOrder ld a, [wWhichTownMapLocation] @@ -140,11 +140,11 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90) call LoadFontTilePatterns ld de, BirdSprite ld hl, vSprites + $40 - ld bc, (BANK(BirdSprite) << 8) + $0c + lb bc, BANK(BirdSprite), $0c call CopyVideoData ld de, TownMapUpArrow ld hl, vChars1 + $6d0 - ld bc, (BANK(TownMapUpArrow) << 8) + $01 + lb bc, BANK(TownMapUpArrow), $01 call CopyVideoDataDouble call BuildFlyLocationsList ld hl, wUpdateSpritesEnabled @@ -161,12 +161,12 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90) ld hl, wFlyLocationsList coord de, 18, 0 .townMapFlyLoop - ld a, $7f + ld a, " " ld [de], a push hl push hl coord hl, 3, 0 - ld bc, $10f + lb bc, 1, 15 call ClearScreenArea pop hl ld a, [hl] @@ -442,8 +442,8 @@ WritePlayerOrBirdSpriteOAM: ; 7126d (1c:526d) WriteTownMapSpriteOAM: ; 71279 (1c:5279) push hl - ld hl, $fcfc - add hl, bc ; subtract 4 from c (X coord) and 3 from b (Y coord) + lb hl, -4, -4 + add hl, bc ; subtract 4 from c (X coord) and 4 from b (Y coord) ld b, h ld c, l pop hl @@ -451,7 +451,7 @@ WriteTownMapSpriteOAM: ; 71279 (1c:5279) WriteAsymmetricMonPartySpriteOAM: ; 71281 (1c:5281) ; Writes 4 OAM blocks for a helix mon party sprite, since it does not have ; a vertical line of symmetry. - ld de, $202 + lb de, 2, 2 .loop push de push bc diff --git a/engine/trade.asm b/engine/trade.asm index 74fd3434..1a0e5f61 100755 --- a/engine/trade.asm +++ b/engine/trade.asm @@ -371,7 +371,7 @@ Trade_ShowEnemyMon: ; 41336 (10:5336) call PlayCry call Trade_Delay100 coord hl, 4, 10 - ld bc, $80c + lb bc, 8, 12 call ClearScreenArea jp PrintTradeTakeCareText @@ -647,14 +647,14 @@ Trade_AnimMonMoveVertical: ; 41525 (10:5525) and a jr z, .movingLeft ; moving right - ld bc, $400 ; move right + lb bc, 4, 0 ; move right call .doAnim - ld bc, $a ; move down + lb bc, 0, 10 ; move down jr .doAnim .movingLeft - ld bc, $f6 ; move up + lb bc, 0, -10 ; move up call .doAnim - ld bc, $fc00 ; move left + lb bc, -4, 0 ; move left .doAnim ld a, b ld [W_BASECOORDX], a diff --git a/home.asm b/home.asm index 449666df..2753307b 100644 --- a/home.asm +++ b/home.asm @@ -1402,7 +1402,7 @@ DisplayListMenuID:: ; 2be6 (0:2be6) call UpdateSprites ; disable sprites behind the text box ; the code up to .skipMovingSprites appears to be useless coord hl, 4, 2 ; coordinates of upper left corner of menu text box - ld de,$090e ; height and width of menu text box + lb de, 9, 14 ; height and width of menu text box ld a,[wListMenuID] and a ; is it a PC pokemon list? jr nz,.skipMovingSprites @@ -1668,7 +1668,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57) coord hl, 9, 10 .printQuantity ld de,wItemQuantity ; current quantity - lb bc,LEADING_ZEROES | 1, 2 ; 1 byte, 2 digits + lb bc, LEADING_ZEROES | 1, 2 ; 1 byte, 2 digits call PrintNumber jp .waitForKeyPressLoop .buttonAPressed ; the player chose to make the transaction @@ -1705,8 +1705,8 @@ ExitListMenu:: ; 2e3b (0:2e3b) PrintListMenuEntries:: ; 2e5a (0:2e5a) coord hl, 5, 3 - ld b,$09 - ld c,$0e + ld b,9 + ld c,14 call ClearScreenArea ld a,[wListPointer] ld e,a @@ -1786,7 +1786,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) ld [wcf91],a call GetItemPrice ; get price pop hl - ld bc,20 + 5 ; 1 row down and 5 columns right + ld bc, SCREEN_WIDTH + 5 ; 1 row down and 5 columns right add hl,bc ld c,$a3 ; no leading zeroes, right-aligned, print currency symbol, 3 bytes call PrintBCDNumber @@ -1815,7 +1815,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) ld a,[wListScrollOffset] add b ld [hl],a - call LoadMonData ; load pokemon info + call LoadMonData ld a,[wMonDataLocation] and a ; is it a list of party pokemon or box pokemon? jr z,.skipCopyingLevel @@ -1826,7 +1826,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) pop hl ld bc,$001c add hl,bc - call PrintLevel ; print level + call PrintLevel pop af ld [wd11e],a .skipPrintingPokemonLevel @@ -1844,7 +1844,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) and a ; is the item unsellable? jr nz,.skipPrintingItemQuantity ; if so, don't print the quantity push hl - ld bc,20 + 8 ; 1 row down and 8 columns right + ld bc, SCREEN_WIDTH + 8 ; 1 row down and 8 columns right add hl,bc ld a,"×" ld [hli],a @@ -1877,7 +1877,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) ld a,$ec ; unfilled right arrow menu cursor to indicate an item being swapped ld [hli],a .nextListEntry - ld bc,2 * 20 ; 2 rows + ld bc,2 * SCREEN_WIDTH ; 2 rows add hl,bc pop bc inc c @@ -1899,12 +1899,12 @@ GetMonName:: ; 2f9e (0:2f9e) push hl ld a,[H_LOADEDROMBANK] push af - ld a,BANK(MonsterNames) ; 07 + ld a,BANK(MonsterNames) ld [H_LOADEDROMBANK],a ld [MBC1RomBank],a ld a,[wd11e] dec a - ld hl,MonsterNames ; 421E + ld hl,MonsterNames ld c,10 ld b,0 call AddNTimes @@ -1972,7 +1972,7 @@ GetMachineName:: ; 2ff3 (0:2ff3) ; now get the machine number and convert it to text ld a,[wd11e] sub TM_01 - 1 - ld b,$F6 ; "0" + ld b, "0" .FirstDigit sub 10 jr c,.SecondDigit @@ -1985,7 +1985,7 @@ GetMachineName:: ; 2ff3 (0:2ff3) ld [de],a inc de pop af - ld b,$F6 ; "0" + ld b, "0" add b ld [de],a inc de @@ -2134,6 +2134,7 @@ IsKeyItem:: ; 30d9 (0:30d9) ; function to draw various text boxes ; INPUT: ; [wTextBoxID] = text box ID +; b, c = y, x cursor position (TWO_OPTION_MENU only) DisplayTextBoxID:: ; 30e8 (0:30e8) ld a,[H_LOADEDROMBANK] push af @@ -3002,7 +3003,7 @@ YesNoChoicePokeCenter:: ; 360a (0:360a) ld a, HEAL_CANCEL_MENU ld [wTwoOptionMenuID], a coord hl, 11, 6 - ld bc, $80c + lb bc, 8, 12 jr DisplayYesNoChoice Func_361a:: ; 361a (0:361a) @@ -3010,7 +3011,7 @@ Func_361a:: ; 361a (0:361a) ld a, WIDE_YES_NO_MENU ld [wTwoOptionMenuID], a coord hl, 12, 7 - ld bc, $080d + lb bc, 8, 13 DisplayYesNoChoice:: ; 3628 (0:3628) ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -3097,7 +3098,7 @@ LoadFontTilePatterns:: .on ld de, FontGraphics ld hl, vFont - ld bc, BANK(FontGraphics) << 8 | $80 + lb bc, BANK(FontGraphics), $80 jp CopyVideoDataDouble ; if LCD is on, transfer during V-blank LoadTextBoxTilePatterns:: @@ -3113,7 +3114,7 @@ LoadTextBoxTilePatterns:: .on ld de, TextBoxGraphics ld hl, vChars2 + $600 - ld bc, BANK(TextBoxGraphics) << 8 | $20 + lb bc, BANK(TextBoxGraphics), $20 jp CopyVideoData ; if LCD is on, transfer during V-blank LoadHpBarAndStatusTilePatterns:: @@ -3129,7 +3130,7 @@ LoadHpBarAndStatusTilePatterns:: .on ld de, HpBarAndStatusGraphics ld hl, vChars2 + $620 - ld bc, BANK(HpBarAndStatusGraphics) << 8 | $1e + lb bc, BANK(HpBarAndStatusGraphics), $1e jp CopyVideoData ; if LCD is on, transfer during V-blank @@ -3824,12 +3825,12 @@ MoveMon:: ; 3a68 (0:3a68) ld [MBC1RomBank], a ret -; skips a text entries, each of size $b (like trainer name, OT name, rival name, ...) +; skips a text entries, each of size 11 (like trainer name, OT name, rival name, ...) ; hl: base pointer, will be incremented by $b * a SkipFixedLengthTextEntries:: ; 3a7d (0:3a7d) and a ret z - ld bc, $b + ld bc, 11 .skipLoop add hl, bc dec a diff --git a/home/copy2.asm b/home/copy2.asm index 3f7a4400..830440b0 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -161,7 +161,7 @@ CopyVideoDataDouble:: ClearScreenArea:: ; Clear tilemap area cxb at hl. - ld a, $7f ; blank tile + ld a, " " ; blank tile ld de, 20 ; screen width .y push hl @@ -218,7 +218,7 @@ ClearScreen:: ld bc, 20 * 18 inc b coord hl, 0, 0 - ld a, $7f + ld a, " " .loop ld [hli], a dec c diff --git a/home/overworld.asm b/home/overworld.asm index 3675eca8..f8d6e7e1 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1995,7 +1995,7 @@ LoadBikePlayerSpriteGraphics:: ; 105d (0:105d) LoadPlayerSpriteGraphicsCommon:: ; 1063 (0:1063) push de push hl - ld bc,(BANK(RedSprite) << 8) + $0c + lb bc, BANK(RedSprite), $0c call CopyVideoData pop hl pop de @@ -2006,7 +2006,7 @@ LoadPlayerSpriteGraphicsCommon:: ; 1063 (0:1063) inc d .noCarry set 3,h - ld bc,$050c + lb bc, BANK(RedSprite), $0c jp CopyVideoData ; function to load data from the map header diff --git a/home/text.asm b/home/text.asm index 97ff2859..238af447 100644 --- a/home/text.asm +++ b/home/text.asm @@ -291,7 +291,7 @@ Char51:: ; 1ab4 (0:1ab4) call ProtectedDelay3 call ManualTextScroll coord hl, 1, 13 - ld bc,$0412 + lb bc, 4, 18 call ClearScreenArea ld c,20 call DelayFrames @@ -306,7 +306,7 @@ Char49:: ; 1ad5 (0:1ad5) call ProtectedDelay3 call ManualTextScroll coord hl, 1, 10 - ld bc,$0712 + lb bc, 7, 18 call ClearScreenArea ld c,20 call DelayFrames diff --git a/main.asm b/main.asm index 10317d4f..8def2f85 100755 --- a/main.asm +++ b/main.asm @@ -590,7 +590,7 @@ INCLUDE "engine/cable_club.asm" LoadTrainerInfoTextBoxTiles: ; 5ae6 (1:5ae6) ld de, TrainerInfoTextBoxTileGraphics ld hl, vChars2 + $760 - ld bc, (BANK(TrainerInfoTextBoxTileGraphics) << 8) +$09 + lb bc, BANK(TrainerInfoTextBoxTileGraphics), $09 jp CopyVideoData INCLUDE "engine/menu/main_menu.asm" @@ -1435,8 +1435,8 @@ DisplayMoneyBox: ; 74ba (1:74ba) ld [wTextBoxID], a call DisplayTextBoxID coord hl, 13, 1 - ld b, $1 - ld c, $6 + ld b, 1 + ld c, 6 call ClearScreenArea coord hl, 12, 1 ld de, wPlayerMoney @@ -1967,7 +1967,7 @@ _RemovePokemon: ; 7b68 (1:7b68) .asm_7ba6 ld d, h ld e, l - ld bc, $b + ld bc, 11 add hl, bc ld bc, wPartyMonNicks ld a, [wRemoveMonFromBox] @@ -2007,12 +2007,12 @@ _RemovePokemon: ; 7b68 (1:7b68) jr z, .asm_7bfa ld hl, wBoxMonNicks .asm_7bfa - ld bc, $b + ld bc, 11 ld a, [wWhichPokemon] call AddNTimes ld d, h ld e, l - ld bc, $b + ld bc, 11 add hl, bc ld bc, wPokedexOwned ld a, [wRemoveMonFromBox] @@ -3587,7 +3587,7 @@ _AddPartyMon: ; f2e5 (3:72e5) ld d, h ld e, l ld hl, wPlayerName - ld bc, $b + ld bc, 11 call CopyData ld a, [wMonDataLocation] and a @@ -3858,7 +3858,7 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d) ld hl, wEnemyMonOT ld a, [wWhichPokemon] call SkipFixedLengthTextEntries - ld bc, $000b + ld bc, 11 call CopyData ; write new mon's OT name (from an enemy mon) ld hl, wPartyMonNicks ld a, [wPartyCount] @@ -3869,7 +3869,7 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d) ld hl, wEnemyMonNicks ld a, [wWhichPokemon] call SkipFixedLengthTextEntries - ld bc, $000b + ld bc, 11 call CopyData ; write new mon's nickname (from an enemy mon) ld a, [wcf91] ld [wd11e], a @@ -4000,7 +4000,7 @@ _MoveMon: ; f51e (3:751e) ld a, [wWhichPokemon] call SkipFixedLengthTextEntries .asm_f5ec - ld bc, $b + ld bc, 11 call CopyData ld a, [wMoveMonType] cp PARTY_TO_DAYCARE @@ -4030,7 +4030,7 @@ _MoveMon: ; f51e (3:751e) ld a, [wWhichPokemon] call SkipFixedLengthTextEntries .asm_f62a - ld bc, $b + ld bc, 11 call CopyData pop hl ld a, [wMoveMonType] diff --git a/scripts/agatha.asm b/scripts/agatha.asm index 60ddf606..1e34c99c 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -22,7 +22,7 @@ AgathaScript_76443: ; 76443 (1d:6443) AgathaScript_76459: ; 76459 (1d:6459) ld [wNewTileBlockID], a - ld bc, $2 + lb bc, 0, 2 predef_jump ReplaceTileBlock AgathaScript_76464: ; 76464 (1d:6464) diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index f0bdf615..cf717b43 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -19,7 +19,7 @@ BikeShopText1: ; 1d745 (7:5745) jr z, .asm_41190 ld hl, BikeShopText_1d81f call PrintText - ld bc, (BICYCLE << 8) | 1 + lb bc, BICYCLE, 1 call GiveItem jr nc, .BagFull ld a, BIKE_VOUCHER diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index e4cfc031..08ac98d6 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -163,7 +163,7 @@ BillsHouseText2: ; 1e874 (7:6874) jr nz, .asm_1e8a9 ld hl, BillThankYouText call PrintText - ld bc, (S_S__TICKET << 8) | 1 + lb bc, S_S__TICKET, 1 call GiveItem jr nc, .BagFull ld hl, SSTicketReceivedText diff --git a/scripts/blueshouse.asm b/scripts/blueshouse.asm index 0e29d64c..6aa2eaec 100755 --- a/scripts/blueshouse.asm +++ b/scripts/blueshouse.asm @@ -36,7 +36,7 @@ BluesHouseText1: ; 19b5d (6:5b5d) .GiveMap ld hl,DaisyOfferMapText call PrintText - ld bc,(TOWN_MAP << 8) | 1 + lb bc, TOWN_MAP, 1 call GiveItem jr nc, .BagFull ld a,HS_TOWN_MAP diff --git a/scripts/bruno.asm b/scripts/bruno.asm index c39656b9..bdfd7e24 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -22,7 +22,7 @@ BrunoScript_762ec: ; 762ec (1d:62ec) BrunoScript_76302: ; 76302 (1d:6302) ld [wNewTileBlockID], a - ld bc, $2 + lb bc, 0, 2 predef_jump ReplaceTileBlock BrunoScript_7630d: ; 7630d (1d:630d) diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index ce0c4731..cfc8f197 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -46,7 +46,7 @@ CeladonCityText5: ; 1999e (6:599e) jr nz, .asm_7053f ld hl, TM41PreText call PrintText - ld bc, (TM_41 << 8) | 1 + lb bc, TM_41, 1 call GiveItem jr c, .Success ld hl, TM41NoRoomText diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index a37bc558..be1ed4c8 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -31,7 +31,7 @@ CeladonDinerText5: ; 49173 (12:5173) jr nz, .asm_eb14d ld hl, CeladonDinerText_491a7 call PrintText - ld bc, (COIN_CASE << 8) | 1 + lb bc, COIN_CASE, 1 call GiveItem jr nc, .BagFull SetEvent EVENT_GOT_COIN_CASE diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index e8917434..787a2f3d 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -32,7 +32,7 @@ CeladonGameCornerScript_48bec: ; 48bec (12:4bec) ret nz ld a, $2a ld [wNewTileBlockID], a - ld bc, $0208 + lb bc, 2, 8 predef_jump ReplaceTileBlock CeladonGameCornerScript_48c07: ; 48c07 (12:4c07) @@ -452,7 +452,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) SetEvent EVENT_FOUND_ROCKET_HIDEOUT ld a, $43 ld [wNewTileBlockID], a - ld bc, $0208 + lb bc, 2, 8 predef ReplaceTileBlock jp TextScriptEnd @@ -477,8 +477,8 @@ CeladonGameCornerScript_48f1e: ; 48f1e (12:4f1e) call TextBoxBorder call UpdateSprites coord hl, 12, 1 - ld b, $4 - ld c, $7 + ld b, 4 + ld c, 7 call ClearScreenArea coord hl, 12, 2 ld de, GameCornerMoneyText diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index 5dc328c7..64e85ff7 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -47,7 +47,7 @@ CeladonGymText_48963: ; 48963 (12:4963) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_ERIKA - ld bc, (TM_21 << 8) | 1 + lb bc, TM_21, 1 call GiveItem jr nc, .BagFull ld a, $a diff --git a/scripts/celadonmansion5.asm b/scripts/celadonmansion5.asm index 60d2cc92..6d979e04 100755 --- a/scripts/celadonmansion5.asm +++ b/scripts/celadonmansion5.asm @@ -11,7 +11,7 @@ CeladonMansion5Text1: ; 1dd41 (7:5d41) CeladonMansion5Text2: ; 1dd46 (7:5d46) TX_ASM - ld bc,(EEVEE << 8) | 25 + lb bc, EEVEE, 25 call GivePokemon jr nc, .asm_24365 ld a, HS_CELADON_MANSION_5_GIFT diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index f525d0af..c6c6ecc7 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -26,7 +26,7 @@ CeladonMart3Text1: ; 4824a (12:424a) jr nz, .asm_a5463 ld hl, TM18PreReceiveText call PrintText - ld bc, (TM_18 << 8) | 1 + lb bc, TM_18, 1 call GiveItem jr nc, .BagFull SetEvent EVENT_GOT_TM18 diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index 113044cd..8eeb5d2b 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -88,7 +88,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) ld hl, CeladonMartRoofText_48515 call PrintText call RemoveItemByIDBank12 - ld bc, (TM_49 << 8) | 1 + lb bc, TM_49, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedTM49Text @@ -101,7 +101,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) ld hl, CeladonMartRoofText_48504 call PrintText call RemoveItemByIDBank12 - ld bc, (TM_48 << 8) | 1 + lb bc, TM_48, 1 call GiveItem jr nc, .BagFull ld hl, CeladonMartRoofText_4850a @@ -114,7 +114,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) ld hl, CeladonMartRoofText_484f3 call PrintText call RemoveItemByIDBank12 - ld bc, (TM_13 << 8) | 1 + lb bc, TM_13, 1 call GiveItem jr nc, .BagFull ld hl, CeladonMartRoofText_484f9 diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index c13e66e2..158a683d 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -299,7 +299,7 @@ CeruleanCityText2: ; 1967c (6:567c) .asm_4ca20 ld hl, CeruleanCityText_196f3 call PrintText - ld bc, (TM_28 << 8) + 1 + lb bc, TM_28, 1 call GiveItem jr c, .Success ld hl, TM28NoRoomText diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index a7845c68..ca1c2c7d 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -47,7 +47,7 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_MISTY - ld bc, (TM_11 << 8) | 1 + lb bc, TM_11, 1 call GiveItem jr nc, .BagFull ld a, $6 diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index 60df9338..5bbb94a9 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -144,7 +144,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_BLAINE - ld bc, (TM_38 << 8) | 1 + lb bc, TM_38, 1 call GiveItem jr nc, .BagFull ld a, $b diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index 953c7126..74dbb1c5 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -23,7 +23,7 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) jr z, .asm_62ecd ld hl, TM31PreReceiveText call PrintText - ld bc, (TM_31 << 8) | 1 + lb bc, TM_31, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedTM31Text diff --git a/scripts/fanclub.asm b/scripts/fanclub.asm index adde809f..cbafc034 100755 --- a/scripts/fanclub.asm +++ b/scripts/fanclub.asm @@ -113,7 +113,7 @@ FanClubText5: ; tell the story ld hl, .storytext call PrintText - ld bc, (BIKE_VOUCHER << 8) | 1 + lb bc, BIKE_VOUCHER, 1 call GiveItem jr nc, .BagFull ld hl, .receivedvouchertext diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index 9bbc38a8..3ec89256 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -47,7 +47,7 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_KOGA - ld bc, (TM_06 << 8) | 1 + lb bc, TM_06, 1 call GiveItem jr nc, .BagFull ld a, $a diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index 37aebd23..76b5e91f 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -38,7 +38,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) .asm_60cba ld hl, WardenThankYouText call PrintText - ld bc,(HM_04 << 8) | 1 + lb bc, HM_04, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedHM04Text diff --git a/scripts/fuchsiahouse3.asm b/scripts/fuchsiahouse3.asm index 8c83b779..2aabb9c2 100755 --- a/scripts/fuchsiahouse3.asm +++ b/scripts/fuchsiahouse3.asm @@ -18,7 +18,7 @@ FuchsiaHouse3Text1: ; 56181 (15:6181) and a jr nz, .refused - ld bc, (GOOD_ROD << 8) | 1 + lb bc, GOOD_ROD, 1 call GiveItem jr nc, .full diff --git a/scripts/lab3.asm b/scripts/lab3.asm index 59b04b8c..cbb5f53f 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -14,7 +14,7 @@ Lab3Text1: ; 75c94 (1d:5c94) jr nz, .asm_e551a ld hl, TM35PreReceiveText call PrintText - ld bc, (TM_35 << 8) | 1 + lb bc, TM_35, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedTM35Text diff --git a/scripts/lance.asm b/scripts/lance.asm index 9fa621da..e2c43614 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -25,12 +25,12 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) LanceScript_5a2de: ; 5a2de (16:62de) push bc ld [wNewTileBlockID], a - ld bc, $602 + lb bc, 6, 2 call LanceScript_5a2f0 pop bc ld a, b ld [wNewTileBlockID], a - ld bc, $603 + lb bc, 6, 3 LanceScript_5a2f0: ; 5a2f0 (16:62f0) predef_jump ReplaceTileBlock diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index 556e94a3..ccf9cef1 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -72,7 +72,7 @@ LavenderHouse1Text5: ; 1d918 (7:5918) jr nz, .asm_15ac2 ld hl, LavenderHouse1Text_1d94c call PrintText - ld bc, (POKE_FLUTE << 8) | 1 + lb bc, POKE_FLUTE, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedFluteText diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index 3c639d1e..43eee966 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -23,7 +23,7 @@ LoreleiScript_76191: ; 76191 (1d:6191) ld a, $24 .asm_761ab ld [wNewTileBlockID], a - ld bc, $2 + lb bc, 0, 2 predef_jump ReplaceTileBlock LoreleiScript_761b6: ; 761b6 (1d:61b6) diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index 88bdd3ed..bbfb0a0b 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -15,22 +15,22 @@ Mansion1Subscript1: ; 442c5 (11:42c5) ret z CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_442ec - ld bc, $060c + lb bc, 6, 12 call Mansion1Script_4430b - ld bc, $0308 + lb bc, 3, 8 call Mansion1Script_44304 - ld bc, $080a + lb bc, 8, 10 call Mansion1Script_44304 - ld bc, $0d0d + lb bc, 13, 13 jp Mansion1Script_44304 .asm_442ec - ld bc, $060c + lb bc, 6, 12 call Mansion1Script_44304 - ld bc, $0308 + lb bc, 3, 8 call Mansion1Script_4430b - ld bc, $080a + lb bc, 8, 10 call Mansion1Script_4430b - ld bc, $0d0d + lb bc, 13, 13 jp Mansion1Script_4430b Mansion1Script_44304: ; 44304 (11:4304) diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index cb697b94..22bc2b12 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -16,24 +16,24 @@ Mansion2Script_51fee: ; 51fee (14:5fee) CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_52016 ld a, $e - ld bc, $204 + lb bc, 2, 4 call Mansion2Script_5202f ld a, $54 - ld bc, $409 + lb bc, 4, 9 call Mansion2Script_5202f ld a, $5f - ld bc, $b03 + lb bc, 11, 3 call Mansion2Script_5202f ret .asm_52016 ld a, $5f - ld bc, $204 + lb bc, 2, 4 call Mansion2Script_5202f ld a, $e - ld bc, $409 + lb bc, 4, 9 call Mansion2Script_5202f ld a, $e - ld bc, $b03 + lb bc, 11, 3 call Mansion2Script_5202f ret diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index 21c959aa..84c00981 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -271,7 +271,7 @@ MtMoon3Text6: ; 49ee9 (12:5ee9) ld a, [wCurrentMenuItem] and a jr nz, .asm_49f21 - ld bc,(DOME_FOSSIL << 8) | 1 + lb bc, DOME_FOSSIL, 1 call GiveItem jp nc, MtMoon3Script_49f76 call MtMoon3Script_49f69 @@ -299,7 +299,7 @@ MtMoon3Text7: ; 49f29 (12:5f29) ld a, [wCurrentMenuItem] and a jr nz, .asm_49f61 - ld bc, (HELIX_FOSSIL << 8) | 1 + lb bc, HELIX_FOSSIL, 1 call GiveItem jp nc, MtMoon3Script_49f76 call MtMoon3Script_49f69 diff --git a/scripts/mtmoonpokecenter.asm b/scripts/mtmoonpokecenter.asm index 63cc06e4..fd3e4e53 100755 --- a/scripts/mtmoonpokecenter.asm +++ b/scripts/mtmoonpokecenter.asm @@ -43,7 +43,7 @@ MtMoonPokecenterText4: ; 492ec (12:52ec) ld hl, MtMoonPokecenterText_49366 jr .printText .enoughMoney - ld bc,(MAGIKARP << 8) | 5 + lb bc, MAGIKARP, 5 call GivePokemon jr nc, .done xor a diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 4c209eb8..ac552c6d 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -191,7 +191,7 @@ Museum1FText3: ; 5c256 (17:4256) jr nz, .asm_5c285 ld hl, Museum1FText_5c28e call PrintText - ld bc, (OLD_AMBER << 8) | 1 + lb bc, OLD_AMBER, 1 call GiveItem jr nc, .BagFull SetEvent EVENT_GOT_OLD_AMBER diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 93f87657..996ab754 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -1022,7 +1022,7 @@ OaksLabText5: ; 1d248 (7:5248) .asm_1d2d0 CheckAndSetEvent EVENT_GOT_POKEBALLS_FROM_OAK jr nz, .asm_1d2e7 - ld bc, (POKE_BALL << 8) | 5 + lb bc, POKE_BALL, 5 call GiveItem ld hl, OaksLabGivePokeballsText call PrintText diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 81fcb600..831403bb 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -47,7 +47,7 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_BROCK - ld bc, (TM_34 << 8) | 1 + lb bc, TM_34, 1 call GiveItem jr nc, .BagFull ld a, $5 diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index c658596e..82561577 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -27,7 +27,7 @@ RocketHideout1Script_44be0: ; 44be0 (11:4be0) ld a, $e .asm_44c03 ld [wNewTileBlockID], a - ld bc, $080c + lb bc, 8, 12 predef_jump ReplaceTileBlock RocketHideout1ScriptPointers: ; 44c0e (11:4c0e) diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index 62d6f6bb..a71e444c 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -27,7 +27,7 @@ RocketHideout4Script_45473: ; 45473 (11:5473) ld a, $e .asm_45498 ld [wNewTileBlockID], a - ld bc, $050c + lb bc, 5, 12 predef_jump ReplaceTileBlock RocketHideout4Script_454a3: ; 454a3 (11:54a3) diff --git a/scripts/route1.asm b/scripts/route1.asm index 6c00e555..926ffd20 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -12,7 +12,7 @@ Route1Text1: ; 1cab8 (7:4ab8) jr nz, .asm_1cada ld hl, Route1ViridianMartSampleText call PrintText - ld bc, (POTION << 8) | 1 + lb bc, POTION, 1 call GiveItem jr nc, .BagFull ld hl, Route1Text_1cae8 diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index f651d373..e7ad5cbf 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -12,7 +12,7 @@ Route12GateUpstairsText1: ; 49569 (12:5569) jr c, .asm_0ad3c ld hl, TM39PreReceiveText call PrintText - ld bc, (TM_39 << 8) | 1 + lb bc, TM_39, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedTM39Text diff --git a/scripts/route12house.asm b/scripts/route12house.asm index 6b3e17fc..bb065f1c 100755 --- a/scripts/route12house.asm +++ b/scripts/route12house.asm @@ -15,7 +15,7 @@ Route12HouseText1: ; 56484 (15:6484) ld a, [wCurrentMenuItem] and a jr nz, .asm_a2d76 - ld bc, (SUPER_ROD << 8) | 1 + lb bc, SUPER_ROD, 1 call GiveItem jr nc, .BagFull ld hl, wd728 diff --git a/scripts/route16house.asm b/scripts/route16house.asm index 4a0ac0c3..ee23fd89 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -12,7 +12,7 @@ Route16HouseText1: ; 1e5ff (7:65ff) jr nz, .asm_13616 ld hl, Route16HouseText3 call PrintText - ld bc, (HM_02 << 8) | 1 + lb bc, HM_02, 1 call GiveItem jr nc, .BagFull SetEvent EVENT_GOT_HM02 diff --git a/scripts/route24.asm b/scripts/route24.asm index 4e83a5cd..6eba1d35 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -149,7 +149,7 @@ Route24Text1: ; 514a4 (14:54a4) jr nz, .asm_514f9 ld hl, Route24Text_51510 call PrintText - ld bc, (NUGGET << 8) | 1 + lb bc, NUGGET, 1 call GiveItem jr nc, .BagFull SetEvent EVENT_GOT_NUGGET diff --git a/scripts/safarizoneentrance-yellow.asm b/scripts/safarizoneentrance-yellow.asm index 9d354cff..4a37f0e6 100644 --- a/scripts/safarizoneentrance-yellow.asm +++ b/scripts/safarizoneentrance-yellow.asm @@ -54,7 +54,7 @@ ld hl,.MakePaymentText call PrintText ld a,30 - ld hl,(502 / $100) << 8 | (502 % $100) + lb hl, (502 / $100), (502 % $100) .xf1ff2 ld [W_NUMSAFARIBALLS],a ld a,h diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index 6cf17b9d..8881472b 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -10,7 +10,7 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) jr nz, .asm_20a9b ld hl, SafariZoneSecretHouseText_4a350 call PrintText - ld bc, (HM_03 << 8) | 1 + lb bc, HM_03, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedHM03Text diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index 9ee632f7..140b1130 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -47,7 +47,7 @@ SaffronGymText_5d068: ; 5d068 (17:5068) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_SABRINA - ld bc, (TM_46 << 8) | 1 + lb bc, TM_46, 1 call GiveItem jr nc, .BagFull ld a, $b diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index f3ec4c99..2c159190 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -10,7 +10,7 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) jr nz, .asm_9e72b ld hl, TM29PreReceiveText call PrintText - ld bc,(TM_29 << 8) | 1 + lb bc, TM_29, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedTM29Text diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index fb419a22..a6f2f860 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -13,18 +13,19 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_5a173 + ld hl, SilphCo10GateCoords call SilphCo2Script_59d43 call SilphCo10Text_5a176 CheckEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret nz ld a, $54 ld [wNewTileBlockID], a - ld bc, $405 + lb bc, 4, 5 predef_jump ReplaceTileBlock -DataTable_5a173: ; 5a173 (16:6173) - db $04,$05,$FF +SilphCo10GateCoords: ; 5a173 (16:6173) + db $04,$05 + db $FF SilphCo10Text_5a176: ; 5a176 (16:6176) ld a, [$ffe0] diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index 9cdf2891..4c83c20d 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -13,18 +13,19 @@ SilphCo11Script_62110: ; 62110 (18:6110) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_62134 + ld hl, SilphCo11GateCoords call SilphCo11Script_62137 call SilphCo11Script_62163 CheckEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR ret nz ld a, $20 ld [wNewTileBlockID], a - ld bc, $603 + lb bc, 6, 3 predef_jump ReplaceTileBlock -DataTable_62134: ; 62134 (18:6134) - db $06,$03,$FF +SilphCo11GateCoords: ; 62134 (18:6134) + db $06,$03 + db $FF SilphCo11Script_62137: ; 62137 (18:6137) push hl @@ -306,7 +307,7 @@ SilphCo11Text1: ; 622dc (18:62dc) jp nz, .asm_62308 ld hl, SilphCoPresidentText call PrintText - ld bc, (MASTER_BALL << 8) | 1 + lb bc, MASTER_BALL, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedSilphCoMasterBallText diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index b758455e..ecb3b5a5 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -13,7 +13,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_59d3e + ld hl, SilphCo2GateCoords call SilphCo2Script_59d43 call SilphCo2Script_59d6f CheckEvent EVENT_SILPH_CO_2_UNLOCKED_DOOR1 @@ -21,7 +21,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) push af ld a, $54 ld [wNewTileBlockID], a - ld bc, $0202 + lb bc, 2, 2 predef ReplaceTileBlock pop af .asm_59d2e @@ -29,11 +29,13 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) ret nz ld a, $54 ld [wNewTileBlockID], a - ld bc, $0502 + lb bc, 5, 2 predef_jump ReplaceTileBlock -DataTable_59d3e: ; 59d3e (16:5d3e) - db $02,$02,$05,$02,$FF +SilphCo2GateCoords: ; 59d3e (16:5d3e) + db $02,$02 + db $05,$02 + db $FF SilphCo2Script_59d43: ; 59d43 (16:5d43) push hl @@ -141,7 +143,7 @@ SilphCo2Text1: ; 59dc1 (16:5dc1) jr nz, .asm_59de4 ld hl, SilphCo2Text_59ded call PrintText - ld bc, (TM_36 << 8) | 1 + lb bc, TM_36, 1 call GiveItem ld hl, TM36NoRoomText jr nc, .asm_59de7 diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index f693ea33..bdaac452 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -13,7 +13,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_59fa8 + ld hl, SilphCo3GateCoords call SilphCo2Script_59d43 call SilphCo3Script_59fad CheckEvent EVENT_SILPH_CO_3_UNLOCKED_DOOR1 @@ -21,7 +21,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) push af ld a, $5f ld [wNewTileBlockID], a - ld bc, $404 + lb bc, 4, 4 predef ReplaceTileBlock pop af .asm_59f98 @@ -29,11 +29,13 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) ret nz ld a, $5f ld [wNewTileBlockID], a - ld bc, $408 + lb bc, 4, 8 predef_jump ReplaceTileBlock -DataTable_59fa8: ; 59fa8 (16:5fa8) - db $04,$04,$04,$08,$FF +SilphCo3GateCoords: ; 59fa8 (16:5fa8) + db $04,$04 + db $04,$08 + db $FF SilphCo3Script_59fad: ; 59fad (16:5fad) EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index 0ea2c8c8..0dad6f6b 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -13,7 +13,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) bit 5, [hl] res 5, [hl] ret z - ld hl, SilphCo4Data19d58 + ld hl, SilphCo4GateCoords call SilphCo4Script_19d5d call SilphCo4Script_19d89 CheckEvent EVENT_SILPH_CO_4_UNLOCKED_DOOR1 @@ -21,7 +21,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) push af ld a, $54 ld [wNewTileBlockID], a - ld bc, $0602 + lb bc, 6, 2 predef ReplaceTileBlock pop af .asm_19d48 @@ -29,11 +29,13 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) ret nz ld a, $54 ld [wNewTileBlockID], a - ld bc, $0406 + lb bc, 4, 6 predef_jump ReplaceTileBlock -SilphCo4Data19d58: ; 19d58 (6:5d58) - db $06, $02, $04, $06, $ff +SilphCo4GateCoords: ; 19d58 (6:5d58) + db $06,$02 + db $04,$06 + db $FF SilphCo4Script_19d5d: ; 19d5d (6:5d5d) push hl diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index d6f35993..7380f98f 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -13,7 +13,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) bit 5, [hl] res 5, [hl] ret z - ld hl, SilphCo5Coords + ld hl, SilphCo5GateCoords call SilphCo4Script_19d5d call SilphCo5Script_19f9e CheckEvent EVENT_SILPH_CO_5_UNLOCKED_DOOR1 @@ -21,7 +21,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) push af ld a, $5f ld [wNewTileBlockID], a - ld bc, $0203 + lb bc, 2, 3 predef ReplaceTileBlock pop af .asm_19f74 @@ -30,7 +30,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) push af ld a, $5f ld [wNewTileBlockID], a - ld bc, $0603 + lb bc, 6, 3 predef ReplaceTileBlock pop af .asm_19f87 @@ -38,11 +38,14 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) ret nz ld a, $5f ld [wNewTileBlockID], a - ld bc, $0507 + lb bc, 5, 7 predef_jump ReplaceTileBlock -SilphCo5Coords: ; 19f97 (6:5f97) - db $02, $03, $06, $03, $05, $07, $ff +SilphCo5GateCoords: ; 19f97 (6:5f97) + db $02,$03 + db $06,$03 + db $05,$07 + db $FF SilphCo5Script_19f9e: ; 19f9e (6:5f9e) EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index 25fbcef9..fa199069 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -13,19 +13,19 @@ SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) bit 5, [hl] res 5, [hl] ret z - ld hl, SilphCo6Coords1 + ld hl, SilphCo6GateCoords call SilphCo4Script_19d5d call SilphCo6Script_1a1e6 CheckEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR ret nz ld a, $5f ld [wNewTileBlockID], a - ld bc, $0602 + lb bc, 6, 2 predef_jump ReplaceTileBlock -SilphCo6Coords1: ; 1a1e3 (6:61e3) - db $06, $02 - db $ff +SilphCo6GateCoords: ; 1a1e3 (6:61e3) + db $06,$02 + db $FF SilphCo6Script_1a1e6: ; 1a1e6 (6:61e6) ld a, [$ffe0] diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 44e92475..525405c7 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -13,7 +13,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_51bc1 + ld hl, SilphCo7GateCoords call SilphCo7Text_51bc8 call SilphCo7Text_51bf4 CheckEvent EVENT_SILPH_CO_7_UNLOCKED_DOOR1 @@ -21,7 +21,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) push af ld a, $54 ld [wNewTileBlockID], a - ld bc, $305 + lb bc, 3, 5 predef ReplaceTileBlock pop af .asm_51b9e @@ -30,7 +30,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) push af ld a, $54 ld [wNewTileBlockID], a - ld bc, $20a + lb bc, 2, 10 predef ReplaceTileBlock pop af .asm_51bb1 @@ -38,11 +38,14 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) ret nz ld a, $54 ld [wNewTileBlockID], a - ld bc, $60a + lb bc, 6, 10 predef_jump ReplaceTileBlock -DataTable_51bc1: ; 51bc1 (14:5bc1) - db $03,$05,$02,$0A,$06,$0A,$FF +SilphCo7GateCoords: ; 51bc1 (14:5bc1) + db $03,$05 + db $02,$0A + db $06,$0A + db $FF SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) push hl @@ -329,7 +332,7 @@ SilphCo7Text1: .givelapras ld hl, .MeetLaprasGuyText call PrintText - ld bc, (LAPRAS << 8) | 15 + lb bc, LAPRAS, 15 call GivePokemon jr nc, .done ld a, [wSimulatedJoypadStatesEnd] diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index 7545f359..9ea985a8 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -13,18 +13,19 @@ SilphCo8Script_5651a: ; 5651a (15:651a) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_5653e + ld hl, SilphCo8GateCoords call SilphCo8Script_56541 call SilphCo8Script_5656d CheckEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR ret nz ld a, $5f ld [wNewTileBlockID], a - ld bc, $403 + lb bc, 4, 3 predef_jump ReplaceTileBlock -DataTable_5653e: ; 5653e (15:653e) - db $04,$03,$FF +SilphCo8GateCoords: ; 5653e (15:653e) + db $04,$03 + db $FF SilphCo8Script_56541: ; 56541 (15:6541) push hl diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index 557ce1f1..02638459 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -13,7 +13,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) bit 5, [hl] res 5, [hl] ret z - ld hl, DataTable_5d82e + ld hl, SilphCo9GateCoords call SilphCo9Script_5d837 call SilphCo9Script_5d863 CheckEvent EVENT_SILPH_CO_9_UNLOCKED_DOOR1 @@ -21,7 +21,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) push af ld a, $5f ld [wNewTileBlockID], a - ld bc, $401 + lb bc, 4, 1 predef ReplaceTileBlock pop af .asm_5d7f8 @@ -30,7 +30,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) push af ld a, $54 ld [wNewTileBlockID], a - ld bc, $209 + lb bc, 2, 9 predef ReplaceTileBlock pop af .asm_5d80b @@ -39,7 +39,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) push af ld a, $54 ld [wNewTileBlockID], a - ld bc, $509 + lb bc, 5, 9 predef ReplaceTileBlock pop af .asm_5d81e @@ -47,11 +47,15 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) ret nz ld a, $5f ld [wNewTileBlockID], a - ld bc, $605 + lb bc, 6, 5 predef_jump ReplaceTileBlock -DataTable_5d82e: ; 5d82e (17:582e) - db $04,$01,$02,$09,$05,$09,$06,$05,$FF +SilphCo9GateCoords: ; 5d82e (17:582e) + db $04,$01 + db $02,$09 + db $05,$09 + db $06,$05 + db $FF SilphCo9Script_5d837: ; 5d837 (17:5837) push hl diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index 9bb4aac6..b99f5bb2 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -22,7 +22,7 @@ SSAnne7Text1: ; 618ad (18:58ad) call PrintText ld hl, ReceivingHM01Text call PrintText - ld bc, (HM_01 << 8) | 1 + lb bc, HM_01, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedHM01Text diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index 5c504335..78a38aec 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -38,7 +38,7 @@ VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d) ld a, $5 .asm_5ca7f ld [wNewTileBlockID], a - ld bc, $202 + lb bc, 2, 2 predef_jump ReplaceTileBlock VermilionGymScript_5ca8a: ; 5ca8a (17:4a8a) @@ -66,7 +66,7 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_LT_SURGE - ld bc, (TM_24 << 8) | 1 + lb bc, TM_24, 1 call GiveItem jr nc, .BagFull ld a, $7 diff --git a/scripts/vermilionhouse2.asm b/scripts/vermilionhouse2.asm index 775c32bb..f166ebb8 100755 --- a/scripts/vermilionhouse2.asm +++ b/scripts/vermilionhouse2.asm @@ -15,7 +15,7 @@ VermilionHouse2Text1: ; 56075 (15:6075) ld a, [wCurrentMenuItem] and a jr nz, .asm_eb1b7 - ld bc, (OLD_ROD << 8) | 1 + lb bc, OLD_ROD, 1 call GiveItem jr nc, .BagFull ld hl, wd728 diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index dbb69a64..11f5d5db 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -15,7 +15,7 @@ VictoryRoad1Script: ; 5da0a (17:5a0a) ret z ld a, $1d ld [wNewTileBlockID], a - ld bc, $604 + lb bc, 6, 4 predef_jump ReplaceTileBlock VictoryRoad1ScriptPointers: ; 5da3a (17:5a3a) diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index 41fe0212..cb956b1c 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -23,14 +23,14 @@ VictoryRoad2Script_517c9: ; 517c9 (14:57c9) jr z, .asm_517da push af ld a, $15 - ld bc, $403 + lb bc, 4, 3 call VictoryRoad2Script_517e2 pop af .asm_517da bit 7, a ret z ld a, $1d - ld bc, $70b + lb bc, 7, 11 VictoryRoad2Script_517e2: ; 517e2 (14:57e2) ld [wNewTileBlockID], a diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index c5aaef50..22e6813a 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -17,7 +17,7 @@ VictoryRoad3Script_44996: ; 44996 (11:4996) ret z ld a, $1d ld [wNewTileBlockID], a - ld bc, $503 + lb bc, 5, 3 predef_jump ReplaceTileBlock VictoryRoad3ScriptPointers: ; 449b1 (11:49b1) diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index 7cdf5ad8..79ad444f 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -235,7 +235,7 @@ ViridianCityText6: ; 19196 (6:5196) jr nz, .asm_4e5a0 ld hl, ViridianCityText_191ca call PrintText - ld bc, (TM_42 << 8) | 1 + lb bc, TM_42, 1 call GiveItem jr nc, .BagFull ld hl, ReceivedTM42Text diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 8e012040..6cded55d 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -141,7 +141,7 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI - ld bc, (TM_27 << 8) | 1 + lb bc, TM_27, 1 call GiveItem jr nc, .BagFull ld a, $d diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index 986ac8f1..5cb6eaea 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -52,7 +52,7 @@ ViridianMartScript1: ; 1d4c0 (7:54c0) ld a, $5 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld bc, (OAKS_PARCEL << 8) + 1 + lb bc, OAKS_PARCEL, 1 call GiveItem SetEvent EVENT_GOT_OAKS_PARCEL ld a, $2 -- cgit v1.3.1-sl0p