diff options
author | xCrystal <rgr.crystal@gmail.com> | 2018-02-10 14:11:36 +0100 |
---|---|---|
committer | xCrystal <rgr.crystal@gmail.com> | 2018-02-10 14:11:36 +0100 |
commit | f541f5e03adadf0b9315cc642da9a5b377b52c12 (patch) | |
tree | 3aa0db9181a57a8dd5456955f7957a1950fe1400 /src/engine | |
parent | 4d594f0e320b5eda3a6bc503392c88131358d3ce (diff) |
Refractor/rearrange some macros
Diffstat (limited to 'src/engine')
-rwxr-xr-x | src/engine/bank1.asm | 36 | ||||
-rwxr-xr-x | src/engine/bank2.asm | 8 | ||||
-rwxr-xr-x | src/engine/bank3.asm | 4 | ||||
-rwxr-xr-x | src/engine/bank4.asm | 12 | ||||
-rwxr-xr-x | src/engine/bank6.asm | 10 | ||||
-rw-r--r-- | src/engine/effect_functions.asm | 16 | ||||
-rwxr-xr-x | src/engine/home.asm | 54 |
7 files changed, 70 insertions, 70 deletions
diff --git a/src/engine/bank1.asm b/src/engine/bank1.asm index 5adf436..b5894d2 100755 --- a/src/engine/bank1.asm +++ b/src/engine/bank1.asm @@ -22,7 +22,7 @@ Func_4000: ; 4000 (1:4000) .ask_erase_backup_ram call Func_405a call Func_04a2 - text_hl ResetBackUpRamText + ldtx hl, ResetBackUpRamText call YesOrNoMenuWithText jr c, .reset_game ; erase sram @@ -129,7 +129,7 @@ StartDuel: ; 409f (1:409f) call Func_04a2 ld a, $3 call Func_2167 - text_hl DecisionText + ldtx hl, DecisionText call DrawWideTextBox_WaitForInput call Func_04a2 ldh a, [hWhoseTurn] @@ -148,7 +148,7 @@ StartDuel: ; 409f (1:409f) jr z, .activeDuelistLostBattle ld a, $5f ld c, MUSIC_DARKDIDDLY - text_hl DuelWasDrawText + ldtx hl, DuelWasDrawText jr .handleDuelFinished .activeDuelistWonBattle @@ -160,7 +160,7 @@ StartDuel: ; 409f (1:409f) ld [wd0c3], a ld a, $5d ld c, MUSIC_MATCHVICTORY - text_hl WonDuelText + ldtx hl, WonDuelText jr .handleDuelFinished .activeDuelistLostBattle @@ -172,7 +172,7 @@ StartDuel: ; 409f (1:409f) ld [wd0c3], a ld a, $5e ld c, MUSIC_MATCHLOSS - text_hl LostDuelText + ldtx hl, LostDuelText .handleDuelFinished call Func_3b6a @@ -203,7 +203,7 @@ StartDuel: ; 409f (1:409f) call Func_3b31 ld a, [wDuelTheme] call PlaySong - text_hl StartSuddenDeathMatchText + ldtx hl, StartSuddenDeathMatchText call DrawWideTextBox_WaitForInput ld a, $1 ld [wcc08], a @@ -283,7 +283,7 @@ Func_426d: xor a ld [wVBlankCtr], a ld [wcbf9], a - text_hl DuelistIsThinkingText + ldtx hl, DuelistIsThinkingText call DrawWideTextBox_PrintTextNoDelay call Func_2bbf ld a, $ff @@ -414,7 +414,7 @@ DuelMenu_Retreat: ; 43ab (1:43ab) jr c, Func_441f call $4611 jr c, Func_441c - text_hl SelectMonOnBenchToSwitchWithActiveText + ldtx hl, SelectMonOnBenchToSwitchWithActiveText call DrawWideTextBox_WaitForInput call $600c jr c, Func_441c @@ -428,7 +428,7 @@ DuelMenu_Retreat: ; 43ab (1:43ab) call $4f9d Func_43e8: ; 43e8 - text_hl UnableToRetreatText + ldtx hl, UnableToRetreatText call DrawWideTextBox_WaitForInput jp PrintDuelMenu @@ -438,7 +438,7 @@ Func_43f1: ; 43f1 (1:43f1) call $4611 jr c, Func_441c call $6558 - text_hl SelectMonOnBenchToSwitchWithActiveText + ldtx hl, SelectMonOnBenchToSwitchWithActiveText call DrawWideTextBox_WaitForInput call $600c ld [wBenchSelectedPokemon], a @@ -463,14 +463,14 @@ DuelMenu_Hand: ; 4425 (1:4425) call GetTurnDuelistVariable or a jr nz, Func_4436 - text_hl NoCardsInHandText + ldtx hl, NoCardsInHandText call DrawWideTextBox_WaitForInput jp PrintDuelMenu Func_4436: ; 4436 (1:4436) INCROM $4436, $4477 -; c contains the energy card being played +; c contains the type of energy card being played PlayerUseEnergyCard: ; 4477 (1:4477) ld a, c cp TYPE_ENERGY_WATER ; XXX why treat water energy card differently? @@ -510,12 +510,12 @@ PlayerUseEnergyCard: ; 4477 (1:4477) ld a, [wAlreadyPlayedEnergy] or a jr z, .asm_4490 - text_hl OnlyOneEnergyCardText + ldtx hl, OnlyOneEnergyCardText call DrawWideTextBox_WaitForInput jp Func_4436 .alreadyPlayedEnergy - text_hl OnlyOneEnergyCardText + ldtx hl, OnlyOneEnergyCardText call DrawWideTextBox_WaitForInput call CreateHandCardBuffer call $55be @@ -549,7 +549,7 @@ DuelMenu_Attack: ; 46fc (1:46fc) call LoadPokemonMovesToDuelCardOrAttackList or a jr nz, .openAttackMenu - text_hl NoSelectableAttackText + ldtx hl, NoSelectableAttackText call DrawWideTextBox_WaitForInput jp PrintDuelMenu @@ -578,7 +578,7 @@ DuelMenu_Attack: ; 46fc (1:46fc) ld [wSelectedDuelSubMenuItem], a call CheckIfEnoughEnergies jr nc, .enoughEnergy - text_hl NotEnoughEnergyCardsText + ldtx hl, NotEnoughEnergyCardsText call DrawWideTextBox_WaitForInput jr .tryOpenAttackMenu @@ -918,11 +918,11 @@ CheckIfActiveCardParalyzedOrAsleep: ; 4918 (1:4918) ret .paralyzed - text_hl UnableDueToParalysisText + ldtx hl, UnableDueToParalysisText jr .returnWithStatusCondition .asleep - text_hl UnableDueToSleepText + ldtx hl, UnableDueToSleepText .returnWithStatusCondition: scf diff --git a/src/engine/bank2.asm b/src/engine/bank2.asm index d9685a1..fea3d9b 100755 --- a/src/engine/bank2.asm +++ b/src/engine/bank2.asm @@ -81,7 +81,7 @@ Func_8db0: ; 8db0 (2:4db0) Func_8dbc: ; 8dbc (2:4dbc) ld hl, Unknown_8de2 call InitializeCursorParameters - text_hl PleaseSelectDeckText + ldtx hl, PleaseSelectDeckText call DrawWideTextBox_PrintText .asm_8dc8 call DoFrame @@ -348,13 +348,13 @@ Func_8f9d: ; 8f9d (2:4f9d) xor a ld [wce3f], a ld [wce40], a - text_hl ChosenAsDuelingDeckText + ldtx hl, ChosenAsDuelingDeckText call DrawWideTextBox_WaitForInput ld a, [wceb1] jp Func_8dbc Func_8fe8: ; 8fe8 (2:4fe8) - text_hl ThereIsNoDeckHereText + ldtx hl, ThereIsNoDeckHereText call DrawWideTextBox_WaitForInput ld a, [wceb1] ret @@ -703,7 +703,7 @@ Func_926e: ; 926e (2:526e) ret .asm_929c call Func_22ae - text_hl NewDeckText + ldtx hl, NewDeckText call Func_2c29 scf ret diff --git a/src/engine/bank3.asm b/src/engine/bank3.asm index 7317f32..563a667 100755 --- a/src/engine/bank3.asm +++ b/src/engine/bank3.asm @@ -1062,7 +1062,7 @@ PC_c7ea: ; c7ea (3:47ea) call Func_c241 call $4915 call DoFrameIfLCDEnabled - text_hl TurnedPCOnText + ldtx hl, TurnedPCOnText call Func_2c73 call $484e .asm_c801 @@ -1089,7 +1089,7 @@ PC_c7ea: ; c7ea (3:47ea) .asm_c82f call Func_c135 call DoFrameIfLCDEnabled - text_hl TurnedPCOffText + ldtx hl, TurnedPCOffText call Func_c891 call CloseDialogueBox xor a diff --git a/src/engine/bank4.asm b/src/engine/bank4.asm index cdb767f..29d96fc 100755 --- a/src/engine/bank4.asm +++ b/src/engine/bank4.asm @@ -90,7 +90,7 @@ Medal_1029e: ; 1029e (4:429e) ld a, [wd116] cp $e0 jr nz, .asm_102e2 - text_hl WonTheMedalText + ldtx hl, WonTheMedalText call Func_2c73 call Func_3c96 call Func_37a0 @@ -142,16 +142,16 @@ BoosterPack_1031b: ; 1031b (4:431b) pop bc ld a, c farcall GenerateBoosterPack - text_hl ReceivedBoosterPackText + ldtx hl, ReceivedBoosterPackText ld a, [wd117] cp $1 jr nz, .asm_10373 - text_hl AndAnotherBoosterPackText + ldtx hl, AndAnotherBoosterPackText .asm_10373 call Func_2c73 call Func_3c96 call Func_37a0 - text_hl CheckedCardsInBoosterPackText + ldtx hl, CheckedCardsInBoosterPackText call Func_2c73 call DisableLCD call Func_1288c @@ -1502,7 +1502,7 @@ Func_1344d: ; 1344d (4:744d) call Func_379b ld a, MUSIC_MEDAL call PlaySong - text_hl DefeatedFiveOpponentsText + ldtx hl, DefeatedFiveOpponentsText call Func_2c73 call Func_3c96 call Func_37a0 @@ -1524,7 +1524,7 @@ Func_13485: ; 13485 (4:7485) call Func_379b ld a, MUSIC_MEDAL call PlaySong - text_hl ConsecutiveWinRecordIncreasedText + ldtx hl, ConsecutiveWinRecordIncreasedText call Func_2c73 call Func_3c96 call Func_37a0 diff --git a/src/engine/bank6.asm b/src/engine/bank6.asm index 82fb589..6428c3f 100755 --- a/src/engine/bank6.asm +++ b/src/engine/bank6.asm @@ -124,23 +124,23 @@ Func_1a61f: ; 1a61f (6:661f) ld a, $76 call $663b ld a, $c1 - text_hl ReceivedLegendaryCardText + ldtx hl, ReceivedLegendaryCardText jr .asm_1a660 .asm_1a640 - text_hl ReceivedCardText + ldtx hl, ReceivedCardText cp $1e jr z, .asm_1a660 cp $43 jr z, .asm_1a660 - text_hl ReceivedPromotionalFlyingPikachuText + ldtx hl, ReceivedPromotionalFlyingPikachuText cp $64 jr z, .asm_1a660 - text_hl ReceivedPromotionalSurfingPikachuText + ldtx hl, ReceivedPromotionalSurfingPikachuText cp $65 jr z, .asm_1a660 cp $66 jr z, .asm_1a660 - text_hl ReceivedPromotionalCardText + ldtx hl, ReceivedPromotionalCardText .asm_1a660 push hl ld e, a diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm index 82198a2..dc05043 100644 --- a/src/engine/effect_functions.asm +++ b/src/engine/effect_functions.asm @@ -1,5 +1,5 @@ Poison50PercentEffect: ; 2c000 (b:4000) - text_de PoisonCheckText + ldtx de, PoisonCheckText call TossCoin_BankB ret nc @@ -11,14 +11,14 @@ PoisonEffect: ; 2c007 (b:4007) jr applyEffect Paralysis50PercentEffect: ; 2c011 (b:4011) - text_de ParalysisCheckText + ldtx de, ParalysisCheckText call TossCoin_BankB ret nc lb bc, $f0, PARALYZED jr applyEffect Confusion50PercentEffect: ; 2c01d (b:401d) - text_de ConfusionCheckText + ldtx de, ConfusionCheckText call TossCoin_BankB ret nc @@ -26,7 +26,7 @@ ConfusionEffect: ; 2c024 (b:4024) lb bc, $f0, CONFUSED jr applyEffect - text_de SleepCheckText + ldtx de, SleepCheckText call TossCoin_BankB ret nc @@ -227,7 +227,7 @@ SpitPoison_AIEffect: ; 2c6f0 (b:46f0) ; 0x2c6f8 SpitPoison_Poison50PercentEffect: ; 2c6f8 (b:46f8) - text_de PoisonCheckText + ldtx de, PoisonCheckText call TossCoin_BankB jp c, PoisonEffect ld a, $8c @@ -253,7 +253,7 @@ WeepinbellPoisonPowder_AIEffect: ; 2c738 (b:4738) INCROM $2c740, $2c77e AcidEffect: ; 2c77e (b:477e) - text_de AcidCheckText + ldtx de, AcidCheckText call TossCoin_BankB ret nc ld a, SUBSTATUS2_UNABLE_RETREAT @@ -277,7 +277,7 @@ FoulOdorEffect: ; 2c793 (b:4793) ; 0x2c7a0 KakunaStiffenEffect: ; 2c7a0 (b:47a0) - text_de IfHeadsNoDamageNextTurnText + ldtx de, IfHeadsNoDamageNextTurnText call TossCoin_BankB jp nc, Func_2c0a2 ld a, $4f @@ -314,7 +314,7 @@ ZubatSupersonicEffect: ; 2c7dc (b:47dc) ; an exact copy of KakunaStiffenEffect MetapodStiffenEffect: ; 2c836 (b:4836) - text_de IfHeadsNoDamageNextTurnText + ldtx de, IfHeadsNoDamageNextTurnText call TossCoin_BankB jp nc, Func_2c0a2 ld a, $4f diff --git a/src/engine/home.asm b/src/engine/home.asm index 1bc9a47..2f57dce 100755 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -2330,7 +2330,7 @@ Func_0f35: ; 0f35 (0:0f35) ld l, a ld h, $0 call Func_2ec4 - text_hl TransmissionErrorText + ldtx hl, TransmissionErrorText call DrawWideTextBox_WaitForInput ld a, $ff ld [wd0c3], a @@ -2609,7 +2609,7 @@ ShuffleDeck: ; 10bc (0:10bc) call ShuffleCards ret -; draw a card from the deck, saving its location as $40 +; draw a card from the deck, saving its location as CARD_LOCATION_JUST_DRAWN ; returns c if deck is empty, nc if a card was succesfully drawn DrawCardFromDeck: ; 10cf (0:10cf) push hl @@ -2623,7 +2623,7 @@ DrawCardFromDeck: ; 10cf (0:10cf) ld l, a ld a, [hl] ; grab card number (0-59) from wPlayerDeckCards or wOpponentDeckCards array ld l, a - ld [hl], CARD_LOCATION_JUST_DRAWN ; temporarily write $40 to corresponding card location variable + ld [hl], CARD_LOCATION_JUST_DRAWN ; temporarily write to corresponding card location variable pop hl or a ret @@ -3200,7 +3200,7 @@ DealConfusionDamageToSelf: ; 1828 (0:1828) bank1call $4f9d ld a, $1 ld [wcce6], a - text_hl DamageToSelfDueToConfusionText + ldtx hl, DamageToSelfDueToConfusionText call DrawWideTextBox_PrintText ld a, $75 ld [wLoadedMoveAnimation], a @@ -3299,7 +3299,7 @@ CheckSelfConfusionDamage: ; 18d7 (0:18d7) or a ret .confused - text_de ConfusionCheckDamageText + ldtx de, ConfusionCheckDamageText call TossCoin jr c, .no_confusion_damage ld a, $1 @@ -3572,7 +3572,7 @@ Func_1ad3: ; 1ad3 (0:1ad3) ld h, [hl] ld l, a call Func_2ebb - text_hl WasKnockedOutText + ldtx hl, WasKnockedOutText call DrawWideTextBox_PrintText ld a, $28 .asm_1aeb @@ -3601,7 +3601,7 @@ Func_1b8d: ; 1b8d (0:1b8d) ld [hli], a ld a, [wLoadedMoveName + 1] ld [hli], a - text_hl PokemonsAttackText ; text when using an attack + ldtx hl, PokemonsAttackText ; text when using an attack call DrawWideTextBox_PrintText ret @@ -3638,7 +3638,7 @@ Func_1bca: ; 1bca (0:1bca) inc de ld a, [hli] ld [de], a - text_hl WasUnsuccessfulText + ldtx hl, WasUnsuccessfulText call DrawWideTextBox_PrintText scf ret @@ -3694,7 +3694,7 @@ PrintOpponentName: ; 1c8e (0:1c8e) jr z, .print_player2 jr printNameLoop .print_player2 - text_hl Player2 + ldtx hl, Player2Text jp PrintTextBoxBorderLabel Func_1caa: ; 1caa (0:1caa) @@ -5435,7 +5435,7 @@ HandleYesOrNoMenu: ; prints YES NO at de PrintYesOrNoItems: ; 2b66 (0:2b66) call AdjustCoordinatesForWindow - text_hl YesOrNoText + ldtx hl, YesOrNoText call Func_2c1b ret ; 0x2b70 @@ -6728,13 +6728,13 @@ HandleCantAttackSubstatus: ; 33c1 (0:33c1) call GetTurnDuelistVariable or a ret z - text_hl UnableToAttackDueToTailWagText + ldtx hl, UnableToAttackDueToTailWagText cp SUBSTATUS2_TAIL_WAG jr z, .return_with_cant_attack - text_hl UnableToAttackDueToLeerText + ldtx hl, UnableToAttackDueToLeerText cp SUBSTATUS2_LEER jr z, .return_with_cant_attack - text_hl UnableToAttackDueToBoneAttackText + ldtx hl, UnableToAttackDueToBoneAttackText cp SUBSTATUS2_BONE_ATTACK jr z, .return_with_cant_attack or a @@ -6762,7 +6762,7 @@ HandleAmnesiaSubstatus: ; 33e1 (0:33e1) ld a, [wSelectedMoveIndex] cp [hl] jr nz, .not_the_disabled_move - text_hl UnableToUseAttackDueToAmnesiaText + ldtx hl, UnableToUseAttackDueToAmnesiaText scf ret @@ -6774,7 +6774,7 @@ HandleSandAttackOrSmokescreenSubstatus: ; 3400 (0:3400) ld [wcc0a], a ccf ret nc - text_hl AttackUnsuccessfulText + ldtx hl, AttackUnsuccessfulText call DrawWideTextBox_WaitForInput scf ret @@ -6785,10 +6785,10 @@ CheckSandAttackOrSmokescreenSubstatus: ; 3414 (0:3414) call GetTurnDuelistVariable or a ret z - text_de SandAttackCheckText + ldtx de, SandAttackCheckText cp SUBSTATUS2_SAND_ATTACK jr z, .card_is_affected - text_de SmokescreenCheckText + ldtx de, SmokescreenCheckText cp SUBSTATUS2_SMOKESCREEN jr z, .card_is_affected or a @@ -6812,15 +6812,15 @@ HandleNoDamageOrEffectSubstatus: ; 3432 (0:3432) ld a, DUELVARS_ARENA_CARD_SUBSTATUS1 call GetTurnDuelistVariable ld e, NO_DAMAGE_OR_EFFECT_FLY - text_hl NoDamageOrEffectDueToFlyText + ldtx hl, NoDamageOrEffectDueToFlyText cp SUBSTATUS1_FLY jr z, .no_damage_or_effect ld e, NO_DAMAGE_OR_EFFECT_BARRIER - text_hl NoDamageOrEffectDueToBarrierText + ldtx hl, NoDamageOrEffectDueToBarrierText cp SUBSTATUS1_BARRIER jr z, .no_damage_or_effect ld e, NO_DAMAGE_OR_EFFECT_AGILITY - text_hl NoDamageOrEffectDueToAgilityText + ldtx hl, NoDamageOrEffectDueToAgilityText cp SUBSTATUS1_AGILITY jr z, .no_damage_or_effect call CheckIfUnderAnyCannotUseStatus @@ -6848,7 +6848,7 @@ HandleNoDamageOrEffectSubstatus: ; 3432 (0:3432) or a ret z ld e, NO_DAMAGE_OR_EFFECT_NSHIELD - text_hl NoDamageOrEffectDueToNShieldText + ldtx hl, NoDamageOrEffectDueToNShieldText jr .no_damage_or_effect ; if the Pokemon being attacked is Haunter1, and its Transparency is active, @@ -6869,12 +6869,12 @@ HandleTransparency: ; 348a (0:348a) jr c, .asm_3491 xor a ld [wcac2], a - text_de TransparencyCheckText + ldtx de, TransparencyCheckText call TossCoin ret nc ld a, NO_DAMAGE_OR_EFFECT_TRANSPARENCY ld [wNoDamageOrEffect], a - text_hl NoDamageOrEffectDueToTransparencyText + ldtx hl, NoDamageOrEffectDueToTransparencyText scf ret ; 0x34b7 @@ -6936,13 +6936,13 @@ CheckIfUnderAnyCannotUseStatus2: ; 34f0 (0:34f0) ld a, DUELVARS_ARENA_CARD_STATUS call GetTurnDuelistVariable and PASSIVE_STATUS_MASK - text_hl CannotUseDueToStatusText + ldtx hl, CannotUseDueToStatusText scf jr nz, .done ; return carry .check_toxic_gas ld a, MUK call Func_3509 - text_hl UnableDueToToxicGasText + ldtx hl, UnableDueToToxicGasText .done ret @@ -7084,7 +7084,7 @@ HandleDestinyBondSubstatus: ; 363b (0:363b) ld h, [hl] ld l, a call Func_2ebb - text_hl KnockedOutDueToDestinyBondText + ldtx hl, KnockedOutDueToDestinyBondText call DrawWideTextBox_WaitForInput ret ; 0x367b @@ -7130,7 +7130,7 @@ ApplyStrikesBack: ; 36a2 (0:36a2) push af push hl call SubstractHP - text_hl ReceivesDamageDueToStrikesBackText + ldtx hl, ReceivesDamageDueToStrikesBackText call DrawWideTextBox_PrintText pop hl pop af |