summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rwxr-xr-xengine/battle/animations.asm8
-rw-r--r--engine/battle/battle_transitions.asm2
-rw-r--r--engine/battle/common_text.asm64
-rwxr-xr-xengine/battle/core.asm343
-rw-r--r--engine/battle/display_effectiveness.asm8
-rw-r--r--engine/battle/effects.asm128
-rwxr-xr-xengine/battle/end_of_battle.asm4
-rw-r--r--engine/battle/experience.asm20
-rw-r--r--engine/battle/move_effects/conversion.asm4
-rw-r--r--engine/battle/move_effects/drain_hp.asm8
-rw-r--r--engine/battle/move_effects/focus_energy.asm6
-rw-r--r--engine/battle/move_effects/haze.asm4
-rw-r--r--engine/battle/move_effects/heal.asm12
-rw-r--r--engine/battle/move_effects/leech_seed.asm8
-rw-r--r--engine/battle/move_effects/mist.asm4
-rw-r--r--engine/battle/move_effects/pay_day.asm4
-rw-r--r--engine/battle/move_effects/recoil.asm4
-rw-r--r--engine/battle/move_effects/reflect_light_screen.asm8
-rw-r--r--engine/battle/move_effects/substitute.asm12
-rw-r--r--engine/battle/move_effects/transform.asm4
-rwxr-xr-xengine/battle/safari_zone.asm8
-rw-r--r--engine/battle/trainer_ai.asm12
-rwxr-xr-xengine/events/card_key.asm14
-rwxr-xr-xengine/events/cinnabar_lab.asm16
-rwxr-xr-xengine/events/diploma.asm6
-rwxr-xr-xengine/events/elevator.asm4
-rwxr-xr-xengine/events/give_pokemon.asm14
-rwxr-xr-xengine/events/hidden_items.asm22
-rw-r--r--engine/events/hidden_objects/bench_guys.asm68
-rw-r--r--engine/events/hidden_objects/bills_house_pc.asm22
-rw-r--r--engine/events/hidden_objects/blues_room.asm4
-rw-r--r--engine/events/hidden_objects/book_or_sculpture.asm10
-rw-r--r--engine/events/hidden_objects/bookshelves.asm2
-rw-r--r--engine/events/hidden_objects/cinnabar_gym_quiz.asm44
-rw-r--r--engine/events/hidden_objects/elevator.asm4
-rw-r--r--engine/events/hidden_objects/fighting_dojo.asm12
-rw-r--r--engine/events/hidden_objects/gym_statues.asm10
-rw-r--r--engine/events/hidden_objects/indigo_plateau_hq.asm6
-rw-r--r--engine/events/hidden_objects/indigo_plateau_statues.asm14
-rw-r--r--engine/events/hidden_objects/magazines.asm4
-rw-r--r--engine/events/hidden_objects/museum_fossils.asm8
-rw-r--r--engine/events/hidden_objects/new_bike.asm4
-rw-r--r--engine/events/hidden_objects/oaks_lab_email.asm6
-rw-r--r--engine/events/hidden_objects/oaks_lab_posters.asm12
-rw-r--r--engine/events/hidden_objects/pokecenter_pc.asm6
-rw-r--r--engine/events/hidden_objects/pokemon_stuff.asm4
-rw-r--r--engine/events/hidden_objects/reds_room.asm6
-rw-r--r--engine/events/hidden_objects/route_15_binoculars.asm6
-rw-r--r--engine/events/hidden_objects/safari_game.asm10
-rw-r--r--engine/events/hidden_objects/school_blackboard.asm56
-rw-r--r--engine/events/hidden_objects/school_notebooks.asm34
-rw-r--r--engine/events/hidden_objects/town_map.asm6
-rw-r--r--engine/events/hidden_objects/vermilion_gym_trash.asm22
-rwxr-xr-xengine/events/in_game_trades.asm75
-rwxr-xr-xengine/events/oaks_aide.asm26
-rw-r--r--engine/events/pick_up_item.asm10
-rwxr-xr-xengine/events/pokecenter.asm28
-rwxr-xr-xengine/events/pokedex_rating.asm68
-rwxr-xr-xengine/events/pokemart.asm44
-rwxr-xr-xengine/events/prize_menu.asm42
-rwxr-xr-xengine/events/vending_machine.asm20
-rwxr-xr-xengine/items/item_effects.asm198
-rwxr-xr-xengine/items/tmhm.asm4
-rwxr-xr-xengine/link/cable_club.asm4
-rwxr-xr-xengine/link/cable_club_npc.asm30
-rw-r--r--engine/menus/display_text_id_init.asm4
-rwxr-xr-xengine/menus/league_pc.asm4
-rwxr-xr-xengine/menus/main_menu.asm18
-rwxr-xr-xengine/menus/naming_screen.asm4
-rwxr-xr-xengine/menus/oaks_pc.asm14
-rwxr-xr-xengine/menus/party_menu.asm60
-rwxr-xr-xengine/menus/pc.asm16
-rwxr-xr-xengine/menus/players_pc.asm56
-rwxr-xr-xengine/menus/pokedex.asm10
-rwxr-xr-xengine/menus/save.asm24
-rwxr-xr-xengine/menus/start_sub_menus.asm32
-rw-r--r--engine/menus/text_box.asm8
-rwxr-xr-xengine/movie/credits.asm14
-rwxr-xr-xengine/movie/hall_of_fame.asm8
-rwxr-xr-xengine/movie/intro.asm6
-rwxr-xr-xengine/movie/oak_speech/clear_save.asm4
-rwxr-xr-xengine/movie/oak_speech/oak_speech.asm28
-rwxr-xr-xengine/movie/oak_speech/oak_speech2.asm12
-rwxr-xr-xengine/movie/title.asm2
-rwxr-xr-xengine/movie/trade.asm32
-rwxr-xr-xengine/movie/trade2.asm5
-rwxr-xr-xengine/overworld/auto_movement.asm6
-rw-r--r--engine/overworld/clear_variables.asm2
-rwxr-xr-xengine/overworld/cut.asm14
-rwxr-xr-xengine/overworld/dust_smoke.asm2
-rwxr-xr-xengine/overworld/emotion_bubbles.asm2
-rw-r--r--engine/overworld/field_move_messages.asm16
-rwxr-xr-xengine/overworld/hidden_objects.asm12
-rwxr-xr-xengine/overworld/ledges.asm2
-rwxr-xr-xengine/overworld/map_sprites.asm22
-rw-r--r--engine/overworld/missable_objects.asm14
-rw-r--r--engine/overworld/movement.asm50
-rw-r--r--engine/overworld/pathfinding.asm6
-rwxr-xr-xengine/overworld/player_animations.asm48
-rw-r--r--engine/overworld/player_state.asm12
-rw-r--r--engine/overworld/push_boulder.asm4
-rw-r--r--engine/overworld/sprite_collisions.asm6
-rwxr-xr-xengine/overworld/trainer_sight.asm28
-rw-r--r--engine/pokemon/bills_pc.asm68
-rwxr-xr-xengine/pokemon/evos_moves.asm16
-rwxr-xr-xengine/pokemon/learn_move.asm42
-rw-r--r--engine/pokemon/remove_mon.asm66
-rwxr-xr-xengine/pokemon/status_screen.asm21
-rwxr-xr-xengine/slots/game_corner_slots.asm12
-rwxr-xr-xengine/slots/game_corner_slots2.asm10
-rwxr-xr-xengine/slots/slot_machine.asm40
111 files changed, 1290 insertions, 1272 deletions
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index ee476ce9..78301b2e 100755
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -1838,10 +1838,10 @@ AnimationWavyScreen:
call Delay3
xor a
ld [hAutoBGTransferEnabled], a
- ld a, SCREEN_HEIGHT_PIXELS
+ ld a, SCREEN_HEIGHT_PX
ld [hWY], a
ld d, $80 ; terminator
- ld e, SCREEN_HEIGHT_PIXELS - 1
+ ld e, SCREEN_HEIGHT_PX - 1
ld c, $ff
ld hl, WavyScreenLineOffsets
.loop
@@ -2538,7 +2538,7 @@ AnimationShakeEnemyHUD:
; 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 a, SCREEN_HEIGHT_PX
ld [hWY], a
; Copy wTileMap to VRAM such that the row below the enemy HUD (in wTileMap) is
@@ -2575,7 +2575,7 @@ AnimationShakeEnemyHUD:
; Restore the original graphics.
call AnimationShowMonPic
call ClearSprites
- ld a, SCREEN_HEIGHT_PIXELS
+ ld a, SCREEN_HEIGHT_PX
ld [hWY], a
ld hl, vBGMap1
call BattleAnimCopyTileMapToVRAM
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index 98e87dc0..548e85fb 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -10,7 +10,7 @@ BattleTransition:
; Determine which OAM block is being used by the enemy trainer sprite (if there
; is one).
- ld hl, wSpriteStateData1 + 2
+ ld hl, wSpritePlayerStateData1ImageIndex
ld a, [hSpriteIndexOrTextID] ; enemy trainer sprite index (0 if wild battle)
ld c, a
ld b, 0
diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm
index e8998414..1cb455f3 100644
--- a/engine/battle/common_text.asm
+++ b/engine/battle/common_text.asm
@@ -71,28 +71,28 @@ PrintBeginningBattleText:
ret
WildMonAppearedText:
- TX_FAR _WildMonAppearedText
- db "@"
+ text_far _WildMonAppearedText
+ text_end
HookedMonAttackedText:
- TX_FAR _HookedMonAttackedText
- db "@"
+ text_far _HookedMonAttackedText
+ text_end
EnemyAppearedText:
- TX_FAR _EnemyAppearedText
- db "@"
+ text_far _EnemyAppearedText
+ text_end
TrainerWantsToFightText:
- TX_FAR _TrainerWantsToFightText
- db "@"
+ text_far _TrainerWantsToFightText
+ text_end
UnveiledGhostText:
- TX_FAR _UnveiledGhostText
- db "@"
+ text_far _UnveiledGhostText
+ text_end
GhostCantBeIDdText:
- TX_FAR _GhostCantBeIDdText
- db "@"
+ text_far _GhostCantBeIDdText
+ text_end
PrintSendOutMonMessage:
ld hl, wEnemyMonHP
@@ -138,39 +138,39 @@ PrintSendOutMonMessage:
jp PrintText
GoText:
- TX_FAR _GoText
- TX_ASM
+ text_far _GoText
+ text_asm
jr PrintPlayerMon1Text
DoItText:
- TX_FAR _DoItText
- TX_ASM
+ text_far _DoItText
+ text_asm
jr PrintPlayerMon1Text
GetmText:
- TX_FAR _GetmText
- TX_ASM
+ text_far _GetmText
+ text_asm
jr PrintPlayerMon1Text
EnemysWeakText:
- TX_FAR _EnemysWeakText
- TX_ASM
+ text_far _EnemysWeakText
+ text_asm
PrintPlayerMon1Text:
ld hl, PlayerMon1Text
ret
PlayerMon1Text:
- TX_FAR _PlayerMon1Text
- db "@"
+ text_far _PlayerMon1Text
+ text_end
RetreatMon:
ld hl, PlayerMon2Text
jp PrintText
PlayerMon2Text:
- TX_FAR _PlayerMon2Text
- TX_ASM
+ text_far _PlayerMon2Text
+ text_asm
push de
push bc
ld hl, wEnemyMonHP + 1
@@ -220,18 +220,18 @@ PlayerMon2Text:
ret
EnoughText:
- TX_FAR _EnoughText
- TX_ASM
+ text_far _EnoughText
+ text_asm
jr PrintComeBackText
OKExclamationText:
- TX_FAR _OKExclamationText
- TX_ASM
+ text_far _OKExclamationText
+ text_asm
jr PrintComeBackText
GoodText:
- TX_FAR _GoodText
- TX_ASM
+ text_far _GoodText
+ text_asm
jr PrintComeBackText
PrintComeBackText:
@@ -239,5 +239,5 @@ PrintComeBackText:
ret
ComeBackText:
- TX_FAR _ComeBackText
- db "@"
+ text_far _ComeBackText
+ text_end
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 6881aef5..935764aa 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -207,8 +207,8 @@ StartBattle:
jr EnemyRan ; if b was greater than the random value, the enemy runs
.outOfSafariBallsText
- TX_FAR _OutOfSafariBallsText
- db "@"
+ text_far _OutOfSafariBallsText
+ text_end
.playerSendOutFirstMon
xor a
@@ -270,12 +270,12 @@ EnemyRan:
jpab AnimationSlideEnemyMonOff
WildRanText:
- TX_FAR _WildRanText
- db "@"
+ text_far _WildRanText
+ text_end
EnemyRanText:
- TX_FAR _EnemyRanText
- db "@"
+ text_far _EnemyRanText
+ text_end
MainInBattleLoop:
call ReadPlayerMonCurHPAndStatus
@@ -532,16 +532,16 @@ HandlePoisonBurnLeechSeed:
ret
HurtByPoisonText:
- TX_FAR _HurtByPoisonText
- db "@"
+ text_far _HurtByPoisonText
+ text_end
HurtByBurnText:
- TX_FAR _HurtByBurnText
- db "@"
+ text_far _HurtByBurnText
+ text_end
HurtByLeechSeedText:
- TX_FAR _HurtByLeechSeedText
- db "@"
+ text_far _HurtByLeechSeedText
+ text_end
; decreases the mon's current HP by 1/16 of the Max HP (multiplied by number of toxic ticks if active)
; note that the toxic ticks are considered even if the damage is not poison (hence the Leech Seed glitch)
@@ -858,8 +858,8 @@ FaintEnemyPokemon:
jpab GainExperience
EnemyMonFaintedText:
- TX_FAR _EnemyMonFaintedText
- db "@"
+ text_far _EnemyMonFaintedText
+ text_end
EndLowHealthAlarm:
; This function is called when the player has the won the battle. It turns off
@@ -949,12 +949,12 @@ TrainerBattleVictory:
predef_jump AddBCDPredef
MoneyForWinningText:
- TX_FAR _MoneyForWinningText
- db "@"
+ text_far _MoneyForWinningText
+ text_end
TrainerDefeatedText:
- TX_FAR _TrainerDefeatedText
- db "@"
+ text_far _TrainerDefeatedText
+ text_end
PlayBattleVictoryMusic:
push af
@@ -1044,8 +1044,8 @@ RemoveFaintedPlayerMon:
jp PrintText
PlayerMonFaintedText:
- TX_FAR _PlayerMonFaintedText
- db "@"
+ text_far _PlayerMonFaintedText
+ text_end
; asks if you want to use next mon
; stores whether you ran in C flag
@@ -1078,8 +1078,8 @@ DoUseNextMonDialogue:
jp TryRunningFromBattle
UseNextMonText:
- TX_FAR _UseNextMonText
- db "@"
+ text_far _UseNextMonText
+ text_end
; choose next player mon to send out
; stores whether enemy mon has no HP left in Z flag
@@ -1165,16 +1165,16 @@ HandlePlayerBlackOut:
ret
Sony1WinText:
- TX_FAR _Sony1WinText
- db "@"
+ text_far _Sony1WinText
+ text_end
PlayerBlackedOutText2:
- TX_FAR _PlayerBlackedOutText2
- db "@"
+ text_far _PlayerBlackedOutText2
+ text_end
LinkBattleLostText:
- TX_FAR _LinkBattleLostText
- db "@"
+ text_far _LinkBattleLostText
+ text_end
; slides pic of fainted mon downwards until it disappears
; bug: when this is called, [hAutoBGTransferEnabled] is non-zero, so there is screen tearing
@@ -1442,12 +1442,12 @@ EnemySendOutFirstMon:
jp SwitchPlayerMon
TrainerAboutToUseText:
- TX_FAR _TrainerAboutToUseText
- db "@"
+ text_far _TrainerAboutToUseText
+ text_end
TrainerSentOutText:
- TX_FAR _TrainerSentOutText
- db "@"
+ text_far _TrainerSentOutText
+ text_end
; tests if the player has any pokemon that are not fainted
; sets d = 0 if all fainted, d != 0 if some mons are still alive
@@ -1487,8 +1487,8 @@ HasMonFainted:
ret
NoWillText:
- TX_FAR _NoWillText
- db "@"
+ text_far _NoWillText
+ text_end
; try to run from battle (hl = player speed, de = enemy speed)
; stores whether the attempt was successful in carry flag
@@ -1610,16 +1610,16 @@ TryRunningFromBattle:
ret
CantEscapeText:
- TX_FAR _CantEscapeText
- db "@"
+ text_far _CantEscapeText
+ text_end
NoRunningText:
- TX_FAR _NoRunningText
- db "@"
+ text_far _NoRunningText
+ text_end
GotAwayText:
- TX_FAR _GotAwayText
- db "@"
+ text_far _GotAwayText
+ text_end
; copies from party data to battle mon data when sending out a new player mon
LoadBattleMonFromParty:
@@ -2289,8 +2289,8 @@ UseBagItem:
ret
ItemsCantBeUsedHereText:
- TX_FAR _ItemsCantBeUsedHereText
- db "@"
+ text_far _ItemsCantBeUsedHereText
+ text_end
PartyMenuOrRockOrRun:
dec a ; was Run selected?
@@ -2434,8 +2434,8 @@ SwitchPlayerMon:
ret
AlreadyOutText:
- TX_FAR _AlreadyOutText
- db "@"
+ text_far _AlreadyOutText
+ text_end
BattleMenu_RunWasSelected:
call LoadScreenTilesFromBuffer1
@@ -2667,12 +2667,12 @@ SelectMenuItem:
jp MoveSelectionMenu
MoveNoPPText:
- TX_FAR _MoveNoPPText
- db "@"
+ text_far _MoveNoPPText
+ text_end
MoveDisabledText:
- TX_FAR _MoveDisabledText
- db "@"
+ text_far _MoveDisabledText
+ text_end
WhichTechniqueString:
db "WHICH TECHNIQUE?@"
@@ -2744,8 +2744,8 @@ AnyMoveToSelect:
ret
NoMovesLeftText:
- TX_FAR _NoMovesLeftText
- db "@"
+ text_far _NoMovesLeftText
+ text_end
SwapMovesInMenu:
ld a, [wMenuItemToSwap]
@@ -3239,8 +3239,8 @@ MirrorMoveCheck:
jp ExecutePlayerMoveDone
MultiHitText:
- TX_FAR _MultiHitText
- db "@"
+ text_far _MultiHitText
+ text_end
ExecutePlayerMoveDone:
xor a
@@ -3269,12 +3269,12 @@ PrintGhostText:
ret
ScaredText:
- TX_FAR _ScaredText
- db "@"
+ text_far _ScaredText
+ text_end
GetOutText:
- TX_FAR _GetOutText
- db "@"
+ text_far _GetOutText
+ text_end
IsGhostBattle:
ld a, [wIsInBattle]
@@ -3557,64 +3557,64 @@ CheckPlayerStatusConditions:
ret
FastAsleepText:
- TX_FAR _FastAsleepText
- db "@"
+ text_far _FastAsleepText
+ text_end
WokeUpText:
- TX_FAR _WokeUpText
- db "@"
+ text_far _WokeUpText
+ text_end
IsFrozenText:
- TX_FAR _IsFrozenText
- db "@"
+ text_far _IsFrozenText
+ text_end
FullyParalyzedText:
- TX_FAR _FullyParalyzedText
- db "@"
+ text_far _FullyParalyzedText
+ text_end
FlinchedText:
- TX_FAR _FlinchedText
- db "@"
+ text_far _FlinchedText
+ text_end
MustRechargeText:
- TX_FAR _MustRechargeText
- db "@"
+ text_far _MustRechargeText
+ text_end
DisabledNoMoreText:
- TX_FAR _DisabledNoMoreText
- db "@"
+ text_far _DisabledNoMoreText
+ text_end
IsConfusedText:
- TX_FAR _IsConfusedText
- db "@"
+ text_far _IsConfusedText
+ text_end
HurtItselfText:
- TX_FAR _HurtItselfText
- db "@"
+ text_far _HurtItselfText
+ text_end
ConfusedNoMoreText:
- TX_FAR _ConfusedNoMoreText
- db "@"
+ text_far _ConfusedNoMoreText
+ text_end
SavingEnergyText:
- TX_FAR _SavingEnergyText
- db "@"
+ text_far _SavingEnergyText
+ text_end
UnleashedEnergyText:
- TX_FAR _UnleashedEnergyText
- db "@"
+ text_far _UnleashedEnergyText
+ text_end
ThrashingAboutText:
- TX_FAR _ThrashingAboutText
- db "@"
+ text_far _ThrashingAboutText
+ text_end
AttackContinuesText:
- TX_FAR _AttackContinuesText
- db "@"
+ text_far _AttackContinuesText
+ text_end
CantMoveText:
- TX_FAR _CantMoveText
- db "@"
+ text_far _CantMoveText
+ text_end
PrintMoveIsDisabledText:
ld hl, wPlayerSelectedMove
@@ -3635,8 +3635,8 @@ PrintMoveIsDisabledText:
jp PrintText
MoveIsDisabledText:
- TX_FAR _MoveIsDisabledText
- db "@"
+ text_far _MoveIsDisabledText
+ text_end
HandleSelfConfusionDamage:
ld hl, HurtItselfText
@@ -3692,8 +3692,8 @@ PrintMonName1Text:
; this likely had to do with Japanese grammar that got translated,
; but the functionality didn't get removed
MonName1Text:
- TX_FAR _MonName1Text
- TX_ASM
+ text_far _MonName1Text
+ text_asm
ld a, [hWhoseTurn]
and a
ld a, [wPlayerMoveNum]
@@ -3717,13 +3717,13 @@ MonName1Text:
ret
Used1Text:
- TX_FAR _Used1Text
- TX_ASM
+ text_far _Used1Text
+ text_asm
jr PrintInsteadText
Used2Text:
- TX_FAR _Used2Text
- TX_ASM
+ text_far _Used2Text
+ text_asm
; fall through
PrintInsteadText:
@@ -3734,8 +3734,8 @@ PrintInsteadText:
ret
InsteadText:
- TX_FAR _InsteadText
- TX_ASM
+ text_far _InsteadText
+ text_asm
; fall through
PrintMoveName:
@@ -3743,8 +3743,8 @@ PrintMoveName:
ret
_PrintMoveName:
- TX_FAR _CF4BText
- TX_ASM
+ text_far _CF4BText
+ text_asm
ld hl, ExclamationPointPointerTable
ld a, [wd11e] ; exclamation point num
add a
@@ -3766,24 +3766,24 @@ ExclamationPointPointerTable:
dw ExclamationPoint5Text
ExclamationPoint1Text:
- TX_FAR _ExclamationPoint1Text
- db "@"
+ text_far _ExclamationPoint1Text
+ text_end
ExclamationPoint2Text:
- TX_FAR _ExclamationPoint2Text
- db "@"
+ text_far _ExclamationPoint2Text
+ text_end
ExclamationPoint3Text:
- TX_FAR _ExclamationPoint3Text
- db "@"
+ text_far _ExclamationPoint3Text
+ text_end
ExclamationPoint4Text:
- TX_FAR _ExclamationPoint4Text
- db "@"
+ text_far _ExclamationPoint4Text
+ text_end
ExclamationPoint5Text:
- TX_FAR _ExclamationPoint5Text
- db "@"
+ text_far _ExclamationPoint5Text
+ text_end
; this function does nothing useful
; if the move being used is in set [1-4] from ExclamationPointMoveSets,
@@ -3874,24 +3874,24 @@ PrintMoveFailureText:
jp ApplyDamageToEnemyPokemon
AttackMissedText:
- TX_FAR _AttackMissedText
- db "@"
+ text_far _AttackMissedText
+ text_end
KeptGoingAndCrashedText:
- TX_FAR _KeptGoingAndCrashedText
- db "@"
+ text_far _KeptGoingAndCrashedText
+ text_end
UnaffectedText:
- TX_FAR _UnaffectedText
- db "@"
+ text_far _UnaffectedText
+ text_end
PrintDoesntAffectText:
ld hl, DoesntAffectMonText
jp PrintText
DoesntAffectMonText:
- TX_FAR _DoesntAffectMonText
- db "@"
+ text_far _DoesntAffectMonText
+ text_end
; if there was a critical hit or an OHKO was successful, print the corresponding text
PrintCriticalOHKOText:
@@ -3919,12 +3919,12 @@ CriticalOHKOTextPointers:
dw OHKOText
CriticalHitText:
- TX_FAR _CriticalHitText
- db "@"
+ text_far _CriticalHitText
+ text_end
OHKOText:
- TX_FAR _OHKOText
- db "@"
+ text_far _OHKOText
+ text_end
; checks if a traded mon will disobey due to lack of badges
; stores whether the mon will use a move in Z flag
@@ -4108,24 +4108,24 @@ CheckForDisobedience:
ret
LoafingAroundText:
- TX_FAR _LoafingAroundText
- db "@"
+ text_far _LoafingAroundText
+ text_end
BeganToNapText:
- TX_FAR _BeganToNapText
- db "@"
+ text_far _BeganToNapText
+ text_end
WontObeyText:
- TX_FAR _WontObeyText
- db "@"
+ text_far _WontObeyText
+ text_end
TurnedAwayText:
- TX_FAR _TurnedAwayText
- db "@"
+ text_far _TurnedAwayText
+ text_end
IgnoredOrdersText:
- TX_FAR _IgnoredOrdersText
- db "@"
+ text_far _IgnoredOrdersText
+ text_end
; sets b, c, d, and e for the CalculateDamage routine in the case of an attack by the player mon
GetDamageVarsForPlayerAttack:
@@ -4485,37 +4485,42 @@ CalculateDamage:
ld b, 4
call Divide
+; Update wCurDamage.
+; Capped at MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE: 999 - 2 = 997.
ld hl, wDamage
ld b, [hl]
ld a, [hQuotient + 3]
add b
ld [hQuotient + 3], a
- jr nc, .asm_3dfd0
+ jr nc, .dont_cap_1
ld a, [hQuotient + 2]
inc a
ld [hQuotient + 2], a
and a
- jr z, .asm_3e004
+ jr z, .cap
-.asm_3dfd0
+.dont_cap_1
ld a, [hQuotient]
ld b, a
ld a, [hQuotient + 1]
or a
- jr nz, .asm_3e004
+ jr nz, .cap
ld a, [hQuotient + 2]
- cp 998 / $100
- jr c, .asm_3dfe8
- cp 998 / $100 + 1
- jr nc, .asm_3e004
+ cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100
+ jr c, .dont_cap_2
+
+ cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + 1
+ jr nc, .cap
+
ld a, [hQuotient + 3]
- cp 998 % $100
- jr nc, .asm_3e004
+ cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) % $100
+ jr nc, .cap
-.asm_3dfe8
+.dont_cap_2
inc hl
+
ld a, [hQuotient + 3]
ld b, [hl]
add b
@@ -4525,36 +4530,37 @@ CalculateDamage:
ld b, [hl]
adc b
ld [hl], a
- jr c, .asm_3e004
+ jr c, .cap
ld a, [hl]
- cp 998 / $100
- jr c, .asm_3e00a
- cp 998 / $100 + 1
- jr nc, .asm_3e004
+ cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100
+ jr c, .dont_cap_3
+
+ cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + 1
+ jr nc, .cap
+
inc hl
ld a, [hld]
- cp 998 % $100
- jr c, .asm_3e00a
+ cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) % $100
+ jr c, .dont_cap_3
-.asm_3e004
-; cap at 997
- ld a, 997 / $100
+.cap
+ ld a, (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) / $100
ld [hli], a
- ld a, 997 % $100
+ ld a, (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) % $100
ld [hld], a
-.asm_3e00a
-; add 2
+.dont_cap_3
+; Add back MIN_NEUTRAL_DAMAGE (capping at 999).
inc hl
ld a, [hl]
- add 2
+ add MIN_NEUTRAL_DAMAGE
ld [hld], a
- jr nc, .done
+ jr nc, .dont_floor
inc [hl]
+.dont_floor
-.done
-; minimum damage is 1
+; Returns nz and nc.
ld a, 1
and a
ret
@@ -4997,12 +5003,12 @@ AttackSubstitute:
jp DrawHUDsAndHPBars
SubstituteTookDamageText:
- TX_FAR _SubstituteTookDamageText
- db "@"
+ text_far _SubstituteTookDamageText
+ text_end
SubstituteBrokeText:
- TX_FAR _SubstituteBrokeText
- db "@"
+ text_far _SubstituteBrokeText
+ text_end
; this function raises the attack modifier of a pokemon using Rage when that pokemon is attacked
HandleBuildingRage:
@@ -5048,8 +5054,8 @@ HandleBuildingRage:
ret
BuildingRageText:
- TX_FAR _BuildingRageText
- db "@"
+ text_far _BuildingRageText
+ text_end
; copy last move for Mirror Move
; sets zero flag on failure and unsets zero flag on success
@@ -5084,8 +5090,8 @@ MirrorMoveCopyMove:
ret
MirrorMoveFailedText:
- TX_FAR _MirrorMoveFailedText
- db "@"
+ text_far _MirrorMoveFailedText
+ text_end
; function used to reload move data for moves like Mirror Move and Metronome
ReloadMoveData:
@@ -5759,8 +5765,8 @@ EnemyCheckIfMirrorMoveEffect:
jr ExecuteEnemyMoveDone
HitXTimesText:
- TX_FAR _HitXTimesText
- db "@"
+ text_far _HitXTimesText
+ text_end
ExecuteEnemyMoveDone:
ld b, $1
@@ -6626,6 +6632,7 @@ LoadHudTilePatterns:
PrintEmptyString:
ld hl, .emptyString
jp PrintText
+
.emptyString
db "@"
diff --git a/engine/battle/display_effectiveness.asm b/engine/battle/display_effectiveness.asm
index 1bf14460..b23695cf 100644
--- a/engine/battle/display_effectiveness.asm
+++ b/engine/battle/display_effectiveness.asm
@@ -10,9 +10,9 @@ DisplayEffectiveness:
jp PrintText
SuperEffectiveText:
- TX_FAR _SuperEffectiveText
- db "@"
+ text_far _SuperEffectiveText
+ text_end
NotVeryEffectiveText:
- TX_FAR _NotVeryEffectiveText
- db "@"
+ text_far _NotVeryEffectiveText
+ text_end
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index 0a1eb61c..22fadb42 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -68,12 +68,12 @@ SleepEffect:
jp PrintDidntAffectText
FellAsleepText:
- TX_FAR _FellAsleepText
- db "@"
+ text_far _FellAsleepText
+ text_end
AlreadyAsleepText:
- TX_FAR _AlreadyAsleepText
- db "@"
+ text_far _AlreadyAsleepText
+ text_end
PoisonEffect:
ld hl, wEnemyMonStatus
@@ -162,12 +162,12 @@ PoisonEffect:
jp PrintDidntAffectText
PoisonedText:
- TX_FAR _PoisonedText
- db "@"
+ text_far _PoisonedText
+ text_end
BadlyPoisonedText:
- TX_FAR _BadlyPoisonedText
- db "@"
+ text_far _BadlyPoisonedText
+ text_end
DrainHPEffect:
jpab DrainHPEffect_
@@ -297,12 +297,12 @@ opponentAttacker:
jp PrintText
BurnedText:
- TX_FAR _BurnedText
- db "@"
+ text_far _BurnedText
+ text_end
FrozenText:
- TX_FAR _FrozenText
- db "@"
+ text_far _FrozenText
+ text_end
CheckDefrost:
; any fire-type move that has a chance inflict burn (all but Fire Spin) will defrost a frozen target
@@ -340,8 +340,8 @@ CheckDefrost:
jp PrintText
FireDefrostedText:
- TX_FAR _FireDefrostedText
- db "@"
+ text_far _FireDefrostedText
+ text_end
StatModifierUpEffect:
ld hl, wPlayerMonStatMods
@@ -508,8 +508,8 @@ PrintNothingHappenedText:
jp PrintText
MonsStatsRoseText:
- TX_FAR _MonsStatsRoseText
- TX_ASM
+ text_far _MonsStatsRoseText
+ text_asm
ld hl, GreatlyRoseText
ld a, [hWhoseTurn]
and a
@@ -523,12 +523,12 @@ MonsStatsRoseText:
ret
GreatlyRoseText:
- TX_DELAY
- TX_FAR _GreatlyRoseText
+ text_pause
+ text_far _GreatlyRoseText
; fallthrough
RoseText:
- TX_FAR _RoseText
- db "@"
+ text_far _RoseText
+ text_end
StatModifierDownEffect:
ld hl, wEnemyMonStatMods
@@ -710,8 +710,8 @@ MoveMissed:
jp ConditionalPrintButItFailed
MonsStatsFellText:
- TX_FAR _MonsStatsFellText
- TX_ASM
+ text_far _MonsStatsFellText
+ text_asm
ld hl, FellText
ld a, [hWhoseTurn]
and a
@@ -728,12 +728,12 @@ MonsStatsFellText:
ret
GreatlyFellText:
- TX_DELAY
- TX_FAR _GreatlyFellText
+ text_pause
+ text_far _GreatlyFellText
; fallthrough
FellText:
- TX_FAR _FellText
- db "@"
+ text_far _FellText
+ text_end
PrintStatText:
ld hl, StatsTextStrings
@@ -905,16 +905,16 @@ SwitchAndTeleportEffect:
jp PrintText
RanFromBattleText:
- TX_FAR _RanFromBattleText
- db "@"
+ text_far _RanFromBattleText
+ text_end
RanAwayScaredText:
- TX_FAR _RanAwayScaredText
- db "@"
+ text_far _RanAwayScaredText
+ text_end
WasBlownAwayText:
- TX_FAR _WasBlownAwayText
- db "@"
+ text_far _WasBlownAwayText
+ text_end
TwoToFiveAttacksEffect:
ld hl, wPlayerBattleStatus1
@@ -1024,8 +1024,8 @@ ChargeEffect:
jp PrintText
ChargeMoveEffectText:
- TX_FAR _ChargeMoveEffectText
- TX_ASM
+ text_far _ChargeMoveEffectText
+ text_asm
ld a, [wChargeMoveNum]
cp RAZOR_WIND
ld hl, MadeWhirlwindText
@@ -1048,28 +1048,28 @@ ChargeMoveEffectText:
ret
MadeWhirlwindText:
- TX_FAR _MadeWhirlwindText
- db "@"
+ text_far _MadeWhirlwindText
+ text_end
TookInSunlightText:
- TX_FAR _TookInSunlightText
- db "@"
+ text_far _TookInSunlightText
+ text_end
LoweredItsHeadText:
- TX_FAR _LoweredItsHeadText
- db "@"
+ text_far _LoweredItsHeadText
+ text_end
SkyAttackGlowingText:
- TX_FAR _SkyAttackGlowingText
- db "@"
+ text_far _SkyAttackGlowingText
+ text_end
FlewUpHighText:
- TX_FAR _FlewUpHighText
- db "@"
+ text_far _FlewUpHighText
+ text_end
DugAHoleText:
- TX_FAR _DugAHoleText
- db "@"
+ text_far _DugAHoleText
+ text_end
TrappingEffect:
ld hl, wPlayerBattleStatus1
@@ -1146,8 +1146,8 @@ ConfusionSideEffectSuccess:
jp PrintText
BecameConfusedText:
- TX_FAR _BecameConfusedText
- db "@"
+ text_far _BecameConfusedText
+ text_end
ConfusionEffectFailed:
cp CONFUSION_SIDE_EFFECT
@@ -1267,8 +1267,8 @@ MimicEffect:
jp PrintButItFailedText_
MimicLearnedMoveText:
- TX_FAR _MimicLearnedMoveText
- db "@"
+ text_far _MimicLearnedMoveText
+ text_end
LeechSeedEffect:
jpab LeechSeedEffect_
@@ -1361,8 +1361,8 @@ DisableEffect:
jp PrintButItFailedText_
MoveWasDisabledText:
- TX_FAR _MoveWasDisabledText
- db "@"
+ text_far _MoveWasDisabledText
+ text_end
PayDayEffect:
jpab PayDayEffect_
@@ -1383,16 +1383,16 @@ ReflectLightScreenEffect:
jpab ReflectLightScreenEffect_
NothingHappenedText:
- TX_FAR _NothingHappenedText
- db "@"
+ text_far _NothingHappenedText
+ text_end
PrintNoEffectText:
ld hl, NoEffectText
jp PrintText
NoEffectText:
- TX_FAR _NoEffectText
- db "@"
+ text_far _NoEffectText
+ text_end
ConditionalPrintButItFailed:
ld a, [wMoveDidntMiss]
@@ -1404,28 +1404,28 @@ PrintButItFailedText_:
jp PrintText
ButItFailedText:
- TX_FAR _ButItFailedText
- db "@"
+ text_far _ButItFailedText
+ text_end
PrintDidntAffectText:
ld hl, DidntAffectText
jp PrintText
DidntAffectText:
- TX_FAR _DidntAffectText
- db "@"
+ text_far _DidntAffectText
+ text_end
IsUnaffectedText:
- TX_FAR _IsUnaffectedText
- db "@"
+ text_far _IsUnaffectedText
+ text_end
PrintMayNotAttackText:
ld hl, ParalyzedMayNotAttackText
jp PrintText
ParalyzedMayNotAttackText:
- TX_FAR _ParalyzedMayNotAttackText
- db "@"
+ text_far _ParalyzedMayNotAttackText
+ text_end
CheckTargetSubstitute:
push hl
diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm
index 830a23a1..f490c34d 100755
--- a/engine/battle/end_of_battle.asm
+++ b/engine/battle/end_of_battle.asm
@@ -84,5 +84,5 @@ DrawText:
db " DRAW@"
PickUpPayDayMoneyText:
- TX_FAR _PickUpPayDayMoneyText
- db "@"
+ text_far _PickUpPayDayMoneyText
+ text_end
diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm
index c628ae32..6bc0a019 100644
--- a/engine/battle/experience.asm
+++ b/engine/battle/experience.asm
@@ -340,8 +340,8 @@ BoostExp:
ret
GainedText:
- TX_FAR _GainedText
- TX_ASM
+ text_far _GainedText
+ text_asm
ld a, [wBoostExpByExpAll]
ld hl, WithExpAllText
and a
@@ -354,19 +354,19 @@ GainedText:
ret
WithExpAllText:
- TX_FAR _WithExpAllText
- TX_ASM
+ text_far _WithExpAllText
+ text_asm
ld hl, ExpPointsText
ret
BoostedText:
- TX_FAR _BoostedText
+ text_far _BoostedText
ExpPointsText:
- TX_FAR _ExpPointsText
- db "@"
+ text_far _ExpPointsText
+ text_end
GrewLevelText:
- TX_FAR _GrewLevelText
- TX_SFX_LEVEL_UP
- db "@"
+ text_far _GrewLevelText
+ sound_level_up
+ text_end
diff --git a/engine/battle/move_effects/conversion.asm b/engine/battle/move_effects/conversion.asm
index 8c41f914..662f65e0 100644
--- a/engine/battle/move_effects/conversion.asm
+++ b/engine/battle/move_effects/conversion.asm
@@ -25,8 +25,8 @@ ConversionEffect_:
jp PrintText
ConvertedTypeText:
- TX_FAR _ConvertedTypeText
- db "@"
+ text_far _ConvertedTypeText
+ text_end
PrintButItFailedText:
ld hl, PrintButItFailedText_
diff --git a/engine/battle/move_effects/drain_hp.asm b/engine/battle/move_effects/drain_hp.asm
index 60d23a95..452ccf0c 100644
--- a/engine/battle/move_effects/drain_hp.asm
+++ b/engine/battle/move_effects/drain_hp.asm
@@ -96,9 +96,9 @@ DrainHPEffect_:
jp PrintText
SuckedHealthText:
- TX_FAR _SuckedHealthText
- db "@"
+ text_far _SuckedHealthText
+ text_end
DreamWasEatenText:
- TX_FAR _DreamWasEatenText
- db "@"
+ text_far _DreamWasEatenText
+ text_end
diff --git a/engine/battle/move_effects/focus_energy.asm b/engine/battle/move_effects/focus_energy.asm
index af4a6521..7a426d2c 100644
--- a/engine/battle/move_effects/focus_energy.asm
+++ b/engine/battle/move_effects/focus_energy.asm
@@ -17,6 +17,6 @@ FocusEnergyEffect_:
jpab PrintButItFailedText_
GettingPumpedText:
- TX_DELAY
- TX_FAR _GettingPumpedText
- db "@"
+ text_pause
+ text_far _GettingPumpedText
+ text_end
diff --git a/engine/battle/move_effects/haze.asm b/engine/battle/move_effects/haze.asm
index bd73d249..521ff662 100644
--- a/engine/battle/move_effects/haze.asm
+++ b/engine/battle/move_effects/haze.asm
@@ -77,5 +77,5 @@ ResetStats:
ret
StatusChangesEliminatedText:
- TX_FAR _StatusChangesEliminatedText
- db "@"
+ text_far _StatusChangesEliminatedText
+ text_end
diff --git a/engine/battle/move_effects/heal.asm b/engine/battle/move_effects/heal.asm
index 8042bc63..8cc9da93 100644
--- a/engine/battle/move_effects/heal.asm
+++ b/engine/battle/move_effects/heal.asm
@@ -108,13 +108,13 @@ HealEffect_:
jp BankswitchEtoF
StartedSleepingEffect:
- TX_FAR _StartedSleepingEffect
- db "@"
+ text_far _StartedSleepingEffect
+ text_end
FellAsleepBecameHealthyText:
- TX_FAR _FellAsleepBecameHealthyText
- db "@"
+ text_far _FellAsleepBecameHealthyText
+ text_end
RegainedHealthText:
- TX_FAR _RegainedHealthText
- db "@"
+ text_far _RegainedHealthText
+ text_end
diff --git a/engine/battle/move_effects/leech_seed.asm b/engine/battle/move_effects/leech_seed.asm
index 981f5da9..74360233 100644
--- a/engine/battle/move_effects/leech_seed.asm
+++ b/engine/battle/move_effects/leech_seed.asm
@@ -32,9 +32,9 @@ LeechSeedEffect_:
jp PrintText
WasSeededText:
- TX_FAR _WasSeededText
- db "@"
+ text_far _WasSeededText
+ text_end
EvadedAttackText:
- TX_FAR _EvadedAttackText
- db "@"
+ text_far _EvadedAttackText
+ text_end
diff --git a/engine/battle/move_effects/mist.asm b/engine/battle/move_effects/mist.asm
index 6373770d..67ee4921 100644
--- a/engine/battle/move_effects/mist.asm
+++ b/engine/battle/move_effects/mist.asm
@@ -15,5 +15,5 @@ MistEffect_:
jpab PrintButItFailedText_
ShroudedInMistText:
- TX_FAR _ShroudedInMistText
- db "@"
+ text_far _ShroudedInMistText
+ text_end
diff --git a/engine/battle/move_effects/pay_day.asm b/engine/battle/move_effects/pay_day.asm
index 5bdb86da..11140ec2 100644
--- a/engine/battle/move_effects/pay_day.asm
+++ b/engine/battle/move_effects/pay_day.asm
@@ -41,5 +41,5 @@ PayDayEffect_:
jp PrintText
CoinsScatteredText:
- TX_FAR _CoinsScatteredText
- db "@"
+ text_far _CoinsScatteredText
+ text_end
diff --git a/engine/battle/move_effects/recoil.asm b/engine/battle/move_effects/recoil.asm
index e94f8043..63aff429 100644
--- a/engine/battle/move_effects/recoil.asm
+++ b/engine/battle/move_effects/recoil.asm
@@ -66,5 +66,5 @@ RecoilEffect_:
ld hl, HitWithRecoilText
jp PrintText
HitWithRecoilText:
- TX_FAR _HitWithRecoilText
- db "@"
+ text_far _HitWithRecoilText
+ text_end
diff --git a/engine/battle/move_effects/reflect_light_screen.asm b/engine/battle/move_effects/reflect_light_screen.asm
index 7693a348..07338c9a 100644
--- a/engine/battle/move_effects/reflect_light_screen.asm
+++ b/engine/battle/move_effects/reflect_light_screen.asm
@@ -33,12 +33,12 @@ ReflectLightScreenEffect_:
jp BankswitchEtoF
LightScreenProtectedText:
- TX_FAR _LightScreenProtectedText
- db "@"
+ text_far _LightScreenProtectedText
+ text_end
ReflectGainedArmorText:
- TX_FAR _ReflectGainedArmorText
- db "@"
+ text_far _ReflectGainedArmorText
+ text_end
BankswitchEtoF:
ld b, BANK(BattleCore)
diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm
index a1cd11b2..95c43462 100644
--- a/engine/battle/move_effects/substitute.asm
+++ b/engine/battle/move_effects/substitute.asm
@@ -65,13 +65,13 @@ SubstituteEffect_:
jp PrintText
SubstituteText:
- TX_FAR _SubstituteText
- db "@"
+ text_far _SubstituteText
+ text_end
HasSubstituteText:
- TX_FAR _HasSubstituteText
- db "@"
+ text_far _HasSubstituteText
+ text_end
TooWeakSubstituteText:
- TX_FAR _TooWeakSubstituteText
- db "@"
+ text_far _TooWeakSubstituteText
+ text_end
diff --git a/engine/battle/move_effects/transform.asm b/engine/battle/move_effects/transform.asm
index 1b459910..da26d031 100644
--- a/engine/battle/move_effects/transform.asm
+++ b/engine/battle/move_effects/transform.asm
@@ -144,5 +144,5 @@ TransformEffect_:
jp BankswitchEtoF
TransformedText:
- TX_FAR _TransformedText
- db "@"
+ text_far _TransformedText
+ text_end
diff --git a/engine/battle/safari_zone.asm b/engine/battle/safari_zone.asm
index 4672892d..4f01c2f4 100755
--- a/engine/battle/safari_zone.asm
+++ b/engine/battle/safari_zone.asm
@@ -28,9 +28,9 @@ PrintSafariZoneBattleText:
jp PrintText
SafariZoneEatingText:
- TX_FAR _SafariZoneEatingText
- db "@"
+ text_far _SafariZoneEatingText
+ text_end
SafariZoneAngryText:
- TX_FAR _SafariZoneAngryText
- db "@"
+ text_far _SafariZoneAngryText
+ text_end
diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm
index d61b44f8..8373ef4f 100644
--- a/engine/battle/trainer_ai.asm
+++ b/engine/battle/trainer_ai.asm
@@ -549,7 +549,7 @@ AIPrintItemUseAndUpdateHPBar:
jp DecrementAICount
AISwitchIfEnoughMons:
-; enemy trainer switches if there are 3 or more unfainted mons in party
+; enemy trainer switches if there are 2 or more unfainted mons in party
ld a, [wEnemyPartyCount]
ld c, a
ld hl, wEnemyMon1HP
@@ -573,7 +573,7 @@ AISwitchIfEnoughMons:
jr nz, .loop
ld a, d ; how many available monsters are there?
- cp 2 ; don't bother if only 1 or 2
+ cp 2 ; don't bother if only 1
jp nc, SwitchEnemyMon
and a
ret
@@ -610,8 +610,8 @@ SwitchEnemyMon:
ret
AIBattleWithdrawText:
- TX_FAR _AIBattleWithdrawText
- db "@"
+ text_far _AIBattleWithdrawText
+ text_end
AIUseFullHeal:
call AIPlayRestoringSFX
@@ -735,5 +735,5 @@ AIPrintItemUse_:
jp PrintText
AIBattleUseItemText:
- TX_FAR _AIBattleUseItemText
- db "@"
+ text_far _AIBattleUseItemText
+ text_end
diff --git a/engine/events/card_key.asm b/engine/events/card_key.asm
index c77d5fcd..a37a1f27 100755
--- a/engine/events/card_key.asm
+++ b/engine/events/card_key.asm
@@ -72,14 +72,14 @@ SilphCoMapList:
db $FF
CardKeySuccessText::
- TX_FAR _CardKeySuccessText1
- TX_SFX_ITEM_1
- TX_FAR _CardKeySuccessText2
- db "@"
+ text_far _CardKeySuccessText1
+ sound_get_item_1
+ text_far _CardKeySuccessText2
+ text_end
CardKeyFailText::
- TX_FAR _CardKeyFailText
- db "@"
+ text_far _CardKeyFailText
+ text_end
; d = Y
; e = X
@@ -88,7 +88,7 @@ GetCoordsInFrontOfPlayer:
ld d, a
ld a, [wXCoord]
ld e, a
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a
jr nz, .notFacingDown
; facing down
diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm
index e1598f98..7878780c 100755
--- a/engine/events/cinnabar_lab.asm
+++ b/engine/events/cinnabar_lab.asm
@@ -73,20 +73,20 @@ GiveFossilToCinnabarLab::
ret
LabFossil_610ae:
- TX_FAR _Lab4Text_610ae
- db "@"
+ text_far _Lab4Text_610ae
+ text_end
LabFossil_610b3:
- TX_FAR _Lab4Text_610b3
- db "@"
+ text_far _Lab4Text_610b3
+ text_end
LabFossil_610b8:
- TX_FAR _Lab4Text_610b8
- db "@"
+ text_far _Lab4Text_610b8
+ text_end
LabFossil_610bd:
- TX_FAR _Lab4Text_610bd
- db "@"
+ text_far _Lab4Text_610bd
+ text_end
PrintFossilsInBag:
; Prints each fossil in the player's bag on a separate line in the menu.
diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm
index 53d78e57..92196537 100755
--- a/engine/events/diploma.asm
+++ b/engine/events/diploma.asm
@@ -1,3 +1,5 @@
+CIRCLE_TILE_ID EQU $70
+
DisplayDiploma::
call SaveScreenTilesToBuffer2
call GBPalWhiteOutWithDelay3
@@ -8,7 +10,7 @@ DisplayDiploma::
set 6, [hl]
call DisableLCD
ld hl, CircleTile
- ld de, vChars2 + $700
+ ld de, vChars2 + CIRCLE_TILE_ID * $10
ld bc, $10
ld a, BANK(CircleTile)
call FarCopyData2
@@ -94,7 +96,7 @@ DiplomaTextPointersAndCoords:
dwCoord 9, 16
DiplomaText:
- db $70,"Diploma",$70,"@"
+ db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@"
DiplomaPlayer:
db "Player@"
diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm
index 752bdd1a..8e871456 100755
--- a/engine/events/elevator.asm
+++ b/engine/events/elevator.asm
@@ -44,5 +44,5 @@ DisplayElevatorFloorMenu:
ret
WhichFloorText:
- TX_FAR _WhichFloorText
- db "@"
+ text_far _WhichFloorText
+ text_end
diff --git a/engine/events/give_pokemon.asm b/engine/events/give_pokemon.asm
index 03177e60..041b9fb0 100755
--- a/engine/events/give_pokemon.asm
+++ b/engine/events/give_pokemon.asm
@@ -69,14 +69,14 @@ SetPokedexOwnedFlag:
jp PrintText
GotMonText:
- TX_FAR _GotMonText
- TX_SFX_ITEM_1
- db "@"
+ text_far _GotMonText
+ sound_get_item_1
+ text_end
SentToBoxText:
- TX_FAR _SentToBoxText
- db "@"
+ text_far _SentToBoxText
+ text_end
BoxIsFullText:
- TX_FAR _BoxIsFullText
- db "@"
+ text_far _BoxIsFullText
+ text_end
diff --git a/engine/events/hidden_items.asm b/engine/events/hidden_items.asm
index ad954c9f..85ae7c93 100755
--- a/engine/events/hidden_items.asm
+++ b/engine/events/hidden_items.asm
@@ -21,8 +21,8 @@ HiddenItems:
INCLUDE "data/events/hidden_item_coords.asm"
FoundHiddenItemText::
- TX_FAR _FoundHiddenItemText
- TX_ASM
+ text_far _FoundHiddenItemText
+ text_asm
ld a, [wHiddenObjectFunctionArgument] ; item ID
ld b, a
ld c, 1
@@ -46,8 +46,8 @@ FoundHiddenItemText::
jp TextScriptEnd
HiddenItemBagFullText::
- TX_FAR _HiddenItemBagFullText
- db "@"
+ text_far _HiddenItemBagFullText
+ text_end
HiddenCoins:
ld b, COIN_CASE
@@ -121,15 +121,15 @@ HiddenCoins:
INCLUDE "data/events/hidden_coins.asm"
FoundHiddenCoinsText::
- TX_FAR _FoundHiddenCoinsText
- TX_SFX_ITEM_2
- db "@"
+ text_far _FoundHiddenCoinsText
+ sound_get_item_2
+ text_end
DroppedHiddenCoinsText::
- TX_FAR _FoundHiddenCoins2Text
- TX_SFX_ITEM_2
- TX_FAR _DroppedHiddenCoinsText
- db "@"
+ text_far _FoundHiddenCoins2Text
+ sound_get_item_2
+ text_far _DroppedHiddenCoinsText
+ text_end
FindHiddenItemOrCoinsIndex:
ld a, [wHiddenObjectY]
diff --git a/engine/events/hidden_objects/bench_guys.asm b/engine/events/hidden_objects/bench_guys.asm
index 995b5929..d5db99ec 100644
--- a/engine/events/hidden_objects/bench_guys.asm
+++ b/engine/events/hidden_objects/bench_guys.asm
@@ -15,7 +15,7 @@ PrintBenchGuyText:
.match
ld a, [hli]
ld b, a
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp b
jr nz, .loop ; player isn't facing left at the bench guy
ld a, [hl]
@@ -50,59 +50,59 @@ BenchGuyTextPointers:
db $FF
ViridianCityPokecenterBenchGuyText::
- TX_FAR _ViridianCityPokecenterGuyText
- db "@"
+ text_far _ViridianCityPokecenterGuyText
+ text_end
PewterCityPokecenterBenchGuyText::
- TX_FAR _PewterCityPokecenterGuyText
- db "@"
+ text_far _PewterCityPokecenterGuyText
+ text_end
CeruleanCityPokecenterBenchGuyText::
- TX_FAR _CeruleanPokecenterGuyText
- db "@"
+ text_far _CeruleanPokecenterGuyText
+ text_end
LavenderCityPokecenterBenchGuyText::
- TX_FAR _LavenderPokecenterGuyText
- db "@"
+ text_far _LavenderPokecenterGuyText
+ text_end
MtMoonPokecenterBenchGuyText::
- TX_FAR _MtMoonPokecenterBenchGuyText
- db "@"
+ text_far _MtMoonPokecenterBenchGuyText
+ text_end
RockTunnelPokecenterBenchGuyText::
- TX_FAR _RockTunnelPokecenterGuyText
- db "@"
+ text_far _RockTunnelPokecenterGuyText
+ text_end
UnusedBenchGuyText1::
- TX_FAR _UnusedBenchGuyText1
- db "@"
+ text_far _UnusedBenchGuyText1
+ text_end
UnusedBenchGuyText2::
- TX_FAR _UnusedBenchGuyText2
- db "@"
+ text_far _UnusedBenchGuyText2
+ text_end
UnusedBenchGuyText3::
- TX_FAR _UnusedBenchGuyText3
- db "@"
+ text_far _UnusedBenchGuyText3
+ text_end
VermilionCityPokecenterBenchGuyText::
- TX_FAR _VermilionPokecenterGuyText
- db "@"
+ text_far _VermilionPokecenterGuyText
+ text_end
CeladonCityPokecenterBenchGuyText::
- TX_FAR _CeladonCityPokecenterGuyText
- db "@"
+ text_far _CeladonCityPokecenterGuyText
+ text_end
FuchsiaCityPokecenterBenchGuyText::
- TX_FAR _FuchsiaCityPokecenterGuyText
- db "@"
+ text_far _FuchsiaCityPokecenterGuyText
+ text_end
CinnabarIslandPokecenterBenchGuyText::
- TX_FAR _CinnabarPokecenterGuyText
- db "@"
+ text_far _CinnabarPokecenterGuyText
+ text_end
SaffronCityPokecenterBenchGuyText::
- TX_ASM
+ text_asm
CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
ld hl, SaffronCityPokecenterBenchGuyText2
jr nz, .asm_624f2
@@ -112,13 +112,13 @@ SaffronCityPokecenterBenchGuyText::
jp TextScriptEnd
SaffronCityPokecenterBenchGuyText1:
- TX_FAR _SaffronCityPokecenterGuyText1
- db "@"
+ text_far _SaffronCityPokecenterGuyText1
+ text_end
SaffronCityPokecenterBenchGuyText2:
- TX_FAR _SaffronCityPokecenterGuyText2
- db "@"
+ text_far _SaffronCityPokecenterGuyText2
+ text_end
CeladonCityHotelText::
- TX_FAR _CeladonCityHotelText
- db "@"
+ text_far _CeladonCityHotelText
+ text_end
diff --git a/engine/events/hidden_objects/bills_house_pc.asm b/engine/events/hidden_objects/bills_house_pc.asm
index 836aace0..92679d66 100644
--- a/engine/events/hidden_objects/bills_house_pc.asm
+++ b/engine/events/hidden_objects/bills_house_pc.asm
@@ -1,6 +1,6 @@
BillsHousePC:
call EnableAutoTextBoxDrawing
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING
@@ -45,13 +45,13 @@ BillsHousePC:
ret
BillsHouseMonitorText::
- TX_FAR _BillsHouseMonitorText
- db "@"
+ text_far _BillsHouseMonitorText
+ text_end
BillsHouseInitiatedText::
- TX_FAR _BillsHouseInitiatedText
- TX_BLINK
- TX_ASM
+ text_far _BillsHouseInitiatedText
+ text_promptbutton
+ text_asm
ld a, SFX_STOP_ALL_MUSIC
ld [wNewSoundID], a
call PlaySound
@@ -65,7 +65,7 @@ BillsHouseInitiatedText::
jp TextScriptEnd
BillsHousePokemonList::
- TX_ASM
+ text_asm
call SaveScreenTilesToBuffer1
ld hl, BillsHousePokemonListText1
call PrintText
@@ -119,8 +119,8 @@ BillsHousePokemonList::
jp TextScriptEnd
BillsHousePokemonListText1:
- TX_FAR _BillsHousePokemonListText1
- db "@"
+ text_far _BillsHousePokemonListText1
+ text_end
BillsMonListText:
db "EEVEE"
@@ -130,5 +130,5 @@ BillsMonListText:
next "CANCEL@"
BillsHousePokemonListText2:
- TX_FAR _BillsHousePokemonListText2
- db "@"
+ text_far _BillsHousePokemonListText2
+ text_end
diff --git a/engine/events/hidden_objects/blues_room.asm b/engine/events/hidden_objects/blues_room.asm
index 879a7ac8..bcbad556 100644
--- a/engine/events/hidden_objects/blues_room.asm
+++ b/engine/events/hidden_objects/blues_room.asm
@@ -9,5 +9,5 @@ PrintBookcaseText:
tx_pre_jump BookcaseText
BookcaseText::
- TX_FAR _BookcaseText
- db "@"
+ text_far _BookcaseText
+ text_end
diff --git a/engine/events/hidden_objects/book_or_sculpture.asm b/engine/events/hidden_objects/book_or_sculpture.asm
index 2d6f278a..2f3334b8 100644
--- a/engine/events/hidden_objects/book_or_sculpture.asm
+++ b/engine/events/hidden_objects/book_or_sculpture.asm
@@ -1,5 +1,5 @@
BookOrSculptureText::
- TX_ASM
+ text_asm
ld hl, PokemonBooksText
ld a, [wCurMapTileset]
cp MANSION ; Celadon Mansion tileset
@@ -13,9 +13,9 @@ BookOrSculptureText::
jp TextScriptEnd
PokemonBooksText:
- TX_FAR _PokemonBooksText
- db "@"
+ text_far _PokemonBooksText
+ text_end
DiglettSculptureText:
- TX_FAR _DiglettSculptureText
- db "@"
+ text_far _DiglettSculptureText
+ text_end
diff --git a/engine/events/hidden_objects/bookshelves.asm b/engine/events/hidden_objects/bookshelves.asm
index eaf744ff..9cdd037a 100644
--- a/engine/events/hidden_objects/bookshelves.asm
+++ b/engine/events/hidden_objects/bookshelves.asm
@@ -1,6 +1,6 @@
; prints text for bookshelves in buildings without sign events
PrintBookshelfText::
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jr nz, .noMatch
; facing up
diff --git a/engine/events/hidden_objects/cinnabar_gym_quiz.asm b/engine/events/hidden_objects/cinnabar_gym_quiz.asm
index 6404717e..da309f87 100644
--- a/engine/events/hidden_objects/cinnabar_gym_quiz.asm
+++ b/engine/events/hidden_objects/cinnabar_gym_quiz.asm
@@ -1,12 +1,12 @@
PrintCinnabarQuiz:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
tx_pre_jump CinnabarGymQuiz
CinnabarGymQuiz::
- TX_ASM
+ text_asm
xor a
ld [wOpponentAfterWrongAnswer], a
ld a, [wHiddenObjectFunctionArgument]
@@ -36,8 +36,8 @@ CinnabarGymQuiz::
jp TextScriptEnd
CinnabarGymQuizIntroText:
- TX_FAR _CinnabarGymQuizIntroText
- db "@"
+ text_far _CinnabarGymQuizIntroText
+ text_end
CinnabarQuizQuestions:
dw CinnabarQuizQuestionsText1
@@ -48,28 +48,28 @@ CinnabarQuizQuestions:
dw CinnabarQuizQuestionsText6
CinnabarQuizQuestionsText1:
- TX_FAR _CinnabarQuizQuestionsText1
- db "@"
+ text_far _CinnabarQuizQuestionsText1
+ text_end
CinnabarQuizQuestionsText2:
- TX_FAR _CinnabarQuizQuestionsText2
- db "@"
+ text_far _CinnabarQuizQuestionsText2
+ text_end
CinnabarQuizQuestionsText3:
- TX_FAR _CinnabarQuizQuestionsText3
- db "@"
+ text_far _CinnabarQuizQuestionsText3
+ text_end
CinnabarQuizQuestionsText4:
- TX_FAR _CinnabarQuizQuestionsText4
- db "@"
+ text_far _CinnabarQuizQuestionsText4
+ text_end
CinnabarQuizQuestionsText5:
- TX_FAR _CinnabarQuizQuestionsText5
- db "@"
+ text_far _CinnabarQuizQuestionsText5
+ text_end
CinnabarQuizQuestionsText6:
- TX_FAR _CinnabarQuizQuestionsText6
- db "@"
+ text_far _CinnabarQuizQuestionsText6
+ text_end
CinnabarGymGateFlagAction:
EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED
@@ -117,10 +117,10 @@ CinnabarGymQuiz_1ea92:
ret
CinnabarGymQuizCorrectText:
- TX_SFX_ITEM_1
- TX_FAR _CinnabarGymQuizCorrectText
- TX_BLINK
- TX_ASM
+ sound_get_item_1
+ text_far _CinnabarGymQuizCorrectText
+ text_promptbutton
+ text_asm
ld a, [hBackupGymGateIndex]
AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
@@ -137,8 +137,8 @@ CinnabarGymQuizCorrectText:
jp TextScriptEnd
CinnabarGymQuizIncorrectText:
- TX_FAR _CinnabarGymQuizIncorrectText
- db "@"
+ text_far _CinnabarGymQuizIncorrectText
+ text_end
UpdateCinnabarGymGateTileBlocks_::
; Update the overworld map with open floor blocks or locked gate blocks
diff --git a/engine/events/hidden_objects/elevator.asm b/engine/events/hidden_objects/elevator.asm
index e72ca44b..ab0f731f 100644
--- a/engine/events/hidden_objects/elevator.asm
+++ b/engine/events/hidden_objects/elevator.asm
@@ -1,3 +1,3 @@
ElevatorText::
- TX_FAR _ElevatorText
- db "@"
+ text_far _ElevatorText
+ text_end
diff --git a/engine/events/hidden_objects/fighting_dojo.asm b/engine/events/hidden_objects/fighting_dojo.asm
index 94d4871d..b4f89985 100644
--- a/engine/events/hidden_objects/fighting_dojo.asm
+++ b/engine/events/hidden_objects/fighting_dojo.asm
@@ -3,21 +3,21 @@ PrintFightingDojoText2:
tx_pre_jump EnemiesOnEverySideText
EnemiesOnEverySideText::
- TX_FAR _EnemiesOnEverySideText
- db "@"
+ text_far _EnemiesOnEverySideText
+ text_end
PrintFightingDojoText3:
call EnableAutoTextBoxDrawing
tx_pre_jump WhatGoesAroundComesAroundText
WhatGoesAroundComesAroundText::
- TX_FAR _WhatGoesAroundComesAroundText
- db "@"
+ text_far _WhatGoesAroundComesAroundText
+ text_end
PrintFightingDojoText:
call EnableAutoTextBoxDrawing
tx_pre_jump FightingDojoText
FightingDojoText::
- TX_FAR _FightingDojoText
- db "@"
+ text_far _FightingDojoText
+ text_end
diff --git a/engine/events/hidden_objects/gym_statues.asm b/engine/events/hidden_objects/gym_statues.asm
index e9a407b2..1f592f2f 100644
--- a/engine/events/hidden_objects/gym_statues.asm
+++ b/engine/events/hidden_objects/gym_statues.asm
@@ -3,7 +3,7 @@ GymStatues:
; if in a gym and don’t have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID
; else ret
call EnableAutoTextBoxDrawing
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
ld hl, .BadgeFlags
@@ -40,9 +40,9 @@ GymStatues:
db $ff
GymStatueText1::
- TX_FAR _GymStatueText1
- db "@"
+ text_far _GymStatueText1
+ text_end
GymStatueText2::
- TX_FAR _GymStatueText2
- db "@"
+ text_far _GymStatueText2
+ text_end
diff --git a/engine/events/hidden_objects/indigo_plateau_hq.asm b/engine/events/hidden_objects/indigo_plateau_hq.asm
index d0d0b8c2..e8fd0220 100644
--- a/engine/events/hidden_objects/indigo_plateau_hq.asm
+++ b/engine/events/hidden_objects/indigo_plateau_hq.asm
@@ -1,10 +1,10 @@
PrintIndigoPlateauHQText:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
tx_pre_jump IndigoPlateauHQText
IndigoPlateauHQText::
- TX_FAR _IndigoPlateauHQText
- db "@"
+ text_far _IndigoPlateauHQText
+ text_end
diff --git a/engine/events/hidden_objects/indigo_plateau_statues.asm b/engine/events/hidden_objects/indigo_plateau_statues.asm
index 62b31e0a..23e94fcf 100644
--- a/engine/events/hidden_objects/indigo_plateau_statues.asm
+++ b/engine/events/hidden_objects/indigo_plateau_statues.asm
@@ -1,5 +1,5 @@
IndigoPlateauStatues::
- TX_ASM
+ text_asm
ld hl, IndigoPlateauStatuesText1
call PrintText
ld a, [wXCoord]
@@ -12,13 +12,13 @@ IndigoPlateauStatues::
jp TextScriptEnd
IndigoPlateauStatuesText1:
- TX_FAR _IndigoPlateauStatuesText1
- db "@"
+ text_far _IndigoPlateauStatuesText1
+ text_end
IndigoPlateauStatuesText2:
- TX_FAR _IndigoPlateauStatuesText2
- db "@"
+ text_far _IndigoPlateauStatuesText2
+ text_end
IndigoPlateauStatuesText3:
- TX_FAR _IndigoPlateauStatuesText3
- db "@"
+ text_far _IndigoPlateauStatuesText3
+ text_end
diff --git a/engine/events/hidden_objects/magazines.asm b/engine/events/hidden_objects/magazines.asm
index af31b317..b58636ff 100644
--- a/engine/events/hidden_objects/magazines.asm
+++ b/engine/events/hidden_objects/magazines.asm
@@ -4,5 +4,5 @@ PrintMagazinesText:
ret
MagazinesText::
- TX_FAR _MagazinesText
- db "@"
+ text_far _MagazinesText
+ text_end
diff --git a/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm
index 8636418c..36fb2556 100644
--- a/engine/events/hidden_objects/museum_fossils.asm
+++ b/engine/events/hidden_objects/museum_fossils.asm
@@ -7,8 +7,8 @@ AerodactylFossil:
ret
AerodactylFossilText::
- TX_FAR _AerodactylFossilText
- db "@"
+ text_far _AerodactylFossilText
+ text_end
KabutopsFossil:
ld a, FOSSIL_KABUTOPS
@@ -19,8 +19,8 @@ KabutopsFossil:
ret
KabutopsFossilText::
- TX_FAR _KabutopsFossilText
- db "@"
+ text_far _KabutopsFossilText
+ text_end
DisplayMonFrontSpriteInBox:
; Displays a pokemon's front sprite in a pop-up window.
diff --git a/engine/events/hidden_objects/new_bike.asm b/engine/events/hidden_objects/new_bike.asm
index 7836262e..5bce5937 100644
--- a/engine/events/hidden_objects/new_bike.asm
+++ b/engine/events/hidden_objects/new_bike.asm
@@ -3,5 +3,5 @@ PrintNewBikeText:
tx_pre_jump NewBicycleText
NewBicycleText::
- TX_FAR _NewBicycleText
- db "@"
+ text_far _NewBicycleText
+ text_end
diff --git a/engine/events/hidden_objects/oaks_lab_email.asm b/engine/events/hidden_objects/oaks_lab_email.asm
index c59ff9ac..b66babe0 100644
--- a/engine/events/hidden_objects/oaks_lab_email.asm
+++ b/engine/events/hidden_objects/oaks_lab_email.asm
@@ -1,10 +1,10 @@
DisplayOakLabEmailText:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
tx_pre_jump OakLabEmailText
OakLabEmailText::
- TX_FAR _OakLabEmailText
- db "@"
+ text_far _OakLabEmailText
+ text_end
diff --git a/engine/events/hidden_objects/oaks_lab_posters.asm b/engine/events/hidden_objects/oaks_lab_posters.asm
index 0fe21cf3..502cf951 100644
--- a/engine/events/hidden_objects/oaks_lab_posters.asm
+++ b/engine/events/hidden_objects/oaks_lab_posters.asm
@@ -3,8 +3,8 @@ DisplayOakLabLeftPoster:
tx_pre_jump PushStartText
PushStartText::
- TX_FAR _PushStartText
- db "@"
+ text_far _PushStartText
+ text_end
DisplayOakLabRightPoster:
call EnableAutoTextBoxDrawing
@@ -21,9 +21,9 @@ DisplayOakLabRightPoster:
jp PrintPredefTextID
SaveOptionText::
- TX_FAR _SaveOptionText
- db "@"
+ text_far _SaveOptionText
+ text_end
StrengthsAndWeaknessesText::
- TX_FAR _StrengthsAndWeaknessesText
- db "@"
+ text_far _StrengthsAndWeaknessesText
+ text_end
diff --git a/engine/events/hidden_objects/pokecenter_pc.asm b/engine/events/hidden_objects/pokecenter_pc.asm
index c1225d3a..9ae7d41c 100644
--- a/engine/events/hidden_objects/pokecenter_pc.asm
+++ b/engine/events/hidden_objects/pokecenter_pc.asm
@@ -1,6 +1,6 @@
OpenPokemonCenterPC:
- ld a, [wSpriteStateData1 + 9]
- cp SPRITE_FACING_UP ; check to see if player is facing up
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
ld a, $1
@@ -8,4 +8,4 @@ OpenPokemonCenterPC:
tx_pre_jump PokemonCenterPCText
PokemonCenterPCText::
- TX_POKECENTER_PC
+ script_pokecenter_pc
diff --git a/engine/events/hidden_objects/pokemon_stuff.asm b/engine/events/hidden_objects/pokemon_stuff.asm
index b78b2500..267a191a 100644
--- a/engine/events/hidden_objects/pokemon_stuff.asm
+++ b/engine/events/hidden_objects/pokemon_stuff.asm
@@ -1,3 +1,3 @@
PokemonStuffText::
- TX_FAR _PokemonStuffText
- db "@"
+ text_far _PokemonStuffText
+ text_end
diff --git a/engine/events/hidden_objects/reds_room.asm b/engine/events/hidden_objects/reds_room.asm
index b124f9c6..7b8d51a0 100644
--- a/engine/events/hidden_objects/reds_room.asm
+++ b/engine/events/hidden_objects/reds_room.asm
@@ -3,12 +3,12 @@ PrintRedSNESText:
tx_pre_jump RedBedroomSNESText
RedBedroomSNESText::
- TX_FAR _RedBedroomSNESText
- db "@"
+ text_far _RedBedroomSNESText
+ text_end
OpenRedsPC:
call EnableAutoTextBoxDrawing
tx_pre_jump RedBedroomPCText
RedBedroomPCText::
- TX_PLAYERS_PC
+ script_players_pc
diff --git a/engine/events/hidden_objects/route_15_binoculars.asm b/engine/events/hidden_objects/route_15_binoculars.asm
index b380bb33..ce047c2f 100644
--- a/engine/events/hidden_objects/route_15_binoculars.asm
+++ b/engine/events/hidden_objects/route_15_binoculars.asm
@@ -1,5 +1,5 @@
Route15GateLeftBinoculars:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
@@ -10,5 +10,5 @@ Route15GateLeftBinoculars:
jp DisplayMonFrontSpriteInBox
Route15UpstairsBinocularsText::
- TX_FAR _Route15UpstairsBinocularsText
- db "@"
+ text_far _Route15UpstairsBinocularsText
+ text_end
diff --git a/engine/events/hidden_objects/safari_game.asm b/engine/events/hidden_objects/safari_game.asm
index 68fc943f..656e872a 100644
--- a/engine/events/hidden_objects/safari_game.asm
+++ b/engine/events/hidden_objects/safari_game.asm
@@ -59,7 +59,7 @@ PrintSafariGameOverText::
jp PrintText
SafariGameOverText:
- TX_ASM
+ text_asm
ld a, [wNumSafariBalls]
and a
jr z, .noMoreSafariBalls
@@ -71,9 +71,9 @@ SafariGameOverText:
jp TextScriptEnd
TimesUpText:
- TX_FAR _TimesUpText
- db "@"
+ text_far _TimesUpText
+ text_end
GameOverText:
- TX_FAR _GameOverText
- db "@"
+ text_far _GameOverText
+ text_end
diff --git a/engine/events/hidden_objects/school_blackboard.asm b/engine/events/hidden_objects/school_blackboard.asm
index 4cd48d23..48b97d73 100644
--- a/engine/events/hidden_objects/school_blackboard.asm
+++ b/engine/events/hidden_objects/school_blackboard.asm
@@ -7,7 +7,7 @@ PrintBlackboardLinkCableText:
ret
LinkCableHelp::
- TX_ASM
+ text_asm
call SaveScreenTilesToBuffer1
ld hl, LinkCableHelpText1
call PrintText
@@ -60,12 +60,12 @@ LinkCableHelp::
jp TextScriptEnd
LinkCableHelpText1:
- TX_FAR _LinkCableHelpText1
- db "@"
+ text_far _LinkCableHelpText1
+ text_end
LinkCableHelpText2:
- TX_FAR _LinkCableHelpText2
- db "@"
+ text_far _LinkCableHelpText2
+ text_end
HowToLinkText:
db "HOW TO LINK"
@@ -79,19 +79,19 @@ LinkCableInfoTexts:
dw LinkCableInfoText3
LinkCableInfoText1:
- TX_FAR _LinkCableInfoText1
- db "@"
+ text_far _LinkCableInfoText1
+ text_end
LinkCableInfoText2:
- TX_FAR _LinkCableInfoText2
- db "@"
+ text_far _LinkCableInfoText2
+ text_end
LinkCableInfoText3:
- TX_FAR _LinkCableInfoText3
- db "@"
+ text_far _LinkCableInfoText3
+ text_end
ViridianSchoolBlackboard::
- TX_ASM
+ text_asm
call SaveScreenTilesToBuffer1
ld hl, ViridianSchoolBlackboardText1
call PrintText
@@ -177,12 +177,12 @@ ViridianSchoolBlackboard::
jp TextScriptEnd
ViridianSchoolBlackboardText1:
- TX_FAR _ViridianSchoolBlackboardText1
- db "@"
+ text_far _ViridianSchoolBlackboardText1
+ text_end
ViridianSchoolBlackboardText2:
- TX_FAR _ViridianSchoolBlackboardText2
- db "@"
+ text_far _ViridianSchoolBlackboardText2
+ text_end
StatusAilmentText1:
db " SLP"
@@ -192,7 +192,9 @@ StatusAilmentText1:
StatusAilmentText2:
db " BRN"
next " FRZ"
- next " QUIT@@"
+ next " QUIT@"
+
+ db "@" ; unused
ViridianBlackboardStatusPointers:
dw ViridianBlackboardSleepText
@@ -202,21 +204,21 @@ ViridianBlackboardStatusPointers:
dw ViridianBlackboardFrozenText
ViridianBlackboardSleepText:
- TX_FAR _ViridianBlackboardSleepText
- db "@"
+ text_far _ViridianBlackboardSleepText
+ text_end
ViridianBlackboardPoisonText:
- TX_FAR _ViridianBlackboardPoisonText
- db "@"
+ text_far _ViridianBlackboardPoisonText
+ text_end
ViridianBlackboardPrlzText:
- TX_FAR _ViridianBlackboardPrlzText
- db "@"
+ text_far _ViridianBlackboardPrlzText
+ text_end
ViridianBlackboardBurnText:
- TX_FAR _ViridianBlackboardBurnText
- db "@"
+ text_far _ViridianBlackboardBurnText
+ text_end
ViridianBlackboardFrozenText:
- TX_FAR _ViridianBlackboardFrozenText
- db "@"
+ text_far _ViridianBlackboardFrozenText
+ text_end
diff --git a/engine/events/hidden_objects/school_notebooks.asm b/engine/events/hidden_objects/school_notebooks.asm
index f5cc1341..9fccf6c0 100644
--- a/engine/events/hidden_objects/school_notebooks.asm
+++ b/engine/events/hidden_objects/school_notebooks.asm
@@ -6,12 +6,12 @@ PrintNotebookText:
jp PrintPredefTextID
TMNotebook::
- TX_FAR TMNotebookText
- TX_WAIT
- db "@"
+ text_far TMNotebookText
+ text_linkpromptbutton
+ text_end
ViridianSchoolNotebook::
- TX_ASM
+ text_asm
ld hl, ViridianSchoolNotebookText1
call PrintText
call TurnPageSchoolNotebook
@@ -40,26 +40,26 @@ TurnPageSchoolNotebook:
ret
TurnPageText:
- TX_FAR _TurnPageText
- db "@"
+ text_far _TurnPageText
+ text_end
ViridianSchoolNotebookText5:
- TX_FAR _ViridianSchoolNotebookText5
- TX_WAIT
- db "@"
+ text_far _ViridianSchoolNotebookText5
+ text_linkpromptbutton
+ text_end
ViridianSchoolNotebookText1:
- TX_FAR _ViridianSchoolNotebookText1
- db "@"
+ text_far _ViridianSchoolNotebookText1
+ text_end
ViridianSchoolNotebookText2:
- TX_FAR _ViridianSchoolNotebookText2
- db "@"
+ text_far _ViridianSchoolNotebookText2
+ text_end
ViridianSchoolNotebookText3:
- TX_FAR _ViridianSchoolNotebookText3
- db "@"
+ text_far _ViridianSchoolNotebookText3
+ text_end
ViridianSchoolNotebookText4:
- TX_FAR _ViridianSchoolNotebookText4
- db "@"
+ text_far _ViridianSchoolNotebookText4
+ text_end
diff --git a/engine/events/hidden_objects/town_map.asm b/engine/events/hidden_objects/town_map.asm
index 31e75d0d..9481b902 100644
--- a/engine/events/hidden_objects/town_map.asm
+++ b/engine/events/hidden_objects/town_map.asm
@@ -1,7 +1,7 @@
TownMapText::
- TX_FAR _TownMapText
- TX_BLINK
- TX_ASM
+ text_far _TownMapText
+ text_promptbutton
+ text_asm
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wd730
diff --git a/engine/events/hidden_objects/vermilion_gym_trash.asm b/engine/events/hidden_objects/vermilion_gym_trash.asm
index c2d22cd5..f46b53c2 100644
--- a/engine/events/hidden_objects/vermilion_gym_trash.asm
+++ b/engine/events/hidden_objects/vermilion_gym_trash.asm
@@ -3,8 +3,8 @@ PrintTrashText:
tx_pre_jump VermilionGymTrashText
VermilionGymTrashText::
- TX_FAR _VermilionGymTrashText
- db "@"
+ text_far _VermilionGymTrashText
+ text_end
GymTrashScript:
call EnableAutoTextBoxDrawing
@@ -128,8 +128,8 @@ GymTrashCans:
db 2, 11, 13, 0, 0 ; 14
VermilionGymTrashSuccessText1::
- TX_FAR _VermilionGymTrashSuccessText1
- TX_ASM
+ text_far _VermilionGymTrashSuccessText1
+ text_asm
call WaitForSoundToFinish
ld a, SFX_SWITCH
call PlaySound
@@ -138,12 +138,12 @@ VermilionGymTrashSuccessText1::
; unused
VermilionGymTrashSuccessText2::
- TX_FAR _VermilionGymTrashSuccessText2
- db "@"
+ text_far _VermilionGymTrashSuccessText2
+ text_end
; unused
VermilionGymTrashSuccesPlaySfx:
- TX_ASM
+ text_asm
call WaitForSoundToFinish
ld a, SFX_SWITCH
call PlaySound
@@ -151,8 +151,8 @@ VermilionGymTrashSuccesPlaySfx:
jp TextScriptEnd
VermilionGymTrashSuccessText3::
- TX_FAR _VermilionGymTrashSuccessText3
- TX_ASM
+ text_far _VermilionGymTrashSuccessText3
+ text_asm
call WaitForSoundToFinish
ld a, SFX_GO_INSIDE
call PlaySound
@@ -160,8 +160,8 @@ VermilionGymTrashSuccessText3::
jp TextScriptEnd
VermilionGymTrashFailText::
- TX_FAR _VermilionGymTrashFailText
- TX_ASM
+ text_far _VermilionGymTrashFailText
+ text_asm
call WaitForSoundToFinish
ld a, SFX_DENIED
call PlaySound
diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm
index c1466485..a25abe0b 100755
--- a/engine/events/in_game_trades.asm
+++ b/engine/events/in_game_trades.asm
@@ -230,8 +230,7 @@ InGameTrade_GetReceivedMonPointer:
ret
InGameTrade_TrainerString:
- ; "TRAINER@@@@@@@@@@"
- db $5d, "@@@@@@@@@@"
+ db "<TRAINER>@@@@@@@@@@"
InGameTradeTextPointers:
dw TradeTextPointers1
@@ -260,71 +259,71 @@ TradeTextPointers3:
dw AfterTrade3Text
ConnectCableText:
- TX_FAR _ConnectCableText
- db "@"
+ text_far _ConnectCableText
+ text_end
TradedForText:
- TX_FAR _TradedForText
- TX_SFX_KEY_ITEM
- TX_DELAY
- db "@"
+ text_far _TradedForText
+ sound_get_key_item
+ text_pause
+ text_end
WannaTrade1Text:
- TX_FAR _WannaTrade1Text
- db "@"
+ text_far _WannaTrade1Text
+ text_end
NoTrade1Text:
- TX_FAR _NoTrade1Text
- db "@"
+ text_far _NoTrade1Text
+ text_end
WrongMon1Text:
- TX_FAR _WrongMon1Text
- db "@"
+ text_far _WrongMon1Text
+ text_end
Thanks1Text:
- TX_FAR _Thanks1Text
- db "@"
+ text_far _Thanks1Text
+ text_end
AfterTrade1Text:
- TX_FAR _AfterTrade1Text
- db "@"
+ text_far _AfterTrade1Text
+ text_end
WannaTrade2Text:
- TX_FAR _WannaTrade2Text
- db "@"
+ text_far _WannaTrade2Text
+ text_end
NoTrade2Text:
- TX_FAR _NoTrade2Text
- db "@"
+ text_far _NoTrade2Text
+ text_end
WrongMon2Text:
- TX_FAR _WrongMon2Text
- db "@"
+ text_far _WrongMon2Text
+ text_end
Thanks2Text:
- TX_FAR _Thanks2Text
- db "@"
+ text_far _Thanks2Text
+ text_end
AfterTrade2Text:
- TX_FAR _AfterTrade2Text
- db "@"
+ text_far _AfterTrade2Text
+ text_end
WannaTrade3Text:
- TX_FAR _WannaTrade3Text
- db "@"
+ text_far _WannaTrade3Text
+ text_end
NoTrade3Text:
- TX_FAR _NoTrade3Text
- db "@"
+ text_far _NoTrade3Text
+ text_end
WrongMon3Text:
- TX_FAR _WrongMon3Text
- db "@"
+ text_far _WrongMon3Text
+ text_end
Thanks3Text:
- TX_FAR _Thanks3Text
- db "@"
+ text_far _Thanks3Text
+ text_end
AfterTrade3Text:
- TX_FAR _AfterTrade3Text
- db "@"
+ text_far _AfterTrade3Text
+ text_end
diff --git a/engine/events/oaks_aide.asm b/engine/events/oaks_aide.asm
index f5068fda..61304877 100755
--- a/engine/events/oaks_aide.asm
+++ b/engine/events/oaks_aide.asm
@@ -46,26 +46,26 @@ OaksAideScript:
ret
OaksAideHiText:
- TX_FAR _OaksAideHiText
- db "@"
+ text_far _OaksAideHiText
+ text_end
OaksAideUhOhText:
- TX_FAR _OaksAideUhOhText
- db "@"
+ text_far _OaksAideUhOhText
+ text_end
OaksAideComeBackText:
- TX_FAR _OaksAideComeBackText
- db "@"
+ text_far _OaksAideComeBackText
+ text_end
OaksAideHereYouGoText:
- TX_FAR _OaksAideHereYouGoText
- db "@"
+ text_far _OaksAideHereYouGoText
+ text_end
OaksAideGotItemText:
- TX_FAR _OaksAideGotItemText
- TX_SFX_ITEM_1
- db "@"
+ text_far _OaksAideGotItemText
+ sound_get_item_1
+ text_end
OaksAideNoRoomText:
- TX_FAR _OaksAideNoRoomText
- db "@"
+ text_far _OaksAideNoRoomText
+ text_end
diff --git a/engine/events/pick_up_item.asm b/engine/events/pick_up_item.asm
index 5a658f22..ec50d9c4 100644
--- a/engine/events/pick_up_item.asm
+++ b/engine/events/pick_up_item.asm
@@ -45,10 +45,10 @@ PickUpItem:
ret
FoundItemText:
- TX_FAR _FoundItemText
- TX_SFX_ITEM_1
- db "@"
+ text_far _FoundItemText
+ sound_get_item_1
+ text_end
NoMoreRoomForItemText:
- TX_FAR _NoMoreRoomForItemText
- db "@"
+ text_far _NoMoreRoomForItemText
+ text_end
diff --git a/engine/events/pokecenter.asm b/engine/events/pokecenter.asm
index f340e06d..030c333f 100755
--- a/engine/events/pokecenter.asm
+++ b/engine/events/pokecenter.asm
@@ -19,7 +19,7 @@ DisplayPokemonCenterDialogue_::
ld hl, NeedYourPokemonText
call PrintText
ld a, $18
- ld [wSpriteStateData1 + $12], a ; make the nurse turn to face the machine
+ ld [wSprite01StateData1ImageIndex], a ; make the nurse turn to face the machine
call Delay3
predef HealParty
callba AnimateHealingMachine ; do the healing machine animation
@@ -34,7 +34,7 @@ DisplayPokemonCenterDialogue_::
ld hl, PokemonFightingFitText
call PrintText
ld a, $14
- ld [wSpriteStateData1 + $12], a ; make the nurse bow
+ ld [wSprite01StateData1ImageIndex], a ; make the nurse bow
ld c, a
call DelayFrames
jr .done
@@ -46,23 +46,23 @@ DisplayPokemonCenterDialogue_::
jp UpdateSprites
PokemonCenterWelcomeText:
- TX_FAR _PokemonCenterWelcomeText
- db "@"
+ text_far _PokemonCenterWelcomeText
+ text_end
ShallWeHealYourPokemonText:
- TX_DELAY
- TX_FAR _ShallWeHealYourPokemonText
- db "@"
+ text_pause
+ text_far _ShallWeHealYourPokemonText
+ text_end
NeedYourPokemonText:
- TX_FAR _NeedYourPokemonText
- db "@"
+ text_far _NeedYourPokemonText
+ text_end
PokemonFightingFitText:
- TX_FAR _PokemonFightingFitText
- db "@"
+ text_far _PokemonFightingFitText
+ text_end
PokemonCenterFarewellText:
- TX_DELAY
- TX_FAR _PokemonCenterFarewellText
- db "@"
+ text_pause
+ text_far _PokemonCenterFarewellText
+ text_end
diff --git a/engine/events/pokedex_rating.asm b/engine/events/pokedex_rating.asm
index f1aaf618..9dbe2138 100755
--- a/engine/events/pokedex_rating.asm
+++ b/engine/events/pokedex_rating.asm
@@ -52,8 +52,8 @@ DisplayDexRating:
ret
PokedexRatingText_441cc:
- TX_FAR _OaksLabText_441cc
- db "@"
+ text_far _OaksLabText_441cc
+ text_end
DexRatingsTable:
db 10
@@ -90,65 +90,65 @@ DexRatingsTable:
dw PokedexRatingText_4424c
PokedexRatingText_44201:
- TX_FAR _OaksLabText_44201
- db "@"
+ text_far _OaksLabText_44201
+ text_end
PokedexRatingText_44206:
- TX_FAR _OaksLabText_44206
- db "@"
+ text_far _OaksLabText_44206
+ text_end
PokedexRatingText_4420b:
- TX_FAR _OaksLabText_4420b
- db "@"
+ text_far _OaksLabText_4420b
+ text_end
PokedexRatingText_44210:
- TX_FAR _OaksLabText_44210
- db "@"
+ text_far _OaksLabText_44210
+ text_end
PokedexRatingText_44215:
- TX_FAR _OaksLabText_44215
- db "@"
+ text_far _OaksLabText_44215
+ text_end
PokedexRatingText_4421a:
- TX_FAR _OaksLabText_4421a
- db "@"
+ text_far _OaksLabText_4421a
+ text_end
PokedexRatingText_4421f:
- TX_FAR _OaksLabText_4421f
- db "@"
+ text_far _OaksLabText_4421f
+ text_end
PokedexRatingText_44224:
- TX_FAR _OaksLabText_44224
- db "@"
+ text_far _OaksLabText_44224
+ text_end
PokedexRatingText_44229:
- TX_FAR _OaksLabText_44229
- db "@"
+ text_far _OaksLabText_44229
+ text_end
PokedexRatingText_4422e:
- TX_FAR _OaksLabText_4422e
- db "@"
+ text_far _OaksLabText_4422e
+ text_end
PokedexRatingText_44233:
- TX_FAR _OaksLabText_44233
- db "@"
+ text_far _OaksLabText_44233
+ text_end
PokedexRatingText_44238:
- TX_FAR _OaksLabText_44238
- db "@"
+ text_far _OaksLabText_44238
+ text_end
PokedexRatingText_4423d:
- TX_FAR _OaksLabText_4423d
- db "@"
+ text_far _OaksLabText_4423d
+ text_end
PokedexRatingText_44242:
- TX_FAR _OaksLabText_44242
- db "@"
+ text_far _OaksLabText_44242
+ text_end
PokedexRatingText_44247:
- TX_FAR _OaksLabText_44247
- db "@"
+ text_far _OaksLabText_44247
+ text_end
PokedexRatingText_4424c:
- TX_FAR _OaksLabText_4424c
- db "@"
+ text_far _OaksLabText_4424c
+ text_end
diff --git a/engine/events/pokemart.asm b/engine/events/pokemart.asm
index 177e8a09..b05e4ed6 100755
--- a/engine/events/pokemart.asm
+++ b/engine/events/pokemart.asm
@@ -228,45 +228,45 @@ DisplayPokemartDialogue_::
ret
PokemartBuyingGreetingText:
- TX_FAR _PokemartBuyingGreetingText
- db "@"
+ text_far _PokemartBuyingGreetingText
+ text_end
PokemartTellBuyPriceText:
- TX_FAR _PokemartTellBuyPriceText
- db "@"
+ text_far _PokemartTellBuyPriceText
+ text_end
PokemartBoughtItemText:
- TX_FAR _PokemartBoughtItemText
- db "@"
+ text_far _PokemartBoughtItemText
+ text_end
PokemartNotEnoughMoneyText:
- TX_FAR _PokemartNotEnoughMoneyText
- db "@"
+ text_far _PokemartNotEnoughMoneyText
+ text_end
PokemartItemBagFullText:
- TX_FAR _PokemartItemBagFullText
- db "@"
+ text_far _PokemartItemBagFullText
+ text_end
PokemonSellingGreetingText:
- TX_FAR _PokemonSellingGreetingText
- db "@"
+ text_far _PokemonSellingGreetingText
+ text_end
PokemartTellSellPriceText:
- TX_FAR _PokemartTellSellPriceText
- db "@"
+ text_far _PokemartTellSellPriceText
+ text_end
PokemartItemBagEmptyText:
- TX_FAR _PokemartItemBagEmptyText
- db "@"
+ text_far _PokemartItemBagEmptyText
+ text_end
PokemartUnsellableItemText:
- TX_FAR _PokemartUnsellableItemText
- db "@"
+ text_far _PokemartUnsellableItemText
+ text_end
PokemartThankYouText:
- TX_FAR _PokemartThankYouText
- db "@"
+ text_far _PokemartThankYouText
+ text_end
PokemartAnythingElseText:
- TX_FAR _PokemartAnythingElseText
- db "@"
+ text_far _PokemartAnythingElseText
+ text_end
diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm
index 5a00a89e..c79fdbbc 100755
--- a/engine/events/prize_menu.asm
+++ b/engine/events/prize_menu.asm
@@ -43,17 +43,17 @@ CeladonPrizeMenu::
ret
RequireCoinCaseTextPtr:
- TX_FAR _RequireCoinCaseText
- TX_WAIT
- db "@"
+ text_far _RequireCoinCaseText
+ text_linkpromptbutton
+ text_end
ExchangeCoinsForPrizesTextPtr:
- TX_FAR _ExchangeCoinsForPrizesText
- db "@"
+ text_far _ExchangeCoinsForPrizesText
+ text_end
WhichPrizeTextPtr:
- TX_FAR _WhichPrizeText
- db "@"
+ text_far _WhichPrizeText
+ text_end
GetPrizeMenuId:
; determine which one among the three
@@ -263,28 +263,28 @@ UnknownPrizeData:
db $00,$01,$00,$01,$00,$01,$00,$00,$01
HereYouGoTextPtr:
- TX_FAR _HereYouGoText
- TX_WAIT
- db "@"
+ text_far _HereYouGoText
+ text_linkpromptbutton
+ text_end
SoYouWantPrizeTextPtr:
- TX_FAR _SoYouWantPrizeText
- db "@"
+ text_far _SoYouWantPrizeText
+ text_end
SorryNeedMoreCoinsText:
- TX_FAR _SorryNeedMoreCoinsText
- TX_WAIT
- db "@"
+ text_far _SorryNeedMoreCoinsText
+ text_linkpromptbutton
+ text_end
PrizeRoomBagIsFullTextPtr:
- TX_FAR _OopsYouDontHaveEnoughRoomText
- TX_WAIT
- db "@"
+ text_far _OopsYouDontHaveEnoughRoomText
+ text_linkpromptbutton
+ text_end
OhFineThenTextPtr:
- TX_FAR _OhFineThenText
- TX_WAIT
- db "@"
+ text_far _OhFineThenText
+ text_linkpromptbutton
+ text_end
GetPrizeMonLevel:
ld a, [wcf91]
diff --git a/engine/events/vending_machine.asm b/engine/events/vending_machine.asm
index 4a39f7b9..acb8dce8 100755
--- a/engine/events/vending_machine.asm
+++ b/engine/events/vending_machine.asm
@@ -81,8 +81,8 @@ VendingMachineMenu::
jp PrintText
VendingMachineText1:
- TX_FAR _VendingMachineText1
- db "@"
+ text_far _VendingMachineText1
+ text_end
DrinkText:
db "FRESH WATER"
@@ -97,20 +97,20 @@ DrinkPriceText:
next "@"
VendingMachineText4:
- TX_FAR _VendingMachineText4
- db "@"
+ text_far _VendingMachineText4
+ text_end
VendingMachineText5:
- TX_FAR _VendingMachineText5
- db "@"
+ text_far _VendingMachineText5
+ text_end
VendingMachineText6:
- TX_FAR _VendingMachineText6
- db "@"
+ text_far _VendingMachineText6
+ text_end
VendingMachineText7:
- TX_FAR _VendingMachineText7
- db "@"
+ text_far _VendingMachineText7
+ text_end
LoadVendingMachineItem:
ld hl, VendingPrices
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm
index 7e2aa227..93eab051 100755
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -586,47 +586,47 @@ ItemUseBall:
ItemUseBallText00:
;"It dodged the thrown ball!"
;"This pokemon can't be caught"
- TX_FAR _ItemUseBallText00
- db "@"
+ text_far _ItemUseBallText00
+ text_end
ItemUseBallText01:
;"You missed the pokemon!"
- TX_FAR _ItemUseBallText01
- db "@"
+ text_far _ItemUseBallText01
+ text_end
ItemUseBallText02:
;"Darn! The pokemon broke free!"
- TX_FAR _ItemUseBallText02
- db "@"
+ text_far _ItemUseBallText02
+ text_end
ItemUseBallText03:
;"Aww! It appeared to be caught!"
- TX_FAR _ItemUseBallText03
- db "@"
+ text_far _ItemUseBallText03
+ text_end
ItemUseBallText04:
;"Shoot! It was so close too!"
- TX_FAR _ItemUseBallText04
- db "@"
+ text_far _ItemUseBallText04
+ text_end
ItemUseBallText05:
;"All right! {MonName} was caught!"
;play sound
- TX_FAR _ItemUseBallText05
- TX_SFX_CAUGHT_MON
- TX_BLINK
- db "@"
+ text_far _ItemUseBallText05
+ sound_caught_mon
+ text_promptbutton
+ text_end
ItemUseBallText07:
;"X was transferred to Bill's PC"
- TX_FAR _ItemUseBallText07
- db "@"
+ text_far _ItemUseBallText07
+ text_end
ItemUseBallText08:
;"X was transferred to someone's PC"
- TX_FAR _ItemUseBallText08
- db "@"
+ text_far _ItemUseBallText08
+ text_end
ItemUseBallText06:
;"New DEX data will be added..."
;play sound
- TX_FAR _ItemUseBallText06
- TX_SFX_DEX_PAGE_ADDED
- TX_BLINK
- db "@"
+ text_far _ItemUseBallText06
+ sound_dex_page_added
+ text_promptbutton
+ text_end
ItemUseTownMap:
ld a, [wIsInBattle]
@@ -745,12 +745,12 @@ ItemUseSurfboard:
ret
SurfingGotOnText:
- TX_FAR _SurfingGotOnText
- db "@"
+ text_far _SurfingGotOnText
+ text_end
SurfingNoPlaceToGetOffText:
- TX_FAR _SurfingNoPlaceToGetOffText
- db "@"
+ text_far _SurfingNoPlaceToGetOffText
+ text_end
ItemUsePokedex:
predef_jump ShowPokedexMenu
@@ -1417,12 +1417,12 @@ ItemUseMedicine:
jp RemoveUsedItem
VitaminStatRoseText:
- TX_FAR _VitaminStatRoseText
- db "@"
+ text_far _VitaminStatRoseText
+ text_end
VitaminNoEffectText:
- TX_FAR _VitaminNoEffectText
- db "@"
+ text_far _VitaminNoEffectText
+ text_end
VitaminText:
db "HEALTH@"
@@ -1479,12 +1479,12 @@ BaitRockCommon:
jp DelayFrames
ThrewBaitText:
- TX_FAR _ThrewBaitText
- db "@"
+ text_far _ThrewBaitText
+ text_end
ThrewRockText:
- TX_FAR _ThrewRockText
- db "@"
+ text_far _ThrewRockText
+ text_end
; also used for Dig out-of-battle effect
ItemUseEscapeRope:
@@ -1829,17 +1829,17 @@ Route16SnorlaxFluteCoords:
db $ff ; terminator
PlayedFluteNoEffectText:
- TX_FAR _PlayedFluteNoEffectText
- db "@"
+ text_far _PlayedFluteNoEffectText
+ text_end
FluteWokeUpText:
- TX_FAR _FluteWokeUpText
- db "@"
+ text_far _FluteWokeUpText
+ text_end
PlayedFluteHadEffectText:
- TX_FAR _PlayedFluteHadEffectText
- TX_BLINK
- TX_ASM
+ text_far _PlayedFluteHadEffectText
+ text_promptbutton
+ text_asm
ld a, [wIsInBattle]
and a
jr nz, .done
@@ -1865,8 +1865,8 @@ ItemUseCoinCase:
jp PrintText
CoinCaseNumCoinsText:
- TX_FAR _CoinCaseNumCoinsText
- db "@"
+ text_far _CoinCaseNumCoinsText
+ text_end
ItemUseOldRod:
call FishingInit
@@ -1984,12 +1984,12 @@ ItemUseItemfinder:
jp PrintText
ItemfinderFoundItemText:
- TX_FAR _ItemfinderFoundItemText
- db "@"
+ text_far _ItemfinderFoundItemText
+ text_end
ItemfinderFoundNothingText:
- TX_FAR _ItemfinderFoundNothingText
- db "@"
+ text_far _ItemfinderFoundNothingText
+ text_end
ItemUsePPUp:
ld a, [wIsInBattle]
@@ -2173,24 +2173,24 @@ ItemUsePPRestore:
ret
RaisePPWhichTechniqueText:
- TX_FAR _RaisePPWhichTechniqueText
- db "@"
+ text_far _RaisePPWhichTechniqueText
+ text_end
RestorePPWhichTechniqueText:
- TX_FAR _RestorePPWhichTechniqueText
- db "@"
+ text_far _RestorePPWhichTechniqueText
+ text_end
PPMaxedOutText:
- TX_FAR _PPMaxedOutText
- db "@"
+ text_far _PPMaxedOutText
+ text_end
PPIncreasedText:
- TX_FAR _PPIncreasedText
- db "@"
+ text_far _PPIncreasedText
+ text_end
PPRestoredText:
- TX_FAR _PPRestoredText
- db "@"
+ text_far _PPRestoredText
+ text_end
; for items that can't be used from the Item menu
UnusableItem:
@@ -2294,20 +2294,20 @@ ItemUseTMHM:
jp RemoveUsedItem
BootedUpTMText:
- TX_FAR _BootedUpTMText
- db "@"
+ text_far _BootedUpTMText
+ text_end
BootedUpHMText:
- TX_FAR _BootedUpHMText
- db "@"
+ text_far _BootedUpHMText
+ text_end
TeachMachineMoveText:
- TX_FAR _TeachMachineMoveText
- db "@"
+ text_far _TeachMachineMoveText
+ text_end
MonCannotLearnMachineMoveText:
- TX_FAR _MonCannotLearnMachineMoveText
- db "@"
+ text_far _MonCannotLearnMachineMoveText
+ text_end
PrintItemUseTextAndRemoveItem:
ld hl, ItemUseText00
@@ -2364,54 +2364,54 @@ ItemUseFailed:
jp PrintText
ItemUseNotTimeText:
- TX_FAR _ItemUseNotTimeText
- db "@"
+ text_far _ItemUseNotTimeText
+ text_end
ItemUseNotYoursToUseText:
- TX_FAR _ItemUseNotYoursToUseText
- db "@"
+ text_far _ItemUseNotYoursToUseText
+ text_end
ItemUseNoEffectText:
- TX_FAR _ItemUseNoEffectText
- db "@"
+ text_far _ItemUseNoEffectText
+ text_end
ThrowBallAtTrainerMonText1:
- TX_FAR _ThrowBallAtTrainerMonText1
- db "@"
+ text_far _ThrowBallAtTrainerMonText1
+ text_end
ThrowBallAtTrainerMonText2:
- TX_FAR _ThrowBallAtTrainerMonText2
- db "@"
+ text_far _ThrowBallAtTrainerMonText2
+ text_end
NoCyclingAllowedHereText:
- TX_FAR _NoCyclingAllowedHereText
- db "@"
+ text_far _NoCyclingAllowedHereText
+ text_end
NoSurfingHereText:
- TX_FAR _NoSurfingHereText
- db "@"
+ text_far _NoSurfingHereText
+ text_end
BoxFullCannotThrowBallText:
- TX_FAR _BoxFullCannotThrowBallText
- db "@"
+ text_far _BoxFullCannotThrowBallText
+ text_end
ItemUseText00:
- TX_FAR _ItemUseText001
- TX_LINE
- TX_FAR _ItemUseText002
- db "@"
+ text_far _ItemUseText001
+ text_low
+ text_far _ItemUseText002
+ text_end
GotOnBicycleText:
- TX_FAR _GotOnBicycleText1
- TX_LINE
- TX_FAR _GotOnBicycleText2
- db "@"
+ text_far _GotOnBicycleText1
+ text_low
+ text_far _GotOnBicycleText2
+ text_end
GotOffBicycleText:
- TX_FAR _GotOffBicycleText1
- TX_LINE
- TX_FAR _GotOffBicycleText2
- db "@"
+ text_far _GotOffBicycleText1
+ text_low
+ text_far _GotOffBicycleText2
+ text_end
; restores bonus PP (from PP Ups) when healing at a pokemon center
; also, when a PP Up is used, it increases the current PP by one PP Up bonus
@@ -2639,16 +2639,16 @@ TossItem_::
ret
ThrewAwayItemText:
- TX_FAR _ThrewAwayItemText
- db "@"
+ text_far _ThrewAwayItemText
+ text_end
IsItOKToTossItemText:
- TX_FAR _IsItOKToTossItemText
- db "@"
+ text_far _IsItOKToTossItemText
+ text_end
TooImportantToTossText:
- TX_FAR _TooImportantToTossText
- db "@"
+ text_far _TooImportantToTossText
+ text_end
; checks if an item is a key item
; INPUT:
diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm
index 7ccaa232..a11cd736 100755
--- a/engine/items/tmhm.asm
+++ b/engine/items/tmhm.asm
@@ -22,5 +22,5 @@ CheckIfMoveIsKnown:
ret
AlreadyKnowsText:
- TX_FAR _AlreadyKnowsText
- db "@"
+ text_far _AlreadyKnowsText
+ text_end
diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm
index 58008a94..ca43a895 100755
--- a/engine/link/cable_club.asm
+++ b/engine/link/cable_club.asm
@@ -872,8 +872,8 @@ TradeCenter_Trade:
jp CallCurrentTradeCenterFunction
WillBeTradedText:
- TX_FAR _WillBeTradedText
- db "@"
+ text_far _WillBeTradedText
+ text_end
TradeCompleted:
db "Trade completed!@"
diff --git a/engine/link/cable_club_npc.asm b/engine/link/cable_club_npc.asm
index bb0f7680..6001c314 100755
--- a/engine/link/cable_club_npc.asm
+++ b/engine/link/cable_club_npc.asm
@@ -110,33 +110,33 @@ CableClubNPC::
jpab LinkMenu
CableClubNPCAreaReservedFor2FriendsLinkedByCableText:
- TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText
- db "@"
+ text_far _CableClubNPCAreaReservedFor2FriendsLinkedByCableText
+ text_end
CableClubNPCWelcomeText:
- TX_FAR _CableClubNPCWelcomeText
- db "@"
+ text_far _CableClubNPCWelcomeText
+ text_end
CableClubNPCPleaseApplyHereHaveToSaveText:
- TX_FAR _CableClubNPCPleaseApplyHereHaveToSaveText
- db "@"
+ text_far _CableClubNPCPleaseApplyHereHaveToSaveText
+ text_end
CableClubNPCPleaseWaitText:
- TX_FAR _CableClubNPCPleaseWaitText
- TX_DELAY
- db "@"
+ text_far _CableClubNPCPleaseWaitText
+ text_pause
+ text_end
CableClubNPCLinkClosedBecauseOfInactivityText:
- TX_FAR _CableClubNPCLinkClosedBecauseOfInactivityText
- db "@"
+ text_far _CableClubNPCLinkClosedBecauseOfInactivityText
+ text_end
CableClubNPCPleaseComeAgainText:
- TX_FAR _CableClubNPCPleaseComeAgainText
- db "@"
+ text_far _CableClubNPCPleaseComeAgainText
+ text_end
CableClubNPCMakingPreparationsText:
- TX_FAR _CableClubNPCMakingPreparationsText
- db "@"
+ text_far _CableClubNPCMakingPreparationsText
+ text_end
CloseLinkConnection:
call Delay3
diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm
index 45c76f9c..c02e5bbc 100644
--- a/engine/menus/display_text_id_init.asm
+++ b/engine/menus/display_text_id_init.asm
@@ -41,7 +41,7 @@ DisplayTextIDInit::
; loop to copy C1X9 (direction the sprite is facing) to C2X9 for each sprite
; this is done because when you talk to an NPC, they turn to look your way
; the original direction they were facing must be restored after the dialogue is over
- ld hl, wSpriteStateData1 + $19
+ ld hl, wSprite01StateData1FacingDirection
ld c, $0f
ld de, $10
.spriteFacingDirectionCopyLoop
@@ -54,7 +54,7 @@ DisplayTextIDInit::
jr nz, .spriteFacingDirectionCopyLoop
; loop to force all the sprites in the middle of animation to stand still
; (so that they don't like they're frozen mid-step during the dialogue)
- ld hl, wSpriteStateData1 + 2
+ ld hl, wSpritePlayerStateData1ImageIndex
ld de, $10
ld c, e
.spriteStandStillLoop
diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm
index 170c0ef3..c07c6bc1 100755
--- a/engine/menus/league_pc.asm
+++ b/engine/menus/league_pc.asm
@@ -116,5 +116,5 @@ HallOfFameNoText:
db "HALL OF FAME No @"
AccessedHoFPCText:
- TX_FAR _AccessedHoFPCText
- db "@"
+ text_far _AccessedHoFPCText
+ text_end
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index fe82ec4a..43289ce8 100755
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -136,7 +136,7 @@ LinkMenu:
ld [wLetterPrintingDelayFlags], a
ld hl, wd72e
set 6, [hl]
- ld hl, TextTerminator_6b20
+ ld hl, LinkMenuEmptyText
call PrintText
call SaveScreenTilesToBuffer1
ld hl, WhereWouldYouLikeText
@@ -293,16 +293,16 @@ LinkMenu:
ret
WhereWouldYouLikeText:
- TX_FAR _WhereWouldYouLikeText
- db "@"
+ text_far _WhereWouldYouLikeText
+ text_end
PleaseWaitText:
- TX_FAR _PleaseWaitText
- db "@"
+ text_far _PleaseWaitText
+ text_end
LinkCanceledText:
- TX_FAR _LinkCanceledText
- db "@"
+ text_far _LinkCanceledText
+ text_end
StartNewGame:
ld hl, wd732
@@ -329,7 +329,9 @@ SpecialEnterMap::
jp EnterMap
ContinueText:
- db "CONTINUE", $4e
+ db "CONTINUE"
+ next ""
+ ; fallthrough
NewGameText:
db "NEW GAME"
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index efeab4c3..a84609c9 100755
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -50,8 +50,8 @@ AskName:
jp CopyData
DoYouWantToNicknameText:
- TX_FAR _DoYouWantToNicknameText
- db "@"
+ text_far _DoYouWantToNicknameText
+ text_end
DisplayNameRaterScreen::
ld hl, wBuffer
diff --git a/engine/menus/oaks_pc.asm b/engine/menus/oaks_pc.asm
index 03c9b8f1..cdb97aca 100755
--- a/engine/menus/oaks_pc.asm
+++ b/engine/menus/oaks_pc.asm
@@ -15,14 +15,14 @@ OpenOaksPC:
jp LoadScreenTilesFromBuffer2
GetDexRatedText:
- TX_FAR _GetDexRatedText
- db "@"
+ text_far _GetDexRatedText
+ text_end
ClosedOaksPCText:
- TX_FAR _ClosedOaksPCText
- TX_WAIT
- db "@"
+ text_far _ClosedOaksPCText
+ text_linkpromptbutton
+ text_end
AccessedOaksPCText:
- TX_FAR _AccessedOaksPCText
- db "@"
+ text_far _AccessedOaksPCText
+ text_end
diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm
index 9ae5706e..f63a3cf0 100755
--- a/engine/menus/party_menu.asm
+++ b/engine/menus/party_menu.asm
@@ -254,62 +254,62 @@ PartyMenuMessagePointers:
dw PartyMenuItemUseText
PartyMenuNormalText:
- TX_FAR _PartyMenuNormalText
- db "@"
+ text_far _PartyMenuNormalText
+ text_end
PartyMenuItemUseText:
- TX_FAR _PartyMenuItemUseText
- db "@"
+ text_far _PartyMenuItemUseText
+ text_end
PartyMenuBattleText:
- TX_FAR _PartyMenuBattleText
- db "@"
+ text_far _PartyMenuBattleText
+ text_end
PartyMenuUseTMText:
- TX_FAR _PartyMenuUseTMText
- db "@"
+ text_far _PartyMenuUseTMText
+ text_end
PartyMenuSwapMonText:
- TX_FAR _PartyMenuSwapMonText
- db "@"
+ text_far _PartyMenuSwapMonText
+ text_end
PotionText:
- TX_FAR _PotionText
- db "@"
+ text_far _PotionText
+ text_end
AntidoteText:
- TX_FAR _AntidoteText
- db "@"
+ text_far _AntidoteText
+ text_end
ParlyzHealText:
- TX_FAR _ParlyzHealText
- db "@"
+ text_far _ParlyzHealText
+ text_end
BurnHealText:
- TX_FAR _BurnHealText
- db "@"
+ text_far _BurnHealText
+ text_end
IceHealText:
- TX_FAR _IceHealText
- db "@"
+ text_far _IceHealText
+ text_end
AwakeningText:
- TX_FAR _AwakeningText
- db "@"
+ text_far _AwakeningText
+ text_end
FullHealText:
- TX_FAR _FullHealText
- db "@"
+ text_far _FullHealText
+ text_end
ReviveText:
- TX_FAR _ReviveText
- db "@"
+ text_far _ReviveText
+ text_end
RareCandyText:
- TX_FAR _RareCandyText
- TX_SFX_ITEM_1 ; probably supposed to play SFX_LEVEL_UP but the wrong music bank is loaded
- TX_BLINK
- db "@"
+ text_far _RareCandyText
+ sound_get_item_1 ; probably supposed to play SFX_LEVEL_UP but the wrong music bank is loaded
+ text_promptbutton
+ text_end
SetPartyMenuHPBarColor:
ld hl, wPartyMenuHPBarColors
diff --git a/engine/menus/pc.asm b/engine/menus/pc.asm
index 6ec45f2e..f296ad61 100755
--- a/engine/menus/pc.asm
+++ b/engine/menus/pc.asm
@@ -99,20 +99,20 @@ LogOff:
ret
TurnedOnPC1Text:
- TX_FAR _TurnedOnPC1Text
- db "@"
+ text_far _TurnedOnPC1Text
+ text_end
AccessedBillsPCText:
- TX_FAR _AccessedBillsPCText
- db "@"
+ text_far _AccessedBillsPCText
+ text_end
AccessedSomeonesPCText:
- TX_FAR _AccessedSomeonesPCText
- db "@"
+ text_far _AccessedSomeonesPCText
+ text_end
AccessedMyPCText:
- TX_FAR _AccessedMyPCText
- db "@"
+ text_far _AccessedMyPCText
+ text_end
; removes one of the specified item ID [hItemToRemoveID] from bag (if existent)
RemoveItemByID::
diff --git a/engine/menus/players_pc.asm b/engine/menus/players_pc.asm
index 403632fa..ebaacd52 100755
--- a/engine/menus/players_pc.asm
+++ b/engine/menus/players_pc.asm
@@ -247,57 +247,57 @@ PlayersPCMenuEntries:
next "LOG OFF@"
TurnedOnPC2Text:
- TX_FAR _TurnedOnPC2Text
- db "@"
+ text_far _TurnedOnPC2Text
+ text_end
WhatDoYouWantText:
- TX_FAR _WhatDoYouWantText
- db "@"
+ text_far _WhatDoYouWantText
+ text_end
WhatToDepositText:
- TX_FAR _WhatToDepositText
- db "@"
+ text_far _WhatToDepositText
+ text_end
DepositHowManyText:
- TX_FAR _DepositHowManyText
- db "@"
+ text_far _DepositHowManyText
+ text_end
ItemWasStoredText:
- TX_FAR _ItemWasStoredText
- db "@"
+ text_far _ItemWasStoredText
+ text_end
NothingToDepositText:
- TX_FAR _NothingToDepositText
- db "@"
+ text_far _NothingToDepositText
+ text_end
NoRoomToStoreText:
- TX_FAR _NoRoomToStoreText
- db "@"
+ text_far _NoRoomToStoreText
+ text_end
WhatToWithdrawText:
- TX_FAR _WhatToWithdrawText
- db "@"
+ text_far _WhatToWithdrawText
+ text_end
WithdrawHowManyText:
- TX_FAR _WithdrawHowManyText
- db "@"
+ text_far _WithdrawHowManyText
+ text_end
WithdrewItemText:
- TX_FAR _WithdrewItemText
- db "@"
+ text_far _WithdrewItemText
+ text_end
NothingStoredText:
- TX_FAR _NothingStoredText
- db "@"
+ text_far _NothingStoredText
+ text_end
CantCarryMoreText:
- TX_FAR _CantCarryMoreText
- db "@"
+ text_far _CantCarryMoreText
+ text_end
WhatToTossText:
- TX_FAR _WhatToTossText
- db "@"
+ text_far _WhatToTossText
+ text_end
TossHowManyText:
- TX_FAR _TossHowManyText
- db "@"
+ text_far _TossHowManyText
+ text_end
diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm
index baf656b6..542ef873 100755
--- a/engine/menus/pokedex.asm
+++ b/engine/menus/pokedex.asm
@@ -478,7 +478,7 @@ ShowPokedexDataInternal:
coord hl, 2, 8
ld a, "№"
ld [hli], a
- ld a, "⠄"
+ ld a, "<DOT>"
ld [hli], a
ld de, wd11e
lb bc, LEADING_ZEROES | 1, 3
@@ -518,14 +518,14 @@ ShowPokedexDataInternal:
coord hl, 12, 6
lb bc, 1, 2
call PrintNumber ; print feet (height)
- ld a, $60 ; feet symbol tile (one tick)
+ ld a, "′"
ld [hl], a
inc de
inc de ; de = address of inches (height)
coord hl, 15, 6
lb bc, LEADING_ZEROES | 1, 2
call PrintNumber ; print inches (height)
- ld a, $61 ; inches symbol tile (two ticks)
+ ld a, "″"
ld [hl], a
; now print the weight (note that weight is stored in tenths of pounds internally)
inc de
@@ -558,7 +558,7 @@ ShowPokedexDataInternal:
inc hl
ld a, [hli]
ld [hld], a ; make space for the decimal point by moving the last digit forward one tile
- ld [hl], "⠄" ; decimal point tile
+ ld [hl], "<DOT>" ; decimal point tile
pop af
ld [hDexWeight + 1], a ; restore original value of [hDexWeight + 1]
pop af
@@ -590,7 +590,7 @@ ShowPokedexDataInternal:
ret
HeightWeightText:
- db "HT ?",$60,"??",$61
+ db "HT ?′??″"
next "WT ???lb@"
; XXX does anything point to this?
diff --git a/engine/menus/save.asm b/engine/menus/save.asm
index ee73c850..462e0eea 100755
--- a/engine/menus/save.asm
+++ b/engine/menus/save.asm
@@ -28,8 +28,8 @@ LoadSAV:
ret
FileDataDestroyedText:
- TX_FAR _FileDataDestroyedText
- db "@"
+ text_far _FileDataDestroyedText
+ text_end
LoadSAV0:
ld a, SRAM_ENABLE
@@ -184,16 +184,16 @@ SaveSAVConfirm:
ret
WouldYouLikeToSaveText:
- TX_FAR _WouldYouLikeToSaveText
- db "@"
+ text_far _WouldYouLikeToSaveText
+ text_end
GameSavedText:
- TX_FAR _GameSavedText
- db "@"
+ text_far _GameSavedText
+ text_end
OlderFileWillBeErasedText:
- TX_FAR _OlderFileWillBeErasedText
- db "@"
+ text_far _OlderFileWillBeErasedText
+ text_end
SaveSAVtoSRAM0:
ld a, SRAM_ENABLE
@@ -386,8 +386,8 @@ ChangeBox::
ret
WhenYouChangeBoxText:
- TX_FAR _WhenYouChangeBoxText
- db "@"
+ text_far _WhenYouChangeBoxText
+ text_end
CopyBoxToOrFromSRAM:
; copy an entire box from hl to de with b as the SRAM bank
@@ -490,8 +490,8 @@ DisplayChangeBoxMenu:
ret
ChooseABoxText:
- TX_FAR _ChooseABoxText
- db "@"
+ text_far _ChooseABoxText
+ text_end
BoxNames:
db "BOX 1"
diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm
index 526540df..9ec06556 100755
--- a/engine/menus/start_sub_menus.asm
+++ b/engine/menus/start_sub_menus.asm
@@ -190,8 +190,8 @@ StartMenu_Pokemon::
call GBPalWhiteOutWithDelay3
jp .goBackToMap
.flashLightsAreaText
- TX_FAR _FlashLightsAreaText
- db "@"
+ text_far _FlashLightsAreaText
+ text_end
.dig
ld a, ESCAPE_ROPE
ld [wcf91], a
@@ -225,14 +225,14 @@ StartMenu_Pokemon::
call GBPalWhiteOutWithDelay3
jp .goBackToMap
.warpToLastPokemonCenterText
- TX_FAR _WarpToLastPokemonCenterText
- db "@"
+ text_far _WarpToLastPokemonCenterText
+ text_end
.cannotUseTeleportNowText
- TX_FAR _CannotUseTeleportNowText
- db "@"
+ text_far _CannotUseTeleportNowText
+ text_end
.cannotFlyHereText
- TX_FAR _CannotFlyHereText
- db "@"
+ text_far _CannotFlyHereText
+ text_end
.softboiled
ld hl, wPartyMon1MaxHP
ld a, [wWhichPokemon]
@@ -270,8 +270,8 @@ StartMenu_Pokemon::
call PrintText
jp .loop
.notHealthyEnoughText
- TX_FAR _NotHealthyEnoughText
- db "@"
+ text_far _NotHealthyEnoughText
+ text_end
.goBackToMap
call RestoreScreenTilesAndReloadTilePatterns
jp CloseTextDisplay
@@ -280,8 +280,8 @@ StartMenu_Pokemon::
call PrintText
jp .loop
.newBadgeRequiredText
- TX_FAR _NewBadgeRequiredText
- db "@"
+ text_far _NewBadgeRequiredText
+ text_end
; writes a blank tile to all possible menu cursor positions on the party menu
ErasePartyMenuCursors::
@@ -439,12 +439,12 @@ StartMenu_Item::
jp ItemMenuLoop
CannotUseItemsHereText:
- TX_FAR _CannotUseItemsHereText
- db "@"
+ text_far _CannotUseItemsHereText
+ text_end
CannotGetOffHereText:
- TX_FAR _CannotGetOffHereText
- db "@"
+ text_far _CannotGetOffHereText
+ text_end
INCLUDE "data/items/use_party.asm"
diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm
index 00045959..e3de41b4 100644
--- a/engine/menus/text_box.asm
+++ b/engine/menus/text_box.asm
@@ -220,7 +220,9 @@ TextBoxTextAndCoordTable:
BuySellQuitText:
db "BUY"
next "SELL"
- next "QUIT@@"
+ next "QUIT@"
+
+ db "@" ; unused
UseTossText:
db "USE"
@@ -245,7 +247,7 @@ JapaneseMainMenuText:
next "さいしょから@"
BattleMenuText:
- db "FIGHT ",$E1,$E2
+ db "FIGHT <PK><MN>"
next "ITEM RUN@"
SafariZoneBattleMenuText:
@@ -258,7 +260,7 @@ SwitchStatsCancelText:
next "CANCEL@"
JapaneseAhText:
- db "アッ!@"
+ db "アッ!@"
JapanesePokedexMenu:
db "データをみる"
diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm
index 4ba50615..d8e593a5 100755
--- a/engine/movie/credits.asm
+++ b/engine/movie/credits.asm
@@ -180,17 +180,17 @@ Credits:
ld a, [de]
inc de
push de
- cp $ff
+ cp CRED_TEXT_FADE_MON
jr z, .fadeInTextAndShowMon
- cp $fe
+ cp CRED_TEXT_MON
jr z, .showTextAndShowMon
- cp $fd
+ cp CRED_TEXT_FADE
jr z, .fadeInText
- cp $fc
+ cp CRED_TEXT
jr z, .showText
- cp $fb
+ cp CRED_COPYRIGHT
jr z, .showCopyrightText
- cp $fa
+ cp CRED_THE_END
jr z, .showTheEnd
push hl
push hl
@@ -205,7 +205,7 @@ Credits:
ld a, [de]
inc de
ld c, a
- ld b, $ff
+ ld b, -1
pop hl
add hl, bc
call PlaceString
diff --git a/engine/movie/hall_of_fame.asm b/engine/movie/hall_of_fame.asm
index d874b2fd..f0553eb6 100755
--- a/engine/movie/hall_of_fame.asm
+++ b/engine/movie/hall_of_fame.asm
@@ -257,12 +257,12 @@ HoFMoneyText:
db "MONEY@"
DexSeenOwnedText:
- TX_FAR _DexSeenOwnedText
- db "@"
+ text_far _DexSeenOwnedText
+ text_end
DexRatingText:
- TX_FAR _DexRatingText
- db "@"
+ text_far _DexRatingText
+ text_end
HoFRecordMonInfo:
ld hl, wHallOfFame
diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm
index a8151ab4..21f1a885 100755
--- a/engine/movie/intro.asm
+++ b/engine/movie/intro.asm
@@ -97,7 +97,7 @@ PlayIntroScene:
; hip
ld a, SFX_INTRO_HIP
call PlaySound
- ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / BYTES_PER_TILE
+ ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / LEN_2BPP_TILE
ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation3
call AnimateIntroNidorino
@@ -129,7 +129,7 @@ PlayIntroScene:
call CheckForUserInterruption
ret c
- ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / BYTES_PER_TILE
+ ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / LEN_2BPP_TILE
ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation6
call AnimateIntroNidorino
@@ -140,7 +140,7 @@ PlayIntroScene:
; lunge
ld a, SFX_INTRO_LUNGE
call PlaySound
- ld a, (FightIntroFrontMon3 - FightIntroFrontMon) / BYTES_PER_TILE
+ ld a, (FightIntroFrontMon3 - FightIntroFrontMon) / LEN_2BPP_TILE
ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation7
jp AnimateIntroNidorino
diff --git a/engine/movie/oak_speech/clear_save.asm b/engine/movie/oak_speech/clear_save.asm
index b47cd6c4..b214ec32 100755
--- a/engine/movie/oak_speech/clear_save.asm
+++ b/engine/movie/oak_speech/clear_save.asm
@@ -19,5 +19,5 @@ DoClearSaveDialogue:
jp Init
ClearSaveDataText:
- TX_FAR _ClearSaveDataText
- db "@"
+ text_far _ClearSaveDataText
+ text_end
diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm
index 578cf3b2..0dd0c2dc 100755
--- a/engine/movie/oak_speech/oak_speech.asm
+++ b/engine/movie/oak_speech/oak_speech.asm
@@ -9,8 +9,8 @@ SetDefaultNames:
ld bc, wBoxDataEnd - wPlayerName
xor a
call FillMemory
- ld hl, wSpriteStateData1
- ld bc, $200
+ ld hl, wSpriteDataStart
+ ld bc, wSpriteDataEnd - wSpriteDataStart
xor a
call FillMemory
pop af
@@ -153,22 +153,22 @@ OakSpeech:
call GBFadeOutToWhite
jp ClearScreen
OakSpeechText1:
- TX_FAR _OakSpeechText1
- db "@"
+ text_far _OakSpeechText1
+ text_end
OakSpeechText2:
- TX_FAR _OakSpeechText2A
- TX_CRY_NIDORINA
- TX_FAR _OakSpeechText2B
- db "@"
+ text_far _OakSpeechText2A
+ sound_cry_nidorina
+ text_far _OakSpeechText2B
+ text_end
IntroducePlayerText:
- TX_FAR _IntroducePlayerText
- db "@"
+ text_far _IntroducePlayerText
+ text_end
IntroduceRivalText:
- TX_FAR _IntroduceRivalText
- db "@"
+ text_far _IntroduceRivalText
+ text_end
OakSpeechText3:
- TX_FAR _OakSpeechText3
- db "@"
+ text_far _OakSpeechText3
+ text_end
FadeInIntroPic:
ld hl, IntroFadePalettes
diff --git a/engine/movie/oak_speech/oak_speech2.asm b/engine/movie/oak_speech/oak_speech2.asm
index 8c4a896b..743d0d13 100755
--- a/engine/movie/oak_speech/oak_speech2.asm
+++ b/engine/movie/oak_speech/oak_speech2.asm
@@ -28,8 +28,8 @@ ChoosePlayerName:
jp PrintText
YourNameIsText:
- TX_FAR _YourNameIsText
- db "@"
+ text_far _YourNameIsText
+ text_end
ChooseRivalName:
call OakSpeechSlidePicRight
@@ -61,8 +61,8 @@ ChooseRivalName:
jp PrintText
HisNameIsText:
- TX_FAR _HisNameIsText
- db "@"
+ text_far _HisNameIsText
+ text_end
OakSpeechSlidePicLeft:
push de
@@ -215,5 +215,5 @@ GetDefaultName:
INCLUDE "data/player_names_list.asm"
-TextTerminator_6b20:
- db "@"
+LinkMenuEmptyText:
+ text_end
diff --git a/engine/movie/title.asm b/engine/movie/title.asm
index 9cbe5494..5ee9b77f 100755
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -189,7 +189,7 @@ ENDC
; scroll game version in from the right
call PrintGameVersionOnTitleScreen
- ld a, SCREEN_HEIGHT_PIXELS
+ ld a, SCREEN_HEIGHT_PX
ld [hWY], a
ld d, 144
.scrollTitleScreenGameVersionLoop
diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm
index 6af6f2e3..8b596e5e 100755
--- a/engine/movie/trade.asm
+++ b/engine/movie/trade.asm
@@ -785,8 +785,8 @@ PrintTradeWentToText:
jp Trade_SlideTextBoxOffScreen
TradeWentToText:
- TX_FAR _TradeWentToText
- db "@"
+ text_far _TradeWentToText
+ text_end
PrintTradeForSendsText:
ld hl, TradeForText
@@ -797,12 +797,12 @@ PrintTradeForSendsText:
jp Trade_Delay80
TradeForText:
- TX_FAR _TradeForText
- db "@"
+ text_far _TradeForText
+ text_end
TradeSendsText:
- TX_FAR _TradeSendsText
- db "@"
+ text_far _TradeSendsText
+ text_end
PrintTradeFarewellText:
ld hl, TradeWavesFarewellText
@@ -814,12 +814,12 @@ PrintTradeFarewellText:
jp Trade_SlideTextBoxOffScreen
TradeWavesFarewellText:
- TX_FAR _TradeWavesFarewellText
- db "@"
+ text_far _TradeWavesFarewellText
+ text_end
TradeTransferredText:
- TX_FAR _TradeTransferredText
- db "@"
+ text_far _TradeTransferredText
+ text_end
PrintTradeTakeCareText:
ld hl, TradeTakeCareText
@@ -827,8 +827,8 @@ PrintTradeTakeCareText:
jp Trade_Delay80
TradeTakeCareText:
- TX_FAR _TradeTakeCareText
- db "@"
+ text_far _TradeTakeCareText
+ text_end
PrintTradeWillTradeText:
ld hl, TradeWillTradeText
@@ -839,12 +839,12 @@ PrintTradeWillTradeText:
jp Trade_Delay80
TradeWillTradeText:
- TX_FAR _TradeWillTradeText
- db "@"
+ text_far _TradeWillTradeText
+ text_end
TradeforText:
- TX_FAR _TradeforText
- db "@"
+ text_far _TradeforText
+ text_end
Trade_ShowAnimation:
ld [wAnimationID], a
diff --git a/engine/movie/trade2.asm b/engine/movie/trade2.asm
index 2c79e077..6b744fd8 100755
--- a/engine/movie/trade2.asm
+++ b/engine/movie/trade2.asm
@@ -43,6 +43,7 @@ Trade_PrintEnemyMonInfoText:
jp PrintNumber
Trade_MonInfoText:
- db "──№⠄",$4E
+ db "──№<DOT>"
+ next ""
next "OT/"
- next $73,"№⠄","@"
+ next "<ID>№<DOT>@"
diff --git a/engine/overworld/auto_movement.asm b/engine/overworld/auto_movement.asm
index 421e3180..5e70ab8c 100755
--- a/engine/overworld/auto_movement.asm
+++ b/engine/overworld/auto_movement.asm
@@ -12,7 +12,7 @@ PlayerStepOutFromDoor::
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
xor a
- ld [wSpriteStateData1 + 2], a
+ ld [wSpritePlayerStateData1ImageIndex], a
call StartSimulatingJoypadStates
ret
.notStandingOnDoor
@@ -110,7 +110,7 @@ PalletMovementScript_WalkToLab:
swap a
ld [wNPCMovementScriptSpriteOffset], a
xor a
- ld [wSpriteStateData2 + $06], a
+ ld [wSpritePlayerStateData2MovementByte1], a
ld hl, wSimulatedJoypadStatesEnd
ld de, RLEList_PlayerWalkToLab
call DecodeRLEList
@@ -228,7 +228,7 @@ PewterMovementScript_WalkToGym:
swap a
ld [wNPCMovementScriptSpriteOffset], a
xor a
- ld [wSpriteStateData2 + $06], a
+ ld [wSpritePlayerStateData2MovementByte1], a
ld hl, wSimulatedJoypadStatesEnd
ld de, RLEList_PewterGymPlayer
call DecodeRLEList
diff --git a/engine/overworld/clear_variables.asm b/engine/overworld/clear_variables.asm
index b5a1f4a0..9b735495 100644
--- a/engine/overworld/clear_variables.asm
+++ b/engine/overworld/clear_variables.asm
@@ -1,5 +1,5 @@
ClearVariablesOnEnterMap::
- ld a, SCREEN_HEIGHT_PIXELS
+ ld a, SCREEN_HEIGHT_PX
ld [hWY], a
ld [rWY], a
xor a
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index c75fbbb6..f99bf323 100755
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -22,8 +22,8 @@ UsedCut:
jp PrintText
.NothingToCutText
- TX_FAR _NothingToCutText
- db "@"
+ text_far _NothingToCutText
+ text_end
.canCut
ld [wCutTile], a
@@ -37,7 +37,7 @@ UsedCut:
call GBPalWhiteOutWithDelay3
call ClearSprites
call RestoreScreenTilesAndReloadTilePatterns
- ld a, SCREEN_HEIGHT_PIXELS
+ ld a, SCREEN_HEIGHT_PX
ld [hWY], a
call Delay3
call LoadGBPal
@@ -68,8 +68,8 @@ UsedCut:
jp RedrawMapView
UsedCutText:
- TX_FAR _UsedCutText
- db "@"
+ text_far _UsedCutText
+ text_end
InitCutAnimOAM:
xor a
@@ -127,7 +127,7 @@ CutOrBoulderDustAnimationTilesAndAttributes:
db $FE,$10,$FF,$10
GetCutOrBoulderDustAnimationOffsets:
- ld hl, wSpriteStateData1 + 4
+ ld hl, wSpritePlayerStateData1YPixels
ld a, [hli] ; player's sprite screen Y position
ld b, a
inc hl
@@ -187,7 +187,7 @@ ReplaceTreeTileBlock:
ld h, [hl]
ld l, a
add hl, bc
- ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a
jr z, .down
cp SPRITE_FACING_UP
diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm
index 6c26b712..2dc6882e 100755
--- a/engine/overworld/dust_smoke.asm
+++ b/engine/overworld/dust_smoke.asm
@@ -30,7 +30,7 @@ AnimateBoulderDust:
jp LoadPlayerSpriteGraphics
GetMoveBoulderDustFunctionPointer:
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
ld hl, MoveBoulderDustFunctionPointerTable
ld c, a
ld b, $0
diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm
index 20309fc1..1ac07b80 100755
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -38,7 +38,7 @@ EmotionBubble:
jr nz, .loop
; get the screen coordinates of the sprite the bubble is to be displayed above
- ld hl, wSpriteStateData1 + 4
+ ld hl, wSpritePlayerStateData1YPixels
ld a, [wEmotionBubbleSpriteIndex]
swap a
ld c, a
diff --git a/engine/overworld/field_move_messages.asm b/engine/overworld/field_move_messages.asm
index b1506742..8e849e46 100644
--- a/engine/overworld/field_move_messages.asm
+++ b/engine/overworld/field_move_messages.asm
@@ -7,16 +7,16 @@ PrintStrengthTxt:
jp PrintText
UsedStrengthText:
- TX_FAR _UsedStrengthText
- TX_ASM
+ text_far _UsedStrengthText
+ text_asm
ld a, [wcf91]
call PlayCry
call Delay3
jp TextScriptEnd
CanMoveBouldersText:
- TX_FAR _CanMoveBouldersText
- db "@"
+ text_far _CanMoveBouldersText
+ text_end
IsSurfingAllowed:
; Returns whether surfing is allowed in bit 1 of wd728.
@@ -49,9 +49,9 @@ CoordsData_cdf7:
db $0B,$07,$FF
CurrentTooFastText:
- TX_FAR _CurrentTooFastText
- db "@"
+ text_far _CurrentTooFastText
+ text_end
CyclingIsFunText:
- TX_FAR _CyclingIsFunText
- db "@"
+ text_far _CyclingIsFunText
+ text_end
diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm
index a19694e0..5ce7f3cb 100755
--- a/engine/overworld/hidden_objects.asm
+++ b/engine/overworld/hidden_objects.asm
@@ -14,14 +14,14 @@ IsPlayerOnDungeonWarp::
set 4, [hl]
ret
-; if a hidden object was found, stores $00 in [hFoundHiddenObject], else stores $ff
+; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff
CheckForHiddenObject::
- ld hl, hFoundHiddenObjectOrBookshelf
+ ld hl, hItemAlreadyFound
xor a
- ld [hli], a ; [hFoundHiddenObjectOrBookshelf]
+ ld [hli], a ; [hItemAlreadyFound]
ld [hli], a ; [hSavedMapTextPtr]
ld [hli], a ; [hSavedMapTextPtr + 1]
- ld [hl], a ; [hFoundHiddenObject]
+ ld [hl], a ; [hDidntFindAnyHiddenObject]
ld de, $0
ld hl, HiddenObjectMaps
.hiddenMapLoop
@@ -81,13 +81,13 @@ CheckForHiddenObject::
ret
.noMatch
ld a, $ff
- ld [hFoundHiddenObject], a
+ ld [hDidntFindAnyHiddenObject], a
ret
; checks if the coordinates in front of the player's sprite match Y in b and X in c
; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match
CheckIfCoordsInFrontOfPlayerMatch:
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jr z, .facingUp
cp SPRITE_FACING_LEFT
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index c56914f6..0f135fb6 100755
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -6,7 +6,7 @@ HandleLedges::
and a ; OVERWORLD
ret nz
predef GetTileAndCoordsInFrontOfPlayer
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
ld b, a
aCoord 8, 9
ld c, a
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 904e9b04..0de1befd 100755
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -12,8 +12,8 @@ InitMapSprites::
call InitOutsideMapSprites
ret c ; return if the map is an outside map (already handled by above call)
; if the map is an inside map (i.e. mapID >= $25)
- ld hl, wSpriteStateData1
- ld de, wSpriteStateData2 + $0d
+ ld hl, wSpritePlayerStateData1PictureID
+ ld de, wSpritePlayerStateData2PictureID
; Loop to copy picture ID's from $C1X0 to $C2XD for LoadMapSpriteTilePatterns.
.copyPictureIDLoop
ld a, [hl] ; $C1X0 (picture ID)
@@ -37,7 +37,7 @@ LoadMapSpriteTilePatterns:
.spritesExist
ld c, a ; c = [wNumSprites]
ld b, $10 ; number of sprite slots
- ld hl, wSpriteStateData2 + $0d
+ ld hl, wSpritePlayerStateData2PictureID
xor a
ld [hFourTileSpriteCount], a
.copyPictureIDLoop ; loop to copy picture ID from $C2XD to $C2XE
@@ -48,9 +48,9 @@ LoadMapSpriteTilePatterns:
ld l, a
dec b
jr nz, .copyPictureIDLoop
- ld hl, wSpriteStateData2 + $1e
+ ld hl, wSprite01StateData2ImageBaseOffset
.loadTilePatternLoop
- ld de, wSpriteStateData2 + $1d
+ ld de, wSprite01StateData2PictureID
; Check if the current picture ID has already had its tile patterns loaded.
; This done by looping through the previous sprite slots and seeing if any of
; their picture ID's match that of the current sprite slot.
@@ -70,7 +70,7 @@ LoadMapSpriteTilePatterns:
ld e, a
jr .checkIfAlreadyLoadedLoop
.notAlreadyLoaded
- ld de, wSpriteStateData2 + $0e
+ ld de, wSpritePlayerStateData2ImageBaseOffset
ld b, $01
; loop to find the highest tile pattern VRAM slot (among the first 10 slots) used by a previous sprite slot
; this is done in order to find the first free VRAM slot available
@@ -133,7 +133,7 @@ LoadMapSpriteTilePatterns:
jr nc, .fourTileSpriteVRAMAddr
ld d, a
dec d
-; vSprites += [hVRAMSlot] * $C0 (the number of bytes in 12 tiles)
+; hl = vSprites + [hVRAMSlot] * $C0 (the number of bytes in 12 tiles)
.calculateVRAMAddrLoop
add hl, bc
dec d
@@ -215,7 +215,7 @@ LoadMapSpriteTilePatterns:
ld l, a
dec c
jp nz, .loadTilePatternLoop
- ld hl, wSpriteStateData2 + $0d
+ ld hl, wSpritePlayerStateData2PictureID
ld b, $10
; the pictures ID's stored at $C2XD are no longer needed, so zero them
.zeroStoredPictureIDLoop
@@ -287,7 +287,7 @@ InitOutsideMapSprites:
jr nc, .noCarry2
inc d
.noCarry2
- ld hl, wSpriteStateData2 + $0d
+ ld hl, wSpritePlayerStateData2PictureID
ld a, SPRITE_RED
ld [hl], a
ld bc, wSpriteSet
@@ -323,7 +323,7 @@ InitOutsideMapSprites:
call LoadMapSpriteTilePatterns
pop af
ld [wNumSprites], a ; restore number of sprites
- ld hl, wSpriteStateData2 + $1e
+ ld hl, wSprite01StateData2ImageBaseOffset
ld b, $0f
; The VRAM tile pattern slots that LoadMapSpriteTilePatterns set are in the
; order of the map's sprite set, not the order of the actual sprites loaded
@@ -337,7 +337,7 @@ InitOutsideMapSprites:
dec b
jr nz, .zeroVRAMSlotsLoop
.skipLoadingSpriteSet
- ld hl, wSpriteStateData1 + $10
+ ld hl, wSprite01StateData1
; This loop stores the correct VRAM tile pattern slots according the sprite
; data from the map's header. Since the VRAM tile pattern slots are filled in
; the order of the sprite set, in order to find the VRAM tile pattern slot
diff --git a/engine/overworld/missable_objects.asm b/engine/overworld/missable_objects.asm
index a89fcb54..1ebe8064 100644
--- a/engine/overworld/missable_objects.asm
+++ b/engine/overworld/missable_objects.asm
@@ -20,7 +20,7 @@ MarkTownVisitedAndLoadMissableObjects::
LoadMissableObjects:
ld l, a
push hl
- ld de, MapHS00 ; calculate difference between out pointer and the base pointer
+ ld de, MissableObjects ; calculate difference between out pointer and the base pointer
ld a, l
sub e
jr nc, .asm_f13c
@@ -49,7 +49,7 @@ LoadMissableObjects:
pop hl
.writeMissableObjectsListLoop
ld a, [hli]
- cp $ff
+ cp -1
jr z, .done ; end of list
cp b
jr nz, .done ; not for current map anymore
@@ -63,7 +63,7 @@ LoadMissableObjects:
inc de
jr .writeMissableObjectsListLoop
.done
- ld a, $ff
+ ld a, -1
ld [de], a ; write sentinel
ret
@@ -72,17 +72,17 @@ InitializeMissableObjectsFlags:
ld bc, wMissableObjectFlagsEnd - wMissableObjectFlags
xor a
call FillMemory ; clear missable objects flags
- ld hl, MapHS00
+ ld hl, MissableObjects
xor a
ld [wMissableObjectCounter], a
.missableObjectsLoop
ld a, [hli]
- cp $ff ; end of list
+ cp -1 ; end of list
ret z
push hl
inc hl
ld a, [hl]
- cp Hide
+ cp HIDE
jr nz, .skip
ld hl, wMissableObjectFlags
ld a, [wMissableObjectCounter]
@@ -105,7 +105,7 @@ IsObjectHidden:
ld hl, wMissableObjectList
.loop
ld a, [hli]
- cp $ff
+ cp -1
jr z, .notHidden ; not missable -> not hidden
cp b
ld a, [hli]
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index 6c354779..d27ccb4b 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -1,13 +1,13 @@
MAP_TILESET_SIZE EQU $60
UpdatePlayerSprite:
- ld a, [wSpriteStateData2]
+ ld a, [wSpritePlayerStateData2WalkAnimationCounter]
and a
jr z, .checkIfTextBoxInFrontOfSprite
cp $ff
jr z, .disableSprite
dec a
- ld [wSpriteStateData2], a
+ ld [wSpritePlayerStateData2WalkAnimationCounter], a
jr .disableSprite
; check if a text box is in front of the sprite by checking if the lower left
; background tile the sprite is standing on is greater than $5F, which is
@@ -19,7 +19,7 @@ UpdatePlayerSprite:
jr c, .lowerLeftTileIsMapTile
.disableSprite
ld a, $ff
- ld [wSpriteStateData1 + 2], a
+ ld [wSpritePlayerStateData1ImageIndex], a
ret
.lowerLeftTileIsMapTile
call DetectCollisionBetweenSprites
@@ -51,11 +51,11 @@ UpdatePlayerSprite:
.notMoving
; zero the animation counters
xor a
- ld [wSpriteStateData1 + 7], a
- ld [wSpriteStateData1 + 8], a
+ ld [wSpritePlayerStateData1IntraAnimFrameCounter], a
+ ld [wSpritePlayerStateData1AnimFrameCounter], a
jr .calcImageIndex
.next
- ld [wSpriteStateData1 + 9], a ; facing direction
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, [wFontLoaded]
bit 0, a
jr nz, .notMoving
@@ -79,11 +79,11 @@ UpdatePlayerSprite:
and $3
ld [hl], a
.calcImageIndex
- ld a, [wSpriteStateData1 + 8]
+ ld a, [wSpritePlayerStateData1AnimFrameCounter]
ld b, a
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
add b
- ld [wSpriteStateData1 + 2], a
+ ld [wSpritePlayerStateData1ImageIndex], a
.skipSpriteAnim
; If the player is standing on a grass tile, make the player's sprite have
; lower priority than the background so that it's partially obscured by the
@@ -97,7 +97,7 @@ UpdatePlayerSprite:
jr nz, .next2
ld a, $80
.next2
- ld [wSpriteStateData2 + 7], a
+ ld [wSpritePlayerStateData2GrassPriority], a
ret
UnusedReadSpriteDataFunction:
@@ -397,7 +397,7 @@ UpdateSpriteMovementDelay:
notYetMoving:
ld h, wSpriteStateData1 / $100
ld a, [hCurrentSpriteOffset]
- add $8
+ add wSpritePlayerStateData1AnimFrameCounter - wSpritePlayerStateData1
ld l, a
ld [hl], $0 ; c1x8 = 0 (walk animation frame)
jp UpdateSpriteImage
@@ -452,7 +452,7 @@ InitializeSpriteStatus:
InitializeSpriteScreenPosition:
ld h, wSpriteStateData2 / $100
ld a, [hCurrentSpriteOffset]
- add $4
+ add wSpritePlayerStateData2MapY - wSpritePlayerStateData2
ld l, a
ld a, [wYCoord]
ld b, a
@@ -480,13 +480,13 @@ CheckSpriteAvailability:
jp nz, .spriteInvisible
ld h, wSpriteStateData2 / $100
ld a, [hCurrentSpriteOffset]
- add $6
+ add wSpritePlayerStateData2MovementByte1 - wSpritePlayerStateData2
ld l, a
ld a, [hl] ; c2x6: movement byte 1
cp $fe
jr c, .skipXVisibilityTest ; movement byte 1 < $fe (i.e. the sprite's movement is scripted)
ld a, [hCurrentSpriteOffset]
- add $4
+ add wSpritePlayerStateData2MapY - wSpritePlayerStateData2
ld l, a
ld b, [hl] ; c2x4: Y pos (+4)
ld a, [wYCoord]
@@ -528,7 +528,7 @@ CheckSpriteAvailability:
.spriteInvisible
ld h, wSpriteStateData1 / $100
ld a, [hCurrentSpriteOffset]
- add $2
+ add wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1
ld l, a
ld [hl], $ff ; c1x2
scf
@@ -582,7 +582,7 @@ UpdateSpriteImage:
CanWalkOntoTile:
ld h, wSpriteStateData2 / $100
ld a, [hCurrentSpriteOffset]
- add $6
+ add wSpritePlayerStateData2MovementByte1 - wSpritePlayerStateData2
ld l, a
ld a, [hl] ; c2x6 (movement byte 1)
cp $fe
@@ -610,7 +610,7 @@ CanWalkOntoTile:
jr z, .impassable ; if $ff, no movement allowed (however, changing direction is)
ld h, wSpriteStateData1 / $100
ld a, [hCurrentSpriteOffset]
- add $4
+ add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld l, a
ld a, [hli] ; c1x4 (screen Y pos)
add $4 ; align to blocks (Y pos is always 4 pixels off)
@@ -636,7 +636,7 @@ CanWalkOntoTile:
jr nz, .impassable ; collision between sprites, don't go there
ld h, wSpriteStateData2 / $100
ld a, [hCurrentSpriteOffset]
- add $2
+ add wSpritePlayerStateData2YDisplacement - wSpritePlayerStateData2
ld l, a
ld a, [hli] ; c2x2 (sprite Y displacement, initialized at $8, keep track of where a sprite did go)
bit 7, d ; check if going upwards (d=$ff)
@@ -665,7 +665,7 @@ CanWalkOntoTile:
and a ; clear carry (marking success)
ret
.impassable
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [hCurrentSpriteOffset]
inc a
ld l, a
@@ -693,7 +693,7 @@ CanWalkOntoTile:
GetTileSpriteStandsOn:
ld h, wSpriteStateData1 / $100
ld a, [hCurrentSpriteOffset]
- add $4
+ add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld l, a
ld a, [hli] ; c1x4: screen Y position
add $4 ; align to 2*2 tile blocks (Y position is always off 4 pixels to the top)
@@ -807,12 +807,12 @@ InitScriptedNPCMovement:
jp AnimScriptedNPCMovement
GetSpriteScreenYPointer:
- ld a, $4
+ ld a, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld b, a
jr GetSpriteScreenXYPointerCommon
GetSpriteScreenXPointer:
- ld a, $6
+ ld a, wSpritePlayerStateData1XPixels - wSpritePlayerStateData1
ld b, a
GetSpriteScreenXYPointerCommon:
@@ -826,7 +826,7 @@ GetSpriteScreenXYPointerCommon:
AnimScriptedNPCMovement:
ld hl, wSpriteStateData2
ld a, [hCurrentSpriteOffset]
- add $e
+ add wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData2
ld l, a
ld a, [hl] ; VRAM slot
dec a
@@ -834,7 +834,7 @@ AnimScriptedNPCMovement:
ld b, a
ld hl, wSpriteStateData1
ld a, [hCurrentSpriteOffset]
- add $9
+ add wSpritePlayerStateData1FacingDirection - wSpritePlayerStateData1
ld l, a
ld a, [hl] ; facing direction
cp SPRITE_FACING_DOWN
@@ -853,7 +853,7 @@ AnimScriptedNPCMovement:
call AdvanceScriptedNPCAnimFrameCounter
ld hl, wSpriteStateData1
ld a, [hCurrentSpriteOffset]
- add $2
+ add wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1
ld l, a
ld a, [hSpriteVRAMSlotAndFacing]
ld b, a
diff --git a/engine/overworld/pathfinding.asm b/engine/overworld/pathfinding.asm
index ba052d38..7251759c 100644
--- a/engine/overworld/pathfinding.asm
+++ b/engine/overworld/pathfinding.asm
@@ -77,14 +77,14 @@ FindPathToPlayer:
CalcPositionOfPlayerRelativeToNPC:
xor a
ld [hNPCPlayerRelativePosFlags], a
- ld a, [wSpriteStateData1 + 4] ; player's sprite screen Y position in pixels
+ ld a, [wSpritePlayerStateData1YPixels]
ld d, a
- ld a, [wSpriteStateData1 + 6] ; player's sprite screen X position in pixels
+ ld a, [wSpritePlayerStateData1XPixels]
ld e, a
ld hl, wSpriteStateData1
ld a, [hNPCSpriteOffset]
add l
- add $4
+ add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld l, a
jr nc, .noCarry
inc h
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index a3f6e051..cfd6cc8d 100755
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -1,7 +1,7 @@
EnterMapAnim::
call InitFacingDirectionList
ld a, $ec
- ld [wSpriteStateData1 + 4], a ; player's sprite Y screen position
+ ld [wSpritePlayerStateData1YPixels], a
call Delay3
push hl
call GBFadeInFromWhite
@@ -227,19 +227,19 @@ DoFlyAnimation:
ld a, [wFlyAnimBirdSpriteImageIndex]
xor $1 ; make the bird flap its wings
ld [wFlyAnimBirdSpriteImageIndex], a
- ld [wSpriteStateData1 + 2], a
+ ld [wSpritePlayerStateData1ImageIndex], a
call Delay3
ld a, [wFlyAnimUsingCoordList]
cp $ff
jr z, .skipCopyingCoords ; if the bird is flapping its wings in place
- ld hl, wSpriteStateData1 + 4
+ ld hl, wSpritePlayerStateData1YPixels
ld a, [de]
inc de
- ld [hli], a
+ ld [hli], a ; y
inc hl
ld a, [de]
inc de
- ld [hl], a
+ ld [hl], a ; x
.skipCopyingCoords
ld a, [wFlyAnimCounter]
dec a
@@ -258,15 +258,15 @@ LoadBirdSpriteGraphics:
jp CopyVideoData
InitFacingDirectionList:
- ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images)
+ ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images)
ld [wSavedPlayerFacingDirection], a
- ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position
+ ld a, [wSpritePlayerStateData1YPixels]
ld [wSavedPlayerScreenY], a
ld hl, PlayerSpinningFacingOrder
ld de, wFacingDirectionList
ld bc, 4
call CopyData
- ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images)
+ ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images)
ld hl, wFacingDirectionList
; find the place in the list that matches the current facing direction
.loop
@@ -284,7 +284,7 @@ PlayerSpinningFacingOrder:
SpinPlayerSprite:
; copy the current value from the list into the sprite data and rotate the list
ld a, [hl]
- ld [wSpriteStateData1 + 2], a ; player's sprite facing direction (image index is locked to standing images)
+ ld [wSpritePlayerStateData1ImageIndex], a ; (image index is locked to standing images)
push hl
ld hl, wFacingDirectionList
ld de, wFacingDirectionList - 1
@@ -320,9 +320,9 @@ PlayerSpinWhileMovingUpOrDown:
call SpinPlayerSprite
ld a, [wPlayerSpinWhileMovingUpOrDownAnimDeltaY]
ld c, a
- ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position
+ ld a, [wSpritePlayerStateData1YPixels]
add c
- ld [wSpriteStateData1 + 4], a
+ ld [wSpritePlayerStateData1YPixels], a
ld c, a
ld a, [wPlayerSpinWhileMovingUpOrDownAnimMaxY]
cp c
@@ -334,9 +334,9 @@ PlayerSpinWhileMovingUpOrDown:
RestoreFacingDirectionAndYScreenPos:
ld a, [wSavedPlayerScreenY]
- ld [wSpriteStateData1 + 4], a
+ ld [wSpritePlayerStateData1YPixels], a
ld a, [wSavedPlayerFacingDirection]
- ld [wSpriteStateData1 + 2], a
+ ld [wSpritePlayerStateData1ImageIndex], a ; (image index is locked to standing images)
ret
; if SGB, 2 frames, else 3 frames
@@ -387,7 +387,7 @@ FishingAnim:
ld a, $4
ld hl, RedFishingTiles
call LoadAnimSpriteGfx
- ld a, [wSpriteStateData1 + 2]
+ ld a, [wSpritePlayerStateData1ImageIndex]
ld c, a
ld b, $0
ld hl, FishingRodOAM
@@ -410,7 +410,7 @@ FishingAnim:
; shake the player's sprite vertically
ld b, 10
.loop
- ld hl, wSpriteStateData1 + 4 ; player's sprite Y screen position
+ ld hl, wSpritePlayerStateData1YPixels
call .ShakePlayerSprite
ld hl, wOAMBuffer + $9c
call .ShakePlayerSprite
@@ -420,7 +420,7 @@ FishingAnim:
; If the player is facing up, hide the fishing rod so it doesn't overlap with
; the exclamation bubble that will be shown next.
- ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images)
cp SPRITE_FACING_UP
jr nz, .skipHidingFishingRod
ld a, $a0
@@ -434,7 +434,7 @@ FishingAnim:
predef EmotionBubble
; If the player is facing up, unhide the fishing rod.
- ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images)
cp SPRITE_FACING_UP
jr nz, .skipUnhidingFishingRod
ld a, $44
@@ -457,16 +457,16 @@ FishingAnim:
ret
NoNibbleText:
- TX_FAR _NoNibbleText
- db "@"
+ text_far _NoNibbleText
+ text_end
NothingHereText:
- TX_FAR _NothingHereText
- db "@"
+ text_far _NothingHereText
+ text_end
ItsABiteText:
- TX_FAR _ItsABiteText
- db "@"
+ text_far _ItsABiteText
+ text_end
FishingRodOAM:
; specifies how the fishing rod should be drawn on the screen
@@ -507,7 +507,7 @@ _HandleMidJump::
ld hl, PlayerJumpingYScreenCoords
add hl, bc
ld a, [hl]
- ld [wSpriteStateData1 + 4], a ; player's sprite y coordinate
+ ld [wSpritePlayerStateData1YPixels], a
ret
.finishedJump
ld a, [wWalkCounter]
diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm
index ea24fdc1..9ff67df8 100644
--- a/engine/overworld/player_state.asm
+++ b/engine/overworld/player_state.asm
@@ -88,7 +88,7 @@ IsPlayerFacingEdgeOfMap::
push hl
push de
push bc
- ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
srl a
ld c, a
ld b, $0
@@ -158,7 +158,7 @@ IsWarpTileInFrontOfPlayer::
ld a, [wCurMap]
cp SS_ANNE_BOW
jr z, IsSSAnneBowWarpTileInFrontOfPlayer
- ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
srl a
ld c, a
ld b, 0
@@ -263,7 +263,7 @@ _GetTileAndCoordsInFrontOfPlayer:
ld d, a
ld a, [wXCoord]
ld e, a
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
jr nz, .notFacingDown
; facing down
@@ -302,7 +302,7 @@ GetTileTwoStepsInFrontOfPlayer:
ld a, [hli]
ld d, a
ld e, [hl]
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
jr nz, .notFacingDown
; facing down
@@ -375,7 +375,7 @@ CheckForBoulderCollisionWithSprites:
swap a
ld d, 0
ld e, a
- ld hl, wSpriteStateData2 + $14
+ ld hl, wSprite01StateData2MapY
add hl, de
ld a, [hli] ; map Y position
ld [hPlayerYCoord], a
@@ -384,7 +384,7 @@ CheckForBoulderCollisionWithSprites:
ld a, [wNumSprites]
ld c, a
ld de, $f
- ld hl, wSpriteStateData2 + $14
+ ld hl, wSprite01StateData2MapY
ld a, [hPlayerFacing]
and $3 ; facing up or down?
jr z, .pushingHorizontallyLoop
diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm
index e4dd91cf..da1c6dee 100644
--- a/engine/overworld/push_boulder.asm
+++ b/engine/overworld/push_boulder.asm
@@ -12,7 +12,7 @@ TryPushingBoulder::
ld [wBoulderSpriteIndex], a
and a
jp z, ResetBoulderPushFlags
- ld hl, wSpriteStateData1 + 1
+ ld hl, wSpritePlayerStateData1MovementStatus
ld d, $0
ld a, [hSpriteIndexOrTextID]
swap a
@@ -36,7 +36,7 @@ TryPushingBoulder::
jp nz, ResetBoulderPushFlags
ld a, [hJoyHeld]
ld b, a
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jr z, .pushBoulderUp
cp SPRITE_FACING_LEFT
diff --git a/engine/overworld/sprite_collisions.asm b/engine/overworld/sprite_collisions.asm
index c5ff8ebb..48cd95b9 100644
--- a/engine/overworld/sprite_collisions.asm
+++ b/engine/overworld/sprite_collisions.asm
@@ -1,10 +1,10 @@
_UpdateSprites::
ld h, $c1
inc h
- ld a, $e ; wSpriteStateData2 + $0e
+ ld a, wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData2
.spriteLoop
ld l, a
- sub $e
+ sub wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData2
ld c, a
ld [hCurrentSpriteOffset], a
ld a, [hl]
@@ -20,7 +20,7 @@ _UpdateSprites::
.skipSprite
ld a, l
add $10 ; move to next sprite
- cp $e ; test for overflow (back at $0e)
+ cp wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData2 ; test for overflow (back at beginning)
jr nz, .spriteLoop
ret
.updateCurrentSprite
diff --git a/engine/overworld/trainer_sight.asm b/engine/overworld/trainer_sight.asm
index 81978c35..c12c064b 100755
--- a/engine/overworld/trainer_sight.asm
+++ b/engine/overworld/trainer_sight.asm
@@ -1,6 +1,6 @@
_GetSpritePosition1::
ld hl, wSpriteStateData1
- ld de, $4
+ ld de, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld a, [wSpriteIndex]
ld [hSpriteIndex], a
call GetSpriteDataPointer
@@ -9,7 +9,7 @@ _GetSpritePosition1::
inc hl
ld a, [hl] ; c1x6 (screen X pos)
ld [hSpriteScreenXCoord], a
- ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6)
+ ld de, wSpritePlayerStateData2MapY - wSpritePlayerStateData1XPixels
add hl, de
ld a, [hli] ; c2x4 (map Y pos)
ld [hSpriteMapYCoord], a
@@ -19,7 +19,7 @@ _GetSpritePosition1::
_GetSpritePosition2::
ld hl, wSpriteStateData1
- ld de, $4
+ ld de, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld a, [wSpriteIndex]
ld [hSpriteIndex], a
call GetSpriteDataPointer
@@ -28,7 +28,7 @@ _GetSpritePosition2::
inc hl
ld a, [hl] ; c1x6 (screen X pos)
ld [wSavedSpriteScreenX], a
- ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6)
+ ld de, wSpritePlayerStateData2MapY - wSpritePlayerStateData1XPixels
add hl, de
ld a, [hli] ; c2x4 (map Y pos)
ld [wSavedSpriteMapY], a
@@ -38,7 +38,7 @@ _GetSpritePosition2::
_SetSpritePosition1::
ld hl, wSpriteStateData1
- ld de, $4
+ ld de, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld a, [wSpriteIndex]
ld [hSpriteIndex], a
call GetSpriteDataPointer
@@ -47,7 +47,7 @@ _SetSpritePosition1::
inc hl
ld a, [hSpriteScreenXCoord] ; c1x6 (screen X pos)
ld [hl], a
- ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6)
+ ld de, wSpritePlayerStateData2MapY - wSpritePlayerStateData1XPixels
add hl, de
ld a, [hSpriteMapYCoord] ; c2x4 (map Y pos)
ld [hli], a
@@ -57,7 +57,7 @@ _SetSpritePosition1::
_SetSpritePosition2::
ld hl, wSpriteStateData1
- ld de, 4
+ ld de, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld a, [wSpriteIndex]
ld [hSpriteIndex], a
call GetSpriteDataPointer
@@ -66,7 +66,7 @@ _SetSpritePosition2::
inc hl
ld a, [wSavedSpriteScreenX]
ld [hl], a ; c1x6 (screen X pos)
- ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6)
+ ld de, wSpritePlayerStateData2MapY - wSpritePlayerStateData1XPixels
add hl, de
ld a, [wSavedSpriteMapY]
ld [hli], a ; c2x4 (map Y pos)
@@ -165,7 +165,7 @@ TrainerEngage:
push hl
push de
ld a, [wTrainerSpriteOffset]
- add $2
+ add wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1
ld d, $0
ld e, a
ld hl, wSpriteStateData1
@@ -176,7 +176,7 @@ TrainerEngage:
jp .noEngage
.spriteOnScreen
ld a, [wTrainerSpriteOffset]
- add $9
+ add wSpritePlayerStateData1FacingDirection - wSpritePlayerStateData1
ld d, $0
ld e, a
ld hl, wSpriteStateData1
@@ -234,7 +234,7 @@ TrainerEngage:
; reads trainer's Y position to wTrainerScreenY and X position to wTrainerScreenX
ReadTrainerScreenPosition:
ld a, [wTrainerSpriteOffset]
- add $4
+ add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld d, $0
ld e, a
ld hl, wSpriteStateData1
@@ -242,7 +242,7 @@ ReadTrainerScreenPosition:
ld a, [hl] ; c1x4 (sprite Y pos)
ld [wTrainerScreenY], a
ld a, [wTrainerSpriteOffset]
- add $6
+ add wSpritePlayerStateData1XPixels - wSpritePlayerStateData1
ld d, $0
ld e, a
ld hl, wSpriteStateData1
@@ -295,7 +295,7 @@ CheckPlayerIsInFrontOfSprite:
cp POWER_PLANT
jp z, .engage ; bypass this for power plant to get voltorb fake items to work
ld a, [wTrainerSpriteOffset]
- add $4
+ add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
ld d, $0
ld e, a
ld hl, wSpriteStateData1
@@ -307,7 +307,7 @@ CheckPlayerIsInFrontOfSprite:
.notOnTopmostTile
ld [wTrainerScreenY], a
ld a, [wTrainerSpriteOffset]
- add $6
+ add wSpritePlayerStateData1XPixels - wSpritePlayerStateData1
ld d, $0
ld e, a
ld hl, wSpriteStateData1
diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm
index d9a329f5..7877ada1 100644
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -89,7 +89,7 @@ SomeonesPCText: db "SOMEONE's PC@"
BillsPCText: db "BILL's PC@"
PlayersPCText: db "'s PC@"
OaksPCText: db "PROF.OAK's PC@"
-PKMNLeaguePCText: db "<pkmn>LEAGUE@"
+PKMNLeaguePCText: db "<PKMN>LEAGUE@"
LogOffPCText: db "LOG OFF@"
BillsPC_::
@@ -339,9 +339,9 @@ DisplayMonListMenu:
ret
BillsPCMenuText:
- db "WITHDRAW <pkmn>"
- next "DEPOSIT <pkmn>"
- next "RELEASE <pkmn>"
+ db "WITHDRAW <PKMN>"
+ next "DEPOSIT <PKMN>"
+ next "RELEASE <PKMN>"
next "CHANGE BOX"
next "SEE YA!"
db "@"
@@ -453,58 +453,58 @@ StatsCancelPCText:
next "CANCEL@"
SwitchOnText:
- TX_FAR _SwitchOnText
- db "@"
+ text_far _SwitchOnText
+ text_end
WhatText:
- TX_FAR _WhatText
- db "@"
+ text_far _WhatText
+ text_end
DepositWhichMonText:
- TX_FAR _DepositWhichMonText
- db "@"
+ text_far _DepositWhichMonText
+ text_end
MonWasStoredText:
- TX_FAR _MonWasStoredText
- db "@"
+ text_far _MonWasStoredText
+ text_end
CantDepositLastMonText:
- TX_FAR _CantDepositLastMonText
- db "@"
+ text_far _CantDepositLastMonText
+ text_end
BoxFullText:
- TX_FAR _BoxFullText
- db "@"
+ text_far _BoxFullText
+ text_end
MonIsTakenOutText:
- TX_FAR _MonIsTakenOutText
- db "@"
+ text_far _MonIsTakenOutText
+ text_end
NoMonText:
- TX_FAR _NoMonText
- db "@"
+ text_far _NoMonText
+ text_end
CantTakeMonText:
- TX_FAR _CantTakeMonText
- db "@"
+ text_far _CantTakeMonText
+ text_end
ReleaseWhichMonText:
- TX_FAR _ReleaseWhichMonText
- db "@"
+ text_far _ReleaseWhichMonText
+ text_end
OnceReleasedText:
- TX_FAR _OnceReleasedText
- db "@"
+ text_far _OnceReleasedText
+ text_end
MonWasReleasedText:
- TX_FAR _MonWasReleasedText
- db "@"
+ text_far _MonWasReleasedText
+ text_end
CableClubLeftGameboy::
ld a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
ret z
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_RIGHT
ret nz
ld a, [wCurMap]
@@ -521,7 +521,7 @@ CableClubRightGameboy::
ld a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ret z
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_LEFT
ret nz
ld a, [wCurMap]
@@ -535,15 +535,15 @@ CableClubRightGameboy::
tx_pre_jump JustAMomentText
JustAMomentText::
- TX_FAR _JustAMomentText
- db "@"
+ text_far _JustAMomentText
+ text_end
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
tx_pre_jump OpenBillsPCText
OpenBillsPCText::
- TX_BILLS_PC
+ script_bills_pc
diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm
index 36f135cc..469d689a 100755
--- a/engine/pokemon/evos_moves.asm
+++ b/engine/pokemon/evos_moves.asm
@@ -296,20 +296,20 @@ CancelledEvolution:
jp Evolution_PartyMonLoop
EvolvedText:
- TX_FAR _EvolvedText
- db "@"
+ text_far _EvolvedText
+ text_end
IntoText:
- TX_FAR _IntoText
- db "@"
+ text_far _IntoText
+ text_end
StoppedEvolvingText:
- TX_FAR _StoppedEvolvingText
- db "@"
+ text_far _StoppedEvolvingText
+ text_end
IsEvolvingText:
- TX_FAR _IsEvolvingText
- db "@"
+ text_far _IsEvolvingText
+ text_end
Evolution_ReloadTilesetTilePatterns:
ld a, [wLinkState]
diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm
index 09413c9b..e1b1a4c7 100755
--- a/engine/pokemon/learn_move.asm
+++ b/engine/pokemon/learn_move.asm
@@ -184,43 +184,43 @@ TryingToLearn:
ret
LearnedMove1Text:
- TX_FAR _LearnedMove1Text
- TX_SFX_ITEM_1 ; plays SFX_GET_ITEM_1 in the party menu (rare candy) and plays SFX_LEVEL_UP in battle
- TX_BLINK
- db "@"
+ text_far _LearnedMove1Text
+ sound_get_item_1 ; plays SFX_GET_ITEM_1 in the party menu (rare candy) and plays SFX_LEVEL_UP in battle
+ text_promptbutton
+ text_end
WhichMoveToForgetText:
- TX_FAR _WhichMoveToForgetText
- db "@"
+ text_far _WhichMoveToForgetText
+ text_end
AbandonLearningText:
- TX_FAR _AbandonLearningText
- db "@"
+ text_far _AbandonLearningText
+ text_end
DidNotLearnText:
- TX_FAR _DidNotLearnText
- db "@"
+ text_far _DidNotLearnText
+ text_end
TryingToLearnText:
- TX_FAR _TryingToLearnText
- db "@"
+ text_far _TryingToLearnText
+ text_end
OneTwoAndText:
- TX_FAR _OneTwoAndText
- TX_DELAY
- TX_ASM
+ text_far _OneTwoAndText
+ text_pause
+ text_asm
ld a, SFX_SWAP
call PlaySoundWaitForCurrent
ld hl, PoofText
ret
PoofText:
- TX_FAR _PoofText
- TX_DELAY
+ text_far _PoofText
+ text_pause
ForgotAndText:
- TX_FAR _ForgotAndText
- db "@"
+ text_far _ForgotAndText
+ text_end
HMCantDeleteText:
- TX_FAR _HMCantDeleteText
- db "@"
+ text_far _HMCantDeleteText
+ text_end
diff --git a/engine/pokemon/remove_mon.asm b/engine/pokemon/remove_mon.asm
index 6f7e91d6..c85b96bf 100644
--- a/engine/pokemon/remove_mon.asm
+++ b/engine/pokemon/remove_mon.asm
@@ -2,9 +2,9 @@ _RemovePokemon::
ld hl, wPartyCount
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7b74
+ jr z, .usePartyCount
ld hl, wNumInBox
-.asm_7b74
+.usePartyCount
ld a, [hl]
dec a
ld [hli], a
@@ -15,28 +15,28 @@ _RemovePokemon::
ld e, l
ld d, h
inc de
-.asm_7b81
+.shiftMonSpeciesLoop
ld a, [de]
inc de
ld [hli], a
- inc a
- jr nz, .asm_7b81
+ inc a ; reached terminator?
+ jr nz, .shiftMonSpeciesLoop ; if not, continue shifting species
ld hl, wPartyMonOT
- ld d, $5
+ ld d, PARTY_LENGTH - 1 ; max number of pokemon to shift
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7b97
+ jr z, .usePartyMonOTs
ld hl, wBoxMonOT
- ld d, $13
-.asm_7b97
+ ld d, MONS_PER_BOX - 1
+.usePartyMonOTs
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
ld a, [wWhichPokemon]
- cp d
- jr nz, .asm_7ba6
- ld [hl], $ff
+ cp d ; are we removing the last pokemon?
+ jr nz, .notRemovingLastMon ; if not, shift the pokemon below
+ ld [hl], $ff ; else, write the terminator and return
ret
-.asm_7ba6
+.notRemovingLastMon
ld d, h
ld e, l
ld bc, NAME_LENGTH
@@ -44,41 +44,41 @@ _RemovePokemon::
ld bc, wPartyMonNicks
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7bb8
+ jr z, .usePartyMonNicks
ld bc, wBoxMonNicks
-.asm_7bb8
+.usePartyMonNicks
call CopyDataUntil
ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7bcd
+ jr z, .usePartyMonStructs
ld hl, wBoxMons
ld bc, wBoxMon2 - wBoxMon1
-.asm_7bcd
+.usePartyMonStructs
ld a, [wWhichPokemon]
- call AddNTimes
- ld d, h
+ call AddNTimes ; get address of the pokemon removed
+ ld d, h ; store in de for CopyDataUntil
ld e, l
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7be4
+ jr z, .copyUntilPartyMonOTs
ld bc, wBoxMon2 - wBoxMon1
- add hl, bc
- ld bc, wBoxMonOT
- jr .asm_7beb
-.asm_7be4
+ add hl, bc ; get address of pokemon after the pokemon removed
+ ld bc, wBoxMonOT ; address of when to stop copying
+ jr .continue
+.copyUntilPartyMonOTs
ld bc, wPartyMon2 - wPartyMon1
- add hl, bc
- ld bc, wPartyMonOT
-.asm_7beb
- call CopyDataUntil
+ add hl, bc ; get address of pokemon after the pokemon removed
+ ld bc, wPartyMonOT ; address of when to stop copying
+.continue
+ call CopyDataUntil ; shift all pokemon data after the removed mon to the removed mon's location
ld hl, wPartyMonNicks
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7bfa
+ jr z, .usePartyMonNicks2
ld hl, wBoxMonNicks
-.asm_7bfa
+.usePartyMonNicks2
ld bc, NAME_LENGTH
ld a, [wWhichPokemon]
call AddNTimes
@@ -86,10 +86,10 @@ _RemovePokemon::
ld e, l
ld bc, NAME_LENGTH
add hl, bc
- ld bc, wPokedexOwned
+ ld bc, wPartyMonNicksEnd
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7c15
+ jr z, .copyUntilPartyMonNicksEnd
ld bc, wBoxMonNicksEnd
-.asm_7c15
+.copyUntilPartyMonNicksEnd
jp CopyDataUntil
diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm
index b262a8b7..35cc9502 100755
--- a/engine/pokemon/status_screen.asm
+++ b/engine/pokemon/status_screen.asm
@@ -110,7 +110,7 @@ StatusScreen:
call DrawLineBox ; Draws the box around name, HP and status
ld de, -6
add hl, de
- ld [hl], "⠄" ; . after No ("." is a different one)
+ ld [hl], "<DOT>"
dec hl
ld [hl], "№"
coord hl, 19, 9
@@ -205,14 +205,17 @@ NamePointers2:
dw wDayCareMonName
Type1Text:
- db "TYPE1/", $4e
-
+ db "TYPE1/"
+ next ""
+ ; fallthrough
Type2Text:
- db "TYPE2/", $4e
-
+ db "TYPE2/"
+ next ""
+ ; fallthrough
IDNoText:
- db $73, "№/", $4e
-
+ db "<ID>№/"
+ next ""
+ ; fallthrough
OTText:
db "OT/"
next "@"
@@ -328,7 +331,7 @@ StatusScreen2:
ld b, a ; Number of moves ?
coord hl, 11, 10
ld de, SCREEN_WIDTH * 2
- ld a, $72 ; special P tile id
+ ld a, "<BOLD_P>"
call StatusScreen_PrintPP ; Print "PP"
ld a, b
and a
@@ -399,7 +402,7 @@ StatusScreen2:
ld [wLoadedMonLevel], a ; Increase temporarily if not 100
.Level100
coord hl, 14, 6
- ld [hl], $70 ; 1-tile "to"
+ ld [hl], "<to>"
inc hl
inc hl
call PrintLevel
diff --git a/engine/slots/game_corner_slots.asm b/engine/slots/game_corner_slots.asm
index d95d20a3..84f3efdc 100755
--- a/engine/slots/game_corner_slots.asm
+++ b/engine/slots/game_corner_slots.asm
@@ -42,13 +42,13 @@ StartSlotMachine:
ret
GameCornerOutOfOrderText::
- TX_FAR _GameCornerOutOfOrderText
- db "@"
+ text_far _GameCornerOutOfOrderText
+ text_end
GameCornerOutToLunchText::
- TX_FAR _GameCornerOutToLunchText
- db "@"
+ text_far _GameCornerOutToLunchText
+ text_end
GameCornerSomeonesKeysText::
- TX_FAR _GameCornerSomeonesKeysText
- db "@"
+ text_far _GameCornerSomeonesKeysText
+ text_end
diff --git a/engine/slots/game_corner_slots2.asm b/engine/slots/game_corner_slots2.asm
index 8f6e8374..a4ba4ec1 100755
--- a/engine/slots/game_corner_slots2.asm
+++ b/engine/slots/game_corner_slots2.asm
@@ -1,5 +1,5 @@
AbleToPlaySlotsCheck:
- ld a, [wSpriteStateData1 + 2]
+ ld a, [wSpritePlayerStateData1ImageIndex]
and $8
jr z, .done ; not able
ld b, COIN_CASE
@@ -23,9 +23,9 @@ AbleToPlaySlotsCheck:
ret
GameCornerCoinCaseText::
- TX_FAR _GameCornerCoinCaseText
- db "@"
+ text_far _GameCornerCoinCaseText
+ text_end
GameCornerNoCoinsText::
- TX_FAR _GameCornerNoCoinsText
- db "@"
+ text_far _GameCornerNoCoinsText
+ text_end
diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm
index c3de5dd2..3802cdd5 100755
--- a/engine/slots/slot_machine.asm
+++ b/engine/slots/slot_machine.asm
@@ -53,8 +53,8 @@ PromptUserToPlaySlots:
jp CloseTextDisplay
PlaySlotMachineText:
- TX_FAR _PlaySlotMachineText
- db "@"
+ text_far _PlaySlotMachineText
+ text_end
MainSlotMachineLoop:
call SlotMachine_PrintCreditCoins
@@ -152,24 +152,24 @@ CoinMultiplierSlotMachineText:
next "×1@"
OutOfCoinsSlotMachineText:
- TX_FAR _OutOfCoinsSlotMachineText
- db "@"
+ text_far _OutOfCoinsSlotMachineText
+ text_end
BetHowManySlotMachineText:
- TX_FAR _BetHowManySlotMachineText
- db "@"
+ text_far _BetHowManySlotMachineText
+ text_end
StartSlotMachineText:
- TX_FAR _StartSlotMachineText
- db "@"
+ text_far _StartSlotMachineText
+ text_end
NotEnoughCoinsSlotMachineText:
- TX_FAR _NotEnoughCoinsSlotMachineText
- db "@"
+ text_far _NotEnoughCoinsSlotMachineText
+ text_end
OneMoreGoSlotMachineText:
- TX_FAR _OneMoreGoSlotMachineText
- db "@"
+ text_far _OneMoreGoSlotMachineText
+ text_end
SlotMachine_SetFlags:
ld hl, wSlotMachineFlags
@@ -476,7 +476,7 @@ SlotMachine_CheckForMatches:
jp .done
SymbolLinedUpSlotMachineText:
- TX_ASM
+ text_asm
push bc
call SlotMachine_PrintWinningSymbol
ld hl, LinedUpText
@@ -488,8 +488,8 @@ SymbolLinedUpSlotMachineText:
ret
LinedUpText:
- TX_FAR _LinedUpText
- db "@"
+ text_far _LinedUpText
+ text_end
SlotRewardPointers:
dw SlotReward300Func
@@ -518,8 +518,8 @@ SlotReward15Text:
db "15@"
NotThisTimeText:
- TX_FAR _NotThisTimeText
- db "@"
+ text_far _NotThisTimeText
+ text_end
; compares the slot machine tiles at bc, de, and hl
SlotMachine_CheckForMatch:
@@ -609,9 +609,9 @@ SlotReward300Func:
ret
YeahText:
- TX_FAR _YeahText
- TX_DELAY
- db "@"
+ text_far _YeahText
+ text_pause
+ text_end
SlotMachine_PrintWinningSymbol:
; prints winning symbol and down arrow in text box