summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/ai/items.asm9
-rw-r--r--engine/battle/ai/move.asm3
-rw-r--r--engine/battle/ai/scoring.asm115
-rw-r--r--engine/battle/ai/switch.asm9
-rw-r--r--engine/battle/battle_transition.asm10
-rw-r--r--engine/battle/core.asm2
-rw-r--r--engine/battle/effect_commands.asm415
-rw-r--r--engine/battle/hidden_power.asm2
-rw-r--r--engine/battle/misc.asm4
-rw-r--r--engine/battle/move_effects/attract.asm1
-rw-r--r--engine/battle/move_effects/baton_pass.asm16
-rw-r--r--engine/battle/move_effects/beat_up.asm6
-rw-r--r--engine/battle/move_effects/belly_drum.asm1
-rw-r--r--engine/battle/move_effects/bide.asm3
-rw-r--r--engine/battle/move_effects/conversion.asm1
-rw-r--r--engine/battle/move_effects/conversion2.asm1
-rw-r--r--engine/battle/move_effects/counter.asm1
-rw-r--r--engine/battle/move_effects/curse.asm3
-rw-r--r--engine/battle/move_effects/destiny_bond.asm1
-rw-r--r--engine/battle/move_effects/disable.asm1
-rw-r--r--engine/battle/move_effects/encore.asm1
-rw-r--r--engine/battle/move_effects/false_swipe.asm1
-rw-r--r--engine/battle/move_effects/focus_energy.asm1
-rw-r--r--engine/battle/move_effects/frustration.asm1
-rw-r--r--engine/battle/move_effects/fury_cutter.asm4
-rw-r--r--engine/battle/move_effects/future_sight.asm2
-rw-r--r--engine/battle/move_effects/heal_bell.asm1
-rw-r--r--engine/battle/move_effects/hidden_power.asm1
-rw-r--r--engine/battle/move_effects/leech_seed.asm1
-rw-r--r--engine/battle/move_effects/lock_on.asm1
-rw-r--r--engine/battle/move_effects/metronome.asm2
-rw-r--r--engine/battle/move_effects/mimic.asm1
-rw-r--r--engine/battle/move_effects/mirror_coat.asm1
-rw-r--r--engine/battle/move_effects/mist.asm1
-rw-r--r--engine/battle/move_effects/pain_split.asm2
-rw-r--r--engine/battle/move_effects/pay_day.asm1
-rw-r--r--engine/battle/move_effects/perish_song.asm1
-rw-r--r--engine/battle/move_effects/protect.asm3
-rw-r--r--engine/battle/move_effects/psych_up.asm1
-rw-r--r--engine/battle/move_effects/pursuit.asm1
-rw-r--r--engine/battle/move_effects/rage.asm1
-rw-r--r--engine/battle/move_effects/rain_dance.asm1
-rw-r--r--engine/battle/move_effects/rapid_spin.asm1
-rw-r--r--engine/battle/move_effects/return.asm1
-rw-r--r--engine/battle/move_effects/rollout.asm2
-rw-r--r--engine/battle/move_effects/safeguard.asm1
-rw-r--r--engine/battle/move_effects/selfdestruct.asm1
-rw-r--r--engine/battle/move_effects/sketch.asm1
-rw-r--r--engine/battle/move_effects/sleep_talk.asm1
-rw-r--r--engine/battle/move_effects/snore.asm1
-rw-r--r--engine/battle/move_effects/spite.asm1
-rw-r--r--engine/battle/move_effects/splash.asm1
-rw-r--r--engine/battle/move_effects/substitute.asm1
-rw-r--r--engine/battle/move_effects/sunny_day.asm1
-rw-r--r--engine/battle/move_effects/teleport.asm1
-rw-r--r--engine/battle/move_effects/thief.asm3
-rw-r--r--engine/battle/move_effects/thunder.asm1
-rw-r--r--engine/battle/move_effects/transform.asm1
-rw-r--r--engine/battle/move_effects/triple_kick.asm3
-rw-r--r--engine/battle/read_trainer_attributes.asm2
-rw-r--r--engine/battle/read_trainer_dvs.asm2
-rw-r--r--engine/battle/read_trainer_party.asm3
-rw-r--r--engine/battle/used_move_text.asm2
-rw-r--r--engine/battle_anims/anim_commands.asm17
-rw-r--r--engine/battle_anims/bg_effects.asm29
-rw-r--r--engine/battle_anims/core.asm5
-rw-r--r--engine/battle_anims/helpers.asm4
-rw-r--r--engine/events/battle_tower/battle_tower.asm9
-rw-r--r--engine/events/battle_tower/load_trainer.asm1
-rw-r--r--engine/events/battle_tower/trainer_text.asm6
-rw-r--r--engine/events/bug_contest/judging.asm2
-rw-r--r--engine/events/celebi.asm20
-rw-r--r--engine/events/elevator.asm2
-rw-r--r--engine/events/engine_flags.asm2
-rw-r--r--engine/events/field_moves.asm9
-rw-r--r--engine/events/fish.asm3
-rw-r--r--engine/events/fruit_trees.asm2
-rw-r--r--engine/events/halloffame.asm2
-rw-r--r--engine/events/happiness_egg.asm3
-rw-r--r--engine/events/magikarp.asm3
-rw-r--r--engine/events/map_name_sign.asm4
-rw-r--r--engine/events/mom_phone.asm4
-rw-r--r--engine/events/money.asm2
-rw-r--r--engine/events/npc_trade.asm9
-rw-r--r--engine/events/overworld.asm2
-rw-r--r--engine/events/poke_seer.asm3
-rw-r--r--engine/events/print_unown.asm11
-rw-r--r--engine/events/shuckle.asm1
-rw-r--r--engine/events/specials.asm5
-rw-r--r--engine/events/std_scripts.asm2
-rw-r--r--engine/events/treemons.asm1
-rw-r--r--engine/events/whiteout.asm1
-rw-r--r--engine/games/card_flip.asm5
-rw-r--r--engine/games/dummy_game.asm8
-rw-r--r--engine/games/slot_machine.asm57
-rw-r--r--engine/games/unown_puzzle.asm1
-rw-r--r--engine/gfx/cgb_layouts.asm1
-rw-r--r--engine/gfx/dma_transfer.asm4
-rw-r--r--engine/gfx/load_pics.asm17
-rw-r--r--engine/gfx/mon_icons.asm3
-rw-r--r--engine/gfx/pic_animation.asm2
-rw-r--r--engine/gfx/sprites.asm7
-rw-r--r--engine/items/item_effects.asm55
-rw-r--r--engine/items/mart.asm6
-rw-r--r--engine/items/pack.asm6
-rw-r--r--engine/items/print_item_description.asm2
-rw-r--r--engine/items/switch_items.asm1
-rw-r--r--engine/items/tmhm2.asm1
-rw-r--r--engine/link/link.asm5
-rw-r--r--engine/link/link_trade.asm1
-rw-r--r--engine/link/mystery_gift.asm5
-rw-r--r--engine/link/mystery_gift_2.asm1
-rw-r--r--engine/link/time_capsule_2.asm1
-rw-r--r--engine/math/math.asm5
-rw-r--r--engine/menus/debug.asm2
-rw-r--r--engine/menus/intro_menu.asm13
-rw-r--r--engine/menus/main_menu.asm4
-rw-r--r--engine/menus/menu.asm6
-rw-r--r--engine/menus/naming_screen.asm37
-rw-r--r--engine/menus/options_menu.asm9
-rw-r--r--engine/menus/save.asm17
-rw-r--r--engine/menus/start_menu.asm48
-rw-r--r--engine/menus/trainer_card.asm4
-rw-r--r--engine/movie/credits.asm3
-rw-r--r--engine/movie/crystal_intro.asm3
-rw-r--r--engine/movie/evolution_animation.asm1
-rw-r--r--engine/movie/gbc_only.asm8
-rw-r--r--engine/movie/title.asm14
-rw-r--r--engine/movie/trade_animation.asm80
-rw-r--r--engine/movie/unused_title.asm1
-rw-r--r--engine/overworld/decorations.asm5
-rw-r--r--engine/overworld/events.asm613
-rw-r--r--engine/overworld/events_2.asm617
-rw-r--r--engine/overworld/landmarks.asm3
-rw-r--r--engine/overworld/map_objects.asm2
-rw-r--r--engine/overworld/map_setup.asm1
-rw-r--r--engine/overworld/movement.asm7
-rw-r--r--engine/overworld/npc_movement.asm11
-rw-r--r--engine/overworld/overworld.asm17
-rw-r--r--engine/overworld/player_movement.asm5
-rw-r--r--engine/overworld/scripting.asm13
-rw-r--r--engine/overworld/select_menu.asm8
-rw-r--r--engine/overworld/spawn_points.asm2
-rw-r--r--engine/overworld/time.asm2
-rw-r--r--engine/overworld/warp_connection.asm2
-rw-r--r--engine/overworld/wildmons.asm7
-rw-r--r--engine/phone/generic_calls.asm2
-rw-r--r--engine/phone/phone.asm12
-rw-r--r--engine/pokedex/pokedex.asm17
-rw-r--r--engine/pokedex/pokedex_2.asm2
-rw-r--r--engine/pokedex/unown_dex.asm1
-rw-r--r--engine/pokegear/pokegear.asm70
-rw-r--r--engine/pokegear/radio.asm1
-rw-r--r--engine/pokemon/bills_pc.asm4
-rw-r--r--engine/pokemon/breeding.asm3
-rw-r--r--engine/pokemon/evolve.asm8
-rw-r--r--engine/pokemon/mail.asm3
-rw-r--r--engine/pokemon/mon_stats.asm1
-rw-r--r--engine/pokemon/move_mon.asm1
-rw-r--r--engine/pokemon/party_menu.asm10
-rw-r--r--engine/pokemon/search.asm3
-rw-r--r--engine/pokemon/stats_screen.asm5
-rw-r--r--engine/pokemon/types.asm4
-rw-r--r--engine/printer/printer.asm2
-rw-r--r--engine/rtc/timeset.asm1
-rw-r--r--engine/tilesets/mapgroup_roofs.asm1
-rw-r--r--engine/tilesets/tileset_anims.asm22
-rw-r--r--engine/tilesets/timeofday_pals.asm7
168 files changed, 658 insertions, 2110 deletions
diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm
index 14817f414..29bc23b20 100644
--- a/engine/battle/ai/items.asm
+++ b/engine/battle/ai/items.asm
@@ -145,13 +145,11 @@ SwitchSometimes:
ld [wEnemySwitchMonIndex], a
jp AI_TrySwitch
-
CheckSubstatusCantRun:
ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
ret
-
AI_TryItem:
; items are not allowed in the BattleTower
ld a, [wInBattleTowerBattle]
@@ -238,7 +236,6 @@ AI_TryItem:
scf
ret
-
.IsHighestLevel:
ld a, [wOTPartyCount]
ld d, a
@@ -270,7 +267,6 @@ AI_TryItem:
scf
ret
-
AI_Items:
dbw FULL_RESTORE, .FullRestore
dbw MAX_POTION, .MaxPotion
@@ -520,7 +516,6 @@ AI_Items:
and a
ret
-
AIUpdateHUD:
call UpdateEnemyMonInParty
farcall UpdateEnemyHUD
@@ -538,7 +533,6 @@ AIUsedItemSound:
pop de
ret
-
EnemyUsedFullHeal:
call AIUsedItemSound
call AI_HealStatus
@@ -642,7 +636,6 @@ EnemyPotionFinish:
predef AnimateHPBar
jp AIUpdateHUD
-
AI_TrySwitch:
; Determine whether the AI can switch based on how many Pokemon are still alive.
; If it can switch, it will.
@@ -805,7 +798,6 @@ EnemyUsedXSpecial:
ld b, SP_ATTACK
ld a, X_SPECIAL
-
; Parameter
; a = ITEM_CONSTANT
; b = BATTLE_CONSTANT (ATTACK, DEFENSE, SPEED, SP_ATTACK, SP_DEFENSE, ACCURACY, EVASION)
@@ -817,7 +809,6 @@ EnemyUsedXItem:
farcall CheckIfStatCanBeRaised
jp AIUpdateHUD
-
; Parameter
; a = ITEM_CONSTANT
PrintText_UsedItemOn_AND_AIUpdateHUD:
diff --git a/engine/battle/ai/move.asm b/engine/battle/ai/move.asm
index 488ea76ca..df0053141 100644
--- a/engine/battle/ai/move.asm
+++ b/engine/battle/ai/move.asm
@@ -15,7 +15,6 @@ AIChooseMove:
farcall CheckEnemyLockedIn
ret nz
-
; The default score is 20. Unusable moves are given a score of 80.
ld a, 20
ld hl, wBuffer1
@@ -61,7 +60,6 @@ AIChooseMove:
ld [hl], 80
jr .CheckMovePP
-
; Apply AI scoring layers depending on the trainer class.
.ApplyLayers:
ld hl, TrainerClassAttributes + TRNATTR_AI_MOVE_WEIGHTS
@@ -199,7 +197,6 @@ AIChooseMove:
ld [wCurEnemyMoveNum], a
ret
-
AIScoringPointers:
; entries correspond to AI_* constants
dw AI_Basic
diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm
index 128e9841b..6928a3a83 100644
--- a/engine/battle/ai/scoring.asm
+++ b/engine/battle/ai/scoring.asm
@@ -65,7 +65,6 @@ AI_Basic:
INCLUDE "data/battle/ai/status_only_effects.asm"
-
AI_Setup:
; Use stat-modifying moves on turn 1.
@@ -141,7 +140,6 @@ AI_Setup:
jr .checkmove
-
AI_Types:
; Dismiss any move that the player is immune to.
; Encourage super-effective moves.
@@ -232,7 +230,6 @@ AI_Types:
jr .checkmove
-
AI_Offensive:
; Greatly discourage non-damaging moves.
@@ -260,7 +257,6 @@ AI_Offensive:
jr .checkmove
-
AI_Smart:
; Context-specific scoring.
@@ -392,7 +388,6 @@ AI_Smart:
dbw EFFECT_FLY, AI_Smart_Fly
db -1 ; end
-
AI_Smart_Sleep:
; Greatly encourage sleep inducing moves if the enemy has either Dream Eater or Nightmare.
; 50% chance to greatly encourage sleep inducing moves otherwise.
@@ -412,7 +407,6 @@ AI_Smart_Sleep:
dec [hl]
ret
-
AI_Smart_LeechHit:
push hl
ld a, 1
@@ -447,7 +441,6 @@ AI_Smart_LeechHit:
inc [hl]
ret
-
AI_Smart_LockOn:
ld a, [wPlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
@@ -552,7 +545,6 @@ AI_Smart_LockOn:
pop hl
jp AIDiscourageMove
-
AI_Smart_Selfdestruct:
; Selfdestruct, Explosion
@@ -589,7 +581,6 @@ AI_Smart_Selfdestruct:
inc [hl]
ret
-
AI_Smart_DreamEater:
; 90% chance to greatly encourage this move.
; The AI_Basic layer will make sure that
@@ -602,9 +593,7 @@ AI_Smart_DreamEater:
dec [hl]
ret
-
AI_Smart_EvasionUp:
-
; Dismiss this move if enemy's evasion can't raise anymore.
ld a, [wEnemyEvaLevel]
cp $d
@@ -688,7 +677,6 @@ AI_Smart_EvasionUp:
bit SUBSTATUS_ROLLOUT, a
jr nz, .asm_388ef
-
.asm_38936
inc [hl]
ret
@@ -714,7 +702,6 @@ AI_Smart_EvasionUp:
dec [hl]
ret
-
AI_Smart_AlwaysHit:
; 80% chance to greatly encourage this move if either...
@@ -736,9 +723,7 @@ AI_Smart_AlwaysHit:
dec [hl]
ret
-
AI_Smart_MirrorMove:
-
; If the player did not use any move last turn...
ld a, [wLastPlayerCounterMove]
and a
@@ -779,9 +764,7 @@ AI_Smart_MirrorMove:
dec [hl]
ret
-
AI_Smart_AccuracyDown:
-
; If player's HP is full...
call AICheckPlayerMaxHP
jr nc, .asm_389a0
@@ -885,9 +868,7 @@ AI_Smart_AccuracyDown:
dec [hl]
ret
-
AI_Smart_ResetStats:
-
; 85% chance to encourage this move if any of enemy's stat levels is lower than -2.
push hl
ld hl, wEnemyAtkLevel
@@ -927,7 +908,6 @@ AI_Smart_ResetStats:
inc [hl]
ret
-
AI_Smart_Bide:
; 90% chance to discourage this move unless enemy's HP is full.
@@ -939,7 +919,6 @@ AI_Smart_Bide:
inc [hl]
ret
-
AI_Smart_ForceSwitch:
; Whirlwind, Roar.
@@ -956,7 +935,6 @@ AI_Smart_ForceSwitch:
inc [hl]
ret
-
AI_Smart_Heal:
AI_Smart_MorningSun:
AI_Smart_Synthesis:
@@ -980,7 +958,6 @@ AI_Smart_Moonlight:
dec [hl]
ret
-
AI_Smart_Toxic:
AI_Smart_LeechSeed:
; Discourage this move if player's HP is below 50%.
@@ -990,7 +967,6 @@ AI_Smart_LeechSeed:
inc [hl]
ret
-
AI_Smart_LightScreen:
AI_Smart_Reflect:
; Over 90% chance to discourage this move unless enemy's HP is full.
@@ -1003,7 +979,6 @@ AI_Smart_Reflect:
inc [hl]
ret
-
AI_Smart_Ohko:
; Dismiss this move if player's level is higher than enemy's level.
; Else, discourage this move is player's HP is below 50%.
@@ -1018,7 +993,6 @@ AI_Smart_Ohko:
inc [hl]
ret
-
AI_Smart_TrapTarget:
; Bind, Wrap, Fire Spin, Clamp
@@ -1058,7 +1032,6 @@ AI_Smart_TrapTarget:
dec [hl]
ret
-
AI_Smart_RazorWind:
AI_Smart_Unused2B:
ld a, [wEnemySubStatus1]
@@ -1112,9 +1085,7 @@ AI_Smart_Unused2B:
ld [hl], a
ret
-
AI_Smart_Confuse:
-
; 90% chance to discourage this move if player's HP is between 25% and 50%.
call AICheckPlayerHalfHP
ret c
@@ -1130,9 +1101,7 @@ AI_Smart_Confuse:
inc [hl]
ret
-
AI_Smart_SpDefenseUp2:
-
; Discourage this move if enemy's HP is lower than 50%.
call AICheckEnemyHalfHP
jr nc, .asm_38b10
@@ -1165,7 +1134,6 @@ AI_Smart_SpDefenseUp2:
inc [hl]
ret
-
AI_Smart_Fly:
; Fly, Dig
@@ -1184,7 +1152,6 @@ AI_Smart_Fly:
dec [hl]
ret
-
AI_Smart_SuperFang:
; Discourage this move if player's HP is below 25%.
@@ -1193,9 +1160,7 @@ AI_Smart_SuperFang:
inc [hl]
ret
-
AI_Smart_Paralyze:
-
; 50% chance to discourage this move if player's HP is below 25%.
call AICheckPlayerQuarterHP
jr nc, .asm_38b3a
@@ -1218,7 +1183,6 @@ AI_Smart_Paralyze:
inc [hl]
ret
-
AI_Smart_SpeedDownHit:
; Icy Wind
@@ -1244,7 +1208,6 @@ AI_Smart_SpeedDownHit:
dec [hl]
ret
-
AI_Smart_Substitute:
; Dismiss this move if enemy's HP is below 50%.
@@ -1252,7 +1215,6 @@ AI_Smart_Substitute:
ret c
jp AIDiscourageMove
-
AI_Smart_HyperBeam:
call AICheckEnemyHalfHP
jr c, .asm_38b72
@@ -1276,7 +1238,6 @@ AI_Smart_HyperBeam:
inc [hl]
ret
-
AI_Smart_Rage:
ld a, [wEnemySubStatus4]
bit SUBSTATUS_RAGE, a
@@ -1315,7 +1276,6 @@ AI_Smart_Rage:
inc [hl]
ret
-
AI_Smart_Mimic:
ld a, [wLastPlayerCounterMove]
and a
@@ -1365,7 +1325,6 @@ AI_Smart_Mimic:
inc [hl]
ret
-
AI_Smart_Counter:
push hl
ld hl, wPlayerUsedMoves
@@ -1415,7 +1374,6 @@ AI_Smart_Counter:
cp SPECIAL
jr nc, .asm_38c38
-
.asm_38c30
call Random
cp 39 percent + 1
@@ -1430,7 +1388,6 @@ AI_Smart_Counter:
inc [hl]
ret
-
AI_Smart_Encore:
call AICompareSpeed
jr nc, .asm_38c81
@@ -1484,7 +1441,6 @@ AI_Smart_Encore:
INCLUDE "data/battle/ai/encore_moves.asm"
-
AI_Smart_PainSplit:
; Discourage this move if [enemy's current HP * 2 > player's current HP].
@@ -1505,7 +1461,6 @@ AI_Smart_PainSplit:
inc [hl]
ret
-
AI_Smart_Snore:
AI_Smart_SleepTalk:
; Greatly encourage this move if enemy is fast asleep.
@@ -1527,7 +1482,6 @@ AI_Smart_SleepTalk:
inc [hl]
ret
-
AI_Smart_DefrostOpponent:
; Greatly encourage this move if enemy is frozen.
; No move has EFFECT_DEFROST_OPPONENT, so this layer is unused.
@@ -1540,7 +1494,6 @@ AI_Smart_DefrostOpponent:
dec [hl]
ret
-
AI_Smart_Spite:
ld a, [wLastPlayerCounterMove]
and a
@@ -1597,11 +1550,9 @@ AI_Smart_Spite:
dec [hl]
ret
-
Function_0x38d16
jp AIDiscourageMove
-
AI_Smart_DestinyBond:
AI_Smart_Reversal:
AI_Smart_SkullBash:
@@ -1612,7 +1563,6 @@ AI_Smart_SkullBash:
inc [hl]
ret
-
AI_Smart_HealBell:
; Dismiss this move if none of the opponent's Pokemon is statused.
; Encourage this move if the enemy is statused.
@@ -1670,7 +1620,6 @@ AI_Smart_HealBell:
jp AIDiscourageMove
-
AI_Smart_PriorityHit:
call AICompareSpeed
ret c
@@ -1702,7 +1651,6 @@ AI_Smart_PriorityHit:
dec [hl]
ret
-
AI_Smart_Thief:
; Don't use Thief unless it's the only move available.
@@ -1711,7 +1659,6 @@ AI_Smart_Thief:
ld [hl], a
ret
-
AI_Smart_Conversion2:
ld a, [wLastPlayerMove]
and a
@@ -1751,7 +1698,6 @@ AI_Smart_Conversion2:
inc [hl]
ret
-
AI_Smart_Disable:
call AICompareSpeed
jr nc, .asm_38df3
@@ -1783,7 +1729,6 @@ AI_Smart_Disable:
inc [hl]
ret
-
AI_Smart_MeanLook:
call AICheckEnemyHalfHP
jr nc, .asm_38e24
@@ -1825,7 +1770,6 @@ AI_Smart_MeanLook:
dec [hl]
ret
-
AICheckLastPlayerMon:
ld a, [wPartyCount]
ld b, a
@@ -1851,7 +1795,6 @@ AICheckLastPlayerMon:
ret
-
AI_Smart_Nightmare:
; 50% chance to encourage this move.
; The AI_Basic layer will make sure that
@@ -1862,7 +1805,6 @@ AI_Smart_Nightmare:
dec [hl]
ret
-
AI_Smart_FlameWheel:
; Use this move if the enemy is frozen.
@@ -1874,7 +1816,6 @@ rept 5
endr
ret
-
AI_Smart_Curse:
ld a, [wEnemyMonType1]
cp GHOST
@@ -1932,14 +1873,12 @@ AI_Smart_Curse:
jr .asm_38eb7
-
.asm_38eb0
push hl
call AICheckLastPlayerMon
pop hl
jr z, .asm_38ecb
-
.asm_38eb7
call AICheckEnemyQuarterHP
jp nc, .asm_38e90
@@ -1962,7 +1901,6 @@ AI_Smart_Curse:
dec [hl]
ret
-
AI_Smart_Protect:
ld a, [wEnemyProtectCount]
and a
@@ -2014,7 +1952,6 @@ AI_Smart_Protect:
inc [hl]
ret
-
AI_Smart_Foresight:
ld a, [wEnemyAccLevel]
cp $5
@@ -2044,7 +1981,6 @@ AI_Smart_Foresight:
dec [hl]
ret
-
AI_Smart_PerishSong:
push hl
callfar FindAliveEnemyMons
@@ -2081,9 +2017,7 @@ AI_Smart_PerishSong:
ld [hl], a
ret
-
AI_Smart_Sandstorm:
-
; Greatly discourage this move if the player is immune to Sandstorm damage.
ld a, [wBattleMonType1]
push hl
@@ -2125,7 +2059,6 @@ AI_Smart_Sandstorm:
db STEEL
db -1 ; end
-
AI_Smart_Endure:
ld a, [wEnemyProtectCount]
and a
@@ -2168,7 +2101,6 @@ AI_Smart_Endure:
inc [hl]
ret
-
AI_Smart_FuryCutter:
; Encourage this move based on Fury Cutter's count.
@@ -2192,7 +2124,6 @@ AI_Smart_FuryCutter:
; fallthrough
-
AI_Smart_Rollout:
; Rollout, Fury Cutter
@@ -2235,7 +2166,6 @@ AI_Smart_Rollout:
inc [hl]
ret
-
AI_Smart_Swagger:
AI_Smart_Attract:
; 80% chance to encourage this move during the first turn of player's Pokemon.
@@ -2257,7 +2187,6 @@ AI_Smart_Attract:
dec [hl]
ret
-
AI_Smart_Safeguard:
; 80% chance to discourage this move if player's HP is below 50%.
@@ -2268,10 +2197,8 @@ AI_Smart_Safeguard:
inc [hl]
ret
-
AI_Smart_Magnitude:
AI_Smart_Earthquake:
-
; Greatly encourage this move if the player is underground and the enemy is faster.
ld a, [wLastPlayerCounterMove]
cp DIG
@@ -2300,7 +2227,6 @@ AI_Smart_Earthquake:
dec [hl]
ret
-
AI_Smart_BatonPass:
; Discourage this move if the player hasn't shown super-effective moves against the enemy.
; Consider player's type(s) if its moves are unknown.
@@ -2314,7 +2240,6 @@ AI_Smart_BatonPass:
inc [hl]
ret
-
AI_Smart_Pursuit:
; 50% chance to greatly encourage this move if player's HP is below 25%.
; 80% chance to discourage this move otherwise.
@@ -2333,7 +2258,6 @@ AI_Smart_Pursuit:
dec [hl]
ret
-
AI_Smart_RapidSpin:
; 80% chance to greatly encourage this move if the enemy is
; trapped (Bind effect), seeded, or scattered with spikes.
@@ -2358,7 +2282,6 @@ AI_Smart_RapidSpin:
dec [hl]
ret
-
AI_Smart_HiddenPower:
push hl
ld a, 1
@@ -2397,9 +2320,7 @@ AI_Smart_HiddenPower:
inc [hl]
ret
-
AI_Smart_RainDance:
-
; Greatly discourage this move if it would favour the player type-wise.
; Particularly, if the player is a Water-type.
ld a, [wBattleMonType1]
@@ -2420,9 +2341,7 @@ AI_Smart_RainDance:
INCLUDE "data/battle/ai/rain_dance_moves.asm"
-
AI_Smart_SunnyDay:
-
; Greatly discourage this move if it would favour the player type-wise.
; Particularly, if the player is a Fire-type.
ld a, [wBattleMonType1]
@@ -2442,7 +2361,6 @@ AI_Smart_SunnyDay:
; fallthrough
-
AI_Smart_WeatherMove:
; Rain Dance, Sunny Day
@@ -2492,10 +2410,8 @@ AIGoodWeatherType:
dec [hl]
ret
-
INCLUDE "data/battle/ai/sunny_day_moves.asm"
-
AI_Smart_BellyDrum:
; Dismiss this move if enemy's attack is higher than +2 or if enemy's HP is below 50%.
; Else, discourage this move if enemy's HP is not full.
@@ -2518,7 +2434,6 @@ AI_Smart_BellyDrum:
ld [hl], a
ret
-
AI_Smart_PsychUp:
push hl
ld hl, wEnemyAtkLevel
@@ -2576,7 +2491,6 @@ AI_Smart_PsychUp:
inc [hl]
ret
-
AI_Smart_MirrorCoat:
push hl
ld hl, wPlayerUsedMoves
@@ -2626,7 +2540,6 @@ AI_Smart_MirrorCoat:
cp SPECIAL
jr c, .asm_391d2
-
.asm_391ca
call Random
cp 100
@@ -2640,10 +2553,8 @@ AI_Smart_MirrorCoat:
inc [hl]
ret
-
AI_Smart_Twister:
AI_Smart_Gust:
-
; Greatly encourage this move if the player is flying and the enemy is faster.
ld a, [wLastPlayerCounterMove]
cp FLY
@@ -2671,7 +2582,6 @@ AI_Smart_Gust:
dec [hl]
ret
-
AI_Smart_FutureSight:
; Greatly encourage this move if the player is
; flying or underground, and slower than the enemy.
@@ -2687,7 +2597,6 @@ AI_Smart_FutureSight:
dec [hl]
ret
-
AI_Smart_Stomp:
; 80% chance to encourage this move if the player has used Minimize.
@@ -2701,7 +2610,6 @@ AI_Smart_Stomp:
dec [hl]
ret
-
AI_Smart_Solarbeam:
; 80% chance to encourage this move when it's sunny.
; 90% chance to discourage this move when it's raining.
@@ -2729,7 +2637,6 @@ AI_Smart_Solarbeam:
dec [hl]
ret
-
AI_Smart_Thunder:
; 90% chance to discourage this move when it's sunny.
@@ -2744,7 +2651,6 @@ AI_Smart_Thunder:
inc [hl]
ret
-
AICompareSpeed:
; Return carry if enemy is faster than player.
@@ -2760,7 +2666,6 @@ AICompareSpeed:
pop bc
ret
-
AICheckPlayerMaxHP:
push hl
push de
@@ -2769,7 +2674,6 @@ AICheckPlayerMaxHP:
ld hl, wBattleMonMaxHP
jr AICheckMaxHP
-
AICheckEnemyMaxHP:
push hl
push de
@@ -2778,7 +2682,6 @@ AICheckEnemyMaxHP:
ld hl, wEnemyMonMaxHP
; fallthrough
-
AICheckMaxHP:
; Return carry if hp at de matches max hp at hl.
@@ -2805,7 +2708,6 @@ AICheckMaxHP:
and a
ret
-
AICheckPlayerHalfHP:
push hl
ld hl, wBattleMonHP
@@ -2823,7 +2725,6 @@ AICheckPlayerHalfHP:
pop hl
ret
-
AICheckEnemyHalfHP:
push hl
push de
@@ -2845,7 +2746,6 @@ AICheckEnemyHalfHP:
pop hl
ret
-
AICheckEnemyQuarterHP:
push hl
push de
@@ -2869,7 +2769,6 @@ AICheckEnemyQuarterHP:
pop hl
ret
-
AICheckPlayerQuarterHP:
push hl
ld hl, wBattleMonHP
@@ -2889,7 +2788,6 @@ AICheckPlayerQuarterHP:
pop hl
ret
-
AIHasMoveEffect:
; Return carry if the enemy has move b.
@@ -2921,7 +2819,6 @@ AIHasMoveEffect:
scf
ret
-
AIHasMoveInArray:
; Return carry if the enemy has a move in array hl.
@@ -2955,10 +2852,8 @@ AIHasMoveInArray:
pop hl
ret
-
INCLUDE "data/battle/ai/useful_moves.asm"
-
AI_Opportunist:
; Discourage stall moves when the enemy's HP is low.
@@ -3009,7 +2904,6 @@ AI_Opportunist:
INCLUDE "data/battle/ai/stall_moves.asm"
-
AI_Aggressive:
; Use whatever does the most damage.
@@ -3117,7 +3011,6 @@ AI_Aggressive:
INCLUDE "data/battle/ai/reckless_moves.asm"
-
AIDamageCalc:
ld a, 1
ld [hBattleTurn], a
@@ -3137,7 +3030,6 @@ AIDamageCalc:
INCLUDE "data/battle/ai/constant_damage_effects.asm"
-
AI_Cautious:
; 90% chance to discourage moves with residual effects after the first turn.
@@ -3180,7 +3072,6 @@ AI_Cautious:
INCLUDE "data/battle/ai/residual_moves.asm"
-
AI_Status:
; Dismiss status moves that don't affect the player.
@@ -3243,7 +3134,6 @@ AI_Status:
jr .checkmove
-
AI_Risky:
; Use any move that will KO the target.
; Risky moves will often be an exception (see below).
@@ -3313,18 +3203,15 @@ endr
INCLUDE "data/battle/ai/risky_effects.asm"
-
AI_None:
ret
-
AIDiscourageMove:
ld a, [hl]
add 10
ld [hl], a
ret
-
AIGetEnemyMove:
; Load attributes of move a into ram
@@ -3345,13 +3232,11 @@ AIGetEnemyMove:
pop hl
ret
-
AI_80_20:
call Random
cp 20 percent - 1
ret
-
AI_50_50:
call Random
cp 50 percent + 1
diff --git a/engine/battle/ai/switch.asm b/engine/battle/ai/switch.asm
index b975776c2..b9bd2ea60 100644
--- a/engine/battle/ai/switch.asm
+++ b/engine/battle/ai/switch.asm
@@ -96,7 +96,6 @@ CheckPlayerMoveTypeMatchups:
pop hl
ret
-
.CheckEnemyMoveMatchups:
ld de, wEnemyMonMoves
ld b, NUM_MOVES + 1
@@ -290,7 +289,6 @@ CheckAbleToSwitch:
ld [wEnemySwitchMonParam], a
ret
-
FindAliveEnemyMons:
ld a, [wOTPartyCount]
cp 2
@@ -341,7 +339,6 @@ FindAliveEnemyMons:
and a
ret
-
FindEnemyMonsImmuneToLastCounterMove:
ld hl, wOTPartyMon1
ld a, [wOTPartyCount]
@@ -408,7 +405,6 @@ FindEnemyMonsImmuneToLastCounterMove:
srl c
jr .loop
-
FindAliveEnemyMonsWithASuperEffectiveMove:
push bc
ld a, [wOTPartyCount]
@@ -439,8 +435,9 @@ FindAliveEnemyMonsWithASuperEffectiveMove:
and c
ld c, a
-FindEnemyMonsWithASuperEffectiveMove:
+ ; fallthrough
+FindEnemyMonsWithASuperEffectiveMove:
ld a, -1
ld [wEnemyAISwitchScore], a
ld hl, wOTPartyMon1Moves
@@ -546,7 +543,6 @@ FindEnemyMonsWithASuperEffectiveMove:
pop bc
ret
-
FindEnemyMonsThatResistPlayer:
push bc
ld hl, wOTPartySpecies
@@ -607,7 +603,6 @@ FindEnemyMonsThatResistPlayer:
ld c, a
ret
-
FindEnemyMonsWithAtLeastQuarterMaxHP:
push bc
ld de, wOTPartySpecies
diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm
index 3a9749b03..8747f46a6 100644
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -6,6 +6,8 @@ BATTLETRANSITION_NO_CAVE_STRONGER EQU $18
BATTLETRANSITION_FINISH EQU $20
BATTLETRANSITION_END EQU $80
+BATTLETRANSITION_SQUARE EQUS "\"8\"" ; $fe
+
DoBattleTransition:
call .InitGFX
ld a, [rBGP]
@@ -97,7 +99,7 @@ LoadTrainerBattlePokeballTiles:
; Load the tiles used in the Pokeball Graphic that fills the screen
; at the start of every Trainer battle.
ld de, TrainerBattlePokeballTiles
- ld hl, vTiles1 tile $7e
+ ld hl, vTiles0 tile BATTLETRANSITION_SQUARE
ld b, BANK(TrainerBattlePokeballTiles)
ld c, 2
call Request2bpp
@@ -108,7 +110,7 @@ LoadTrainerBattlePokeballTiles:
ld [rVBK], a
ld de, TrainerBattlePokeballTiles
- ld hl, vTiles4 tile $7e
+ ld hl, vTiles3 tile BATTLETRANSITION_SQUARE
ld b, BANK(TrainerBattlePokeballTiles)
ld c, 2
call Request2bpp
@@ -146,7 +148,6 @@ ConvertTrainerBattlePokeballTilesTo2bpp:
TrainerBattlePokeballTiles:
INCBIN "gfx/overworld/trainer_battle_pokeball_tiles.2bpp"
-
BattleTransitionJumptable:
jumptable .Jumptable, wJumptableIndex
@@ -617,7 +618,7 @@ StartTrainerBattle_LoadPokeBallGraphics:
jr z, .done
sla a
jr nc, .no_load
- ld [hl], $fe
+ ld [hl], BATTLETRANSITION_SQUARE
.no_load
inc hl
jr .loop4
@@ -753,7 +754,6 @@ WipeLYOverrides:
jr nz, .loop
ret
-
StartTrainerBattle_DrawSineWave:
calc_sine_wave
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 902846bdc..c3c7e9867 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -6036,7 +6036,6 @@ LoadEnemyMon:
jp .Happiness
.InitDVs:
-
; Trainer DVs
; All trainers have preset DVs, determined by class
@@ -6486,7 +6485,6 @@ CheckUnownLetter:
INCLUDE "data/wild/unlocked_unowns.asm"
-
Unreferenced_SwapBattlerLevels:
push bc
ld a, [wBattleMonLevel]
diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm
index 07e8b3a2a..3e6d928d2 100644
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -7,8 +7,6 @@ DoPlayerTurn:
jr DoTurn
-
-
DoEnemyTurn:
call SetEnemyTurn
@@ -24,7 +22,6 @@ DoEnemyTurn:
; fallthrough
-
DoTurn:
; Read in and execute the user's move effects for this turn.
@@ -40,7 +37,6 @@ DoTurn:
call UpdateMoveData
-
DoMove:
; Get the user's move effect.
ld a, BATTLE_VARS_MOVE_EFFECT
@@ -72,7 +68,6 @@ DoMove:
ld [wBattleScriptBufferAddress + 1], a
.ReadMoveEffectCommand:
-
; ld a, [wBattleScriptBufferAddress++]
ld a, [wBattleScriptBufferAddress]
ld l, a
@@ -112,8 +107,6 @@ DoMove:
.DoMoveEffectCommand:
jp hl
-
-
CheckTurn:
BattleCommand_CheckTurn:
; checkturn
@@ -141,9 +134,7 @@ BattleCommand_CheckTurn:
and a
jp nz, CheckEnemyTurn
-
CheckPlayerTurn:
-
ld hl, wPlayerSubStatus4
bit SUBSTATUS_RECHARGE, [hl]
jr z, .no_recharge
@@ -156,7 +147,6 @@ CheckPlayerTurn:
.no_recharge
-
ld hl, wBattleMonStatus
ld a, [hl]
and SLP
@@ -202,7 +192,6 @@ CheckPlayerTurn:
.not_asleep
-
ld hl, wBattleMonStatus
bit FRZ, [hl]
jr z, .not_frozen
@@ -222,7 +211,6 @@ CheckPlayerTurn:
.not_frozen
-
ld hl, wPlayerSubStatus3
bit SUBSTATUS_FLINCHED, [hl]
jr z, .not_flinched
@@ -236,7 +224,6 @@ CheckPlayerTurn:
.not_flinched
-
ld hl, wPlayerDisableCount
ld a, [hl]
and a
@@ -254,7 +241,6 @@ CheckPlayerTurn:
.not_disabled
-
ld a, [wPlayerSubStatus3]
add a
jr nc, .not_confused
@@ -293,7 +279,6 @@ CheckPlayerTurn:
.not_confused
-
ld a, [wPlayerSubStatus1]
add a ; bit SUBSTATUS_ATTRACT
jr nc, .not_infatuated
@@ -317,7 +302,6 @@ CheckPlayerTurn:
.not_infatuated
-
; We can't disable a move that doesn't exist.
ld a, [wDisabledMove]
and a
@@ -334,7 +318,6 @@ CheckPlayerTurn:
.no_disabled_move
-
ld hl, wBattleMonStatus
bit PAR, [hl]
ret z
@@ -349,8 +332,6 @@ CheckPlayerTurn:
call CantMove
jp EndTurn
-
-
CantMove:
ld a, BATTLE_VARS_SUBSTATUS1
call GetBattleVarAddr
@@ -377,19 +358,12 @@ CantMove:
res SUBSTATUS_FLYING, [hl]
jp AppearUserRaiseSub
-
-
-
OpponentCantMove:
call BattleCommand_SwitchTurn
call CantMove
jp BattleCommand_SwitchTurn
-
-
-
CheckEnemyTurn:
-
ld hl, wEnemySubStatus4
bit SUBSTATUS_RECHARGE, [hl]
jr z, .no_recharge
@@ -402,7 +376,6 @@ CheckEnemyTurn:
.no_recharge
-
ld hl, wEnemyMonStatus
ld a, [hl]
and SLP
@@ -446,7 +419,6 @@ CheckEnemyTurn:
.not_asleep
-
ld hl, wEnemyMonStatus
bit FRZ, [hl]
jr z, .not_frozen
@@ -465,7 +437,6 @@ CheckEnemyTurn:
.not_frozen
-
ld hl, wEnemySubStatus3
bit SUBSTATUS_FLINCHED, [hl]
jr z, .not_flinched
@@ -479,7 +450,6 @@ CheckEnemyTurn:
.not_flinched
-
ld hl, wEnemyDisableCount
ld a, [hl]
and a
@@ -498,7 +468,6 @@ CheckEnemyTurn:
.not_disabled
-
ld a, [wEnemySubStatus3]
add a ; bit SUBSTATUS_CONFUSED
jr nc, .not_confused
@@ -513,7 +482,6 @@ CheckEnemyTurn:
call StdBattleTextBox
jr .not_confused
-
.confused
ld hl, IsConfusedText
call StdBattleTextBox
@@ -557,7 +525,6 @@ CheckEnemyTurn:
.not_confused
-
ld a, [wEnemySubStatus1]
add a ; bit SUBSTATUS_ATTRACT
jr nc, .not_infatuated
@@ -581,7 +548,6 @@ CheckEnemyTurn:
.not_infatuated
-
; We can't disable a move that doesn't exist.
ld a, [wEnemyDisabledMove]
and a
@@ -599,7 +565,6 @@ CheckEnemyTurn:
.no_disabled_move
-
ld hl, wEnemyMonStatus
bit PAR, [hl]
ret z
@@ -615,16 +580,12 @@ CheckEnemyTurn:
; fallthrough
-
EndTurn:
ld a, $1
ld [wTurnEnded], a
jp ResetDamage
-
-
MoveDisabled:
-
; Make sure any charged moves fail
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr
@@ -638,10 +599,7 @@ MoveDisabled:
ld hl, DisabledMoveText
jp StdBattleTextBox
-
-
HitConfusion:
-
ld hl, HurtItselfText
call StdBattleTextBox
@@ -670,8 +628,6 @@ HitConfusion:
call DoPlayerDamage
jp BattleCommand_RaiseSub
-
-
BattleCommand_CheckObedience:
; checkobedience
@@ -714,7 +670,6 @@ BattleCommand_CheckObedience:
cp [hl]
ret z
-
.obeylevel
; The maximum obedience level is constrained by owned badges:
ld hl, wJohtoBadges
@@ -742,7 +697,6 @@ BattleCommand_CheckObedience:
; no badges
ld a, 10
-
.getlevel
; c = obedience level
; d = monster level
@@ -761,14 +715,12 @@ BattleCommand_CheckObedience:
jr nc, .checklevel
ld b, $ff
-
.checklevel
; If the monster's level is lower than the obedience level, it will obey.
ld a, c
cp d
ret nc
-
; Random number from 0 to obedience level + monster level
.rand1
call BattleRandom
@@ -786,7 +738,6 @@ BattleCommand_CheckObedience:
call IgnoreSleepOnly
ret c
-
; Another random number from 0 to obedience level + monster level
.rand2
call BattleRandom
@@ -797,7 +748,6 @@ BattleCommand_CheckObedience:
cp c
jr c, .UseInstead
-
; No hope of using a move now.
; b = number of levels the monster is above the obedience level
@@ -820,7 +770,6 @@ BattleCommand_CheckObedience:
call HitConfusion
jp .EndDisobedience
-
.Nap:
call BattleRandom
add a
@@ -833,7 +782,6 @@ BattleCommand_CheckObedience:
ld hl, BeganToNapText
jr .Print
-
.DoNothing:
; 4 random choices
call BattleRandom
@@ -857,9 +805,7 @@ BattleCommand_CheckObedience:
call StdBattleTextBox
jp .EndDisobedience
-
.UseInstead:
-
; Can't use another move if the monster only has one!
ld a, [wBattleMonMoves + 1]
and a
@@ -870,7 +816,6 @@ BattleCommand_CheckObedience:
and a
jr nz, .DoNothing
-
ld hl, wBattleMonPP
ld de, wBattleMonMoves
ld b, 0
@@ -891,7 +836,6 @@ BattleCommand_CheckObedience:
and a
jr nz, .GetTotalPP
-
.CheckMovePP:
ld hl, wBattleMonPP
ld a, [wCurMoveNum]
@@ -905,7 +849,6 @@ BattleCommand_CheckObedience:
cp b
jr z, .DoNothing
-
; Make sure we can actually use the move once we get there.
ld a, 1
ld [wAlreadyDisobeyed], a
@@ -918,7 +861,6 @@ BattleCommand_CheckObedience:
ld c, a
push af
-
.RandomMove:
call BattleRandom
maskbits NUM_MOVES
@@ -940,7 +882,6 @@ BattleCommand_CheckObedience:
and PP_MASK
jr z, .RandomMove
-
; Use it.
ld a, [wCurMoveNum]
ld c, a
@@ -954,12 +895,10 @@ BattleCommand_CheckObedience:
call UpdateMoveData
call DoMove
-
; Restore original move choice.
pop af
ld [wCurMoveNum], a
-
.EndDisobedience:
xor a
ld [wLastPlayerMove], a
@@ -973,10 +912,7 @@ BattleCommand_CheckObedience:
jp EndMoveEffect
-
-
IgnoreSleepOnly:
-
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
@@ -1003,17 +939,12 @@ IgnoreSleepOnly:
scf
ret
-
-
BattleCommand_UsedMoveText:
; usedmovetext
farcall DisplayUsedMoveText
ret
-
-
CheckUserIsCharging:
-
ld a, [hBattleTurn]
and a
ld a, [wPlayerCharging] ; player
@@ -1023,8 +954,6 @@ CheckUserIsCharging:
and a
ret
-
-
BattleCommand_DoTurn:
call CheckUserIsCharging
ret nz
@@ -1150,7 +1079,6 @@ BattleCommand_DoTurn:
ld b, 1
ret
-
.continuousmoves
db EFFECT_RAZOR_WIND
db EFFECT_SKY_ATTACK
@@ -1192,8 +1120,6 @@ CheckMimicUsed:
and a
ret
-
-
BattleCommand_Critical:
; critical
@@ -1286,10 +1212,8 @@ BattleCommand_Critical:
INCLUDE "data/battle/critical_hits.asm"
-
INCLUDE "engine/battle/move_effects/triple_kick.asm"
-
BattleCommand_Stab:
; STAB = Same Type Attack Bonus
ld a, BATTLE_VARS_MOVE_ANIM
@@ -1474,8 +1398,6 @@ BattleCommand_Stab:
ld [wTypeModifier], a
ret
-
-
BattleCheckTypeMatchup:
ld hl, wEnemyMonType1
ld a, [hBattleTurn]
@@ -1555,8 +1477,6 @@ CheckTypeMatchup:
pop hl
ret
-
-
BattleCommand_ResetTypeMatchup:
; Reset the type matchup multiplier to 1.0, if the type matchup is not 0.
; If there is immunity in play, the move automatically misses.
@@ -1576,13 +1496,10 @@ BattleCommand_ResetTypeMatchup:
ld [wTypeMatchup], a
ret
-
-
INCLUDE "engine/battle/ai/switch.asm"
INCLUDE "data/types/type_matchups.asm"
-
BattleCommand_DamageVariation:
; damagevariation
@@ -1592,7 +1509,6 @@ BattleCommand_DamageVariation:
; is not consistent. This makes the highest damage multipliers
; rarer than normal.
-
; No point in reducing 1 or 0 damage.
ld hl, wCurDamage
ld a, [hli]
@@ -1636,8 +1552,6 @@ BattleCommand_DamageVariation:
ld [hl], a
ret
-
-
BattleCommand_CheckHit:
; checkhit
@@ -1706,7 +1620,6 @@ BattleCommand_CheckHit:
.Hit:
ret
-
.Miss:
; Keep the damage value intact if we're using (Hi) Jump Kick.
ld a, BATTLE_VARS_MOVE_EFFECT
@@ -1720,7 +1633,6 @@ BattleCommand_CheckHit:
ld [wAttackMissed], a
ret
-
.DreamEater:
; Return z if we're trying to eat the dream of
; a monster that isn't sleeping.
@@ -1734,7 +1646,6 @@ BattleCommand_CheckHit:
and SLP
ret
-
.Protect:
; Return nz if the opponent is protected.
ld a, BATTLE_VARS_SUBSTATUS1_OPP
@@ -1756,7 +1667,6 @@ BattleCommand_CheckHit:
and a
ret
-
.LockOn:
; Return nz if we are locked-on and aren't trying to use Earthquake,
; Fissure or Magnitude on a monster that is flying.
@@ -1786,7 +1696,6 @@ BattleCommand_CheckHit:
and a
ret
-
.DrainSub:
; Return z if using an HP drain move on a substitute.
call CheckSubstituteOpp
@@ -1805,7 +1714,6 @@ BattleCommand_CheckHit:
and a
ret
-
.FlyDigMoves:
; Check for moves that can hit underground/flying opponents.
; Return z if the current move can hit the opponent.
@@ -1841,7 +1749,6 @@ BattleCommand_CheckHit:
cp MAGNITUDE
ret
-
.ThunderRain:
; Return z if the current move always hits in rain, and it is raining.
ld a, BATTLE_VARS_MOVE_EFFECT
@@ -1853,16 +1760,13 @@ BattleCommand_CheckHit:
cp WEATHER_RAIN
ret
-
.XAccuracy:
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVar
bit SUBSTATUS_X_ACCURACY, a
ret
-
.StatModifiers:
-
ld a, [hBattleTurn]
and a
@@ -1955,7 +1859,6 @@ BattleCommand_CheckHit:
INCLUDE "data/battle/accuracy_multipliers.asm"
-
BattleCommand_EffectChance:
; effectchance
@@ -1983,8 +1886,6 @@ BattleCommand_EffectChance:
and a
ret
-
-
BattleCommand_LowerSub:
; lowersub
@@ -2053,16 +1954,12 @@ BattleCommand_LowerSub:
ld [wSomeoneIsRampaging], a
ret
-
-
BattleCommand_MoveAnim:
; moveanim
call BattleCommand_LowerSub
call BattleCommand_MoveAnimNoSub
jp BattleCommand_RaiseSub
-
-
BattleCommand_MoveAnimNoSub:
ld a, [wAttackMissed]
and a
@@ -2127,8 +2024,6 @@ BattleCommand_MoveAnimNoSub:
ld [wNumHits], a
jp PlayFXAnimID
-
-
BattleCommand_StatUpAnim:
ld a, [wAttackMissed]
and a
@@ -2137,8 +2032,6 @@ BattleCommand_StatUpAnim:
xor a
jr BattleCommand_StatUpDownAnim
-
-
BattleCommand_StatDownAnim:
ld a, [wAttackMissed]
and a
@@ -2152,7 +2045,6 @@ BattleCommand_StatDownAnim:
; fallthrough
-
BattleCommand_StatUpDownAnim:
ld [wNumHits], a
xor a
@@ -2163,8 +2055,6 @@ BattleCommand_StatUpDownAnim:
ld d, 0
jp PlayFXAnimID
-
-
BattleCommand_SwitchTurn:
; switchturn
@@ -2173,8 +2063,6 @@ BattleCommand_SwitchTurn:
ld [hBattleTurn], a
ret
-
-
BattleCommand_RaiseSub:
; raisesub
@@ -2194,8 +2082,6 @@ BattleCommand_RaiseSub:
ld a, SUBSTITUTE
jp LoadAnim
-
-
BattleCommand_FailureText:
; failuretext
; If the move missed or failed, load the appropriate
@@ -2238,8 +2124,6 @@ BattleCommand_FailureText:
call AppearUserRaiseSub
jp EndMoveEffect
-
-
BattleCommand_ApplyDamage:
; applydamage
@@ -2332,8 +2216,6 @@ BattleCommand_ApplyDamage:
ld [de], a
ret
-
-
GetFailureResultText:
ld hl, DoesntAffectText
ld de, DoesntAffectText
@@ -2402,8 +2284,6 @@ FailText_CheckOpponentProtect:
.not_protected
jp StdBattleTextBox
-
-
BattleCommand_BideFailText:
ld a, [wAttackMissed]
and a
@@ -2414,8 +2294,6 @@ BattleCommand_BideFailText:
jp z, PrintDoesntAffect
jp PrintButItFailed
-
-
BattleCommand_CriticalText:
; criticaltext
; Prints the message for critical hits or one-hit KOs.
@@ -2447,7 +2325,6 @@ BattleCommand_CriticalText:
dw CriticalHitText
dw OneHitKOText
-
BattleCommand_StartLoop:
; startloop
@@ -2461,8 +2338,6 @@ BattleCommand_StartLoop:
ld [hl], a
ret
-
-
BattleCommand_SuperEffectiveLoopText:
; supereffectivelooptext
@@ -2473,7 +2348,6 @@ BattleCommand_SuperEffectiveLoopText:
; fallthrough
-
BattleCommand_SuperEffectiveText:
; supereffectivetext
@@ -2487,8 +2361,6 @@ BattleCommand_SuperEffectiveText:
.print
jp StdBattleTextBox
-
-
BattleCommand_CheckDestinyBond:
; checkdestinybond
@@ -2576,8 +2448,6 @@ BattleCommand_CheckDestinyBond:
.finish
jp EndMoveEffect
-
-
BattleCommand_BuildOpponentRage:
; buildopponentrage
@@ -2609,8 +2479,6 @@ BattleCommand_BuildOpponentRage:
call StdBattleTextBox
jp BattleCommand_SwitchTurn
-
-
BattleCommand_RageDamage:
; ragedamage
@@ -2639,8 +2507,6 @@ BattleCommand_RageDamage:
ld [wCurDamage + 1], a
ret
-
-
EndMoveEffect:
ld a, [wBattleScriptBufferAddress]
ld l, a
@@ -2652,8 +2518,6 @@ EndMoveEffect:
ld [hl], a
ret
-
-
DittoMetalPowder:
ld a, MON_SPECIES
call BattlePartyAttr
@@ -2690,8 +2554,6 @@ DittoMetalPowder:
rr c
ret
-
-
BattleCommand_DamageStats:
; damagestats
@@ -2701,7 +2563,6 @@ BattleCommand_DamageStats:
; fallthrough
-
PlayerAttackDamage:
; Return move power d, player level e, enemy defense c and player attack b.
@@ -2784,8 +2645,6 @@ PlayerAttackDamage:
and a
ret
-
-
TruncateHL_BC:
.loop
; Truncate 16-bit values hl and bc to 8-bit values b and c respectively.
@@ -2831,8 +2690,6 @@ TruncateHL_BC:
ld b, l
ret
-
-
GetDamageStatsCritical:
; Return carry if non-critical.
@@ -2843,7 +2700,6 @@ GetDamageStatsCritical:
; fallthrough
-
GetDamageStats:
; Return the attacker's offensive stat and the defender's defensive
; stat based on whether the attacking type is physical or special.
@@ -2884,8 +2740,6 @@ GetDamageStats:
pop hl
ret
-
-
ThickClubBoost:
; Return in hl the stat value at hl.
@@ -2901,8 +2755,6 @@ ThickClubBoost:
pop bc
ret
-
-
LightBallBoost:
; Return in hl the stat value at hl.
@@ -2918,8 +2770,6 @@ LightBallBoost:
pop bc
ret
-
-
SpeciesItemBoost:
; Return in hl the stat value at hl.
@@ -2960,8 +2810,6 @@ SpeciesItemBoost:
rl h
ret
-
-
EnemyAttackDamage:
call ResetDamage
@@ -3040,11 +2888,8 @@ EnemyAttackDamage:
and a
ret
-
-
INCLUDE "engine/battle/move_effects/beat_up.asm"
-
BattleCommand_ClearMissDamage:
; clearmissdamage
ld a, [wAttackMissed]
@@ -3053,8 +2898,6 @@ BattleCommand_ClearMissDamage:
jp ResetDamage
-
-
HitSelfInConfusion:
call ResetDamage
ld a, [hBattleTurn]
@@ -3091,8 +2934,6 @@ HitSelfInConfusion:
ld e, a
ret
-
-
BattleCommand_DamageCalc:
; damagecalc
@@ -3216,12 +3057,11 @@ BattleCommand_DamageCalc:
ld [hDivisor], a
ld b, 4
call Divide
-.DoneItem:
+.DoneItem:
; Critical hits
call .CriticalMultiplier
-
; Update wCurDamage (capped at 997).
ld hl, wCurDamage
ld b, [hl]
@@ -3286,7 +3126,6 @@ BattleCommand_DamageCalc:
ld a, LOW(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE)
ld [hld], a
-
.dont_cap_3
; Minimum neutral damage is 2 (bringing the cap to 999).
inc hl
@@ -3301,7 +3140,6 @@ BattleCommand_DamageCalc:
and a
ret
-
.CriticalMultiplier:
ld a, [wCriticalHit]
and a
@@ -3325,11 +3163,8 @@ BattleCommand_DamageCalc:
ret
-
-
INCLUDE "data/types/type_boost_items.asm"
-
BattleCommand_ConstantDamage:
; constantdamage
@@ -3490,7 +3325,6 @@ BattleCommand_ConstantDamage:
INCLUDE "data/moves/flail_reversal_power.asm"
-
INCLUDE "engine/battle/move_effects/counter.asm"
INCLUDE "engine/battle/move_effects/encore.asm"
@@ -3505,7 +3339,6 @@ INCLUDE "engine/battle/move_effects/lock_on.asm"
INCLUDE "engine/battle/move_effects/sketch.asm"
-
BattleCommand_DefrostOpponent:
; defrostopponent
; Thaw the opponent if frozen, and
@@ -3532,8 +3365,6 @@ BattleCommand_DefrostOpponent:
ld [hl], a
ret
-
-
INCLUDE "engine/battle/move_effects/sleep_talk.asm"
INCLUDE "engine/battle/move_effects/destiny_bond.asm"
@@ -3544,7 +3375,6 @@ INCLUDE "engine/battle/move_effects/false_swipe.asm"
INCLUDE "engine/battle/move_effects/heal_bell.asm"
-
FarPlayBattleAnimation:
; play animation de
@@ -3566,8 +3396,6 @@ PlayFXAnimID:
callfar PlayBattleAnim
ret
-
-
DoEnemyDamage:
ld hl, wCurDamage
ld a, [hli]
@@ -3628,8 +3456,6 @@ DoEnemyDamage:
.did_no_damage
jp RefreshBattleHuds
-
-
DoPlayerDamage:
ld hl, wCurDamage
ld a, [hli]
@@ -3690,8 +3516,6 @@ DoPlayerDamage:
.did_no_damage
jp RefreshBattleHuds
-
-
DoSubstituteDamage:
ld hl, SubTookDamageText
call StdBattleTextBox
@@ -3749,10 +3573,7 @@ DoSubstituteDamage:
.done
jp ResetDamage
-
-
UpdateMoveData:
-
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVarAddr
ld d, h
@@ -3768,8 +3589,6 @@ UpdateMoveData:
call GetMoveName
jp CopyName1
-
-
BattleCommand_SleepTarget:
; sleeptarget
@@ -3841,8 +3660,6 @@ BattleCommand_SleepTarget:
pop hl
jp StdBattleTextBox
-
-
.CheckAIRandomFail:
; Enemy turn
ld a, [hBattleTurn]
@@ -3871,8 +3688,6 @@ BattleCommand_SleepTarget:
xor a
ret
-
-
BattleCommand_PoisonTarget:
; poisontarget
@@ -3908,8 +3723,6 @@ BattleCommand_PoisonTarget:
farcall UseHeldStatusHealingItem
ret
-
-
BattleCommand_Poison:
; poison
@@ -3998,15 +3811,11 @@ BattleCommand_Poison:
pop hl
jp StdBattleTextBox
-
-
.apply_poison
call AnimateCurrentMove
call PoisonOpponent
jp RefreshBattleHuds
-
-
.check_toxic
ld a, BATTLE_VARS_SUBSTATUS5_OPP
call GetBattleVarAddr
@@ -4021,8 +3830,6 @@ BattleCommand_Poison:
cp EFFECT_TOXIC
ret
-
-
CheckIfTargetIsPoisonType:
ld de, wEnemyMonType1
ld a, [hBattleTurn]
@@ -4038,32 +3845,24 @@ CheckIfTargetIsPoisonType:
cp POISON
ret
-
-
PoisonOpponent:
ld a, BATTLE_VARS_STATUS_OPP
call GetBattleVarAddr
set PSN, [hl]
jp UpdateOpponentInParty
-
-
BattleCommand_DrainTarget:
; draintarget
call SapHealth
ld hl, SuckedHealthText
jp StdBattleTextBox
-
-
BattleCommand_EatDream:
; eatdream
call SapHealth
ld hl, DreamEatenText
jp StdBattleTextBox
-
-
SapHealth:
; Divide damage by 2, store it in hDividend
ld hl, wCurDamage
@@ -4157,8 +3956,6 @@ SapHealth:
call RefreshBattleHuds
jp UpdateBattleMonInParty
-
-
BattleCommand_BurnTarget:
; burntarget
@@ -4200,8 +3997,6 @@ BattleCommand_BurnTarget:
farcall UseHeldStatusHealingItem
ret
-
-
Defrost:
ld a, [hl]
and 1 << FRZ
@@ -4227,8 +4022,6 @@ Defrost:
ld hl, DefrostedOpponentText
jp StdBattleTextBox
-
-
BattleCommand_FreezeTarget:
; freezetarget
@@ -4282,8 +4075,6 @@ BattleCommand_FreezeTarget:
ld [hl], $1
ret
-
-
BattleCommand_ParalyzeTarget:
; paralyzetarget
@@ -4320,8 +4111,6 @@ BattleCommand_ParalyzeTarget:
ld hl, UseHeldStatusHealingItem
jp CallBattleCore
-
-
BattleCommand_AttackUp:
; attackup
ld b, ATTACK
@@ -4400,8 +4189,6 @@ BattleCommand_StatUp:
ret nz
jp StatUpAnimation
-
-
CheckIfStatCanBeRaised:
ld a, b
ld [wLoweredStat], a
@@ -4481,14 +4268,11 @@ CheckIfStatCanBeRaised:
ld [wFailedMessage], a
ret
-
-
.stats_already_max
pop hl
dec [hl]
; fallthrough
-
.cant_raise_stat
ld a, $2
ld [wFailedMessage], a
@@ -4496,15 +4280,11 @@ CheckIfStatCanBeRaised:
ld [wAttackMissed], a
ret
-
-
.stat_raise_failed
ld a, $1
ld [wFailedMessage], a
ret
-
-
StatUpAnimation:
ld bc, wPlayerMinimized
ld hl, DropPlayerSub
@@ -4530,8 +4310,6 @@ StatUpAnimation:
call WaitBGMap
jp BattleCommand_MoveDelay
-
-
BattleCommand_AttackDown:
; attackdown
ld a, ATTACK
@@ -4724,8 +4502,6 @@ BattleCommand_StatDown:
ld [wAttackMissed], a
ret
-
-
CheckMist:
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVar
@@ -4751,8 +4527,6 @@ CheckMist:
bit SUBSTATUS_MIST, a
ret
-
-
BattleCommand_StatUpMessage:
ld a, [wFailedMessage]
and a
@@ -4783,8 +4557,6 @@ BattleCommand_StatUpMessage:
text_jump UnknownText_0x1c0ce0
db "@"
-
-
BattleCommand_StatDownMessage:
ld a, [wFailedMessage]
and a
@@ -4814,8 +4586,6 @@ BattleCommand_StatDownMessage:
text_jump UnknownText_0x1c0d06
db "@"
-
-
TryLowerStat:
; Lower stat c from stat struct hl (buffer de).
@@ -4859,8 +4629,6 @@ TryLowerStat:
and a
ret
-
-
BattleCommand_StatUpFailText:
; statupfailtext
ld a, [wFailedMessage]
@@ -4879,8 +4647,6 @@ BattleCommand_StatUpFailText:
ld hl, WontRiseAnymoreText
jp StdBattleTextBox
-
-
BattleCommand_StatDownFailText:
; statdownfailtext
ld a, [wFailedMessage]
@@ -4902,8 +4668,6 @@ BattleCommand_StatDownFailText:
ld hl, WontDropAnymoreText
jp StdBattleTextBox
-
-
GetStatName:
ld hl, StatNames
ld c, "@"
@@ -4923,10 +4687,8 @@ GetStatName:
INCLUDE "data/battle/stat_names.asm"
-
INCLUDE "data/battle/stat_multipliers.asm"
-
BattleCommand_AllStatsUp:
; allstatsup
@@ -4955,14 +4717,11 @@ BattleCommand_AllStatsUp:
call BattleCommand_SpecialDefenseUp
jp BattleCommand_StatUpMessage
-
ResetMiss:
xor a
ld [wAttackMissed], a
ret
-
-
LowerStat:
ld [wLoweredStat], a
@@ -5034,8 +4793,6 @@ LowerStat:
ld [wFailedMessage], a
ret
-
-
BattleCommand_TriStatusChance:
; tristatuschance
@@ -5057,7 +4814,6 @@ BattleCommand_TriStatusChance:
dw BattleCommand_FreezeTarget ; freeze
dw BattleCommand_BurnTarget ; burn
-
BattleCommand_Curl:
; curl
ld a, BATTLE_VARS_SUBSTATUS2
@@ -5065,8 +4821,6 @@ BattleCommand_Curl:
set SUBSTATUS_CURLED, [hl]
ret
-
-
BattleCommand_RaiseSubNoAnim:
ld hl, GetBattleMonBackpic
ld a, [hBattleTurn]
@@ -5079,8 +4833,6 @@ BattleCommand_RaiseSubNoAnim:
call CallBattleCore
jp WaitBGMap
-
-
BattleCommand_LowerSubNoAnim:
ld hl, DropPlayerSub
ld a, [hBattleTurn]
@@ -5093,8 +4845,6 @@ BattleCommand_LowerSubNoAnim:
call CallBattleCore
jp WaitBGMap
-
-
CalcPlayerStats:
ld hl, wPlayerAtkLevel
ld de, wPlayerStats
@@ -5116,8 +4866,6 @@ CalcPlayerStats:
jp BattleCommand_SwitchTurn
-
-
CalcEnemyStats:
ld hl, wEnemyAtkLevel
ld de, wEnemyStats
@@ -5136,8 +4884,6 @@ CalcEnemyStats:
jp BattleCommand_SwitchTurn
-
-
CalcStats:
.loop
push af
@@ -5207,11 +4953,8 @@ CalcStats:
ret
-
-
INCLUDE "engine/battle/move_effects/bide.asm"
-
BattleCommand_CheckRampage:
; checkrampage
@@ -5249,8 +4992,6 @@ BattleCommand_CheckRampage:
ld b, rampage_command
jp SkipToBattleCommand
-
-
BattleCommand_Rampage:
; rampage
@@ -5278,11 +5019,8 @@ BattleCommand_Rampage:
ld [wSomeoneIsRampaging], a
ret
-
-
INCLUDE "engine/battle/move_effects/teleport.asm"
-
SetBattleDraw:
ld a, [wBattleResult]
and BATTLERESULT_BITMASK
@@ -5290,8 +5028,6 @@ SetBattleDraw:
ld [wBattleResult], a
ret
-
-
BattleCommand_ForceSwitch:
; forceswitch
@@ -5511,8 +5247,6 @@ BattleCommand_ForceSwitch:
.do_text
jp StdBattleTextBox
-
-
CheckPlayerHasMonToSwitchTo:
ld a, [wPartyCount]
ld d, a
@@ -5542,8 +5276,6 @@ CheckPlayerHasMonToSwitchTo:
and a
ret
-
-
BattleCommand_EndLoop:
; endloop
@@ -5678,8 +5410,6 @@ BattleCommand_EndLoop:
ld [wBattleScriptBufferAddress], a
ret
-
-
BattleCommand_FakeOut:
ld a, [wAttackMissed]
and a
@@ -5701,8 +5431,6 @@ BattleCommand_FakeOut:
ld [wAttackMissed], a
ret
-
-
BattleCommand_FlinchTarget:
call CheckSubstituteOpp
ret nz
@@ -5721,15 +5449,12 @@ BattleCommand_FlinchTarget:
; fallthrough
-
FlinchTarget:
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVarAddr
set SUBSTATUS_FLINCHED, [hl]
jp EndRechargeOpp
-
-
CheckOpponentWentFirst:
; Returns a=0, z if user went first
; Returns a=1, nz if opponent went first
@@ -5741,8 +5466,6 @@ CheckOpponentWentFirst:
pop bc
ret
-
-
BattleCommand_HeldFlinch:
; kingsrock
@@ -5771,8 +5494,6 @@ BattleCommand_HeldFlinch:
set SUBSTATUS_FLINCHED, [hl]
ret
-
-
BattleCommand_OHKO:
; ohko
@@ -5819,8 +5540,6 @@ BattleCommand_OHKO:
ld [wAttackMissed], a
ret
-
-
BattleCommand_CheckCharge:
; checkcharge
@@ -5834,8 +5553,6 @@ BattleCommand_CheckCharge:
ld b, charge_command
jp SkipToBattleCommand
-
-
BattleCommand_Charge:
; charge
@@ -5977,13 +5694,10 @@ BattleCommand_Charge:
text_jump UnknownText_0x1c0d6c
db "@"
-
BattleCommand3c:
; unused
ret
-
-
BattleCommand_TrapTarget:
; traptarget
@@ -6040,12 +5754,10 @@ BattleCommand_TrapTarget:
dbw CLAMP, ClampedByText ; 'was CLAMPED by'
dbw WHIRLPOOL, WhirlpoolTrapText ; 'was trapped!'
-
INCLUDE "engine/battle/move_effects/mist.asm"
INCLUDE "engine/battle/move_effects/focus_energy.asm"
-
BattleCommand_Recoil:
; recoil
@@ -6110,8 +5822,6 @@ BattleCommand_Recoil:
ld hl, RecoilText
jp StdBattleTextBox
-
-
BattleCommand_ConfuseTarget:
; confusetarget
@@ -6132,7 +5842,6 @@ BattleCommand_ConfuseTarget:
ret nz
jr BattleCommand_FinishConfusingTarget
-
BattleCommand_Confuse:
; confuse
@@ -6205,7 +5914,6 @@ BattleCommand_FinishConfusingTarget:
ld hl, UseConfusionHealingItem
jp CallBattleCore
-
BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit:
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVar
@@ -6217,8 +5925,6 @@ BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit:
ret z
jp PrintDidntAffect2
-
-
BattleCommand_Paralyze:
; paralyze
@@ -6299,8 +6005,6 @@ BattleCommand_Paralyze:
call AnimateFailedMove
jp PrintDoesntAffect
-
-
CheckMoveTypeMatchesTarget:
; Compare move type to opponent type.
; Return z if matching the opponent type,
@@ -6336,11 +6040,8 @@ CheckMoveTypeMatchesTarget:
pop hl
ret
-
-
INCLUDE "engine/battle/move_effects/substitute.asm"
-
BattleCommand_RechargeNextTurn:
; rechargenextturn
ld a, BATTLE_VARS_SUBSTATUS4
@@ -6348,8 +6049,6 @@ BattleCommand_RechargeNextTurn:
set SUBSTATUS_RECHARGE, [hl]
ret
-
-
EndRechargeOpp:
push hl
ld a, BATTLE_VARS_SUBSTATUS4_OPP
@@ -6358,11 +6057,8 @@ EndRechargeOpp:
pop hl
ret
-
-
INCLUDE "engine/battle/move_effects/rage.asm"
-
BattleCommand_DoubleFlyingDamage:
; doubleflyingdamage
ld a, BATTLE_VARS_SUBSTATUS3_OPP
@@ -6371,8 +6067,6 @@ BattleCommand_DoubleFlyingDamage:
ret z
jr DoubleDamage
-
-
BattleCommand_DoubleUndergroundDamage:
; doubleundergrounddamage
ld a, BATTLE_VARS_SUBSTATUS3_OPP
@@ -6382,7 +6076,6 @@ BattleCommand_DoubleUndergroundDamage:
; fallthrough
-
DoubleDamage:
ld hl, wCurDamage + 1
sla [hl]
@@ -6396,8 +6089,6 @@ DoubleDamage:
.quit
ret
-
-
INCLUDE "engine/battle/move_effects/mimic.asm"
INCLUDE "engine/battle/move_effects/leech_seed.asm"
@@ -6410,7 +6101,6 @@ INCLUDE "engine/battle/move_effects/pay_day.asm"
INCLUDE "engine/battle/move_effects/conversion.asm"
-
BattleCommand_ResetStats:
; resetstats
@@ -6444,8 +6134,6 @@ BattleCommand_ResetStats:
jr nz, .next
ret
-
-
BattleCommand_Heal:
; heal
@@ -6528,11 +6216,8 @@ BattleCommand_Heal:
ld hl, HPIsFullText
jp StdBattleTextBox
-
-
INCLUDE "engine/battle/move_effects/transform.asm"
-
BattleSideCopy:
; Copy bc bytes from hl to de if it's the player's turn.
; Copy bc bytes from de to hl if it's the enemy's turn.
@@ -6548,14 +6233,10 @@ BattleSideCopy:
.copy
jp CopyBytes
-
-
BattleEffect_ButItFailed:
call AnimateFailedMove
jp PrintButItFailed
-
-
ClearLastMove:
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
call GetBattleVarAddr
@@ -6568,8 +6249,6 @@ ClearLastMove:
ld [hl], a
ret
-
-
ResetActorDisable:
ld a, [hBattleTurn]
and a
@@ -6586,8 +6265,6 @@ ResetActorDisable:
ld [wDisabledMove], a
ret
-
-
BattleCommand_Screen:
; screen
@@ -6633,22 +6310,16 @@ BattleCommand_Screen:
call AnimateFailedMove
jp PrintButItFailed
-
-
PrintDoesntAffect:
; 'it doesn't affect'
ld hl, DoesntAffectText
jp StdBattleTextBox
-
-
PrintNothingHappened:
; 'but nothing happened!'
ld hl, NothingHappenedText
jp StdBattleTextBox
-
-
TryPrintButItFailed:
ld a, [wAlreadyFailed]
and a
@@ -6656,14 +6327,11 @@ TryPrintButItFailed:
; fallthrough
-
PrintButItFailed:
; 'but it failed!'
ld hl, ButItFailedText
jp StdBattleTextBox
-
-
FailMove:
call AnimateFailedMove
; fallthrough
@@ -6673,45 +6341,34 @@ FailMimic:
ld de, ItFailedText ; 'it failed!'
jp FailText_CheckOpponentProtect
-
-
PrintDidntAffect:
; 'it didn't affect'
ld hl, DidntAffect1Text
jp StdBattleTextBox
-
-
PrintDidntAffect2:
call AnimateFailedMove
ld hl, DidntAffect1Text ; 'it didn't affect'
ld de, DidntAffect2Text ; 'it didn't affect'
jp FailText_CheckOpponentProtect
-
-
PrintParalyze:
; 'paralyzed! maybe it can't attack!'
ld hl, ParalyzedText
jp StdBattleTextBox
-
-
CheckSubstituteOpp:
ld a, BATTLE_VARS_SUBSTATUS4_OPP
call GetBattleVar
bit SUBSTATUS_SUBSTITUTE, a
ret
-
-
INCLUDE "engine/battle/move_effects/selfdestruct.asm"
INCLUDE "engine/battle/move_effects/mirror_move.asm"
INCLUDE "engine/battle/move_effects/metronome.asm"
-
CheckUserMove:
; Return z if the user has move a.
ld b, a
@@ -6736,8 +6393,6 @@ CheckUserMove:
and a
ret
-
-
ResetTurn:
ld hl, wPlayerCharging
ld a, [hBattleTurn]
@@ -6752,11 +6407,8 @@ ResetTurn:
call DoMove
jp EndMoveEffect
-
-
INCLUDE "engine/battle/move_effects/thief.asm"
-
BattleCommand_ArenaTrap:
; arenatrap
@@ -6783,11 +6435,8 @@ BattleCommand_ArenaTrap:
call AnimateFailedMove
jp PrintButItFailed
-
-
INCLUDE "engine/battle/move_effects/nightmare.asm"
-
BattleCommand_Defrost:
; defrost
@@ -6819,8 +6468,6 @@ BattleCommand_Defrost:
ld hl, WasDefrostedText
jp StdBattleTextBox
-
-
INCLUDE "engine/battle/move_effects/curse.asm"
INCLUDE "engine/battle/move_effects/protect.asm"
@@ -6837,13 +6484,10 @@ INCLUDE "engine/battle/move_effects/sandstorm.asm"
INCLUDE "engine/battle/move_effects/rollout.asm"
-
BattleCommand5d:
; unused
ret
-
-
INCLUDE "engine/battle/move_effects/fury_cutter.asm"
INCLUDE "engine/battle/move_effects/attract.asm"
@@ -6856,7 +6500,6 @@ INCLUDE "engine/battle/move_effects/frustration.asm"
INCLUDE "engine/battle/move_effects/safeguard.asm"
-
SafeCheckSafeguard:
push hl
ld hl, wEnemyScreens
@@ -6870,8 +6513,6 @@ SafeCheckSafeguard:
pop hl
ret
-
-
BattleCommand_CheckSafeguard:
; checksafeguard
ld hl, wEnemyScreens
@@ -6889,8 +6530,6 @@ BattleCommand_CheckSafeguard:
call StdBattleTextBox
jp EndMoveEffect
-
-
INCLUDE "engine/battle/move_effects/magnitude.asm"
INCLUDE "engine/battle/move_effects/baton_pass.asm"
@@ -6899,19 +6538,16 @@ INCLUDE "engine/battle/move_effects/pursuit.asm"
INCLUDE "engine/battle/move_effects/rapid_spin.asm"
-
BattleCommand_HealMorn:
; healmorn
ld b, MORN_F
jr BattleCommand_TimeBasedHealContinue
-
BattleCommand_HealDay:
; healday
ld b, DAY_F
jr BattleCommand_TimeBasedHealContinue
-
BattleCommand_HealNite:
; healnite
ld b, NITE_F
@@ -6999,7 +6635,6 @@ BattleCommand_TimeBasedHealContinue:
dw GetHalfMaxHP
dw GetMaxHP
-
INCLUDE "engine/battle/move_effects/hidden_power.asm"
INCLUDE "engine/battle/move_effects/rain_dance.asm"
@@ -7012,7 +6647,6 @@ INCLUDE "engine/battle/move_effects/psych_up.asm"
INCLUDE "engine/battle/move_effects/mirror_coat.asm"
-
BattleCommand_DoubleMinimizeDamage:
; doubleminimizedamage
@@ -7035,8 +6669,6 @@ BattleCommand_DoubleMinimizeDamage:
ld [hl], a
ret
-
-
BattleCommand_SkipSunCharge:
; mimicsuncharge
ld a, [wBattleWeather]
@@ -7045,13 +6677,10 @@ BattleCommand_SkipSunCharge:
ld b, charge_command
jp SkipToBattleCommand
-
-
INCLUDE "engine/battle/move_effects/future_sight.asm"
INCLUDE "engine/battle/move_effects/thunder.asm"
-
CheckHiddenOpponent:
; BUG: This routine should account for Lock-On and Mind Reader.
ld a, BATTLE_VARS_SUBSTATUS3_OPP
@@ -7059,8 +6688,6 @@ CheckHiddenOpponent:
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret
-
-
GetUserItem:
; Return the effect of the user's item in bc, and its id at hl.
ld hl, wBattleMonItem
@@ -7072,8 +6699,6 @@ GetUserItem:
ld b, [hl]
jp GetItemHeldEffect
-
-
GetOpponentItem:
; Return the effect of the opponent's item in bc, and its id at hl.
ld hl, wEnemyMonItem
@@ -7085,8 +6710,6 @@ GetOpponentItem:
ld b, [hl]
jp GetItemHeldEffect
-
-
GetItemHeldEffect:
; Return the effect of item b in bc.
ld a, b
@@ -7107,8 +6730,6 @@ GetItemHeldEffect:
pop hl
ret
-
-
AnimateCurrentMoveEitherSide:
push hl
push de
@@ -7125,8 +6746,6 @@ AnimateCurrentMoveEitherSide:
pop hl
ret
-
-
AnimateCurrentMove:
push hl
push de
@@ -7143,8 +6762,6 @@ AnimateCurrentMove:
pop hl
ret
-
-
PlayDamageAnim:
xor a
ld [wFXAnimID + 1], a
@@ -7167,8 +6784,6 @@ PlayDamageAnim:
jp PlayUserBattleAnim
-
-
LoadMoveAnim:
xor a
ld [wNumHits], a
@@ -7181,13 +6796,11 @@ LoadMoveAnim:
; fallthrough
-
LoadAnim:
ld [wFXAnimID], a
; fallthrough
-
PlayUserBattleAnim:
push hl
push de
@@ -7198,8 +6811,6 @@ PlayUserBattleAnim:
pop hl
ret
-
-
PlayOpponentBattleAnim:
ld a, e
ld [wFXAnimID], a
@@ -7221,30 +6832,22 @@ PlayOpponentBattleAnim:
pop hl
ret
-
-
CallBattleCore:
ld a, BANK("Battle Core")
rst FarCall
ret
-
-
AnimateFailedMove:
call BattleCommand_LowerSub
call BattleCommand_MoveDelay
jp BattleCommand_RaiseSub
-
-
BattleCommand_MoveDelay:
; movedelay
; Wait 40 frames.
ld c, 40
jp DelayFrames
-
-
BattleCommand_ClearText:
; cleartext
@@ -7255,7 +6858,6 @@ BattleCommand_ClearText:
.text
db "@"
-
SkipToBattleCommand:
; Skip over commands until reaching command b.
ld a, [wBattleScriptBufferAddress + 1]
@@ -7273,8 +6875,6 @@ SkipToBattleCommand:
ld [wBattleScriptBufferAddress], a
ret
-
-
GetMoveAttr:
; Assuming hl = Moves + x, return attribute x of move a.
push bc
@@ -7284,8 +6884,6 @@ GetMoveAttr:
pop bc
ret
-
-
GetMoveData:
; Copy move struct a to de.
ld hl, Moves
@@ -7294,32 +6892,22 @@ GetMoveData:
ld a, BANK(Moves)
jp FarCopyBytes
-
-
GetMoveByte:
ld a, BANK(Moves)
jp GetFarByte
-
-
DisappearUser:
farcall _DisappearUser
ret
-
-
AppearUserLowerSub:
farcall _AppearUserLowerSub
ret
-
-
AppearUserRaiseSub:
farcall _AppearUserRaiseSub
ret
-
-
_CheckBattleScene:
; Checks the options. Returns carry if battle animations are disabled.
push hl
@@ -7330,4 +6918,3 @@ _CheckBattleScene:
pop de
pop hl
ret
-
diff --git a/engine/battle/hidden_power.asm b/engine/battle/hidden_power.asm
index 5f3791e18..537fe4354 100644
--- a/engine/battle/hidden_power.asm
+++ b/engine/battle/hidden_power.asm
@@ -8,7 +8,6 @@ HiddenPowerDamage:
ld hl, wEnemyMonDVs
.got_dvs
-
; Power:
; Take the top bit from each stat
@@ -62,7 +61,6 @@ HiddenPowerDamage:
ld d, a
-
; Type:
; Def & 3
diff --git a/engine/battle/misc.asm b/engine/battle/misc.asm
index 1b6cb6783..48062f643 100644
--- a/engine/battle/misc.asm
+++ b/engine/battle/misc.asm
@@ -49,9 +49,7 @@ GetPlayerBackpicCoords:
lb bc, 6, 6
ret
-
DoWeatherModifiers:
-
ld de, WeatherTypeModifiers
ld a, [wBattleWeather]
ld b, a
@@ -76,7 +74,6 @@ DoWeatherModifiers:
inc de
jr .CheckWeatherType
-
.done_weather_types
ld de, WeatherMoveModifiers
@@ -147,7 +144,6 @@ DoWeatherModifiers:
INCLUDE "data/battle/weather_modifiers.asm"
-
DoBadgeTypeBoosts:
ld a, [wLinkMode]
and a
diff --git a/engine/battle/move_effects/attract.asm b/engine/battle/move_effects/attract.asm
index 45417936f..bb7b4fce4 100644
--- a/engine/battle/move_effects/attract.asm
+++ b/engine/battle/move_effects/attract.asm
@@ -22,7 +22,6 @@ BattleCommand_Attract:
.failed
jp FailMove
-
CheckOppositeGender:
ld a, MON_SPECIES
call BattlePartyAttr
diff --git a/engine/battle/move_effects/baton_pass.asm b/engine/battle/move_effects/baton_pass.asm
index 2937a8306..5d9f19838 100644
--- a/engine/battle/move_effects/baton_pass.asm
+++ b/engine/battle/move_effects/baton_pass.asm
@@ -5,7 +5,6 @@ BattleCommand_BatonPass:
and a
jp nz, .Enemy
-
; Need something to switch to
call CheckAnyOtherAlivePartyMons
jp z, FailedBatonPass
@@ -45,9 +44,7 @@ BattleCommand_BatonPass:
call ResetBatonPassStatus
ret
-
.Enemy:
-
; Wildmons don't have anything to switch to
ld a, [wBattleMode]
dec a ; WILDMON
@@ -81,8 +78,6 @@ BattleCommand_BatonPass:
jr ResetBatonPassStatus
-
-
BatonPass_LinkPlayerSwitch:
ld a, [wLinkMode]
and a
@@ -100,8 +95,6 @@ BatonPass_LinkPlayerSwitch:
ld [wBattlePlayerAction], a
ret
-
-
BatonPass_LinkEnemySwitch:
ld a, [wLinkMode]
and a
@@ -127,14 +120,10 @@ BatonPass_LinkEnemySwitch:
.switch
jp CloseWindow
-
-
FailedBatonPass:
call AnimateFailedMove
jp PrintButItFailed
-
-
ResetBatonPassStatus:
; Reset status changes that aren't passed by Baton Pass.
@@ -174,8 +163,6 @@ ResetBatonPassStatus:
ld [wEnemyWrapCount], a
ret
-
-
CheckAnyOtherAlivePartyMons:
ld hl, wPartyMon1HP
ld a, [wPartyCount]
@@ -184,8 +171,6 @@ CheckAnyOtherAlivePartyMons:
ld e, a
jr CheckAnyOtherAliveMons
-
-
CheckAnyOtherAliveEnemyMons:
ld hl, wOTPartyMon1HP
ld a, [wOTPartyCount]
@@ -230,4 +215,3 @@ CheckAnyOtherAliveMons:
ld a, b
and a
ret
-
diff --git a/engine/battle/move_effects/beat_up.asm b/engine/battle/move_effects/beat_up.asm
index 40a375e0d..673fc46c6 100644
--- a/engine/battle/move_effects/beat_up.asm
+++ b/engine/battle/move_effects/beat_up.asm
@@ -193,14 +193,10 @@ BattleCommand_BeatUp:
ld d, a
ret
-
-
.beatup_fail
ld b, buildopponentrage_command
jp SkipToBattleCommand
-
-
BattleCommand_BeatUpFailText:
; beatupfailtext
@@ -210,8 +206,6 @@ BattleCommand_BeatUpFailText:
jp PrintButItFailed
-
-
GetBeatupMonLocation:
push bc
ld c, a
diff --git a/engine/battle/move_effects/belly_drum.asm b/engine/battle/move_effects/belly_drum.asm
index aec3a1d68..27ef1a542 100644
--- a/engine/battle/move_effects/belly_drum.asm
+++ b/engine/battle/move_effects/belly_drum.asm
@@ -32,4 +32,3 @@ BattleCommand_BellyDrum:
.failed
call AnimateFailedMove
jp PrintButItFailed
-
diff --git a/engine/battle/move_effects/bide.asm b/engine/battle/move_effects/bide.asm
index b28773df9..871e0e7a8 100644
--- a/engine/battle/move_effects/bide.asm
+++ b/engine/battle/move_effects/bide.asm
@@ -69,8 +69,6 @@ BattleCommand_StoreEnergy:
call StdBattleTextBox
jp EndMoveEffect
-
-
BattleCommand_UnleashEnergy:
; unleashenergy
@@ -100,4 +98,3 @@ BattleCommand_UnleashEnergy:
ld [wKickCounter], a
call AnimateCurrentMove
jp EndMoveEffect
-
diff --git a/engine/battle/move_effects/conversion.asm b/engine/battle/move_effects/conversion.asm
index bc2c746df..f9307056c 100644
--- a/engine/battle/move_effects/conversion.asm
+++ b/engine/battle/move_effects/conversion.asm
@@ -94,4 +94,3 @@ BattleCommand_Conversion:
call AnimateCurrentMove
ld hl, TransformedTypeText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/conversion2.asm b/engine/battle/move_effects/conversion2.asm
index b1d0e6282..14a7e257a 100644
--- a/engine/battle/move_effects/conversion2.asm
+++ b/engine/battle/move_effects/conversion2.asm
@@ -62,4 +62,3 @@ BattleCommand_Conversion2:
.failed
jp FailMove
-
diff --git a/engine/battle/move_effects/counter.asm b/engine/battle/move_effects/counter.asm
index 9d10d1865..f92e1b3ac 100644
--- a/engine/battle/move_effects/counter.asm
+++ b/engine/battle/move_effects/counter.asm
@@ -56,4 +56,3 @@ BattleCommand_Counter:
xor a
ld [wAttackMissed], a
ret
-
diff --git a/engine/battle/move_effects/curse.asm b/engine/battle/move_effects/curse.asm
index e0fc0144c..4861e9a37 100644
--- a/engine/battle/move_effects/curse.asm
+++ b/engine/battle/move_effects/curse.asm
@@ -21,7 +21,6 @@ BattleCommand_Curse:
cp GHOST
jr z, .ghost
-
; If no stats can be increased, don't.
; Attack
@@ -54,7 +53,6 @@ BattleCommand_Curse:
call BattleCommand_DefenseUp
jp BattleCommand_StatUpMessage
-
.ghost
; Cut HP in half and put a curse on the opponent.
@@ -84,7 +82,6 @@ BattleCommand_Curse:
call AnimateFailedMove
jp PrintButItFailed
-
.cantraise
; Can't raise either stat.
diff --git a/engine/battle/move_effects/destiny_bond.asm b/engine/battle/move_effects/destiny_bond.asm
index 427c8b08a..55809d98a 100644
--- a/engine/battle/move_effects/destiny_bond.asm
+++ b/engine/battle/move_effects/destiny_bond.asm
@@ -7,4 +7,3 @@ BattleCommand_DestinyBond:
call AnimateCurrentMove
ld hl, DestinyBondEffectText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/disable.asm b/engine/battle/move_effects/disable.asm
index b1055b200..44017e30d 100644
--- a/engine/battle/move_effects/disable.asm
+++ b/engine/battle/move_effects/disable.asm
@@ -70,4 +70,3 @@ BattleCommand_Disable:
.failed
jp FailMove
-
diff --git a/engine/battle/move_effects/encore.asm b/engine/battle/move_effects/encore.asm
index e65925f52..f436fd970 100644
--- a/engine/battle/move_effects/encore.asm
+++ b/engine/battle/move_effects/encore.asm
@@ -118,4 +118,3 @@ BattleCommand_Encore:
.failed
jp PrintDidntAffect2
-
diff --git a/engine/battle/move_effects/false_swipe.asm b/engine/battle/move_effects/false_swipe.asm
index c61aa534a..4f4eb329c 100644
--- a/engine/battle/move_effects/false_swipe.asm
+++ b/engine/battle/move_effects/false_swipe.asm
@@ -46,4 +46,3 @@ BattleCommand_FalseSwipe:
.done
and a
ret
-
diff --git a/engine/battle/move_effects/focus_energy.asm b/engine/battle/move_effects/focus_energy.asm
index 8fa6b19ff..ffdc7b136 100644
--- a/engine/battle/move_effects/focus_energy.asm
+++ b/engine/battle/move_effects/focus_energy.asm
@@ -13,4 +13,3 @@ BattleCommand_FocusEnergy:
.already_pumped
call AnimateFailedMove
jp PrintButItFailed
-
diff --git a/engine/battle/move_effects/frustration.asm b/engine/battle/move_effects/frustration.asm
index 5e45636be..3d395b510 100644
--- a/engine/battle/move_effects/frustration.asm
+++ b/engine/battle/move_effects/frustration.asm
@@ -25,4 +25,3 @@ BattleCommand_FrustrationPower:
ld d, a
pop bc
ret
-
diff --git a/engine/battle/move_effects/fury_cutter.asm b/engine/battle/move_effects/fury_cutter.asm
index b34264d62..6aa6b7838 100644
--- a/engine/battle/move_effects/fury_cutter.asm
+++ b/engine/battle/move_effects/fury_cutter.asm
@@ -38,10 +38,7 @@ BattleCommand_FuryCutter:
ld [hl], a
ret
-
-
ResetFuryCutterCount:
-
push hl
ld hl, wPlayerFuryCutterCount
@@ -56,4 +53,3 @@ ResetFuryCutterCount:
pop hl
ret
-
diff --git a/engine/battle/move_effects/future_sight.asm b/engine/battle/move_effects/future_sight.asm
index c1b5c0e72..c28841b35 100644
--- a/engine/battle/move_effects/future_sight.asm
+++ b/engine/battle/move_effects/future_sight.asm
@@ -25,7 +25,6 @@ BattleCommand_CheckFutureSight:
ld b, futuresight_command
jp SkipToBattleCommand
-
BattleCommand_FutureSight:
; futuresight
@@ -80,4 +79,3 @@ BattleCommand_FutureSight:
call AnimateFailedMove
call PrintButItFailed
jp EndMoveEffect
-
diff --git a/engine/battle/move_effects/heal_bell.asm b/engine/battle/move_effects/heal_bell.asm
index 060ac3423..2570a53ba 100644
--- a/engine/battle/move_effects/heal_bell.asm
+++ b/engine/battle/move_effects/heal_bell.asm
@@ -32,4 +32,3 @@ BattleCommand_HealBell:
and a
jp z, CalcPlayerStats
jp CalcEnemyStats
-
diff --git a/engine/battle/move_effects/hidden_power.asm b/engine/battle/move_effects/hidden_power.asm
index 19d7e0b32..3b40a6c31 100644
--- a/engine/battle/move_effects/hidden_power.asm
+++ b/engine/battle/move_effects/hidden_power.asm
@@ -6,4 +6,3 @@ BattleCommand_HiddenPower:
ret nz
farcall HiddenPowerDamage
ret
-
diff --git a/engine/battle/move_effects/leech_seed.asm b/engine/battle/move_effects/leech_seed.asm
index 44019a6ad..5602e7f62 100644
--- a/engine/battle/move_effects/leech_seed.asm
+++ b/engine/battle/move_effects/leech_seed.asm
@@ -38,4 +38,3 @@ BattleCommand_LeechSeed:
call AnimateFailedMove
ld hl, EvadedText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/lock_on.asm b/engine/battle/move_effects/lock_on.asm
index 7b6503575..7dc4a013d 100644
--- a/engine/battle/move_effects/lock_on.asm
+++ b/engine/battle/move_effects/lock_on.asm
@@ -19,4 +19,3 @@ BattleCommand_LockOn:
.fail
call AnimateFailedMove
jp PrintDidntAffect
-
diff --git a/engine/battle/move_effects/metronome.asm b/engine/battle/move_effects/metronome.asm
index b5632d005..b8a6b586f 100644
--- a/engine/battle/move_effects/metronome.asm
+++ b/engine/battle/move_effects/metronome.asm
@@ -34,12 +34,10 @@ BattleCommand_Metronome:
call CheckUserMove
jr z, .GetMove
-
ld a, BATTLE_VARS_MOVE
call GetBattleVarAddr
ld [hl], b
call UpdateMoveData
jp ResetTurn
-
INCLUDE "data/battle/metronome_exception_moves.asm"
diff --git a/engine/battle/move_effects/mimic.asm b/engine/battle/move_effects/mimic.asm
index 2f91d6a1d..b1c6608fa 100644
--- a/engine/battle/move_effects/mimic.asm
+++ b/engine/battle/move_effects/mimic.asm
@@ -48,4 +48,3 @@ BattleCommand_Mimic:
.fail
jp FailMimic
-
diff --git a/engine/battle/move_effects/mirror_coat.asm b/engine/battle/move_effects/mirror_coat.asm
index f8b8ca114..8743c389d 100644
--- a/engine/battle/move_effects/mirror_coat.asm
+++ b/engine/battle/move_effects/mirror_coat.asm
@@ -57,4 +57,3 @@ BattleCommand_MirrorCoat:
xor a
ld [wAttackMissed], a
ret
-
diff --git a/engine/battle/move_effects/mist.asm b/engine/battle/move_effects/mist.asm
index 52e4e59f4..199a30045 100644
--- a/engine/battle/move_effects/mist.asm
+++ b/engine/battle/move_effects/mist.asm
@@ -13,4 +13,3 @@ BattleCommand_Mist:
.already_mist
call AnimateFailedMove
jp PrintButItFailed
-
diff --git a/engine/battle/move_effects/pain_split.asm b/engine/battle/move_effects/pain_split.asm
index a4dbd3d44..4e4380b23 100644
--- a/engine/battle/move_effects/pain_split.asm
+++ b/engine/battle/move_effects/pain_split.asm
@@ -89,7 +89,5 @@ BattleCommand_PainSplit:
ld [wBuffer6], a
ret
-
.ButItFailed:
jp PrintDidntAffect2
-
diff --git a/engine/battle/move_effects/pay_day.asm b/engine/battle/move_effects/pay_day.asm
index 53705d434..ba1dce884 100644
--- a/engine/battle/move_effects/pay_day.asm
+++ b/engine/battle/move_effects/pay_day.asm
@@ -24,4 +24,3 @@ BattleCommand_PayDay:
.done
ld hl, CoinsScatteredText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/perish_song.asm b/engine/battle/move_effects/perish_song.asm
index 221ecfb46..4df52cc1c 100644
--- a/engine/battle/move_effects/perish_song.asm
+++ b/engine/battle/move_effects/perish_song.asm
@@ -1,7 +1,6 @@
BattleCommand_PerishSong:
; perishsong
-
ld hl, wPlayerSubStatus1
ld de, wEnemySubStatus1
bit SUBSTATUS_PERISH, [hl]
diff --git a/engine/battle/move_effects/protect.asm b/engine/battle/move_effects/protect.asm
index 768e51cbb..9025d2f4b 100644
--- a/engine/battle/move_effects/protect.asm
+++ b/engine/battle/move_effects/protect.asm
@@ -12,9 +12,7 @@ BattleCommand_Protect:
ld hl, ProtectedItselfText
jp StdBattleTextBox
-
ProtectChance:
-
ld de, wPlayerProtectCount
ld a, [hBattleTurn]
and a
@@ -68,7 +66,6 @@ ProtectChance:
and a
ret
-
.failed
xor a
ld [de], a
diff --git a/engine/battle/move_effects/psych_up.asm b/engine/battle/move_effects/psych_up.asm
index 743e93c86..02fdef5d2 100644
--- a/engine/battle/move_effects/psych_up.asm
+++ b/engine/battle/move_effects/psych_up.asm
@@ -47,4 +47,3 @@ BattleCommand_PsychUp:
call AnimateCurrentMove
ld hl, CopiedStatsText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/pursuit.asm b/engine/battle/move_effects/pursuit.asm
index 640957516..18c358144 100644
--- a/engine/battle/move_effects/pursuit.asm
+++ b/engine/battle/move_effects/pursuit.asm
@@ -22,4 +22,3 @@ BattleCommand_Pursuit:
ld [hli], a
ld [hl], a
ret
-
diff --git a/engine/battle/move_effects/rage.asm b/engine/battle/move_effects/rage.asm
index 1f40cc1fb..df206a6bf 100644
--- a/engine/battle/move_effects/rage.asm
+++ b/engine/battle/move_effects/rage.asm
@@ -4,4 +4,3 @@ BattleCommand_Rage:
call GetBattleVarAddr
set SUBSTATUS_RAGE, [hl]
ret
-
diff --git a/engine/battle/move_effects/rain_dance.asm b/engine/battle/move_effects/rain_dance.asm
index fa8881c3c..e9ef5d123 100644
--- a/engine/battle/move_effects/rain_dance.asm
+++ b/engine/battle/move_effects/rain_dance.asm
@@ -7,4 +7,3 @@ BattleCommand_StartRain:
call AnimateCurrentMove
ld hl, DownpourText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/rapid_spin.asm b/engine/battle/move_effects/rapid_spin.asm
index 089be7667..0dc8b7de2 100644
--- a/engine/battle/move_effects/rapid_spin.asm
+++ b/engine/battle/move_effects/rapid_spin.asm
@@ -34,4 +34,3 @@ BattleCommand_ClearHazards:
ld [de], a
ld hl, ReleasedByText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/return.asm b/engine/battle/move_effects/return.asm
index ee83843b3..d3071d23a 100644
--- a/engine/battle/move_effects/return.asm
+++ b/engine/battle/move_effects/return.asm
@@ -23,4 +23,3 @@ BattleCommand_HappinessPower:
ld d, a
pop bc
ret
-
diff --git a/engine/battle/move_effects/rollout.asm b/engine/battle/move_effects/rollout.asm
index da890f48f..de4bfcaa6 100644
--- a/engine/battle/move_effects/rollout.asm
+++ b/engine/battle/move_effects/rollout.asm
@@ -1,6 +1,5 @@
MAX_ROLLOUT_COUNT EQU 5
-
BattleCommand_CheckCurl:
; checkcurl
@@ -23,7 +22,6 @@ BattleCommand_CheckCurl:
ld [de], a
ret
-
BattleCommand_RolloutPower:
; rolloutpower
diff --git a/engine/battle/move_effects/safeguard.asm b/engine/battle/move_effects/safeguard.asm
index e4e2e0951..a926bdccc 100644
--- a/engine/battle/move_effects/safeguard.asm
+++ b/engine/battle/move_effects/safeguard.asm
@@ -21,4 +21,3 @@ BattleCommand_Safeguard:
.failed
call AnimateFailedMove
jp PrintButItFailed
-
diff --git a/engine/battle/move_effects/selfdestruct.asm b/engine/battle/move_effects/selfdestruct.asm
index 3c7b05ef9..d6eeac484 100644
--- a/engine/battle/move_effects/selfdestruct.asm
+++ b/engine/battle/move_effects/selfdestruct.asm
@@ -27,4 +27,3 @@ BattleCommand_Selfdestruct:
farcall DrawEnemyHUD
call WaitBGMap
jp RefreshBattleHuds
-
diff --git a/engine/battle/move_effects/sketch.asm b/engine/battle/move_effects/sketch.asm
index 1f2e67dd4..4c15dbe02 100644
--- a/engine/battle/move_effects/sketch.asm
+++ b/engine/battle/move_effects/sketch.asm
@@ -115,4 +115,3 @@ BattleCommand_Sketch:
.fail
call AnimateFailedMove
jp PrintDidntAffect
-
diff --git a/engine/battle/move_effects/sleep_talk.asm b/engine/battle/move_effects/sleep_talk.asm
index ce7a27ed5..ae2d252b7 100644
--- a/engine/battle/move_effects/sleep_talk.asm
+++ b/engine/battle/move_effects/sleep_talk.asm
@@ -141,4 +141,3 @@ BattleCommand_SleepTalk:
ret z
cp EFFECT_BIDE
ret
-
diff --git a/engine/battle/move_effects/snore.asm b/engine/battle/move_effects/snore.asm
index 4544b7fbd..e2432c59f 100644
--- a/engine/battle/move_effects/snore.asm
+++ b/engine/battle/move_effects/snore.asm
@@ -9,4 +9,3 @@ BattleCommand_Snore:
ld [wAttackMissed], a
call FailMove
jp EndMoveEffect
-
diff --git a/engine/battle/move_effects/spite.asm b/engine/battle/move_effects/spite.asm
index 7c9499074..8aba187a4 100644
--- a/engine/battle/move_effects/spite.asm
+++ b/engine/battle/move_effects/spite.asm
@@ -84,4 +84,3 @@ BattleCommand_Spite:
.failed
jp PrintDidntAffect2
-
diff --git a/engine/battle/move_effects/splash.asm b/engine/battle/move_effects/splash.asm
index ed9eeb4ca..493ea8ca6 100644
--- a/engine/battle/move_effects/splash.asm
+++ b/engine/battle/move_effects/splash.asm
@@ -2,4 +2,3 @@ BattleCommand_Splash:
call AnimateCurrentMove
farcall StubbedTrainerRankings_Splash
jp PrintNothingHappened
-
diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm
index f439afd78..8f14bc315 100644
--- a/engine/battle/move_effects/substitute.asm
+++ b/engine/battle/move_effects/substitute.asm
@@ -86,4 +86,3 @@ BattleCommand_Substitute:
ld hl, TooWeakSubText
.jp_stdbattletextbox
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/sunny_day.asm b/engine/battle/move_effects/sunny_day.asm
index ad2298401..f5825930f 100644
--- a/engine/battle/move_effects/sunny_day.asm
+++ b/engine/battle/move_effects/sunny_day.asm
@@ -7,4 +7,3 @@ BattleCommand_StartSun:
call AnimateCurrentMove
ld hl, SunGotBrightText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/teleport.asm b/engine/battle/move_effects/teleport.asm
index b9c7f9fb2..1c67ef112 100644
--- a/engine/battle/move_effects/teleport.asm
+++ b/engine/battle/move_effects/teleport.asm
@@ -87,4 +87,3 @@ BattleCommand_Teleport:
ld hl, FledFromBattleText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/thief.asm b/engine/battle/move_effects/thief.asm
index d9d2f47fd..64de1a4fe 100644
--- a/engine/battle/move_effects/thief.asm
+++ b/engine/battle/move_effects/thief.asm
@@ -50,7 +50,6 @@ BattleCommand_Thief:
ld [de], a
jr .stole
-
.enemy
; The enemy can't already have an item.
@@ -91,13 +90,11 @@ BattleCommand_Thief:
ld [hl], a
ld [de], a
-
.stole
call GetItemName
ld hl, StoleText
jp StdBattleTextBox
-
.playeritem
ld a, 1
call BattlePartyAttr
diff --git a/engine/battle/move_effects/thunder.asm b/engine/battle/move_effects/thunder.asm
index 1a87176bd..b2a643787 100644
--- a/engine/battle/move_effects/thunder.asm
+++ b/engine/battle/move_effects/thunder.asm
@@ -16,4 +16,3 @@ BattleCommand_ThunderAccuracy:
; Redundant with CheckHit guranteeing hit
ld [hl], 100 percent
ret
-
diff --git a/engine/battle/move_effects/transform.asm b/engine/battle/move_effects/transform.asm
index fe85658e6..ef8071290 100644
--- a/engine/battle/move_effects/transform.asm
+++ b/engine/battle/move_effects/transform.asm
@@ -137,4 +137,3 @@ BattleCommand_Transform:
call nz, LoadAnim
ld hl, TransformedText
jp StdBattleTextBox
-
diff --git a/engine/battle/move_effects/triple_kick.asm b/engine/battle/move_effects/triple_kick.asm
index 4fb939d7c..e41044c9d 100644
--- a/engine/battle/move_effects/triple_kick.asm
+++ b/engine/battle/move_effects/triple_kick.asm
@@ -26,12 +26,9 @@ BattleCommand_TripleKick:
ld [hl], a
ret
-
-
BattleCommand_KickCounter:
; kickcounter
ld hl, wKickCounter
inc [hl]
ret
-
diff --git a/engine/battle/read_trainer_attributes.asm b/engine/battle/read_trainer_attributes.asm
index 12554ebaf..6db8f4204 100644
--- a/engine/battle/read_trainer_attributes.asm
+++ b/engine/battle/read_trainer_attributes.asm
@@ -62,3 +62,5 @@ GetTrainerAttributes:
ld a, [hl]
ld [wEnemyTrainerBaseReward], a
ret
+
+INCLUDE "data/trainers/attributes.asm"
diff --git a/engine/battle/read_trainer_dvs.asm b/engine/battle/read_trainer_dvs.asm
index 67ea0fe3c..d35c9ea61 100644
--- a/engine/battle/read_trainer_dvs.asm
+++ b/engine/battle/read_trainer_dvs.asm
@@ -17,3 +17,5 @@ GetTrainerDVs:
pop hl
ret
+
+INCLUDE "data/trainers/dvs.asm"
diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm
index 3b1fe3bca..0a537b64e 100644
--- a/engine/battle/read_trainer_party.asm
+++ b/engine/battle/read_trainer_party.asm
@@ -321,7 +321,6 @@ ComputeTrainerReward:
ld [hl], a
ret
-
Battle_GetTrainerName::
ld a, [wInBattleTowerBattle]
bit 0, a
@@ -388,3 +387,5 @@ Function39990:
ld bc, NAME_LENGTH
pop de
ret
+
+INCLUDE "data/trainers/parties.asm"
diff --git a/engine/battle/used_move_text.asm b/engine/battle/used_move_text.asm
index 2bb6b7845..9307a1a1e 100644
--- a/engine/battle/used_move_text.asm
+++ b/engine/battle/used_move_text.asm
@@ -131,7 +131,6 @@ EndUsedMove5Text:
text_jump _EndUsedMove5Text
db "@"
-
GetMoveGrammar:
; store move grammar type in wd265
@@ -169,7 +168,6 @@ GetMoveGrammar:
INCLUDE "data/moves/grammar.asm"
-
UpdateUsedMoves:
; append move a to wPlayerUsedMoves unless it has already been used
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm
index b30a42bf2..e68b7d774 100644
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -1,7 +1,6 @@
; Battle animation command interpreter.
PlayBattleAnim:
-
ld a, [rSVBK]
push af
@@ -15,7 +14,6 @@ PlayBattleAnim:
ret
_PlayBattleAnim:
-
ld c, 6
.wait
call BattleAnimDelayFrame
@@ -53,7 +51,6 @@ _PlayBattleAnim:
ret
BattleAnimRunScript:
-
ld a, [wFXAnimID + 1]
and a
jr nz, .hi_byte
@@ -97,7 +94,6 @@ BattleAnimRunScript:
ret
RunBattleAnimScript:
-
call ClearBattleAnims
.playframe
@@ -139,7 +135,6 @@ RunBattleAnimScript:
ret
BattleAnimClearHud:
-
call BattleAnimDelayFrame
call WaitTop
call ClearActorHud
@@ -152,7 +147,6 @@ BattleAnimClearHud:
ret
BattleAnimRestoreHuds:
-
call BattleAnimDelayFrame
call WaitTop
@@ -177,7 +171,6 @@ BattleAnimRestoreHuds:
ret
BattleAnimRequestPals:
-
ld a, [hCGB]
and a
ret z
@@ -207,7 +200,6 @@ BattleAnimDelayFrame:
ret
ClearActorHud:
-
ld a, [hBattleTurn]
and a
jr z, .player
@@ -240,9 +232,7 @@ Unreferenced_Functioncc220:
call BattleAnimDelayFrame
ret
-
BattleAnim_ClearCGB_OAMFlags:
-
ld a, [wBattleAnimFlags]
bit 3, a
jr z, .delete
@@ -333,7 +323,6 @@ RunBattleAnimCommand:
ld l, a
jp hl
-
BattleAnimCommands::
; entries correspond to macros/scripts/battle_anims.asm enumeration
dw BattleAnimCmd_Obj
@@ -385,7 +374,6 @@ BattleAnimCommands::
dw BattleAnimCmd_Call
dw BattleAnimCmd_Ret
-
BattleAnimCmd_EA:
BattleAnimCmd_EB:
BattleAnimCmd_EC:
@@ -780,7 +768,6 @@ BattleAnimCmd_SetObj:
ret
BattleAnimCmd_EnemyFeetObj:
-
ld hl, wBattleAnimTileDict
.loop
ld a, [hl]
@@ -835,7 +822,6 @@ BattleAnimCmd_EnemyFeetObj:
ret
BattleAnimCmd_PlayerHeadObj:
-
ld hl, wBattleAnimTileDict
.loop
ld a, [hl]
@@ -934,7 +920,6 @@ BattleAnimCmd_Transform:
ret
BattleAnimCmd_UpdateActorPic:
-
ld de, vTiles0 tile $00
ld a, [hBattleTurn]
and a
@@ -954,7 +939,6 @@ BattleAnimCmd_UpdateActorPic:
ret
BattleAnimCmd_RaiseSub:
-
ld a, [rSVBK]
push af
ld a, 1 ; unnecessary bankswitch?
@@ -1304,7 +1288,6 @@ endr
dw $0000, $0000
dw $0000, $0000
-
PlayHitSound:
ld a, [wNumHits]
cp $1
diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm
index 89ffb0aa4..e5e186ab7 100644
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -134,7 +134,6 @@ BattleBGEffects:
dw BattleBGEffect_WobbleMon
dw BattleBGEffect_35
-
BattleBGEffect_End:
call EndBattleBGEffect
ret
@@ -348,7 +347,6 @@ BattleBGEffect_HideMon:
dw BattleBGEffects_IncrementJumptable
dw .four
-
.zero
call BattleBGEffects_IncrementJumptable
push bc
@@ -415,7 +413,6 @@ BattleBGEffect_FeetFollow:
dw BattleBGEffects_IncrementJumptable
dw .five
-
.zero
call BGEffect_CheckFlyDigStatus
jr z, .not_flying_digging
@@ -483,7 +480,6 @@ BattleBGEffect_HeadFollow:
dw BattleBGEffects_IncrementJumptable
dw .five
-
.zero
call BGEffect_CheckFlyDigStatus
jr z, .not_flying_digging
@@ -554,7 +550,6 @@ BattleBGEffect_27:
dw BattleBGEffects_IncrementJumptable
dw .four
-
.zero
call BattleBGEffects_IncrementJumptable
call BGEffect_CheckBattleTurn
@@ -717,7 +712,6 @@ BattleBGEffect_RunPicResizeScript:
dw .restart
dw .end
-
.zero
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
@@ -915,7 +909,6 @@ BattleBGEffect_Surf:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
lb de, 2, 2
@@ -982,7 +975,6 @@ BattleBGEffect_Whirlpool:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1056,7 +1048,6 @@ BattleBGEffect_Psychic:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1094,7 +1085,6 @@ BattleBGEffect_Teleport:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1119,7 +1109,6 @@ BattleBGEffect_NightShade:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1150,7 +1139,6 @@ BattleBGEffect_DoubleTeam:
dw .four
dw .five
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1242,7 +1230,6 @@ BattleBGEffect_AcidArmor:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1305,7 +1292,6 @@ BattleBGEffect_Withdraw:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1355,7 +1341,6 @@ BattleBGEffect_Dig:
dw .two
dw .three
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1422,7 +1407,6 @@ BattleBGEffect_Tackle:
dw Tackle_BGEffect25_2d_two
dw .three
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1457,7 +1441,6 @@ BattleBGEffect_25:
dw Tackle_BGEffect25_2d_two
dw .three
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1585,7 +1568,6 @@ BattleBGEffect_2d:
dw Tackle_BGEffect25_2d_two
dw .three
-
.three
call BattleAnim_ResetLCDStatCustom
ret
@@ -1633,7 +1615,6 @@ BattleBGEffect_26:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1672,7 +1653,6 @@ BattleBGEffect_2c:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1727,7 +1707,6 @@ BattleBGEffect_28:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1770,7 +1749,6 @@ BattleBGEffect_BounceDown:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1928,7 +1906,6 @@ BattleBGEffect_2b:
dw .zero
dw .one
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -1969,7 +1946,6 @@ BattleBGEffect_1c:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
ld a, $e4
@@ -2196,7 +2172,6 @@ BattleBGEffect_VibrateMon:
dw .zero
dw .one
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -2242,7 +2217,6 @@ BattleBGEffect_WobbleMon:
dw .one
dw .two
-
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
@@ -2407,7 +2381,6 @@ BGEffect_RapidCyclePals:
dw .one_dmg
dw .two_dmg
-
.zero_dmg
call BattleBGEffects_IncrementJumptable
ld a, $e4
@@ -2472,7 +2445,6 @@ BGEffect_RapidCyclePals:
dw .three_cgb
dw .four_cgb
-
.zero_cgb
call BGEffect_CheckBattleTurn
jr nz, .player_turn_cgb
@@ -2932,4 +2904,3 @@ BattleBGEffects_Cosine:
callfar BattleAnim_Cosine_e
ld a, e
ret
-
diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm
index 20ab74e7b..0f3bb8488 100644
--- a/engine/battle_anims/core.asm
+++ b/engine/battle_anims/core.asm
@@ -26,7 +26,6 @@ DeinitBattleAnimation:
ld [hl], $0
ret
-
InitBattleAnimation:
ld a, [wBattleAnimTemp0]
ld e, a
@@ -190,7 +189,6 @@ BattleAnimOAMUpdate:
scf
ret
-
InitBattleAnimBuffer:
ld hl, BATTLEANIMSTRUCT_01
add hl, bc
@@ -274,7 +272,6 @@ InitBattleAnimBuffer:
ld [wBattleAnimTempXOffset], a
ret
-
GetBattleAnimTileOffset:
push hl
push bc
@@ -302,8 +299,6 @@ _ExecuteBGEffects:
callfar ExecuteBGEffects
ret
-
_QueueBGEffect:
callfar QueueBGEffect
ret
-
diff --git a/engine/battle_anims/helpers.asm b/engine/battle_anims/helpers.asm
index 09eb3479f..63177b1b1 100644
--- a/engine/battle_anims/helpers.asm
+++ b/engine/battle_anims/helpers.asm
@@ -72,7 +72,6 @@ GetBattleAnimFrame:
ld [hl], a
jr .loop
-
.GetPointer:
ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
add hl, bc
@@ -92,7 +91,6 @@ GetBattleAnimFrame:
add hl, de
ret
-
GetBattleAnimOAMPointer:
ld l, a
ld h, 0
@@ -102,7 +100,6 @@ GetBattleAnimOAMPointer:
add hl, de
ret
-
LoadBattleAnimObj:
push hl
ld l, a
@@ -123,4 +120,3 @@ LoadBattleAnimObj:
call DecompressRequest2bpp
pop bc
ret
-
diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm
index 59ec3a1a4..e51080ae0 100644
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -264,7 +264,6 @@ RunBattleTowerTrainer:
ld [wBattleTowerBattleEnded], a
ret
-
ReadBTTrainerParty:
; Initialise the BattleTower-Trainer and his mon
call CopyBTTrainer_FromBT_OT_TowBT_OTTemp
@@ -555,7 +554,6 @@ Function17042c:
INCLUDE "data/battle_tower/unknown_levels.asm"
-
CopyBTTrainer_FromBT_OT_TowBT_OTTemp:
; copy the BattleTower-Trainer data that lies at 'wBT_OTTrainer' to 'wBT_OTTemp'
ld a, [rSVBK]
@@ -672,12 +670,10 @@ Function1704e1:
call .PlaceTextItems
jr .NextJumptableFunction
-
.Jumptable_1:
call SetPalettes
call .NextJumptableFunction
-
.Jumptable_2:
ld hl, hJoyPressed
ld a, [hl]
@@ -882,7 +878,6 @@ BattleTowerAction:
ld l, a
jp hl
-
.dw
dw BattleTowerAction_CheckExplanationRead ; 0x00
dw BattleTowerAction_SetExplanationRead ; 0x01
@@ -917,7 +912,6 @@ BattleTowerAction:
dw BattleTower_RandomlyChooseReward ; 0x1e
dw BattleTower_SaveOptions ; 0x1f
-
; Reset the save memory for BattleTower-Trainers (Counter and all 7 TrainerBytes)
ResetBattleTowerTrainersSRAM: ; BattleTowerAction $1a
ld a, BANK(sBTTrainers)
@@ -1200,7 +1194,6 @@ BattleTower_CheckSaveFileExistsAndIsYours: ; BattleTowerAction $09
ld [wScriptVar], a
ret
-
Function1708b1: ; BattleTowerAction $0a
xor a
ld [wMusicFade], a
@@ -1260,7 +1253,6 @@ Function1708f0: ; BattleTowerAction $0d
ld [wScriptVar], a
ret
-
Function170923:
ld a, $5
call GetSRAMBank
@@ -1273,7 +1265,6 @@ Function170923:
call CloseSRAM
ret
-
BattleTowerAction_EggTicket: ; BattleTowerAction $0e
xor a
ld [wScriptVar], a
diff --git a/engine/events/battle_tower/load_trainer.asm b/engine/events/battle_tower/load_trainer.asm
index 3e6dead8a..2f34950b6 100644
--- a/engine/events/battle_tower/load_trainer.asm
+++ b/engine/events/battle_tower/load_trainer.asm
@@ -91,7 +91,6 @@ endc
ret
-
Function_LoadRandomBattleTowerMon:
ld c, BATTLETOWER_PARTY_LENGTH
.loop
diff --git a/engine/events/battle_tower/trainer_text.asm b/engine/events/battle_tower/trainer_text.asm
index 1172717d6..e2db148b7 100644
--- a/engine/events/battle_tower/trainer_text.asm
+++ b/engine/events/battle_tower/trainer_text.asm
@@ -88,7 +88,6 @@ INCLUDE "mobile/fixed_words.asm"
INCLUDE "data/trainers/genders.asm"
-
BTMaleTrainerTexts:
dw .Greetings
dw .PlayerLost
@@ -175,7 +174,6 @@ BTMaleTrainerTexts:
dw BTWinM24
dw BTWinM25
-
BTFemaleTrainerTexts:
dw .Greetings
dw .PlayerLost
@@ -232,7 +230,6 @@ BTFemaleTrainerTexts:
dw BTWinF14
dw BTWinF15
-
BTGreetingM1:
text_jump BattleTowerText_0x1ec000
db "@"
@@ -533,9 +530,6 @@ BTWinM25:
text_jump UnknownText_0x1ec99b
db "@"
-
-
-
BTGreetingF1:
text_jump UnknownText_0x1ec9bd
db "@"
diff --git a/engine/events/bug_contest/judging.asm b/engine/events/bug_contest/judging.asm
index 0f5ff2b7c..d8f9d7657 100644
--- a/engine/events/bug_contest/judging.asm
+++ b/engine/events/bug_contest/judging.asm
@@ -125,10 +125,8 @@ LoadContestantName:
ld bc, NAME_LENGTH
jp CopyBytes
-
INCLUDE "data/events/bug_contest_winners.asm"
-
BugContest_GetPlayersResult:
ld hl, wBugContestThirdPlaceWinnerID
ld de, - BUG_CONTESTANT_SIZE
diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm
index c0f4fcf36..76bdbaa76 100644
--- a/engine/events/celebi.asm
+++ b/engine/events/celebi.asm
@@ -41,7 +41,6 @@ CelebiShrineEvent:
pop bc
jr .loop
-
.done
pop af
ld [wVramState], a
@@ -49,7 +48,6 @@ CelebiShrineEvent:
call CelebiEvent_SetBattleType
ret
-
.RestorePlayerSprite_DespawnLeaves:
ld hl, wVirtualOAMSprite00TileID
xor a
@@ -68,7 +66,6 @@ endr
call ByteFill
ret
-
LoadCelebiGFX:
farcall ClearSpriteAnims
ld de, SpecialCelebiLeafGFX
@@ -83,7 +80,6 @@ LoadCelebiGFX:
ld [wJumptableIndex], a
ret
-
CelebiEvent_CountDown:
ld hl, wFrameCounter
ld a, [hl]
@@ -92,13 +88,11 @@ CelebiEvent_CountDown:
dec [hl]
ret
-
.done
ld hl, wJumptableIndex
set 7, [hl]
ret
-
CelebiEvent_SpawnLeaf:
; unused
ld hl, wcf65
@@ -119,7 +113,6 @@ CelebiEvent_SpawnLeaf:
ld [hl], $80
ret
-
SpecialCelebiLeafGFX:
INCBIN "gfx/overworld/cut_grass.2bpp"
@@ -129,7 +122,6 @@ INCBIN "gfx/overworld/celebi/2.2bpp"
INCBIN "gfx/overworld/celebi/3.2bpp"
INCBIN "gfx/overworld/celebi/4.2bpp"
-
UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XOFFSET
add hl, bc
@@ -224,7 +216,6 @@ UpdateCelebiPosition:
.done
ret
-
.FreezeCelebiPosition:
pop af
ld hl, SPRITEANIMSTRUCT_FRAMESET_ID
@@ -233,7 +224,6 @@ UpdateCelebiPosition:
call ReinitSpriteAnimFrame
ret
-
CelebiEvent_Cosine:
; a = d * cos(a * pi/32)
add %010000 ; cos(x) = sin(x + pi/2)
@@ -261,22 +251,18 @@ GetCelebiSpriteTile:
jr c, .done
jr .restart
-
.Frame1:
ld a, SPECIALCELEBIEVENT_CELEBI
jr .load_tile
-
.Frame2:
ld a, SPECIALCELEBIEVENT_CELEBI + 4
jr .load_tile
-
.Frame3:
ld a, SPECIALCELEBIEVENT_CELEBI + 8
jr .load_tile
-
.Frame4:
ld a, SPECIALCELEBIEVENT_CELEBI + 12
@@ -286,7 +272,6 @@ GetCelebiSpriteTile:
ld [hl], a
jr .done
-
.restart
pop de
ld d, $ff
@@ -298,7 +283,6 @@ GetCelebiSpriteTile:
pop hl
ret
-
.AddE:
push af
ld a, d
@@ -307,13 +291,11 @@ GetCelebiSpriteTile:
pop af
ret
-
CelebiEvent_SetBattleType:
ld a, BATTLETYPE_CELEBI
ld [wBattleType], a
ret
-
CheckCaughtCelebi:
ld a, [wBattleResult]
bit BATTLERESULT_CAUGHT_CELEBI, a
@@ -322,11 +304,9 @@ CheckCaughtCelebi:
ld [wScriptVar], a
jr .done
-
.false
xor a ; FALSE
ld [wScriptVar], a
.done
ret
-
diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm
index 76ef11d6a..705b24992 100644
--- a/engine/events/elevator.asm
+++ b/engine/events/elevator.asm
@@ -142,7 +142,6 @@ Elevator_WhichFloorText:
text_jump UnknownText_0x1bd2bc
db "@"
-
Elevator_GetCurrentFloorText:
ld hl, wOptions
ld a, [hl]
@@ -164,7 +163,6 @@ Elevator_GetCurrentFloorText:
Elevator_CurrentFloorText:
db "Now on:@"
-
Elevator_GetCurrentFloorString:
push hl
ld a, [wElevatorOriginFloor]
diff --git a/engine/events/engine_flags.asm b/engine/events/engine_flags.asm
index 7c894587c..6c2148f79 100644
--- a/engine/events/engine_flags.asm
+++ b/engine/events/engine_flags.asm
@@ -7,7 +7,6 @@ EngineFlagAction::
;
; Setting/resetting does not return a result.
-
; 16-bit flag ids are considered invalid, but it's nice
; to know that the infrastructure is there.
@@ -81,5 +80,4 @@ EngineFlagAction::
ld [de], a
ret
-
INCLUDE "data/engine_flags.asm"
diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm
index b8157fe38..f5ad049f2 100644
--- a/engine/events/field_moves.asm
+++ b/engine/events/field_moves.asm
@@ -20,7 +20,7 @@ BlindingFlash:
ShakeHeadbuttTree:
farcall ClearSpriteAnims
ld de, CutGrassGFX
- ld hl, vTiles1
+ ld hl, vTiles1 tile $00
lb bc, BANK(CutGrassGFX), 4
call Request2bpp
ld de, HeadbuttTreeGFX
@@ -134,11 +134,11 @@ OWCutAnimation:
.LoadCutGFX:
callfar ClearSpriteAnims ; pointless to farcall
ld de, CutGrassGFX
- ld hl, vTiles1
+ ld hl, vTiles1 tile $00
lb bc, BANK(CutGrassGFX), 4
call Request2bpp
ld de, CutTreeGFX
- ld hl, vTiles1 tile $4
+ ld hl, vTiles1 tile $04
lb bc, BANK(CutTreeGFX), 4
call Request2bpp
ret
@@ -161,14 +161,12 @@ OWCutJumptable:
ld l, a
jp hl
-
.dw
dw Cut_SpawnAnimateTree
dw Cut_SpawnAnimateLeaves
dw Cut_StartWaiting
dw Cut_WaitAnimSFX
-
Cut_SpawnAnimateTree:
call Cut_Headbutt_GetPixelFacing
ld a, SPRITE_ANIM_INDEX_CUT_TREE ; cut tree
@@ -303,7 +301,6 @@ Cut_Headbutt_GetPixelFacing:
dbpixel 8, 11
dbpixel 12, 11
-
FlyFromAnim:
call DelayFrame
ld a, [wVramState]
diff --git a/engine/events/fish.asm b/engine/events/fish.asm
index 9d695a908..a1df536bb 100644
--- a/engine/events/fish.asm
+++ b/engine/events/fish.asm
@@ -21,7 +21,6 @@ endr
pop af
ret
-
.Fish:
; Fish for monsters with rod b from encounter data in FishGroup at hl.
; Return monster e at level d.
@@ -90,7 +89,6 @@ endr
inc hl
ret
-
GetFishGroupIndex:
; Return the index of fishgroup d in de.
@@ -126,5 +124,4 @@ GetFishGroupIndex:
ld d, FISHGROUP_REMORAID_SWARM
jr .done
-
INCLUDE "data/wild/fish.asm"
diff --git a/engine/events/fruit_trees.asm b/engine/events/fruit_trees.asm
index 4e955147a..6d5ca6a1d 100644
--- a/engine/events/fruit_trees.asm
+++ b/engine/events/fruit_trees.asm
@@ -94,10 +94,8 @@ GetFruitTreeItem:
pop hl
ret
-
INCLUDE "data/items/fruit_trees.asm"
-
FruitBearingTreeText:
text_jump _FruitBearingTreeText
db "@"
diff --git a/engine/events/halloffame.asm b/engine/events/halloffame.asm
index 11107cdb3..6cbc749d5 100644
--- a/engine/events/halloffame.asm
+++ b/engine/events/halloffame.asm
@@ -134,7 +134,6 @@ AnimateHallOfFame:
.String_NewHallOfFamer:
db "New Hall of Famer!@"
-
GetHallOfFameParty:
ld hl, wHallOfFamePokemonList
ld bc, wHallOfFamePokemonListEnd - wHallOfFamePokemonList + 1
@@ -603,4 +602,3 @@ HOF_AnimatePlayerPic:
.PlayTime:
db "PLAY TIME@"
-
diff --git a/engine/events/happiness_egg.asm b/engine/events/happiness_egg.asm
index d261caa3c..41f9a4411 100644
--- a/engine/events/happiness_egg.asm
+++ b/engine/events/happiness_egg.asm
@@ -102,10 +102,8 @@ ChangeHappiness:
ld [wBattleMonHappiness], a
ret
-
INCLUDE "data/events/happiness_changes.asm"
-
StepHappiness::
; Raise the party's happiness by 1 point every other step cycle.
@@ -141,7 +139,6 @@ StepHappiness::
jr nz, .loop
ret
-
DayCareStep::
; Raise the experience of Day-Care Pokémon every step cycle.
diff --git a/engine/events/magikarp.asm b/engine/events/magikarp.asm
index 31e8de201..7fe8adba7 100644
--- a/engine/events/magikarp.asm
+++ b/engine/events/magikarp.asm
@@ -139,7 +139,6 @@ CalcMagikarpLength:
; if b = 252-253: x = 65210, y = 5, z = 13
; if b = 254: x = 65410, y = 2, z = 14
-
; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id)
; id
@@ -302,8 +301,6 @@ CalcMagikarpLength:
INCLUDE "data/events/magikarp_lengths.asm"
-
-
MagikarpHouseSign:
ld a, [wBestMagikarpLengthFeet]
ld [wMagikarpLength], a
diff --git a/engine/events/map_name_sign.asm b/engine/events/map_name_sign.asm
index 1d8736e54..859f30034 100644
--- a/engine/events/map_name_sign.asm
+++ b/engine/events/map_name_sign.asm
@@ -96,7 +96,6 @@ ReturnFromMapSetupScript::
cp MAP_ROUTE_36_NATIONAL_PARK_GATE
ret
-
PlaceMapNameSign::
ld hl, wLandmarkSignTimer
ld a, [hl]
@@ -125,7 +124,6 @@ PlaceMapNameSign::
ld [hLCDCPointer], a
ret
-
LoadMapNameSignGFX:
ld de, MapEntryFrameGFX
ld hl, vTiles2 tile MAP_NAME_SIGN_START
@@ -141,7 +139,6 @@ InitMapNameFrame:
call PlaceMapNameFrame
ret
-
PlaceMapNameCenterAlign:
ld a, [wCurrentLandmark]
ld e, a
@@ -174,7 +171,6 @@ PlaceMapNameCenterAlign:
pop hl
ret
-
InitMapSignAttrMap:
ld de, wAttrMap - wTileMap
add hl, de
diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm
index fa82da50a..dc10ede35 100644
--- a/engine/events/mom_phone.asm
+++ b/engine/events/mom_phone.asm
@@ -113,7 +113,6 @@ CheckBalance_MomItem2:
farcall AddMoney
ret
-
MomBuysItem_DeductFunds:
call GetItemFromMom
ld de, 3 ; cost
@@ -129,7 +128,6 @@ MomBuysItem_DeductFunds:
farcall TakeMoney
ret
-
Mom_GiveItemOrDoll:
call GetItemFromMom
ld de, 6 ; item type
@@ -153,7 +151,6 @@ Mom_GiveItemOrDoll:
call ReceiveItem
ret
-
Mom_GetScriptPointer:
call GetItemFromMom
ld de, 6 ; item type
@@ -179,7 +176,6 @@ Mom_GetScriptPointer:
writetext _MomText_ItsInRoom
end
-
GetItemFromMom:
ld a, [wWhichMomItemSet]
and a
diff --git a/engine/events/money.asm b/engine/events/money.asm
index c4e20fc3e..c8f9d058e 100644
--- a/engine/events/money.asm
+++ b/engine/events/money.asm
@@ -25,7 +25,6 @@ GiveMoney::
MaxMoney:
dt MAX_MONEY
-
TakeMoney::
ld a, 3
call SubtractMoney
@@ -187,7 +186,6 @@ GiveCoins::
.maxcoins
bigdw MAX_COINS
-
TakeCoins::
ld a, 2
ld de, wCoins
diff --git a/engine/events/npc_trade.asm b/engine/events/npc_trade.asm
index cd83f8cb3..9cff40a2b 100644
--- a/engine/events/npc_trade.asm
+++ b/engine/events/npc_trade.asm
@@ -271,7 +271,6 @@ DoNPCTrade:
pop af
ret
-
GetTradeAttribute:
ld d, 0
push de
@@ -384,10 +383,8 @@ GetTradeMonNames:
ld [hl], "@"
ret
-
INCLUDE "data/events/npc_trades.asm"
-
PrintTradeText:
push af
call GetTradeMonNames
@@ -433,13 +430,11 @@ TradeTexts:
dw TradeAfterText3
dw TradeAfterText4
-
ConnectLinkCableText:
; OK, connect the Game Link Cable.
text_jump UnknownText_0x1bd407
db "@"
-
TradedForText:
; traded givemon for getmon
text_jump UnknownText_0x1bd429
@@ -456,7 +451,6 @@ TradedForText:
text_jump UnknownText_0x1bd445
db "@"
-
TradeIntroText1:
; I collect #MON. Do you have @ ? Want to trade it for my @ ?
text_jump UnknownText_0x1bd449
@@ -482,7 +476,6 @@ TradeAfterText1:
text_jump UnknownText_0x1bd4f4
db "@"
-
TradeIntroText2:
TradeIntroText3:
; Hi, I'm looking for this #MON. If you have @ , would you trade it for my @ ?
@@ -511,7 +504,6 @@ TradeAfterText2:
text_jump UnknownText_0x1bd5f4
db "@"
-
TradeIntroText4:
; 's cute, but I don't have it. Do you have @ ? Want to trade it for my @ ?
text_jump UnknownText_0x1bd621
@@ -537,7 +529,6 @@ TradeAfterText4:
text_jump UnknownText_0x1bd6f5
db "@"
-
TradeCompleteText3:
; Uh? What happened?
text_jump UnknownText_0x1bd731
diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm
index 749964707..e57635fef 100644
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -276,10 +276,8 @@ CheckOverworldTileArrays:
xor a
ret
-
INCLUDE "data/events/field_move_blocks.asm"
-
OWFlash:
call .CheckUseFlash
and $7f
diff --git a/engine/events/poke_seer.asm b/engine/events/poke_seer.asm
index 6f30e24b8..dc99cb536 100644
--- a/engine/events/poke_seer.asm
+++ b/engine/events/poke_seer.asm
@@ -48,7 +48,6 @@ PokeSeer:
call PrintSeerText
ret
-
SeerAction:
ld a, [wSeerAction]
ld hl, SeerActions
@@ -337,7 +336,6 @@ SeerCancelText:
text_jump UnknownText_0x1c4955
db "@"
-
SeerAdvice:
ld a, MON_LEVEL
call GetPartyParamLocation
@@ -398,7 +396,6 @@ SeerAdvice5:
text_jump UnknownText_0x1c4ae5
db "@"
-
GetCaughtGender:
ld hl, MON_CAUGHTGENDER
add hl, bc
diff --git a/engine/events/print_unown.asm b/engine/events/print_unown.asm
index ed7087e35..9e231f449 100644
--- a/engine/events/print_unown.asm
+++ b/engine/events/print_unown.asm
@@ -1,3 +1,6 @@
+UNOWNSTAMP_BOLD_A EQUS "\"♂\"" ; $ef
+UNOWNSTAMP_BOLD_B EQUS "\"♀\"" ; $f5
+
_UnownPrinter:
ld a, [wUnownDex]
and a
@@ -15,12 +18,12 @@ _UnownPrinter:
call ClearTileMap
ld de, UnownDexATile
- ld hl, vTiles1 tile $6f
+ ld hl, vTiles0 tile UNOWNSTAMP_BOLD_A
lb bc, BANK(UnownDexBTile), 1
call Request1bpp
ld de, UnownDexBTile
- ld hl, vTiles1 tile $75
+ ld hl, vTiles0 tile UNOWNSTAMP_BOLD_B
lb bc, BANK(UnownDexBTile), 1
call Request1bpp
@@ -200,8 +203,8 @@ UnownDexDoWhatString:
db "Do what?@"
UnownDexMenuString:
- db "♂ PRINT"
- next "♀ CANCEL"
+ db UNOWNSTAMP_BOLD_A, " PRINT"
+ next UNOWNSTAMP_BOLD_B, " CANCEL"
next "← PREVIOUS"
next "→ NEXT"
db "@"
diff --git a/engine/events/shuckle.asm b/engine/events/shuckle.asm
index 6ac6eeb08..c6d909afe 100644
--- a/engine/events/shuckle.asm
+++ b/engine/events/shuckle.asm
@@ -1,7 +1,6 @@
MANIA_OT_ID EQU 00518
GiveShuckle:
-
; Adding to the party.
xor a
ld [wMonType], a
diff --git a/engine/events/specials.asm b/engine/events/specials.asm
index 8d340a79d..35d32dde6 100644
--- a/engine/events/specials.asm
+++ b/engine/events/specials.asm
@@ -291,7 +291,6 @@ ActivateFishingSwarm:
ld [wFishingSwarmFlag], a
ret
-
StoreSwarmMapIndices::
ld a, c
and a
@@ -310,7 +309,6 @@ StoreSwarmMapIndices::
ld [wYanmaMapNumber], a
ret
-
CheckPokerus:
; Check if a monster in your party has Pokerus
farcall _CheckPokerus
@@ -377,12 +375,10 @@ SnorlaxAwake:
db 36, 9 ; right
db -1
-
PlayCurMonCry:
ld a, [wCurPartySpecies]
jp PlayMonCry
-
GameboyCheck:
ld a, [hCGB]
and a
@@ -404,7 +400,6 @@ GameboyCheck:
ld [wScriptVar], a
ret
-
FadeOutMusic:
ld a, LOW(MUSIC_NONE)
ld [wMusicFadeID], a
diff --git a/engine/events/std_scripts.asm b/engine/events/std_scripts.asm
index 222af41c7..28272405c 100644
--- a/engine/events/std_scripts.asm
+++ b/engine/events/std_scripts.asm
@@ -1850,7 +1850,6 @@ CoinVendor_IntroScript:
closetext
end
-
.MenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 4, 15, TEXTBOX_Y - 1
@@ -1864,7 +1863,6 @@ CoinVendor_IntroScript:
db "500 : ¥10000@"
db "CANCEL@"
-
HappinessCheckScript:
faceplayer
opentext
diff --git a/engine/events/treemons.asm b/engine/events/treemons.asm
index 1fdeceb0a..cd78421d6 100644
--- a/engine/events/treemons.asm
+++ b/engine/events/treemons.asm
@@ -27,7 +27,6 @@ TreeMonEncounter:
ret
RockMonEncounter:
-
xor a
ld [wTempWildMonSpecies], a
ld [wCurPartyLevel], a
diff --git a/engine/events/whiteout.asm b/engine/events/whiteout.asm
index bf5a2257c..82b7a4868 100644
--- a/engine/events/whiteout.asm
+++ b/engine/events/whiteout.asm
@@ -59,7 +59,6 @@ HalveMoney:
ld [hl], a
ret
-
GetWhiteoutSpawn:
ld a, [wLastSpawnMapGroup]
ld d, a
diff --git a/engine/games/card_flip.asm b/engine/games/card_flip.asm
index 9c095a784..805a3ca71 100644
--- a/engine/games/card_flip.asm
+++ b/engine/games/card_flip.asm
@@ -1,5 +1,5 @@
-CARDFLIP_LIGHT_OFF EQU $ef
-CARDFLIP_LIGHT_ON EQU $f5
+CARDFLIP_LIGHT_OFF EQUS "\"♂\"" ; $ef
+CARDFLIP_LIGHT_ON EQUS "\"♀\"" ; $f5
CARDFLIP_DECK_SIZE EQU 4 * 6
@@ -977,7 +977,6 @@ CardFlip_CheckWinCondition:
ld de, SFX_2ND_PLACE
jp .Payout
-
.PikaOne:
ld e, $0
jr .CheckWin72
diff --git a/engine/games/dummy_game.asm b/engine/games/dummy_game.asm
index 89e2ea698..c500dbf66 100644
--- a/engine/games/dummy_game.asm
+++ b/engine/games/dummy_game.asm
@@ -243,7 +243,6 @@ endr
ld [wJumptableIndex], a
ret
-
DummyGame_CheckMatch:
ld hl, wDummyGameCard1
ld a, [hli]
@@ -321,7 +320,6 @@ DummyGame_CheckMatch:
inc bc
ret
-
DummyGameText_Yeah:
; , yeah!
text_jump UnknownText_0x1c1a5b
@@ -381,7 +379,6 @@ DummyGame_InitBoard:
jr nz, .loop
ret
-
DummyGame_SampleTilePlacement:
push hl
ld de, wDummyGameCards
@@ -403,7 +400,6 @@ DummyGame_SampleTilePlacement:
inc hl
ret
-
DummyGame_GetDistributionOfTiles:
ld a, [wMenuCursorY]
dec a
@@ -439,7 +435,6 @@ DummyGame_PlaceCard:
call DelayFrames
ret
-
DummyGame_DeleteCard:
ld a, $1
ld [hli], a
@@ -452,7 +447,6 @@ DummyGame_DeleteCard:
call DelayFrames
ret
-
DummyGame_InitStrings:
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
@@ -501,7 +495,6 @@ DummyGame_Card2Coord:
add hl, de
ret
-
DummyGame_InterpretJoypad_AnimateCursor:
ld a, [wJumptableIndex]
cp $7
@@ -595,6 +588,5 @@ DummyGame_InterpretJoypad_AnimateCursor:
ld [hl], a
ret
-
LZ_e2221:
INCBIN "gfx/dummy_game/dummy_game.2bpp.lz"
diff --git a/engine/games/slot_machine.asm b/engine/games/slot_machine.asm
index 9864a5b9d..0e7a566b9 100644
--- a/engine/games/slot_machine.asm
+++ b/engine/games/slot_machine.asm
@@ -219,7 +219,6 @@ SlotsLoop:
call DmgToCgbBGPals
ret
-
.PrintCoinsAndPayout:
hlcoord 5, 1
ld de, wCoins
@@ -231,7 +230,6 @@ SlotsLoop:
call PrintNum
ret
-
Unreferenced_Function92811:
; debug function?
ld a, [wSlotBias]
@@ -250,7 +248,6 @@ Unreferenced_Function92811:
ld [hl], a
ret
-
Unreferenced_Function9282c:
; animate OAM tiles?
ld hl, wcf66
@@ -271,7 +268,6 @@ endr
jr nz, .loop
ret
-
SlotsJumptable:
jumptable .Jumptable, wJumptableIndex
@@ -849,7 +845,6 @@ Slots_UpdateReelPositionAndOAM:
jr nz, .loop
ret
-
Unreferenced_Function92bbe:
push hl
srl a
@@ -863,7 +858,6 @@ Unreferenced_Function92bbe:
pop hl
ret
-
.Unknown_92bce:
db 0, 1, 2, 3, 4, 5
@@ -880,7 +874,6 @@ ReelActionJumptable:
ld l, a
jp hl
-
.Jumptable:
dw ReelAction_DoNothing ; 00
dw ReelAction_StopReelIgnoreJoypad ; 01
@@ -911,42 +904,36 @@ ReelActionJumptable:
ReelAction_DoNothing:
ret
-
ReelAction_QuadrupleRate:
ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 16
ret
-
ReelAction_DoubleRate:
ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 8
ret
-
ReelAction_NormalRate:
ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 4
ret
-
ReelAction_HalfRate:
ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 2
ret
-
ReelAction_QuarterRate:
ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 1
ret
-
Slots_StopReel:
ld hl, REEL_SPIN_RATE
add hl, bc
@@ -973,7 +960,6 @@ ReelAction_StopReelIgnoreJoypad:
ld [hl], a
ret
-
ReelAction_StopReel1:
; If no bias: don't manipulate reel.
; If bias: manipulate reel up to wReel1ManipCounter (i.e. 4) slots,
@@ -995,7 +981,6 @@ ReelAction_StopReel1:
call Slots_StopReel
ret
-
.CheckForBias:
call Slots_GetCurrentReelState
ld a, [wSlotBias]
@@ -1010,7 +995,6 @@ ReelAction_StopReel1:
cp e
ret
-
ReelAction_StopReel2:
; If no bias: don't manipulate reel.
; If bias: manipulate reel up to wReel2ManipCounter (i.e. 4) slots,
@@ -1039,7 +1023,6 @@ ReelAction_StopReel2:
call Slots_StopReel
ret
-
ReelAction_StopReel3:
; Manipulate the reel up to wReel3ManipCounter (i.e. 4) slots,
; stopping early if the bias symbol is lined up for a win.
@@ -1074,7 +1057,6 @@ ReelAction_StopReel3:
call Slots_StopReel
ret
-
ReelAction_SetUpReel2SkipTo7:
; Unique reel 2 action (see Slots_StopReel2)
; Ensures that 7 symbols become lined up in the first two reels,
@@ -1103,7 +1085,6 @@ ReelAction_SetUpReel2SkipTo7:
ld [hl], 0
ret
-
ReelAction_WaitReel2SkipTo7:
ld hl, REEL_MANIP_DELAY
add hl, bc
@@ -1124,7 +1105,6 @@ ReelAction_WaitReel2SkipTo7:
ld [hl], 8
ret
-
ReelAction_FastSpinReel2UntilLinedUp7s:
call Slots_CheckMatchedFirstTwoReels
ret nc
@@ -1134,7 +1114,6 @@ ReelAction_FastSpinReel2UntilLinedUp7s:
call Slots_StopReel
ret
-
ReelAction_InitGolem:
; Ensures SEVENs are lined up if there's bias to SEVEN.
; Ensures nothing is lined up if there's no bias symbols.
@@ -1190,7 +1169,6 @@ ReelAction_WaitGolem:
ld [hl], 8
ret
-
ReelAction_EndGolem:
xor a
ld [wSlotsDelay], a
@@ -1202,7 +1180,6 @@ ReelAction_EndGolem:
ld [hl], 0
ret
-
ReelAction_InitChansey:
; Ensures the lining up of SEVEN symbols, but this mode is only possible
; when there is bias to SEVEN symbols (and even then, it's still rare).
@@ -1229,7 +1206,6 @@ ReelAction_InitChansey:
ld [wSlotsDelay], a
ret
-
ReelAction_WaitChansey:
ld a, [wSlotsDelay]
and a
@@ -1283,7 +1259,6 @@ ReelAction_DropReel:
ld [wSlotsDelay], a
ret
-
ReelAction_Unused:
call Slots_CheckMatchedAllThreeReels
ret c
@@ -1336,7 +1311,6 @@ ReelAction_WaitDropReel:
ld [hl], 8
ret
-
ReelAction_StartSlowAdvanceReel3:
; Ensures SEVENs are lined up if there's bias to SEVEN.
; Ensures nothing is lined up if there's no bias symbols.
@@ -1390,7 +1364,6 @@ ReelAction_WaitSlowAdvanceReel3:
call WaitSFX
ret
-
Slots_CheckMatchedFirstTwoReels:
xor a
ld [wFirstTwoReelsMatching], a
@@ -1418,7 +1391,6 @@ Slots_CheckMatchedFirstTwoReels:
scf
ret
-
.Jumptable:
dw .zero
dw .one
@@ -1439,7 +1411,6 @@ Slots_CheckMatchedFirstTwoReels:
.zero
ret
-
.CheckBottomRow:
ld hl, wCurrReelStopped
ld a, [wReel1Stopped]
@@ -1447,7 +1418,6 @@ Slots_CheckMatchedFirstTwoReels:
call z, .StoreResult
ret
-
.CheckUpwardsDiag:
ld hl, wCurrReelStopped + 1
ld a, [wReel1Stopped]
@@ -1455,7 +1425,6 @@ Slots_CheckMatchedFirstTwoReels:
call z, .StoreResult
ret
-
.CheckMiddleRow:
ld hl, wCurrReelStopped + 1
ld a, [wReel1Stopped + 1]
@@ -1463,7 +1432,6 @@ Slots_CheckMatchedFirstTwoReels:
call z, .StoreResult
ret
-
.CheckDownwardsDiag:
ld hl, wCurrReelStopped + 1
ld a, [wReel1Stopped + 2]
@@ -1471,7 +1439,6 @@ Slots_CheckMatchedFirstTwoReels:
call z, .StoreResult
ret
-
.CheckTopRow:
ld hl, wCurrReelStopped + 2
ld a, [wReel1Stopped + 2]
@@ -1479,7 +1446,6 @@ Slots_CheckMatchedFirstTwoReels:
call z, .StoreResult
ret
-
.StoreResult:
ld [wSlotBuildingMatch], a
and a
@@ -1492,7 +1458,6 @@ Slots_CheckMatchedFirstTwoReels:
ld [wFirstTwoReelsMatching], a
ret
-
Slots_CheckMatchedAllThreeReels:
ld a, SLOTS_NO_MATCH
ld [wSlotMatched], a
@@ -1523,7 +1488,6 @@ Slots_CheckMatchedAllThreeReels:
scf
ret
-
.Jumptable:
dw .zero
dw .one
@@ -1544,7 +1508,6 @@ Slots_CheckMatchedAllThreeReels:
.zero
ret
-
.CheckBottomRow:
ld hl, wCurrReelStopped
ld a, [wReel1Stopped]
@@ -1555,7 +1518,6 @@ Slots_CheckMatchedAllThreeReels:
call z, .StoreResult
ret
-
.CheckUpwardsDiag:
ld hl, wCurrReelStopped + 2
ld a, [wReel1Stopped]
@@ -1566,7 +1528,6 @@ Slots_CheckMatchedAllThreeReels:
call z, .StoreResult
ret
-
.CheckMiddleRow:
ld hl, wCurrReelStopped + 1
ld a, [wReel1Stopped + 1]
@@ -1577,7 +1538,6 @@ Slots_CheckMatchedAllThreeReels:
call z, .StoreResult
ret
-
.CheckDownwardsDiag:
ld hl, wCurrReelStopped
ld a, [wReel1Stopped + 2]
@@ -1588,7 +1548,6 @@ Slots_CheckMatchedAllThreeReels:
call z, .StoreResult
ret
-
.CheckTopRow:
ld hl, wCurrReelStopped + 2
ld a, [wReel1Stopped + 2]
@@ -1599,12 +1558,10 @@ Slots_CheckMatchedAllThreeReels:
call z, .StoreResult
ret
-
.StoreResult:
ld [wSlotMatched], a
ret
-
Slots_CopyReelState:
ld de, wCurrReelStopped
ld a, [hli]
@@ -1617,7 +1574,6 @@ Slots_CopyReelState:
ld [de], a
ret
-
Slots_GetNumberOfGolems:
ld hl, REEL_POSITION
add hl, bc
@@ -1631,7 +1587,6 @@ Slots_GetNumberOfGolems:
ld a, e
ret
-
.Check7Bias:
ld a, [wSlotBias]
and a
@@ -1669,7 +1624,6 @@ Slots_GetNumberOfGolems:
jr c, .loop2
ret
-
Slots_InitBias:
ld a, [wSlotBias]
and a
@@ -1694,7 +1648,6 @@ Slots_InitBias:
ld [wSlotBias], a
ret
-
.Normal:
db $01, SLOTS_SEVEN ; 1/256
db $03, SLOTS_POKEBALL ; 1/128
@@ -1794,7 +1747,6 @@ Slots_AskBet:
and a
ret
-
.Text_BetHowManyCoins:
; Bet how many coins?
text_jump UnknownText_0x1c5049
@@ -1852,7 +1804,6 @@ Slots_AskPlayAgain:
scf
ret
-
.Text_OutOfCoins:
text_jump UnknownText_0x1c5079
db "@"
@@ -1927,7 +1878,6 @@ Slots_PayoutText:
farcall StubbedTrainerRankings_AddToSlotsWinStreak
ret
-
.PayoutStrings:
dbw "300@", .LinedUpSevens
dbw "50@@", .LinedUpPokeballs
@@ -1955,7 +1905,6 @@ rept 4
endr
ret
-
.Text_LinedUpWonCoins:
; lined up! Won @ coins!
text_jump UnknownText_0x1c509f
@@ -1993,21 +1942,18 @@ endr
ld [wSlotBias], a
ret
-
.LinedUpPokeballs:
ld a, SFX_3RD_PLACE
call Slots_PlaySFX
call WaitSFX
ret
-
.LinedUpMonOrCherry:
ld a, SFX_PRESENT
call Slots_PlaySFX
call WaitSFX
ret
-
Slots_AnimateGolem:
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
@@ -2183,7 +2129,6 @@ Slots_AnimateChansey:
pop bc
ret
-
Slots_WaitSFX:
push bc
ld c, 16
@@ -2191,7 +2136,6 @@ Slots_WaitSFX:
pop bc
ret
-
Slots_PlaySFX:
push de
ld e, a
@@ -2200,7 +2144,6 @@ Slots_PlaySFX:
pop de
ret
-
; The first three positions are repeated to
; avoid needing to check indices when copying.
Reel1Tilemap:
diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm
index 9e4f69441..fb88d93b6 100644
--- a/engine/games/unown_puzzle.asm
+++ b/engine/games/unown_puzzle.asm
@@ -731,7 +731,6 @@ ConvertLoadedPuzzlePieces:
ret
.EnlargedTiles:
-
x = 0
rept 16
db ((x & %1000) * %11000) + ((x & %0100) * %1100) + ((x & %0010) * %110) + ((x & %0001) * %11)
diff --git a/engine/gfx/cgb_layouts.asm b/engine/gfx/cgb_layouts.asm
index c6527085f..d8f53d7fc 100644
--- a/engine/gfx/cgb_layouts.asm
+++ b/engine/gfx/cgb_layouts.asm
@@ -149,7 +149,6 @@ _CGB_FinishBattleScreenLayout:
call ApplyAttrMap
ret
-
InitPartyMenuBGPal7:
farcall Function100dc0
Mobile_InitPartyMenuBGPal7:
diff --git a/engine/gfx/dma_transfer.asm b/engine/gfx/dma_transfer.asm
index 6519949df..241649dc5 100644
--- a/engine/gfx/dma_transfer.asm
+++ b/engine/gfx/dma_transfer.asm
@@ -233,7 +233,6 @@ CallInSafeGFXMode:
._hl_
jp hl
-
HDMATransferToWRAMBank3:
call _LoadHDMAParameters
ld a, $23
@@ -333,7 +332,6 @@ HDMATransfer_Wait123Scanlines:
ld b, $7b
jr _continue_HDMATransfer
-
HDMATransfer_Wait127Scanlines:
ld b, $7f
_continue_HDMATransfer:
@@ -396,7 +394,6 @@ _continue_HDMATransfer:
ret
-
_LoadHDMAParameters:
ld a, h
ld [rHDMA1], a
@@ -453,7 +450,6 @@ PadMapForHDMATransfer:
ld [hMapObjectIndexBuffer], a
ret
-
_Get2bpp::
; 2bpp when [rLCDC] & $80
; switch to WRAM bank 6
diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm
index 9be8428a9..64190083d 100644
--- a/engine/gfx/load_pics.asm
+++ b/engine/gfx/load_pics.asm
@@ -158,7 +158,6 @@ GetAnimatedEnemyFrontpic:
ld de, wDecompressEnemyFrontpic + 7 * 7 tiles
ld c, 7 * 7
.got_dims
-
push hl
push bc
call LoadFrontpicTiles
@@ -418,39 +417,39 @@ PadFrontpic:
jr z, .five
.seven_loop
- ld c, $70
+ ld c, 7 << 4
call LoadOrientedFrontpic
dec b
jr nz, .seven_loop
ret
.six
- ld c, $70
+ ld c, 7 << 4
xor a
call .Fill
.six_loop
- ld c, $10
+ ld c, (7 - 6) << 4
xor a
call .Fill
- ld c, $60
+ ld c, 6 << 4
call LoadOrientedFrontpic
dec b
jr nz, .six_loop
ret
.five
- ld c, $70
+ ld c, 7 << 4
xor a
call .Fill
.five_loop
- ld c, $20
+ ld c, (7 - 5) << 4
xor a
call .Fill
- ld c, $50
+ ld c, 5 << 4
call LoadOrientedFrontpic
dec b
jr nz, .five_loop
- ld c, $70
+ ld c, 7 << 4
xor a
call .Fill
ret
diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm
index 151f8bad5..5ae2fbf8b 100644
--- a/engine/gfx/mon_icons.asm
+++ b/engine/gfx/mon_icons.asm
@@ -33,7 +33,6 @@ LoadMenuMonIcon:
ld l, a
jp hl
-
.Jumptable:
dw PartyMenu_InitAnimatedMonIcon ; party menu
dw NamingScreen_InitAnimatedMonIcon ; naming screen
@@ -263,7 +262,6 @@ GetSpeciesIcon:
call GetIconGFX
ret
-
FlyFunction_GetMonIcon:
push de
ld a, [wd265]
@@ -449,7 +447,6 @@ ReadMonMenuIcon:
ld a, ICON_EGG
ret
-
INCLUDE "data/pokemon/menu_icons.asm"
INCLUDE "data/icon_pointers.asm"
diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm
index 362fe49cd..843e5cba4 100644
--- a/engine/gfx/pic_animation.asm
+++ b/engine/gfx/pic_animation.asm
@@ -79,7 +79,6 @@ PokeAnims:
.Egg1: pokeanim Setup, Play
.Egg2: pokeanim Idle, Play
-
AnimateFrontpic:
call AnimateMon_CheckIfPokemon
ret c
@@ -718,7 +717,6 @@ PokeAnim_ConvertAndApplyBitmask:
; db 36, 37, 38, 39, 40, 41
; db 43, 44, 45, 46, 47, 48
-
.GetStartCoord:
ld hl, wPokeAnimCoord
ld a, [hli]
diff --git a/engine/gfx/sprites.asm b/engine/gfx/sprites.asm
index 709f8aad7..1b22e5832 100644
--- a/engine/gfx/sprites.asm
+++ b/engine/gfx/sprites.asm
@@ -212,7 +212,6 @@ DeinitializeSprite:
ld [hl], $0
ret
-
DeinitializeAllSprites:
; Clear the index field of every struct in the wSpriteAnimationStructs array.
ld hl, wSpriteAnimationStructs
@@ -226,7 +225,6 @@ DeinitializeAllSprites:
jr nz, .loop
ret
-
UpdateAnimFrame:
call InitSpriteAnimBuffer ; init WRAM
call GetSpriteAnimFrame ; read from a memory array
@@ -411,7 +409,6 @@ _ReinitSpriteAnimFrame::
ld [hl], -1
ret
-
GetSpriteAnimFrame:
.loop
ld hl, SPRITEANIMSTRUCT_DURATION
@@ -532,7 +529,6 @@ Unreferenced_BrokenGetStdGraphics:
pop bc
ret
-
INCLUDE "data/sprite_anims/sequences.asm"
INCLUDE "engine/gfx/sprite_anims.asm"
@@ -541,7 +537,6 @@ INCLUDE "data/sprite_anims/framesets.asm"
INCLUDE "data/sprite_anims/oam.asm"
-
BrokenStdGFXPointers:
; tile count, bank, pointer
; (all pointers were dummied out to .deleted)
@@ -557,7 +552,6 @@ BrokenStdGFXPointers:
.deleted
-
Sprites_Cosine:
; a = d * cos(a * pi/32)
add %010000 ; cos(x) = sin(x + pi/2)
@@ -566,7 +560,6 @@ Sprites_Sine:
; a = d * sin(a * pi/32)
calc_sine_wave
-
AnimateEndOfExpBar:
ld a, [hSGB]
ld de, EndOfExpBarGFX
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm
index cf2071952..1439b2c6d 100644
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -11,7 +11,6 @@ _DoItemEffect::
rst JumpTable
ret
-
ItemEffects:
; entries correspond to item ids
dw PokeBallEffect ; MASTER_BALL
@@ -194,7 +193,6 @@ ItemEffects:
dw NoEffect ; RAINBOW_WING
dw NoEffect ; ITEM_B3
-
PokeBallEffect:
ld a, [wBattleMode]
dec a
@@ -486,8 +484,8 @@ PokeBallEffect:
ld de, wEnemyMonPP
ld bc, NUM_MOVES
call CopyBytes
-.Transformed:
+.Transformed:
ld a, [wEnemyMonSpecies]
ld [wWildMon], a
ld [wCurPartySpecies], a
@@ -562,8 +560,8 @@ PokeBallEffect:
ld a, FRIEND_BALL_HAPPINESS
ld [hl], a
-.SkipPartyMonFriendBall:
+.SkipPartyMonFriendBall:
ld hl, Text_AskNicknameNewlyCaughtMon
call PrintText
@@ -712,7 +710,6 @@ PokeBallEffect:
dec [hl]
ret
-
BallMultiplierFunctionTable:
; table of routines that increase or decrease the catch rate based on
; which ball is used in a certain situation.
@@ -1137,12 +1134,10 @@ TownMapEffect:
farcall PokegearMap
ret
-
BicycleEffect:
farcall BikeFunction
ret
-
EvoStoneEffect:
ld b, PARTYMENUACTION_EVO_STONE
call UseItem_SelectMon
@@ -1174,7 +1169,6 @@ EvoStoneEffect:
ld [wItemEffectSucceeded], a
ret
-
VitaminEffect:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
@@ -1218,13 +1212,11 @@ VitaminEffect:
jp UseDisposableItem
-
NoEffectMessage:
ld hl, WontHaveAnyEffectText
call PrintText
jp ClearPalettes
-
UpdateStatsAfterItem:
ld a, MON_MAXHP
call GetPartyParamLocation
@@ -1240,13 +1232,11 @@ RareCandy_StatBooster_ExitMenu:
ld [wItemEffectSucceeded], a
jp ClearPalettes
-
Text_StatRose:
; 's @ rose.
text_jump UnknownText_0x1c5b9a
db "@"
-
StatStrings:
dw .health
dw .attack
@@ -1260,7 +1250,6 @@ StatStrings:
.speed db "SPEED@"
.special db "SPECIAL@"
-
GetStatExpRelativePointer:
ld a, [wCurItem]
ld hl, Table_eeeb
@@ -1284,7 +1273,6 @@ Table_eeeb:
db CARBOS, MON_SPD_EXP - MON_STAT_EXP
db CALCIUM, MON_SPC_EXP - MON_STAT_EXP
-
RareCandy_StatBooster_GetParameters:
ld a, [wCurPartySpecies]
ld [wCurSpecies], a
@@ -1299,7 +1287,6 @@ RareCandy_StatBooster_GetParameters:
call GetNick
ret
-
RareCandyEffect:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
@@ -1390,7 +1377,6 @@ RareCandyEffect:
jp UseDisposableItem
-
HealPowderEffect:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
@@ -1411,7 +1397,6 @@ HealPowderEffect:
.asm_efc9
jp StatusHealer_Jumptable
-
StatusHealingEffect:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
@@ -1421,7 +1406,6 @@ FullyHealStatus:
call UseStatusHealer
jp StatusHealer_Jumptable
-
UseStatusHealer:
call IsMonFainted
ld a, $1
@@ -1529,7 +1513,6 @@ StatusHealer_Jumptable:
dw StatusHealer_NoEffect
dw StatusHealer_ExitMenu
-
RevivalHerbEffect:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
@@ -1547,7 +1530,6 @@ RevivalHerbEffect:
.asm_f0c5
jp StatusHealer_Jumptable
-
ReviveEffect:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
@@ -1556,7 +1538,6 @@ ReviveEffect:
call RevivePokemon
jp StatusHealer_Jumptable
-
RevivePokemon:
call IsMonFainted
ld a, 1
@@ -1603,7 +1584,6 @@ RevivePokemon:
ld a, 0
ret
-
FullRestoreEffect:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
@@ -1621,7 +1601,6 @@ FullRestoreEffect:
call .FullRestore
jp StatusHealer_Jumptable
-
.FullRestore:
xor a
ld [wLowHealthAlarm], a
@@ -1641,7 +1620,6 @@ FullRestoreEffect:
ld a, 0
ret
-
BitterBerryEffect:
ld hl, wPlayerSubStatus3
bit SUBSTATUS_CONFUSED, [hl]
@@ -1661,12 +1639,10 @@ BitterBerryEffect:
.done
jp StatusHealer_Jumptable
-
RestoreHPEffect:
call ItemRestoreHP
jp StatusHealer_Jumptable
-
EnergypowderEffect:
ld c, HAPPINESS_BITTERPOWDER
jr EnergypowderEnergyRootCommon
@@ -1688,7 +1664,6 @@ EnergypowderEnergyRootCommon:
.skip_happiness
jp StatusHealer_Jumptable
-
ItemRestoreHP:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
@@ -2090,7 +2065,6 @@ Softboiled_MilkDrinkFunction:
text_jump UnknownText_0x1c5bac
db "@"
-
EscapeRopeEffect:
xor a
ld [wItemEffectSucceeded], a
@@ -2101,7 +2075,6 @@ EscapeRopeEffect:
call z, UseDisposableItem
ret
-
SuperRepelEffect:
ld b, 200
jr UseRepel
@@ -2123,13 +2096,11 @@ UseRepel:
ld [wRepelEffect], a
jp UseItemText
-
TextJump_RepelUsedEarlierIsStillInEffect:
; The REPEL used earlier is still in effect.
text_jump Text_RepelUsedEarlierIsStillInEffect
db "@"
-
XAccuracyEffect:
ld hl, wPlayerSubStatus4
bit SUBSTATUS_X_ACCURACY, [hl]
@@ -2137,7 +2108,6 @@ XAccuracyEffect:
set SUBSTATUS_X_ACCURACY, [hl]
jp UseItemText
-
PokeDollEffect:
ld a, [wBattleMode]
dec a
@@ -2155,7 +2125,6 @@ PokeDollEffect:
ld [wItemEffectSucceeded], a
ret
-
GuardSpecEffect:
ld hl, wPlayerSubStatus4
bit SUBSTATUS_MIST, [hl]
@@ -2163,7 +2132,6 @@ GuardSpecEffect:
set SUBSTATUS_MIST, [hl]
jp UseItemText
-
DireHitEffect:
ld hl, wPlayerSubStatus4
bit SUBSTATUS_FOCUS_ENERGY, [hl]
@@ -2171,7 +2139,6 @@ DireHitEffect:
set SUBSTATUS_FOCUS_ENERGY, [hl]
jp UseItemText
-
XItemEffect:
call UseItemText
@@ -2206,7 +2173,6 @@ XItemEffect:
INCLUDE "data/items/x_stats.asm"
-
PokeFluteEffect:
ld a, [wBattleMode]
and a
@@ -2251,7 +2217,6 @@ PokeFluteEffect:
ld hl, .AllSleepingMonWokeUp
jp PrintText
-
.CureSleep:
ld de, PARTYMON_STRUCT_LENGTH
ld c, PARTY_LENGTH
@@ -2272,7 +2237,6 @@ PokeFluteEffect:
jr nz, .loop
ret
-
.CatchyTune:
; Played the # FLUTE. Now, that's a catchy tune!
text_jump UnknownText_0x1c5bf9
@@ -2300,7 +2264,6 @@ PokeFluteEffect:
.battle
jp PokeFluteTerminatorCharacter
-
BlueCardEffect:
ld hl, .bluecardtext
jp MenuTextBoxWaitButton
@@ -2309,7 +2272,6 @@ BlueCardEffect:
text_jump UnknownText_0x1c5c5e
db "@"
-
CoinCaseEffect:
ld hl, .coincasetext
jp MenuTextBoxWaitButton
@@ -2318,7 +2280,6 @@ CoinCaseEffect:
text_jump UnknownText_0x1c5c7b
db "@"
-
OldRodEffect:
ld e, $0
jr UseRod
@@ -2335,12 +2296,10 @@ UseRod:
farcall FishFunction
ret
-
ItemfinderEffect:
farcall ItemFinder
ret
-
RestorePPEffect:
ld a, [wCurItem]
ld [wd002], a
@@ -2596,22 +2555,18 @@ UnknownText_0xf739:
text_jump UnknownText_0x1c5cf1
db "@"
-
SquirtbottleEffect:
farcall _Squirtbottle
ret
-
CardKeyEffect:
farcall _CardKey
ret
-
BasementKeyEffect:
farcall _BasementKey
ret
-
SacredAshEffect:
farcall _SacredAsh
ld a, [wItemEffectSucceeded]
@@ -2620,7 +2575,6 @@ SacredAshEffect:
call UseDisposableItem
ret
-
NormalBoxEffect:
ld c, DECOFLAG_SILVER_TROPHY_DOLL
jr OpenBox
@@ -2643,7 +2597,6 @@ OpenBox:
NoEffect:
jp IsntTheTimeMessage
-
Play_SFX_FULL_HEAL:
push de
ld de, SFX_FULL_HEAL
@@ -2796,7 +2749,6 @@ GotOffTheItemText:
text_jump UnknownText_0x1c5e90
db "@"
-
ApplyPPUp:
ld a, MON_MOVES
call GetPartyParamLocation
@@ -2832,8 +2784,6 @@ ApplyPPUp:
inc de
jr .loop
-
-
ComputeMaxPP:
push bc
; Divide the base PP by 5.
@@ -2918,7 +2868,6 @@ RestoreAllPP:
jr nz, .loop
ret
-
GetMaxPPOfMove:
ld a, [wStringBuffer1 + 0]
push af
diff --git a/engine/items/mart.asm b/engine/items/mart.asm
index a683a4b44..7e185662b 100644
--- a/engine/items/mart.asm
+++ b/engine/items/mart.asm
@@ -331,7 +331,6 @@ ReadMart:
INCLUDE "data/items/bargain_shop.asm"
-
BuyMenu:
call FadeToMenu
farcall BlankScreen
@@ -425,7 +424,6 @@ GetMartDialogGroup:
dw Text_Pharmacy_HereYouGo
dw BuyMenuLoop
-
BuyMenuLoop:
farcall PlaceMoneyTopRight
call UpdateSprites
@@ -581,7 +579,6 @@ RooftopSaleAskPurchaseQuantity:
ld d, [hl]
ret
-
Text_Mart_HowMany:
; How many?
text_jump UnknownText_0x1c4bfd
@@ -730,7 +727,6 @@ Text_Pharmacist_ComeAgain:
text_jump UnknownText_0x1c4ef6
db "@"
-
SellMenu:
call DisableSpriteUpdates
farcall DepositSellInitPackBuffers
@@ -758,7 +754,6 @@ SellMenu:
text_jump UnknownText_0x1c4f12
db "@"
-
.TryToSellItem:
farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
@@ -778,7 +773,6 @@ SellMenu:
.cant_buy
ret
-
.try_sell
farcall _CheckTossableItem
ld a, [wItemAttributeParamBuffer]
diff --git a/engine/items/pack.asm b/engine/items/pack.asm
index d20d54111..67e9fe900 100644
--- a/engine/items/pack.asm
+++ b/engine/items/pack.asm
@@ -38,7 +38,6 @@ Pack:
call Pack_GetJumptablePointer
jp hl
-
.Jumptable:
; entries correspond to PACKSTATE_* constants
dw .InitGFX ; 0
@@ -174,7 +173,6 @@ Pack:
dw .UseItem
dw QuitItemSubmenu
-
.MenuHeader2:
db MENU_BACKUP_TILES ; flags
menu_coords 13, 5, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
@@ -424,7 +422,6 @@ Jumptable_GiveTossQuit:
dw TossMenu
dw QuitItemSubmenu
-
UseItem:
farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
@@ -651,7 +648,6 @@ BattlePack:
call Pack_GetJumptablePointer
jp hl
-
.Jumptable:
; entries correspond to PACKSTATE_* constants
dw .InitGFX ; 0
@@ -943,7 +939,6 @@ DepositSellPack:
call Pack_GetJumptablePointer
jp hl
-
.Jumptable:
; entries correspond to *_POCKET constants
dw .ItemsPocket
@@ -1088,7 +1083,6 @@ TutorialPack:
call Pack_GetJumptablePointer
jp hl
-
.dw
; entries correspond to *_POCKET constants
dw .Items
diff --git a/engine/items/print_item_description.asm b/engine/items/print_item_description.asm
index b6ab6c957..b0a3a0b33 100644
--- a/engine/items/print_item_description.asm
+++ b/engine/items/print_item_description.asm
@@ -28,3 +28,5 @@ PrintItemDescription:
ld d, [hl]
pop hl
jp PlaceString
+
+INCLUDE "data/items/descriptions.asm"
diff --git a/engine/items/switch_items.asm b/engine/items/switch_items.asm
index b5fa0f178..81b5ac6a5 100644
--- a/engine/items/switch_items.asm
+++ b/engine/items/switch_items.asm
@@ -239,7 +239,6 @@ ItemSwitch_ConvertSpacingToDW:
pop hl
ret
-
.spacing_dws
dw 0, 1, 2
diff --git a/engine/items/tmhm2.asm b/engine/items/tmhm2.asm
index bb98d8ab8..10206d36b 100644
--- a/engine/items/tmhm2.asm
+++ b/engine/items/tmhm2.asm
@@ -43,5 +43,4 @@ GetTMHMMove:
ld [wd265], a
ret
-
INCLUDE "data/moves/tmhm_moves.asm"
diff --git a/engine/link/link.asm b/engine/link/link.asm
index a8d61d3e8..d72abb0a5 100644
--- a/engine/link/link.asm
+++ b/engine/link/link.asm
@@ -1112,10 +1112,8 @@ TimeCapsule_ReplaceTeruSama:
pop hl
ret
-
INCLUDE "data/items/catch_rate_items.asm"
-
Link_CopyOTData:
.loop
ld a, [hli]
@@ -1489,7 +1487,6 @@ Function28926:
call DelayFrames
jp InitTradeMenuDisplay
-
.Text_CantTradeLastMon:
; If you trade that #MON, you won't be able to battle.
text_jump UnknownText_0x1c41b1
@@ -1503,7 +1500,6 @@ Function28926:
text_jump UnknownText_0x1c41e6
db "@"
-
Function28ac9:
ld a, [wMenuCursorY]
cp 1
@@ -1964,7 +1960,6 @@ String_TooBadTheTradeWasCanceled:
db "Too bad! The trade"
next "was canceled!@"
-
LinkTextboxAtHL:
ld d, h
ld e, l
diff --git a/engine/link/link_trade.asm b/engine/link/link_trade.asm
index 2e584fe4c..a3c596bfe 100644
--- a/engine/link/link_trade.asm
+++ b/engine/link/link_trade.asm
@@ -126,7 +126,6 @@ _LoadTradeScreenBorder:
call __LoadTradeScreenBorder
ret
-
LinkComms_LoadPleaseWaitTextboxBorderGFX:
ld de, LinkCommsBorderGFX + $30 tiles
ld hl, vTiles2 tile $76
diff --git a/engine/link/mystery_gift.asm b/engine/link/mystery_gift.asm
index 8ac734af6..0a5dfcec3 100644
--- a/engine/link/mystery_gift.asm
+++ b/engine/link/mystery_gift.asm
@@ -1168,7 +1168,6 @@ Function1050c8:
.okay
jp CloseSRAM
-
BackupMysteryGift:
call GetMysteryGiftBank
ld hl, sMysteryGiftItem
@@ -1180,7 +1179,6 @@ BackupMysteryGift:
ld [de], a
jp CloseSRAM
-
RestoreMysteryGift:
call GetMysteryGiftBank
ld hl, sBackupMysteryGiftItem
@@ -1202,12 +1200,10 @@ MysteryGift_ClearTrainerData:
jr nz, .loop
ret
-
GetMysteryGiftBank:
ld a, BANK(sBackupMysteryGiftItem)
jp GetSRAMBank
-
StagePartyDataForMysteryGift:
; You will be sending this data to your mystery gift partner.
; Structure is the same as a trainer with species and moves
@@ -1493,7 +1489,6 @@ String_PressAToLink_BToCancel_JP:
next "つうしん<WO>ちゅうし します"
db "@"
-
Text_ReceivedCard:
text_jump UnknownText_0x1c051a
db "@"
diff --git a/engine/link/mystery_gift_2.asm b/engine/link/mystery_gift_2.asm
index a2ce60678..c1b258724 100644
--- a/engine/link/mystery_gift_2.asm
+++ b/engine/link/mystery_gift_2.asm
@@ -145,7 +145,6 @@ MysteryGiftFallbackItem:
ld c, DECO_POLKADOT_BED ; GREAT_BALL
ret
-
INCLUDE "data/items/mystery_gift_items.asm"
INCLUDE "data/decorations/mystery_gift_decos.asm"
diff --git a/engine/link/time_capsule_2.asm b/engine/link/time_capsule_2.asm
index 4300105c6..be7027f34 100644
--- a/engine/link/time_capsule_2.asm
+++ b/engine/link/time_capsule_2.asm
@@ -33,5 +33,4 @@ ConvertMon_1to2:
pop bc
ret
-
INCLUDE "data/pokemon/gen1_order.asm"
diff --git a/engine/math/math.asm b/engine/math/math.asm
index 4240ef6cd..c2e5f70a3 100644
--- a/engine/math/math.asm
+++ b/engine/math/math.asm
@@ -1,5 +1,4 @@
_Multiply::
-
; hMultiplier is one byte.
ld a, 8
ld b, a
@@ -11,7 +10,6 @@ _Multiply::
ld [hMathBuffer + 3], a
ld [hMathBuffer + 4], a
-
.loop
ld a, [hMultiplier]
srl a
@@ -46,7 +44,6 @@ _Multiply::
dec b
jr z, .done
-
; hMultiplicand <<= 1
ld a, [hMultiplicand + 2]
@@ -67,7 +64,6 @@ _Multiply::
jr .loop
-
.done
ld a, [hMathBuffer + 4]
ld [hProduct + 3], a
@@ -83,7 +79,6 @@ _Multiply::
ret
-
_Divide::
xor a
ld [hMathBuffer + 0], a
diff --git a/engine/menus/debug.asm b/engine/menus/debug.asm
index d10d8b7b1..a48322488 100644
--- a/engine/menus/debug.asm
+++ b/engine/menus/debug.asm
@@ -1034,7 +1034,6 @@ String_81fcd:
DebugColorTestGFX:
INCBIN "gfx/debug/color_test.2bpp"
-
TilesetColorTest:
ret
xor a
@@ -1148,7 +1147,6 @@ Function8220f:
ld [rSVBK], a
ret
-
Function82236:
ld hl, hJoyLast
ld a, [hl]
diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm
index 1bdf8b02f..9652dd73e 100644
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -94,7 +94,6 @@ ResetWRAM:
ret
_ResetWRAM:
-
ld hl, wVirtualOAM
ld bc, wOptions - wVirtualOAM
xor a
@@ -549,7 +548,6 @@ Continue_LoadMenuHeader:
db " @"
db "TIME@"
-
Continue_DisplayBadgesDexPlayerName:
call MenuBoxCoord2Tile
push hl
@@ -626,7 +624,6 @@ Continue_DisplayGameTime:
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
jp PrintNum
-
OakSpeech:
farcall InitClock
call RotateFourPalettesLeft
@@ -803,7 +800,6 @@ StorePlayerName:
ret
ShrinkPlayer:
-
ld a, [hROMBank]
push af
@@ -913,7 +909,6 @@ ShrinkFrame:
ret
Intro_PlacePlayerSprite:
-
farcall GetPlayerIcon
ld c, $c
ld hl, vTiles0
@@ -957,7 +952,6 @@ Intro_PlacePlayerSprite:
db 10 * 8 + 4, 9 * 8, 2
db 10 * 8 + 4, 10 * 8, 3
-
CrystalIntroSequence:
callfar Copyright_GFPresents
jr c, StartTitleScreen
@@ -1018,7 +1012,6 @@ StartTitleScreen:
dw CrystalIntroSequence
dw ResetClock
-
.TitleScreen:
farcall _TitleScreen
ret
@@ -1070,9 +1063,7 @@ TitleScreenScene:
inc [hl]
ret
-
TitleScreenEntrance:
-
; Animate the logo:
; Move each line by 4 pixels until our count hits 0.
ld a, [hSCX]
@@ -1119,9 +1110,7 @@ TitleScreenEntrance:
ld [hWY], a
ret
-
TitleScreenTimer:
-
; Next scene
ld hl, wJumptableIndex
inc [hl]
@@ -1135,7 +1124,6 @@ TitleScreenTimer:
ret
TitleScreenMain:
-
; Run the timer down.
ld hl, wTitleScreenTimer
ld e, [hl]
@@ -1236,7 +1224,6 @@ TitleScreenMain:
ret
TitleScreenEnd:
-
; Wait until the music is done fading.
ld hl, wTitleScreenTimer
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index 87823228d..d6afda483 100644
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -139,7 +139,6 @@ StudiumMenu:
db MOBILE_STUDIUM
db -1
-
MainMenu_GetWhichMenu:
nop
nop
@@ -231,7 +230,6 @@ MainMenu_PrintCurrentTimeAndDay:
ld [hBGMapMode], a
ret
-
.PlaceBox:
call CheckRTCStatus
and $80
@@ -246,7 +244,6 @@ MainMenu_PrintCurrentTimeAndDay:
call SpeechTextBox
ret
-
.PlaceTime:
ld a, [wSaveFileExists]
and a
@@ -323,7 +320,6 @@ Function49ed0:
call ClearWindowData
ret
-
MainMenu_NewGame:
farcall NewGame
ret
diff --git a/engine/menus/menu.asm b/engine/menus/menu.asm
index 5f2864ea3..c9ce72b13 100644
--- a/engine/menus/menu.asm
+++ b/engine/menus/menu.asm
@@ -55,8 +55,6 @@ _InterpretMobileMenu::
and a
ret
-
-
Draw2DMenu:
xor a
ld [hBGMapMode], a
@@ -158,7 +156,6 @@ Place2DMenuItemStrings:
rst FarCall
ret
-
Init2DMenuCursorPosition:
call GetMenuTextStartCoord
ld a, b
@@ -247,7 +244,6 @@ Init2DMenuCursorPosition:
ld [wMenuJoypadFilter], a
ret
-
_StaticMenuJoypad::
call Place2DMenuCursor
_ScrollingMenuJoypad::
@@ -276,7 +272,6 @@ MobileMenuJoypad:
ld c, a
ret
-
Unreferenced_Function241d5:
call Place2DMenuCursor
.loop
@@ -315,7 +310,6 @@ Unreferenced_Function241d5:
and a
ret
-
MenuJoypadLoop:
.loop
call Move2DMenuCursor
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index f269e32ad..8a8303067 100644
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -10,7 +10,6 @@ _NamingScreen:
call ReturnToMapWithSpeechTextbox
ret
-
NamingScreen:
ld hl, wNamingScreenDestinationPointer
ld [hl], e
@@ -44,7 +43,6 @@ NamingScreen:
call ClearJoypad
ret
-
.SetUpNamingScreen:
call ClearBGPalettes
ld b, SCGB_DIPLOMA
@@ -61,7 +59,6 @@ NamingScreen:
call NamingScreen_InitNameEntry
ret
-
.GetNamingScreenSetup:
ld a, [wNamingScreenType]
and 7
@@ -75,7 +72,6 @@ NamingScreen:
ld l, a
jp hl
-
.Jumptable:
dw .Pokemon
dw .Player
@@ -117,12 +113,10 @@ NamingScreen:
call .StoreMonIconParams
ret
-
.NicknameStrings:
db "'S@"
db "NICKNAME?@"
-
.Player:
farcall GetPlayerIcon
call .LoadSprite
@@ -132,11 +126,9 @@ NamingScreen:
call .StoreSpriteIconParams
ret
-
.PlayerNameString:
db "YOUR NAME?@"
-
.Rival:
ld de, SilverSpriteGFX
ld b, BANK(SilverSpriteGFX)
@@ -147,11 +139,9 @@ NamingScreen:
call .StoreSpriteIconParams
ret
-
.RivalNameString:
db "RIVAL'S NAME?@"
-
.Mom:
ld de, MomSpriteGFX
ld b, BANK(MomSpriteGFX)
@@ -162,11 +152,9 @@ NamingScreen:
call .StoreSpriteIconParams
ret
-
.MomNameString:
db "MOTHER'S NAME?@"
-
.Box:
ld de, PokeBallSpriteGFX
ld hl, vTiles0 tile $00
@@ -188,11 +176,9 @@ NamingScreen:
call .StoreBoxIconParams
ret
-
.BoxNameString:
db "BOX NAME?@"
-
.Tomodachi:
hlcoord 3, 2
ld de, .oTomodachi_no_namae_sutoringu
@@ -200,11 +186,9 @@ NamingScreen:
call .StoreSpriteIconParams
ret
-
.oTomodachi_no_namae_sutoringu
db "おともだち の なまえは?@"
-
.LoadSprite:
push de
ld hl, vTiles0 tile $00
@@ -271,7 +255,6 @@ NamingScreen_IsTargetBox:
pop bc
ret
-
NamingScreen_InitText:
call WaitTop
hlcoord 0, 0
@@ -333,7 +316,6 @@ NamingScreen_ApplyTextInputMode:
jr nz, .row
ret
-
NamingScreenJoypadLoop:
call JoyTextDelay
ld a, [wJumptableIndex]
@@ -355,7 +337,6 @@ NamingScreenJoypadLoop:
scf
ret
-
.UpdateStringEntry:
xor a
ld [hBGMapMode], a
@@ -380,7 +361,6 @@ NamingScreenJoypadLoop:
ld [hBGMapMode], a
ret
-
.RunJumptable:
ld a, [wJumptableIndex]
ld e, a
@@ -393,7 +373,6 @@ NamingScreenJoypadLoop:
ld l, a
jp hl
-
.Jumptable:
dw .InitCursor
dw .ReadButtons
@@ -569,14 +548,12 @@ NamingScreen_AnimateCursor:
ld [hl], a
ret
-
.LetterEntries:
db $00, $10, $20, $30, $40, $50, $60, $70, $80
.CaseDelEnd:
db $00, $00, $00, $30, $30, $30, $60, $60, $60
-
.GetDPad:
ld hl, hJoyLast
ld a, [hl]
@@ -720,7 +697,6 @@ NamingScreen_AdvanceCursor_CheckEndOfString:
scf
ret
-
; unused
ld a, [wNamingScreenCurrNameLength]
and a
@@ -745,10 +721,8 @@ NamingScreen_AdvanceCursor_CheckEndOfString:
ld a, [hl]
jr NamingScreen_LoadNextCharacter
-
INCLUDE "data/text/unused_dakutens.asm"
-
NamingScreen_DeleteCharacter:
ld hl, wNamingScreenCurrNameLength
ld a, [hl]
@@ -777,7 +751,6 @@ NamingScreen_GetTextCursorPosition:
pop af
ret
-
NamingScreen_InitNameEntry:
; load NAMINGSCREEN_UNDERLINE, (NAMINGSCREEN_MIDDLELINE * [wNamingScreenMaxNameLength]), "@" into the dw address at wNamingScreenDestinationPointer
ld hl, wNamingScreenDestinationPointer
@@ -797,7 +770,6 @@ NamingScreen_InitNameEntry:
ld [hl], "@"
ret
-
NamingScreen_StoreEntry:
ld hl, wNamingScreenDestinationPointer
ld a, [hli]
@@ -907,7 +879,6 @@ LoadNamingScreenGFX:
ld [hWX], a
ret
-
NamingScreenGFX_Border:
INCBIN "gfx/naming_screen/border.2bpp"
@@ -995,7 +966,6 @@ _ComposeMailMessage:
ld [hl], "<NEXT>"
ret
-
.MailIcon:
INCBIN "gfx/icons/mail_big.2bpp"
@@ -1004,11 +974,9 @@ INCBIN "gfx/icons/mail_big.2bpp"
ld [wNamingScreenMaxNameLength], a
ret
-
.UnusedString11f7a:
db "メールを かいてね@"
-
.InitCharset:
call WaitTop
hlcoord 0, 0
@@ -1235,14 +1203,12 @@ ComposeMail_AnimateCursor:
ld [hl], a
ret
-
.LetterEntries:
db $00, $10, $20, $30, $40, $50, $60, $70, $80, $90
.CaseDelEnd:
db $00, $00, $00, $30, $30, $30, $60, $60, $60, $60
-
.GetDPad:
ld hl, hJoyLast
ld a, [hl]
@@ -1383,7 +1349,6 @@ MailComposition_TryAddLastCharacter:
ld a, [wNamingScreenLastCharacter]
jp MailComposition_TryAddCharacter
-
; unused
ld a, [wNamingScreenCurrNameLength]
and a
@@ -1418,6 +1383,4 @@ MailComposition_TryAddLastCharacter:
ld a, [hl]
jp NamingScreen_LoadNextCharacter
-
INCLUDE "data/text/mail_input_chars.asm"
-
diff --git a/engine/menus/options_menu.asm b/engine/menus/options_menu.asm
index 071872068..46fa33621 100644
--- a/engine/menus/options_menu.asm
+++ b/engine/menus/options_menu.asm
@@ -77,7 +77,6 @@ StringOptions:
db " :TYPE<LNBRK>"
db "CANCEL@"
-
GetOptionPointer:
ld a, [wJumptableIndex] ; load the cursor position to a
ld e, a ; copy it to de
@@ -100,7 +99,6 @@ GetOptionPointer:
dw Options_Frame
dw Options_Cancel
-
const_def
const OPT_TEXT_SPEED_FAST ; 0
const OPT_TEXT_SPEED_MED ; 1
@@ -163,7 +161,6 @@ Options_TextSpeed:
.Mid: db "MID @"
.Slow: db "SLOW@"
-
GetTextSpeed:
; converts TEXT_DELAY_* value in a to OPT_TEXT_SPEED_* value in c,
; with previous/next TEXT_DELAY_* values in d/e
@@ -188,7 +185,6 @@ GetTextSpeed:
lb de, TEXT_DELAY_SLOW, TEXT_DELAY_MED
ret
-
Options_BattleScene:
ld hl, wOptions
ld a, [hJoyPressed]
@@ -228,7 +224,6 @@ Options_BattleScene:
.On: db "ON @"
.Off: db "OFF@"
-
Options_BattleStyle:
ld hl, wOptions
ld a, [hJoyPressed]
@@ -267,7 +262,6 @@ Options_BattleStyle:
.Shift: db "SHIFT@"
.Set: db "SET @"
-
Options_Sound:
ld hl, wOptions
ld a, [hJoyPressed]
@@ -313,7 +307,6 @@ Options_Sound:
.Mono: db "MONO @"
.Stereo: db "STEREO@"
-
const_def
const OPT_PRINT_LIGHTEST ; 0
const OPT_PRINT_LIGHTER ; 1
@@ -379,7 +372,6 @@ Options_Print:
.Darker: db "DARKER @"
.Darkest: db "DARKEST @"
-
GetPrinterSetting:
; converts GBPRINTER_* value in a to OPT_PRINT_* value in c,
; with previous/next GBPRINTER_* values in d/e
@@ -455,7 +447,6 @@ Options_MenuAccount:
.Off: db "OFF@"
.On: db "ON @"
-
Options_Frame:
ld hl, wTextBoxFrame
ld a, [hJoyPressed]
diff --git a/engine/menus/save.asm b/engine/menus/save.asm
index 903d9db04..469c55abd 100644
--- a/engine/menus/save.asm
+++ b/engine/menus/save.asm
@@ -36,7 +36,6 @@ SaveAfterLinkTrade:
call ResumeGameLogic
ret
-
ChangeBoxSaveGame:
push de
ld hl, Text_SaveOnBoxSwitch
@@ -143,7 +142,6 @@ ResumeGameLogic:
ld [wGameLogicPaused], a
ret
-
AddHallOfFameEntry:
ld a, BANK(sHallOfFame)
call GetSRAMBank
@@ -254,7 +252,6 @@ SavedTheGame:
call DelayFrames
ret
-
SaveGameData_:
ld a, 1
ld [wSaveFileExists], a
@@ -349,7 +346,6 @@ SavingDontTurnOffThePower:
call DelayFrames
ret
-
ErasePreviousSave:
call EraseBoxes
call EraseHallOfFame
@@ -458,7 +454,6 @@ Unreferenced_Function14d93:
call CloseSRAM
ret
-
HallOfFame_InitSaveIfNeeded:
ld a, [wSavedAtLeastOnce]
and a
@@ -585,7 +580,6 @@ SaveBackupChecksum:
call CloseSRAM
ret
-
TryLoadSaveFile:
call VerifyChecksum
jr nz, .backup
@@ -632,7 +626,6 @@ TryLoadSaveFile:
scf
ret
-
TryLoadSaveData:
xor a
ld [wSaveFileExists], a
@@ -681,10 +674,8 @@ TryLoadSaveData:
call PanicResetClock
ret
-
INCLUDE "data/default_options.asm"
-
CheckPrimarySaveFile:
ld a, BANK(sCheckValue1) ; BANK(sCheckValue2)
call GetSRAMBank
@@ -726,7 +717,6 @@ CheckBackupSaveFile:
call CloseSRAM
ret
-
LoadPlayerData:
ld a, BANK(sPlayerData)
call GetSRAMBank
@@ -823,7 +813,6 @@ VerifyBackupChecksum:
pop af
ret
-
_SaveData:
; This is called within two scenarios:
; a) ErasePreviousSave (the process of erasing the save from a previous game file)
@@ -850,7 +839,6 @@ _SaveData:
jp CloseSRAM
-
_LoadData:
ld a, BANK(sCrystalData)
call GetSRAMBank
@@ -870,7 +858,6 @@ _LoadData:
jp CloseSRAM
-
GetBoxAddress:
ld a, [wCurBox]
cp NUM_BOXES
@@ -972,7 +959,6 @@ SaveBoxAddress:
pop hl
ret
-
LoadBoxAddress:
; Load box via wBoxPartialData.
; We do this in three steps because the size of wBoxPartialData is less than
@@ -1036,7 +1022,6 @@ LoadBoxAddress:
pop hl
ret
-
EraseBoxes:
ld hl, BoxAddresses
ld c, NUM_BOXES
@@ -1095,7 +1080,6 @@ BoxAddresses:
dbww BANK(sBox13), sBox13, sBox13End
dbww BANK(sBox14), sBox14, sBox14End
-
Checksum:
ld de, 0
.loop
@@ -1111,7 +1095,6 @@ Checksum:
jr nz, .loop
ret
-
Text_WouldYouLikeToSaveTheGame:
; Would you like to save the game?
text_jump UnknownText_0x1c454b
diff --git a/engine/menus/start_menu.asm b/engine/menus/start_menu.asm
index 9cff1cb70..108a4edf6 100644
--- a/engine/menus/start_menu.asm
+++ b/engine/menus/start_menu.asm
@@ -10,9 +10,7 @@
const STARTMENUITEM_POKEGEAR ; 7
const STARTMENUITEM_QUIT ; 8
-
StartMenu::
-
call ClearWindowData
ld de, SFX_MENU
@@ -25,8 +23,8 @@ StartMenu::
ld hl, .MenuHeader
jr z, .GotMenuData
ld hl, .ContestMenuHeader
-.GotMenuData:
+.GotMenuData:
call LoadMenuHeader
call .SetUpMenuItems
ld a, [wBattleMenuCursorBuffer]
@@ -157,7 +155,6 @@ StartMenu::
call FinishExitMenu
ret
-
.MenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 10, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
@@ -235,7 +232,6 @@ StartMenu::
db "Quit and"
next "be judged.@"
-
.OpenMenu:
ld a, [wMenuSelection]
call .GetMenuAccountTextPointer
@@ -276,7 +272,6 @@ endr
pop de
ret
-
.GetMenuAccountTextPointer:
ld e, a
ld d, 0
@@ -289,7 +284,6 @@ rept 6
endr
ret
-
.SetUpMenuItems:
xor a
ld [wWhichIndexSet], a
@@ -349,7 +343,6 @@ endr
ld [wMenuItemsList], a
ret
-
.FillMenuList:
xor a
ld hl, wMenuItemsList
@@ -409,14 +402,12 @@ endr
farcall StartMenu_PrintBugContestStatus
ret
-
StartMenu_Exit:
; Exit the menu.
ld a, 1
ret
-
StartMenu_Quit:
; Retire from the bug catching contest.
@@ -437,7 +428,6 @@ StartMenu_Quit:
text_jump UnknownText_0x1c1a6c
db "@"
-
StartMenu_Save:
; Save the game.
@@ -450,7 +440,6 @@ StartMenu_Save:
ld a, 1
ret
-
StartMenu_Option:
; Game options.
@@ -459,7 +448,6 @@ StartMenu_Option:
ld a, 6
ret
-
StartMenu_Status:
; Player status.
@@ -469,9 +457,7 @@ StartMenu_Status:
ld a, 0
ret
-
StartMenu_Pokedex:
-
ld a, [wPartyCount]
and a
jr z, .asm_12949
@@ -484,18 +470,14 @@ StartMenu_Pokedex:
ld a, 0
ret
-
StartMenu_Pokegear:
-
call FadeToMenu
farcall PokeGear
call CloseSubmenu
ld a, 0
ret
-
StartMenu_Pack:
-
call FadeToMenu
farcall Pack
ld a, [wPackUsedItem]
@@ -510,9 +492,7 @@ StartMenu_Pack:
ld a, 4
ret
-
StartMenu_Pokemon:
-
ld a, [wPartyCount]
and a
jr z, .return
@@ -657,7 +637,6 @@ CantUseItemText:
text_jump UnknownText_0x1c1b03
db "@"
-
PartyMonItemName:
ld a, [wCurItem]
ld [wd265], a
@@ -665,14 +644,12 @@ PartyMonItemName:
call CopyName1
ret
-
CancelPokemonAction:
farcall InitPartyMenuWithCancel
farcall UnfreezeMonIcons
ld a, 1
ret
-
PokemonActionSubmenu:
hlcoord 1, 15
lb bc, 2, 18
@@ -717,9 +694,7 @@ PokemonActionSubmenu:
dbw MONMENUITEM_MOVE, ManagePokemonMoves
dbw MONMENUITEM_MAIL, MonMailAction
-
SwitchPartyMons:
-
; Don't try if there's nothing to switch!
ld a, [wPartyCount]
cp 2
@@ -769,9 +744,7 @@ SwitchPartyMons:
call CancelPokemonAction
ret
-
GiveTakePartyMonItem:
-
; Eggs can't hold items!
ld a, [wCurPartySpecies]
cp EGG
@@ -810,9 +783,7 @@ GiveTakePartyMonItem:
ld a, 3
ret
-
.GiveItem:
-
farcall DepositSellInitPackBuffers
.loop
@@ -842,9 +813,7 @@ GiveTakePartyMonItem:
.quit
ret
-
TryGiveItemToPartymon:
-
call SpeechTextBox
call PartyMonItemName
call GetPartyItemLocation
@@ -906,9 +875,7 @@ TryGiveItemToPartymon:
.abort
ret
-
GivePartyItem:
-
call GetPartyItemLocation
ld a, [wCurItem]
ld [hl], a
@@ -920,9 +887,7 @@ GivePartyItem:
.done
ret
-
TakePartyItem:
-
call SpeechTextBox
call GetPartyItemLocation
ld a, [hl]
@@ -955,7 +920,6 @@ TakePartyItem:
.asm_12c9a
ret
-
GiveTakeItemMenuData:
db MENU_SPRITE_ANIMS | MENU_BACKUP_TILES ; flags
menu_coords 12, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
@@ -968,7 +932,6 @@ GiveTakeItemMenuData:
db "GIVE@"
db "TAKE@"
-
TookAndMadeHoldText:
text_jump UnknownText_0x1c1b2c
db "@"
@@ -1001,7 +964,6 @@ CantBeHeldText:
text_jump UnknownText_0x1c1c09
db "@"
-
GetPartyItemLocation:
push af
ld a, MON_ITEM
@@ -1009,14 +971,12 @@ GetPartyItemLocation:
pop af
ret
-
ReceiveItemFromPokemon:
ld a, 1
ld [wItemQuantityChangeBuffer], a
ld hl, wNumItems
jp ReceiveItem
-
GiveItemToPokemon:
ld a, 1
ld [wItemQuantityChangeBuffer], a
@@ -1028,7 +988,6 @@ StartMenuYesNo:
call YesNoBox
jp ExitMenu
-
ComposeMailMessage:
ld de, wTempMailMessage
farcall _ComposeMailMessage
@@ -1130,7 +1089,6 @@ MonMailAction:
ld a, $3
ret
-
.MenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 12, 10, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
@@ -1144,7 +1102,6 @@ MonMailAction:
db "TAKE@"
db "QUIT@"
-
.mailwilllosemessagetext
; The MAIL will lose its message. OK?
text_jump UnknownText_0x1c1c22
@@ -1175,7 +1132,6 @@ MonMailAction:
text_jump UnknownText_0x1c1cc4
db "@"
-
OpenPartyStats:
call LoadStandardMenuHeader
call ClearSprites
@@ -1189,7 +1145,6 @@ OpenPartyStats:
ld a, 0
ret
-
MonMenu_Cut:
farcall CutFunction
ld a, [wFieldMoveSucceeded]
@@ -1203,7 +1158,6 @@ MonMenu_Cut:
ld a, $3
ret
-
MonMenu_Fly:
farcall FlyFunction
ld a, [wFieldMoveSucceeded]
diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm
index 7a0249b61..f48636f67 100644
--- a/engine/menus/trainer_card.asm
+++ b/engine/menus/trainer_card.asm
@@ -136,7 +136,6 @@ TrainerCard_Page1_Joypad:
ld [wJumptableIndex], a
ret
-
TrainerCard_Page2_LoadGFX:
call ClearSprites
hlcoord 0, 8
@@ -256,7 +255,6 @@ TrainerCard_PrintTopHalfOfCard:
predef PlaceGraphic
ret
-
.Name_Money:
db "NAME/"
next ""
@@ -334,7 +332,6 @@ endr
call TrainerCard_Page2_3_OAMUpdate
ret
-
.BadgesTilemap:
db $79, $7a, $7b, $7c, $7d, -1 ; "BADGES"
@@ -540,7 +537,6 @@ TrainerCard_Page2_3_OAMUpdate:
inc de
jr .loop2
-
.facing1
dsprite 0, 0, 0, 0, $00, 0
dsprite 0, 0, 1, 0, $01, 0
diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm
index e8d880816..97828ab58 100644
--- a/engine/movie/credits.asm
+++ b/engine/movie/credits.asm
@@ -221,7 +221,6 @@ Credits_LYOverride:
jr nz, .loop
ret
-
ParseCredits:
ld hl, wJumptableIndex
bit 7, [hl]
@@ -393,7 +392,6 @@ ParseCredits:
pop hl
ret
-
ConstructCreditsTilemap:
xor a
ld [hBGMapMode], a
@@ -598,7 +596,6 @@ Credits_TheEnd:
jr nz, .loop
ret
-
CreditsBorderGFX: INCBIN "gfx/credits/border.2bpp"
CreditsMonsGFX: ; used only for BANK(CreditsMonsGFX)
diff --git a/engine/movie/crystal_intro.asm b/engine/movie/crystal_intro.asm
index 6e132cfec..26fb31bb8 100644
--- a/engine/movie/crystal_intro.asm
+++ b/engine/movie/crystal_intro.asm
@@ -198,7 +198,6 @@ PlaceGameFreakPresents_3:
set 7, [hl]
ret
-
GameFreakLogoJumper:
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
@@ -1736,14 +1735,12 @@ Intro_Scene20_AppearUnown:
RGB 12, 00, 31
RGB 00, 00, 00
-
.pal2
RGB 24, 12, 09
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
-
Intro_FadeUnownWordPals:
add a
add a
diff --git a/engine/movie/evolution_animation.asm b/engine/movie/evolution_animation.asm
index 426636a0e..8f245f003 100644
--- a/engine/movie/evolution_animation.asm
+++ b/engine/movie/evolution_animation.asm
@@ -348,7 +348,6 @@ endr
call DelayFrame
ret
-
.GFX:
INCBIN "gfx/evo/bubble_large.2bpp"
INCBIN "gfx/evo/bubble.2bpp"
diff --git a/engine/movie/gbc_only.asm b/engine/movie/gbc_only.asm
index 39a2ea47e..2ea8ff33c 100644
--- a/engine/movie/gbc_only.asm
+++ b/engine/movie/gbc_only.asm
@@ -1,5 +1,4 @@
GBCOnlyScreen:
-
ld a, [hCGB]
and a
ret nz
@@ -38,9 +37,7 @@ GBCOnlyScreen:
call DelayFrame
jr .loop
-
DrawGBCOnlyScreen:
-
call DrawGBCOnlyBorder
; Pokemon
@@ -63,9 +60,7 @@ DrawGBCOnlyScreen:
ret
-
DrawGBCOnlyBorder:
-
hlcoord 0, 0
ld [hl], 0 ; top-left
@@ -111,7 +106,6 @@ DrawGBCOnlyBorder:
jr nz, .next_row
ret
-
DrawGBCOnlyGraphic:
ld de, SCREEN_WIDTH
.y
@@ -129,13 +123,11 @@ DrawGBCOnlyGraphic:
jr nz, .y
ret
-
GBCOnlyString:
db "This Game Pak is"
next "designed only for"
next "use on the"
next "Game Boy Color.@"
-
GBCOnlyGFX:
INCBIN "gfx/sgb/gbc_only.2bpp.lz"
diff --git a/engine/movie/title.asm b/engine/movie/title.asm
index 56402c7df..3717b4e73 100644
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -1,5 +1,4 @@
_TitleScreen:
-
call ClearBGPalettes
call ClearSprites
call ClearTileMap
@@ -18,25 +17,21 @@ _TitleScreen:
; Turn LCD off
call DisableLCD
-
; VRAM bank 1
ld a, 1
ld [rVBK], a
-
; Decompress running Suicune gfx
ld hl, TitleSuicuneGFX
ld de, vTiles1
call Decompress
-
; Clear screen palettes
hlbgcoord 0, 0
ld bc, 20 * BG_MAP_WIDTH
xor a
call ByteFill
-
; Fill tile palettes:
; BG Map 1:
@@ -47,7 +42,6 @@ _TitleScreen:
ld a, 7 ; palette
call ByteFill
-
; BG Map 0:
; Apply logo gradient:
@@ -78,7 +72,6 @@ _TitleScreen:
ld a, 6
call ByteFill
-
; 'CRYSTAL VERSION'
hlbgcoord 5, 9
ld bc, NAME_LENGTH ; length of version text
@@ -91,12 +84,10 @@ _TitleScreen:
ld a, 0 | VRAM_BANK_1
call ByteFill
-
; Back to VRAM bank 0
ld a, $0
ld [rVBK], a
-
; Decompress logo
ld hl, TitleLogoGFX
ld de, vTiles1
@@ -107,7 +98,6 @@ _TitleScreen:
ld de, vTiles0
call Decompress
-
; Clear screen tiles
hlbgcoord 0, 0
ld bc, 64 * BG_MAP_WIDTH
@@ -157,7 +147,6 @@ _TitleScreen:
pop af
ld [rSVBK], a
-
; LY/SCX trickery starts here
ld a, [rSVBK]
@@ -194,7 +183,6 @@ _TitleScreen:
pop af
ld [rSVBK], a
-
; Reset audio
call ChannelsOff
call EnableLCD
@@ -263,7 +251,6 @@ SuicuneFrameIterator:
db $00 ; vTiles5 tile $00
db $08 ; vTiles5 tile $08
-
LoadSuicuneFrame:
hlcoord 6, 12
ld b, 6
@@ -353,7 +340,6 @@ InitializeBackground:
jr nz, .loop2
ret
-
AnimateTitleCrystal:
; Move the title screen crystal downward until it's fully visible
diff --git a/engine/movie/trade_animation.asm b/engine/movie/trade_animation.asm
index 91bc59a6d..e60344430 100644
--- a/engine/movie/trade_animation.asm
+++ b/engine/movie/trade_animation.asm
@@ -1,5 +1,5 @@
-TRADEANIM_RIGHT_ARROW EQU $ed
-TRADEANIM_LEFT_ARROW EQU $ee
+TRADEANIM_RIGHT_ARROW EQUS "\"▶\"" ; $ed
+TRADEANIM_LEFT_ARROW EQUS "\"▼\"" ; $ee
; TradeAnim_TubeAnimJumptable.Jumptable indexes
const_def
@@ -144,7 +144,6 @@ RunTradeAnimScript:
ld [hMapAnims], a
ret
-
.TradeAnimLayout:
xor a
ld [wJumptableIndex], a
@@ -211,7 +210,6 @@ RunTradeAnimScript:
call TradeAnim_NormalPals
ret
-
DoTradeAnimation:
ld a, [wJumptableIndex]
bit 7, a
@@ -229,7 +227,6 @@ DoTradeAnimation:
scf
ret
-
.DoTradeAnimCommand:
ld a, [wJumptableIndex]
ld e, a
@@ -298,7 +295,6 @@ TradeAnim_IncrementJumptableIndex:
inc [hl]
ret
-
TradeAnim_AdvanceScriptPointer:
ld hl, wTradeAnimAddress
ld e, [hl]
@@ -312,13 +308,11 @@ TradeAnim_AdvanceScriptPointer:
ld [hl], e
ret
-
TradeAnim_End:
ld hl, wJumptableIndex
set 7, [hl]
ret
-
TradeAnim_TubeToOT1:
ld a, TRADEANIM_RIGHT_ARROW
call TradeAnim_PlaceTrademonStatsOnTubeAnim
@@ -394,7 +388,6 @@ TradeAnim_InitTubeAnim:
ld [wFrameCounter], a
ret
-
TradeAnim_TubeToOT2:
call TradeAnim_FlashBGPals
ld a, [hSCX]
@@ -407,7 +400,6 @@ TradeAnim_TubeToOT2:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_TubeToOT3:
call TradeAnim_FlashBGPals
ld a, [hSCX]
@@ -420,7 +412,6 @@ TradeAnim_TubeToOT3:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_TubeToOT4:
call TradeAnim_FlashBGPals
ld a, [hSCX]
@@ -431,7 +422,6 @@ TradeAnim_TubeToOT4:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_TubeToPlayer3:
call TradeAnim_FlashBGPals
ld a, [hSCX]
@@ -444,7 +434,6 @@ TradeAnim_TubeToPlayer3:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_TubeToPlayer4:
call TradeAnim_FlashBGPals
ld a, [hSCX]
@@ -457,7 +446,6 @@ TradeAnim_TubeToPlayer4:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_TubeToPlayer5:
call TradeAnim_FlashBGPals
ld a, [hSCX]
@@ -468,7 +456,6 @@ TradeAnim_TubeToPlayer5:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_TubeToOT6:
TradeAnim_TubeToPlayer6:
ld a, 128
@@ -476,7 +463,6 @@ TradeAnim_TubeToPlayer6:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_TubeToOT8:
TradeAnim_TubeToPlayer8:
call ClearBGPalettes
@@ -499,7 +485,6 @@ TradeAnim_TubeToPlayer8:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_TubeToOT5:
TradeAnim_TubeToOT7:
TradeAnim_TubeToPlayer2:
@@ -516,21 +501,18 @@ TradeAnim_TubeToPlayer7:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_GiveTrademonSFX:
call TradeAnim_AdvanceScriptPointer
ld de, SFX_GIVE_TRADEMON
call PlaySFX
ret
-
TradeAnim_GetTrademonSFX:
call TradeAnim_AdvanceScriptPointer
ld de, SFX_GET_TRADEMON
call PlaySFX
ret
-
TradeAnim_TubeAnimJumptable:
maskbits TRADEANIMJUMPTABLE_LENGTH
ld e, a
@@ -563,7 +545,6 @@ TradeAnim_TubeAnimJumptable:
call TradeAnim_CopyTradeGameBoyTilemap
ret
-
.One:
call TradeAnim_BlankTileMap
hlcoord 0, 3
@@ -572,7 +553,6 @@ TradeAnim_TubeAnimJumptable:
call ByteFill
ret
-
.Two:
call TradeAnim_BlankTileMap
hlcoord 0, 3
@@ -601,14 +581,12 @@ TradeAnim_TubeAnimJumptable:
call TradeAnim_CopyTradeGameBoyTilemap
ret
-
TradeAnim_CopyTradeGameBoyTilemap:
ld de, TradeGameBoyTilemap
lb bc, 8, 6
call TradeAnim_CopyBoxFromDEtoHL
ret
-
TradeAnim_PlaceTrademonStatsOnTubeAnim:
push af
call ClearBGPalettes
@@ -648,7 +626,6 @@ TradeAnim_PlaceTrademonStatsOnTubeAnim:
call ClearTileMap
ret
-
TradeAnim_EnterLinkTube1:
call ClearTileMap
call WaitTop
@@ -671,7 +648,6 @@ TradeAnim_EnterLinkTube1:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_EnterLinkTube2:
ld a, [hSCX]
and a
@@ -686,7 +662,6 @@ TradeAnim_EnterLinkTube2:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_ExitLinkTube:
ld a, [hSCX]
cp $a0
@@ -702,7 +677,6 @@ TradeAnim_ExitLinkTube:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_SetupGivemonScroll:
ld a, $8f
ld [hWX], a
@@ -713,7 +687,6 @@ TradeAnim_SetupGivemonScroll:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_DoGivemonScroll:
ld a, [hWX]
cp $7
@@ -733,7 +706,6 @@ TradeAnim_DoGivemonScroll:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_FrontpicScrollStart:
ld a, $7
ld [hWX], a
@@ -742,7 +714,6 @@ TradeAnim_FrontpicScrollStart:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_TextboxScrollStart:
ld a, $7
ld [hWX], a
@@ -751,7 +722,6 @@ TradeAnim_TextboxScrollStart:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_ScrollOutRight:
call WaitTop
ld a, HIGH(vBGMap1)
@@ -769,7 +739,6 @@ TradeAnim_ScrollOutRight:
call TradeAnim_IncrementJumptableIndex
ret
-
TradeAnim_ScrollOutRight2:
ld a, [hWX]
cp $a1
@@ -791,7 +760,6 @@ TradeAnim_ScrollOutRight2:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_ShowGivemonData:
call ShowPlayerTrademonStats
ld a, [wPlayerTrademonSpecies]
@@ -817,7 +785,6 @@ TradeAnim_ShowGivemonData:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_ShowGetmonData:
call ShowOTTrademonStats
ld a, [wOTTrademonSpecies]
@@ -834,13 +801,11 @@ TradeAnim_ShowGetmonData:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_AnimateFrontpic:
farcall AnimateTrademonFrontpic
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_GetFrontpic:
push de
push af
@@ -853,7 +818,6 @@ TradeAnim_GetFrontpic:
predef GetMonFrontpic
ret
-
TradeAnim_GetNickname:
push de
ld [wd265], a
@@ -864,7 +828,6 @@ TradeAnim_GetNickname:
call CopyBytes
ret
-
TradeAnim_ShowGivemonFrontpic:
ld de, vTiles0
jr TradeAnim_ShowFrontpic
@@ -886,28 +849,24 @@ TradeAnim_ShowFrontpic:
call WaitBGMap
ret
-
TraideAnim_Wait80:
ld c, 80
call DelayFrames
call TradeAnim_AdvanceScriptPointer
ret
-
TraideAnim_Wait40:
ld c, 40
call DelayFrames
call TradeAnim_AdvanceScriptPointer
ret
-
TraideAnim_Wait96:
ld c, 96
call DelayFrames
call TradeAnim_AdvanceScriptPointer
ret
-
TraideAnim_Wait80IfOTEgg:
call IsOTTrademonEgg
ret nz
@@ -915,7 +874,6 @@ TraideAnim_Wait80IfOTEgg:
call DelayFrames
ret
-
TraideAnim_Wait180IfOTEgg:
call IsOTTrademonEgg
ret nz
@@ -923,7 +881,6 @@ TraideAnim_Wait180IfOTEgg:
call DelayFrames
ret
-
IsOTTrademonEgg:
call TradeAnim_AdvanceScriptPointer
ld a, [wOTTrademonSpecies]
@@ -948,7 +905,6 @@ ShowPlayerTrademonStats:
call TrademonStats_WaitBGMap
ret
-
ShowOTTrademonStats:
ld de, wOTTrademonSpecies
ld a, [de]
@@ -967,7 +923,6 @@ ShowOTTrademonStats:
call TrademonStats_WaitBGMap
ret
-
TrademonStats_MonTemplate:
call WaitTop
call TradeAnim_BlankTileMap
@@ -982,7 +937,6 @@ TrademonStats_MonTemplate:
call PlaceString
ret
-
.OTMonData:
db "─── №."
next ""
@@ -1004,7 +958,6 @@ TrademonStats_Egg:
call TrademonStats_WaitBGMap
ret
-
.EggData:
db "EGG"
next "OT/?????"
@@ -1017,7 +970,6 @@ TrademonStats_WaitBGMap:
ld [hBGMapAddress + 1], a
ret
-
TrademonStats_PrintSpeciesNumber:
hlcoord 10, 0
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
@@ -1025,13 +977,11 @@ TrademonStats_PrintSpeciesNumber:
ld [hl], " "
ret
-
TrademonStats_PrintSpeciesName:
hlcoord 4, 2
call PlaceString
ret
-
TrademonStats_PrintOTName:
cp 3
jr c, .caught_gender_okay
@@ -1050,7 +1000,6 @@ TrademonStats_PrintOTName:
ld [bc], a
ret
-
.Gender:
db " ", "♂", "♀"
@@ -1060,7 +1009,6 @@ TrademonStats_PrintTrademonID:
call PrintNum
ret
-
TradeAnim_RockingBall:
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_TRADE_POKE_BALL
@@ -1070,7 +1018,6 @@ TradeAnim_RockingBall:
ld [wFrameCounter], a
ret
-
TradeAnim_DropBall:
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_TRADE_POKE_BALL
@@ -1086,7 +1033,6 @@ TradeAnim_DropBall:
ld [wFrameCounter], a
ret
-
TradeAnim_Poof:
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_TRADE_POOF
@@ -1098,7 +1044,6 @@ TradeAnim_Poof:
call PlaySFX
ret
-
TradeAnim_BulgeThroughTube:
ld a, %11100100 ; 3,2,1,0
call DmgToCgbObjPal0
@@ -1110,7 +1055,6 @@ TradeAnim_BulgeThroughTube:
ld [wFrameCounter], a
ret
-
TradeAnim_AnimateTrademonInTube:
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
@@ -1222,7 +1166,6 @@ TradeAnim_AnimateTrademonInTube:
ld [hl], $0
ret
-
TradeAnim_SentToOTText:
ld a, [wLinkMode]
cp LINK_TIMECAPSULE
@@ -1246,7 +1189,6 @@ TradeAnim_SentToOTText:
call TradeAnim_AdvanceScriptPointer
ret
-
.Text_WasSentTo:
; was sent to @ .
text_jump UnknownText_0x1bc6e9
@@ -1267,7 +1209,6 @@ TradeAnim_OTBidsFarewell:
call TradeAnim_AdvanceScriptPointer
ret
-
.Text_BidsFarewellToMon:
; bids farewell to
text_jump UnknownText_0x1bc703
@@ -1291,7 +1232,6 @@ TradeAnim_TakeCareOfText:
call TradeAnim_AdvanceScriptPointer
ret
-
.Text_TakeGoodCareOfMon:
; Take good care of @ .
text_jump UnknownText_0x1bc71f
@@ -1309,7 +1249,6 @@ TradeAnim_OTSendsText1:
call TradeAnim_AdvanceScriptPointer
ret
-
.Text_ForYourMon:
; For @ 's @ ,
text_jump UnknownText_0x1bc739
@@ -1332,7 +1271,6 @@ TradeAnim_OTSendsText2:
call TradeAnim_AdvanceScriptPointer
ret
-
.Text_WillTrade:
; will trade @ @
text_jump UnknownText_0x1bc75e
@@ -1348,7 +1286,6 @@ TradeAnim_Wait80Frames:
call DelayFrames
ret
-
TradeAnim_BlankTileMap:
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
@@ -1356,7 +1293,6 @@ TradeAnim_BlankTileMap:
call ByteFill
ret
-
TradeAnim_CopyBoxFromDEtoHL:
.row
push bc
@@ -1375,7 +1311,6 @@ TradeAnim_CopyBoxFromDEtoHL:
jr nz, .row
ret
-
TradeAnim_NormalPals:
ld a, [hSGB]
and a
@@ -1389,7 +1324,6 @@ TradeAnim_NormalPals:
call DmgToCgbBGPals
ret
-
LinkTradeAnim_LoadTradePlayerNames:
push de
ld de, wLinkPlayer1Name
@@ -1401,7 +1335,6 @@ LinkTradeAnim_LoadTradePlayerNames:
call CopyBytes
ret
-
LinkTradeAnim_LoadTradeMonSpecies:
ld a, [hl]
ld [wLinkTradeSendmonSpecies], a
@@ -1409,7 +1342,6 @@ LinkTradeAnim_LoadTradeMonSpecies:
ld [wLinkTradeGetmonSpecies], a
ret
-
TradeAnim_FlashBGPals:
ld a, [wcf65]
and $7
@@ -1419,7 +1351,6 @@ TradeAnim_FlashBGPals:
call DmgToCgbBGPals
ret
-
LoadTradeBallAndCableGFX:
call DelayFrame
ld de, TradeBallGFX
@@ -1440,7 +1371,6 @@ LoadTradeBallAndCableGFX:
ld [hl], $62
ret
-
LoadTradeBubbleGFX:
call DelayFrame
ld e, $3
@@ -1455,7 +1385,6 @@ LoadTradeBubbleGFX:
ld [hl], $62
ret
-
TradeAnim_WaitAnim:
ld hl, wFrameCounter
ld a, [hl]
@@ -1468,7 +1397,6 @@ TradeAnim_WaitAnim:
call TradeAnim_AdvanceScriptPointer
ret
-
TradeAnim_WaitAnim2:
ld hl, wFrameCounter
ld a, [hl]
@@ -1481,8 +1409,6 @@ TradeAnim_WaitAnim2:
call TradeAnim_AdvanceScriptPointer
ret
-
-
Unreferenced_DebugTrade:
; This function is not referenced.
; It was meant for use in Japanese versions, so the
@@ -1513,7 +1439,6 @@ Unreferenced_DebugTrade:
jr nz, .loop2
ret
-
debugtrade: MACRO
; species, ot name, ot id (?)
db \1, \2
@@ -1524,7 +1449,6 @@ ENDM
debugtrade VENUSAUR, "ゲーフり@@", $0123 ; GAME FREAK
debugtrade CHARIZARD, "クりーチャ@", $0456 ; Creatures Inc.
-
TradeGameBoyTilemap:
; 6x8
db $31, $32, $32, $32, $32, $33
diff --git a/engine/movie/unused_title.asm b/engine/movie/unused_title.asm
index 4527d9ade..0c97c840a 100644
--- a/engine/movie/unused_title.asm
+++ b/engine/movie/unused_title.asm
@@ -1,5 +1,4 @@
UnusedTitleScreen:
-
call ClearBGPalettes
call ClearTileMap
call DisableLCD
diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm
index a9e127b41..7ba177420 100644
--- a/engine/overworld/decorations.asm
+++ b/engine/overworld/decorations.asm
@@ -415,7 +415,6 @@ PopulateDecoCategoryMenu:
dbw 0, 0
dbw 0, 0
-
GetDecorationData:
ld hl, DecorationAttributes
ld bc, 6
@@ -466,7 +465,6 @@ DoDecorationAction2:
dw DecoAction_setupornament
dw DecoAction_putawayornament
-
GetDecorationFlag:
call GetDecorationData
ld de, 3 ; event flag
@@ -515,7 +513,6 @@ GetDecoName:
dw .doll
dw .bigdoll
-
.invalid
ret
@@ -922,7 +919,6 @@ DecorationFlagAction_c:
ld a, c
jp DecorationFlagAction
-
GetDecorationName_c:
ld a, c
call GetDecorationID
@@ -932,7 +928,6 @@ GetDecorationName_c:
pop de
ret
-
SetSpecificDecorationFlag:
ld a, c
call GetDecorationID
diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm
index daa7b8414..707d31e66 100644
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -485,7 +485,6 @@ CheckTimeEvents:
ret
OWPlayerInput:
-
call PlayerMovement
ret c
and a
@@ -1026,4 +1025,614 @@ ChangeDirectionScript: ; 9
INCLUDE "engine/overworld/scripting.asm"
-INCLUDE "engine/overworld/events_2.asm"
+WarpToSpawnPoint::
+ ld hl, wStatusFlags2
+ res STATUSFLAGS2_SAFARI_GAME_F, [hl]
+ res STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
+ ret
+
+RunMemScript::
+; If there is no script here, we don't need to be here.
+ ld a, [wMapReentryScriptQueueFlag]
+ and a
+ ret z
+; Execute the script at (wMapReentryScriptBank):(wMapReentryScriptAddress).
+ ld hl, wMapReentryScriptAddress
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [wMapReentryScriptBank]
+ call CallScript
+ scf
+; Clear the buffer for the next script.
+ push af
+ xor a
+ ld hl, wMapReentryScriptQueueFlag
+ ld bc, 8
+ call ByteFill
+ pop af
+ ret
+
+LoadScriptBDE::
+; If there's already a script here, don't overwrite.
+ ld hl, wMapReentryScriptQueueFlag
+ ld a, [hl]
+ and a
+ ret nz
+; Set the flag
+ ld [hl], 1
+ inc hl
+; Load the script pointer b:de into (wMapReentryScriptBank):(wMapReentryScriptAddress)
+ ld [hl], b
+ inc hl
+ ld [hl], e
+ inc hl
+ ld [hl], d
+ scf
+ ret
+
+TryTileCollisionEvent::
+ call GetFacingTileCoord
+ ld [wEngineBuffer1], a
+ ld c, a
+ farcall CheckFacingTileForStdScript
+ jr c, .done
+
+ call CheckCutTreeTile
+ jr nz, .whirlpool
+ farcall TryCutOW
+ jr .done
+
+.whirlpool
+ ld a, [wEngineBuffer1]
+ call CheckWhirlpoolTile
+ jr nz, .waterfall
+ farcall TryWhirlpoolOW
+ jr .done
+
+.waterfall
+ ld a, [wEngineBuffer1]
+ call CheckWaterfallTile
+ jr nz, .headbutt
+ farcall TryWaterfallOW
+ jr .done
+
+.headbutt
+ ld a, [wEngineBuffer1]
+ call CheckHeadbuttTreeTile
+ jr nz, .surf
+ farcall TryHeadbuttOW
+ jr c, .done
+ jr .noevent
+
+.surf
+ farcall TrySurfOW
+ jr nc, .noevent
+ jr .done
+
+.noevent
+ xor a
+ ret
+
+.done
+ call PlayClickSFX
+ ld a, $ff
+ scf
+ ret
+
+RandomEncounter::
+; Random encounter
+
+ call CheckWildEncounterCooldown
+ jr c, .nope
+ call CanUseSweetScent
+ jr nc, .nope
+ ld hl, wStatusFlags2
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
+ jr nz, .bug_contest
+ farcall TryWildEncounter
+ jr nz, .nope
+ jr .ok
+
+.bug_contest
+ call _TryWildEncounter_BugContest
+ jr nc, .nope
+ jr .ok_bug_contest
+
+.nope
+ ld a, 1
+ and a
+ ret
+
+.ok
+ ld a, BANK(WildBattleScript)
+ ld hl, WildBattleScript
+ jr .done
+
+.ok_bug_contest
+ ld a, BANK(BugCatchingContestBattleScript)
+ ld hl, BugCatchingContestBattleScript
+ jr .done
+
+.done
+ call CallScript
+ scf
+ ret
+
+WildBattleScript:
+ randomwildmon
+ startbattle
+ reloadmapafterbattle
+ end
+
+CanUseSweetScent::
+ ld hl, wStatusFlags
+ bit STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
+ jr nz, .no
+ ld a, [wEnvironment]
+ cp CAVE
+ jr z, .ice_check
+ cp DUNGEON
+ jr z, .ice_check
+ farcall CheckGrassCollision
+ jr nc, .no
+
+.ice_check
+ ld a, [wPlayerStandingTile]
+ call CheckIceTile
+ jr z, .no
+ scf
+ ret
+
+.no
+ and a
+ ret
+
+_TryWildEncounter_BugContest:
+ call TryWildEncounter_BugContest
+ ret nc
+ call ChooseWildEncounter_BugContest
+ farcall CheckRepelEffect
+ ret
+
+ChooseWildEncounter_BugContest::
+; Pick a random mon out of ContestMons.
+
+.loop
+ call Random
+ cp 100 << 1
+ jr nc, .loop
+ srl a
+
+ ld hl, ContestMons
+ ld de, 4
+.CheckMon:
+ sub [hl]
+ jr c, .GotMon
+ add hl, de
+ jr .CheckMon
+
+.GotMon:
+ inc hl
+
+; Species
+ ld a, [hli]
+ ld [wTempWildMonSpecies], a
+
+; Min level
+ ld a, [hli]
+ ld d, a
+
+; Max level
+ ld a, [hl]
+
+ sub d
+ jr nz, .RandomLevel
+
+; If min and max are the same.
+ ld a, d
+ jr .GotLevel
+
+.RandomLevel:
+; Get a random level between the min and max.
+ ld c, a
+ inc c
+ call Random
+ ld a, [hRandomAdd]
+ call SimpleDivide
+ add d
+
+.GotLevel:
+ ld [wCurPartyLevel], a
+
+ xor a
+ ret
+
+TryWildEncounter_BugContest:
+ ld a, [wPlayerStandingTile]
+ call CheckSuperTallGrassTile
+ ld b, 40 percent
+ jr z, .ok
+ ld b, 20 percent
+
+.ok
+ farcall ApplyMusicEffectOnEncounterRate
+ farcall ApplyCleanseTagEffectOnEncounterRate
+ call Random
+ ld a, [hRandomAdd]
+ cp b
+ ret c
+ ld a, 1
+ and a
+ ret
+
+INCLUDE "data/wild/bug_contest_mons.asm"
+
+DoBikeStep::
+ nop
+ nop
+ ; If the bike shop owner doesn't have our number, or
+ ; if we've already gotten the call, we don't have to
+ ; be here.
+ ld hl, wStatusFlags2
+ bit STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
+ jr z, .NoCall
+
+ ; If we're not on the bike, we don't have to be here.
+ ld a, [wPlayerState]
+ cp PLAYER_BIKE
+ jr nz, .NoCall
+
+ ; If we're not in an area of phone service, we don't
+ ; have to be here.
+ call GetMapPhoneService
+ and a
+ jr nz, .NoCall
+
+ ; Check the bike step count and check whether we've
+ ; taken 65536 of them yet.
+ ld hl, wBikeStep
+ ld a, [hli]
+ ld d, a
+ ld e, [hl]
+ cp 255
+ jr nz, .increment
+ ld a, e
+ cp 255
+ jr z, .dont_increment
+
+.increment
+ inc de
+ ld [hl], e
+ dec hl
+ ld [hl], d
+
+.dont_increment
+ ; If we've taken at least 1024 steps, have the bike
+ ; shop owner try to call us.
+ ld a, d
+ cp HIGH(1024)
+ jr c, .NoCall
+
+ ; If a call has already been queued, don't overwrite
+ ; that call.
+ ld a, [wSpecialPhoneCallID]
+ and a
+ jr nz, .NoCall
+
+ ; Queue the call.
+ ld a, SPECIALCALL_BIKESHOP
+ ld [wSpecialPhoneCallID], a
+ xor a
+ ld [wSpecialPhoneCallID + 1], a
+ ld hl, wStatusFlags2
+ res STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
+ scf
+ ret
+
+.NoCall:
+ xor a
+ ret
+
+ClearCmdQueue::
+ ld hl, wCmdQueue
+ ld de, 6
+ ld c, 4
+ xor a
+.loop
+ ld [hl], a
+ add hl, de
+ dec c
+ jr nz, .loop
+ ret
+
+HandleCmdQueue::
+ ld hl, wCmdQueue
+ xor a
+.loop
+ ld [hMapObjectIndexBuffer], a
+ ld a, [hl]
+ and a
+ jr z, .skip
+ push hl
+ ld b, h
+ ld c, l
+ call HandleQueuedCommand
+ pop hl
+
+.skip
+ ld de, CMDQUEUE_ENTRY_SIZE
+ add hl, de
+ ld a, [hMapObjectIndexBuffer]
+ inc a
+ cp CMDQUEUE_CAPACITY
+ jr nz, .loop
+ ret
+
+Unreferenced_GetNthCmdQueueEntry:
+ ld hl, wCmdQueue
+ ld bc, CMDQUEUE_ENTRY_SIZE
+ call AddNTimes
+ ld b, h
+ ld c, l
+ ret
+
+WriteCmdQueue::
+ push bc
+ push de
+ call .GetNextEmptyEntry
+ ld d, h
+ ld e, l
+ pop hl
+ pop bc
+ ret c
+ ld a, b
+ ld bc, CMDQUEUE_ENTRY_SIZE - 1
+ call FarCopyBytes
+ xor a
+ ld [hl], a
+ ret
+
+.GetNextEmptyEntry:
+ ld hl, wCmdQueue
+ ld de, CMDQUEUE_ENTRY_SIZE
+ ld c, CMDQUEUE_CAPACITY
+.loop
+ ld a, [hl]
+ and a
+ jr z, .done
+ add hl, de
+ dec c
+ jr nz, .loop
+ scf
+ ret
+
+.done
+ ld a, CMDQUEUE_CAPACITY
+ sub c
+ and a
+ ret
+
+DelCmdQueue::
+ ld hl, wCmdQueue
+ ld de, CMDQUEUE_ENTRY_SIZE
+ ld c, CMDQUEUE_CAPACITY
+.loop
+ ld a, [hl]
+ cp b
+ jr z, .done
+ add hl, de
+ dec c
+ jr nz, .loop
+ and a
+ ret
+
+.done
+ xor a
+ ld [hl], a
+ scf
+ ret
+
+_DelCmdQueue:
+ ld hl, CMDQUEUE_TYPE
+ add hl, bc
+ ld [hl], 0
+ ret
+
+HandleQueuedCommand:
+ ld hl, CMDQUEUE_TYPE
+ add hl, bc
+ ld a, [hl]
+ cp 5
+ jr c, .okay
+ xor a
+
+.okay
+ ld e, a
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ push af
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop af
+ rst FarCall
+ ret
+
+.Jumptable:
+ dba CmdQueue_Null
+ dba CmdQueue_Null2
+ dba CmdQueue_StoneTable
+ dba CmdQueue_Type3
+ dba CmdQueue_Type4
+
+CmdQueueAnonymousJumptable:
+ ld hl, CMDQUEUE_05
+ add hl, bc
+ ld a, [hl]
+ pop hl
+ rst JumpTable
+ ret
+
+CmdQueueAnonJT_Increment:
+ ld hl, CMDQUEUE_05
+ add hl, bc
+ inc [hl]
+ ret
+
+CmdQueueAnonJT_Decrement:
+ ld hl, CMDQUEUE_05
+ add hl, bc
+ dec [hl]
+ ret
+
+CmdQueue_Null:
+ ret
+
+CmdQueue_Null2:
+ call ret_2f3e
+ ret
+
+CmdQueue_Type4:
+ call CmdQueueAnonymousJumptable
+ ; anonymous dw
+ dw .zero
+ dw .one
+
+.zero
+ ld a, [hSCY]
+ ld hl, 4
+ add hl, bc
+ ld [hl], a
+ call CmdQueueAnonJT_Increment
+.one
+ ld hl, 1
+ add hl, bc
+ ld a, [hl]
+ dec a
+ ld [hl], a
+ jr z, .finish
+ and $1
+ jr z, .add
+ ld hl, 2
+ add hl, bc
+ ld a, [hSCY]
+ sub [hl]
+ ld [hSCY], a
+ ret
+
+.add
+ ld hl, 2
+ add hl, bc
+ ld a, [hSCY]
+ add [hl]
+ ld [hSCY], a
+ ret
+
+.finish
+ ld hl, 4
+ add hl, bc
+ ld a, [hl]
+ ld [hSCY], a
+ call _DelCmdQueue
+ ret
+
+CmdQueue_Type3:
+ call CmdQueueAnonymousJumptable
+ ; anonymous dw
+ dw .zero
+ dw .one
+ dw .two
+
+.zero
+ call .IsPlayerFacingDown
+ jr z, .PlayerNotFacingDown
+ call CmdQueueAnonJT_Increment
+.one
+ call .IsPlayerFacingDown
+ jr z, .PlayerNotFacingDown
+ call CmdQueueAnonJT_Increment
+
+ ld hl, 2
+ add hl, bc
+ ld a, [hl]
+ ld [wd173], a
+ ret
+
+.two
+ call .IsPlayerFacingDown
+ jr z, .PlayerNotFacingDown
+ call CmdQueueAnonJT_Decrement
+
+ ld hl, 3
+ add hl, bc
+ ld a, [hl]
+ ld [wd173], a
+ ret
+
+.PlayerNotFacingDown:
+ ld a, $7f
+ ld [wd173], a
+ ld hl, 5
+ add hl, bc
+ ld [hl], 0
+ ret
+
+.IsPlayerFacingDown:
+ push bc
+ ld bc, wPlayerStruct
+ call GetSpriteDirection
+ and a
+ pop bc
+ ret
+
+CmdQueue_StoneTable:
+ ld de, wPlayerStruct
+ ld a, NUM_OBJECT_STRUCTS
+.loop
+ push af
+
+ ld hl, OBJECT_SPRITE
+ add hl, de
+ ld a, [hl]
+ and a
+ jr z, .next
+
+ ld hl, OBJECT_MOVEMENTTYPE
+ add hl, de
+ ld a, [hl]
+ cp SPRITEMOVEDATA_STRENGTH_BOULDER
+ jr nz, .next
+
+ ld hl, OBJECT_NEXT_TILE
+ add hl, de
+ ld a, [hl]
+ call CheckPitTile
+ jr nz, .next
+
+ ld hl, OBJECT_DIRECTION_WALKING
+ add hl, de
+ ld a, [hl]
+ cp STANDING
+ jr nz, .next
+ call HandleStoneQueue
+ jr c, .fall_down_hole
+
+.next
+ ld hl, OBJECT_STRUCT_LENGTH
+ add hl, de
+ ld d, h
+ ld e, l
+
+ pop af
+ dec a
+ jr nz, .loop
+ ret
+
+.fall_down_hole
+ pop af
+ ret
diff --git a/engine/overworld/events_2.asm b/engine/overworld/events_2.asm
deleted file mode 100644
index b7376d48d..000000000
--- a/engine/overworld/events_2.asm
+++ /dev/null
@@ -1,617 +0,0 @@
-; More overworld event handling.
-
-
-WarpToSpawnPoint::
- ld hl, wStatusFlags2
- res STATUSFLAGS2_SAFARI_GAME_F, [hl]
- res STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
- ret
-
-RunMemScript::
-; If there is no script here, we don't need to be here.
- ld a, [wMapReentryScriptQueueFlag]
- and a
- ret z
-; Execute the script at (wMapReentryScriptBank):(wMapReentryScriptAddress).
- ld hl, wMapReentryScriptAddress
- ld a, [hli]
- ld h, [hl]
- ld l, a
- ld a, [wMapReentryScriptBank]
- call CallScript
- scf
-; Clear the buffer for the next script.
- push af
- xor a
- ld hl, wMapReentryScriptQueueFlag
- ld bc, 8
- call ByteFill
- pop af
- ret
-
-LoadScriptBDE::
-; If there's already a script here, don't overwrite.
- ld hl, wMapReentryScriptQueueFlag
- ld a, [hl]
- and a
- ret nz
-; Set the flag
- ld [hl], 1
- inc hl
-; Load the script pointer b:de into (wMapReentryScriptBank):(wMapReentryScriptAddress)
- ld [hl], b
- inc hl
- ld [hl], e
- inc hl
- ld [hl], d
- scf
- ret
-
-TryTileCollisionEvent::
- call GetFacingTileCoord
- ld [wEngineBuffer1], a
- ld c, a
- farcall CheckFacingTileForStdScript
- jr c, .done
-
- call CheckCutTreeTile
- jr nz, .whirlpool
- farcall TryCutOW
- jr .done
-
-.whirlpool
- ld a, [wEngineBuffer1]
- call CheckWhirlpoolTile
- jr nz, .waterfall
- farcall TryWhirlpoolOW
- jr .done
-
-.waterfall
- ld a, [wEngineBuffer1]
- call CheckWaterfallTile
- jr nz, .headbutt
- farcall TryWaterfallOW
- jr .done
-
-.headbutt
- ld a, [wEngineBuffer1]
- call CheckHeadbuttTreeTile
- jr nz, .surf
- farcall TryHeadbuttOW
- jr c, .done
- jr .noevent
-
-.surf
- farcall TrySurfOW
- jr nc, .noevent
- jr .done
-
-.noevent
- xor a
- ret
-
-.done
- call PlayClickSFX
- ld a, $ff
- scf
- ret
-
-
-RandomEncounter::
-; Random encounter
-
- call CheckWildEncounterCooldown
- jr c, .nope
- call CanUseSweetScent
- jr nc, .nope
- ld hl, wStatusFlags2
- bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
- jr nz, .bug_contest
- farcall TryWildEncounter
- jr nz, .nope
- jr .ok
-
-.bug_contest
- call _TryWildEncounter_BugContest
- jr nc, .nope
- jr .ok_bug_contest
-
-.nope
- ld a, 1
- and a
- ret
-
-.ok
- ld a, BANK(WildBattleScript)
- ld hl, WildBattleScript
- jr .done
-
-.ok_bug_contest
- ld a, BANK(BugCatchingContestBattleScript)
- ld hl, BugCatchingContestBattleScript
- jr .done
-
-.done
- call CallScript
- scf
- ret
-
-WildBattleScript:
- randomwildmon
- startbattle
- reloadmapafterbattle
- end
-
-CanUseSweetScent::
- ld hl, wStatusFlags
- bit STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
- jr nz, .no
- ld a, [wEnvironment]
- cp CAVE
- jr z, .ice_check
- cp DUNGEON
- jr z, .ice_check
- farcall CheckGrassCollision
- jr nc, .no
-
-.ice_check
- ld a, [wPlayerStandingTile]
- call CheckIceTile
- jr z, .no
- scf
- ret
-
-.no
- and a
- ret
-
-_TryWildEncounter_BugContest:
- call TryWildEncounter_BugContest
- ret nc
- call ChooseWildEncounter_BugContest
- farcall CheckRepelEffect
- ret
-
-ChooseWildEncounter_BugContest::
-; Pick a random mon out of ContestMons.
-
-.loop
- call Random
- cp 100 << 1
- jr nc, .loop
- srl a
-
- ld hl, ContestMons
- ld de, 4
-.CheckMon:
- sub [hl]
- jr c, .GotMon
- add hl, de
- jr .CheckMon
-
-.GotMon:
- inc hl
-
-; Species
- ld a, [hli]
- ld [wTempWildMonSpecies], a
-
-; Min level
- ld a, [hli]
- ld d, a
-
-; Max level
- ld a, [hl]
-
- sub d
- jr nz, .RandomLevel
-
-; If min and max are the same.
- ld a, d
- jr .GotLevel
-
-.RandomLevel:
-; Get a random level between the min and max.
- ld c, a
- inc c
- call Random
- ld a, [hRandomAdd]
- call SimpleDivide
- add d
-
-.GotLevel:
- ld [wCurPartyLevel], a
-
- xor a
- ret
-
-TryWildEncounter_BugContest:
- ld a, [wPlayerStandingTile]
- call CheckSuperTallGrassTile
- ld b, 40 percent
- jr z, .ok
- ld b, 20 percent
-
-.ok
- farcall ApplyMusicEffectOnEncounterRate
- farcall ApplyCleanseTagEffectOnEncounterRate
- call Random
- ld a, [hRandomAdd]
- cp b
- ret c
- ld a, 1
- and a
- ret
-
-
-INCLUDE "data/wild/bug_contest_mons.asm"
-
-
-DoBikeStep::
- nop
- nop
- ; If the bike shop owner doesn't have our number, or
- ; if we've already gotten the call, we don't have to
- ; be here.
- ld hl, wStatusFlags2
- bit STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
- jr z, .NoCall
-
- ; If we're not on the bike, we don't have to be here.
- ld a, [wPlayerState]
- cp PLAYER_BIKE
- jr nz, .NoCall
-
- ; If we're not in an area of phone service, we don't
- ; have to be here.
- call GetMapPhoneService
- and a
- jr nz, .NoCall
-
- ; Check the bike step count and check whether we've
- ; taken 65536 of them yet.
- ld hl, wBikeStep
- ld a, [hli]
- ld d, a
- ld e, [hl]
- cp 255
- jr nz, .increment
- ld a, e
- cp 255
- jr z, .dont_increment
-
-.increment
- inc de
- ld [hl], e
- dec hl
- ld [hl], d
-
-.dont_increment
- ; If we've taken at least 1024 steps, have the bike
- ; shop owner try to call us.
- ld a, d
- cp HIGH(1024)
- jr c, .NoCall
-
- ; If a call has already been queued, don't overwrite
- ; that call.
- ld a, [wSpecialPhoneCallID]
- and a
- jr nz, .NoCall
-
- ; Queue the call.
- ld a, SPECIALCALL_BIKESHOP
- ld [wSpecialPhoneCallID], a
- xor a
- ld [wSpecialPhoneCallID + 1], a
- ld hl, wStatusFlags2
- res STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
- scf
- ret
-
-.NoCall:
- xor a
- ret
-
-ClearCmdQueue::
- ld hl, wCmdQueue
- ld de, 6
- ld c, 4
- xor a
-.loop
- ld [hl], a
- add hl, de
- dec c
- jr nz, .loop
- ret
-
-HandleCmdQueue::
- ld hl, wCmdQueue
- xor a
-.loop
- ld [hMapObjectIndexBuffer], a
- ld a, [hl]
- and a
- jr z, .skip
- push hl
- ld b, h
- ld c, l
- call HandleQueuedCommand
- pop hl
-
-.skip
- ld de, CMDQUEUE_ENTRY_SIZE
- add hl, de
- ld a, [hMapObjectIndexBuffer]
- inc a
- cp CMDQUEUE_CAPACITY
- jr nz, .loop
- ret
-
-Unreferenced_GetNthCmdQueueEntry:
- ld hl, wCmdQueue
- ld bc, CMDQUEUE_ENTRY_SIZE
- call AddNTimes
- ld b, h
- ld c, l
- ret
-
-WriteCmdQueue::
- push bc
- push de
- call .GetNextEmptyEntry
- ld d, h
- ld e, l
- pop hl
- pop bc
- ret c
- ld a, b
- ld bc, CMDQUEUE_ENTRY_SIZE - 1
- call FarCopyBytes
- xor a
- ld [hl], a
- ret
-
-.GetNextEmptyEntry:
- ld hl, wCmdQueue
- ld de, CMDQUEUE_ENTRY_SIZE
- ld c, CMDQUEUE_CAPACITY
-.loop
- ld a, [hl]
- and a
- jr z, .done
- add hl, de
- dec c
- jr nz, .loop
- scf
- ret
-
-.done
- ld a, CMDQUEUE_CAPACITY
- sub c
- and a
- ret
-
-DelCmdQueue::
- ld hl, wCmdQueue
- ld de, CMDQUEUE_ENTRY_SIZE
- ld c, CMDQUEUE_CAPACITY
-.loop
- ld a, [hl]
- cp b
- jr z, .done
- add hl, de
- dec c
- jr nz, .loop
- and a
- ret
-
-.done
- xor a
- ld [hl], a
- scf
- ret
-
-_DelCmdQueue:
- ld hl, CMDQUEUE_TYPE
- add hl, bc
- ld [hl], 0
- ret
-
-HandleQueuedCommand:
- ld hl, CMDQUEUE_TYPE
- add hl, bc
- ld a, [hl]
- cp 5
- jr c, .okay
- xor a
-
-.okay
- ld e, a
- ld d, 0
- ld hl, .Jumptable
- add hl, de
- add hl, de
- add hl, de
- ld a, [hli]
- push af
- ld a, [hli]
- ld h, [hl]
- ld l, a
- pop af
- rst FarCall
- ret
-
-.Jumptable:
- dba CmdQueue_Null
- dba CmdQueue_Null2
- dba CmdQueue_StoneTable
- dba CmdQueue_Type3
- dba CmdQueue_Type4
-
-CmdQueueAnonymousJumptable:
- ld hl, CMDQUEUE_05
- add hl, bc
- ld a, [hl]
- pop hl
- rst JumpTable
- ret
-
-CmdQueueAnonJT_Increment:
- ld hl, CMDQUEUE_05
- add hl, bc
- inc [hl]
- ret
-
-CmdQueueAnonJT_Decrement:
- ld hl, CMDQUEUE_05
- add hl, bc
- dec [hl]
- ret
-
-CmdQueue_Null:
- ret
-
-CmdQueue_Null2:
- call ret_2f3e
- ret
-
-CmdQueue_Type4:
- call CmdQueueAnonymousJumptable
- ; anonymous dw
- dw .zero
- dw .one
-
-.zero
- ld a, [hSCY]
- ld hl, 4
- add hl, bc
- ld [hl], a
- call CmdQueueAnonJT_Increment
-.one
- ld hl, 1
- add hl, bc
- ld a, [hl]
- dec a
- ld [hl], a
- jr z, .finish
- and $1
- jr z, .add
- ld hl, 2
- add hl, bc
- ld a, [hSCY]
- sub [hl]
- ld [hSCY], a
- ret
-
-.add
- ld hl, 2
- add hl, bc
- ld a, [hSCY]
- add [hl]
- ld [hSCY], a
- ret
-
-.finish
- ld hl, 4
- add hl, bc
- ld a, [hl]
- ld [hSCY], a
- call _DelCmdQueue
- ret
-
-CmdQueue_Type3:
- call CmdQueueAnonymousJumptable
- ; anonymous dw
- dw .zero
- dw .one
- dw .two
-
-.zero
- call .IsPlayerFacingDown
- jr z, .PlayerNotFacingDown
- call CmdQueueAnonJT_Increment
-.one
- call .IsPlayerFacingDown
- jr z, .PlayerNotFacingDown
- call CmdQueueAnonJT_Increment
-
- ld hl, 2
- add hl, bc
- ld a, [hl]
- ld [wd173], a
- ret
-
-.two
- call .IsPlayerFacingDown
- jr z, .PlayerNotFacingDown
- call CmdQueueAnonJT_Decrement
-
- ld hl, 3
- add hl, bc
- ld a, [hl]
- ld [wd173], a
- ret
-
-.PlayerNotFacingDown:
- ld a, $7f
- ld [wd173], a
- ld hl, 5
- add hl, bc
- ld [hl], 0
- ret
-
-.IsPlayerFacingDown:
- push bc
- ld bc, wPlayerStruct
- call GetSpriteDirection
- and a
- pop bc
- ret
-
-CmdQueue_StoneTable:
- ld de, wPlayerStruct
- ld a, NUM_OBJECT_STRUCTS
-.loop
- push af
-
- ld hl, OBJECT_SPRITE
- add hl, de
- ld a, [hl]
- and a
- jr z, .next
-
- ld hl, OBJECT_MOVEMENTTYPE
- add hl, de
- ld a, [hl]
- cp SPRITEMOVEDATA_STRENGTH_BOULDER
- jr nz, .next
-
- ld hl, OBJECT_NEXT_TILE
- add hl, de
- ld a, [hl]
- call CheckPitTile
- jr nz, .next
-
- ld hl, OBJECT_DIRECTION_WALKING
- add hl, de
- ld a, [hl]
- cp STANDING
- jr nz, .next
- call HandleStoneQueue
- jr c, .fall_down_hole
-
-.next
- ld hl, OBJECT_STRUCT_LENGTH
- add hl, de
- ld d, h
- ld e, l
-
- pop af
- dec a
- jr nz, .loop
- ret
-
-.fall_down_hole
- pop af
- ret
diff --git a/engine/overworld/landmarks.asm b/engine/overworld/landmarks.asm
index 9501b22cd..9deafb8e6 100644
--- a/engine/overworld/landmarks.asm
+++ b/engine/overworld/landmarks.asm
@@ -13,7 +13,6 @@ GetLandmarkCoords:
pop hl
ret
-
GetLandmarkName::
; Copy the name of landmark e to wStringBuffer1.
push hl
@@ -44,10 +43,8 @@ GetLandmarkName::
pop hl
ret
-
INCLUDE "data/maps/landmarks.asm"
-
RegionCheck:
; Checks if the player is in Kanto or Johto.
; If in Johto, returns 0 in e.
diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm
index d0cfd8741..8c1171981 100644
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -2,7 +2,6 @@ INCLUDE "data/sprites/facings.asm"
INCLUDE "data/sprites/map_objects.asm"
-
DeleteMapObject::
push bc
ld hl, OBJECT_MAP_OBJECT_INDEX
@@ -2765,7 +2764,6 @@ ApplyBGMapAnchorToObjects:
pop hl
ret
-
PRIORITY_LOW EQU $10
PRIORITY_NORM EQU $20
PRIORITY_HIGH EQU $30
diff --git a/engine/overworld/map_setup.asm b/engine/overworld/map_setup.asm
index 6cdccba71..b09404240 100644
--- a/engine/overworld/map_setup.asm
+++ b/engine/overworld/map_setup.asm
@@ -107,7 +107,6 @@ MapSetupCommands:
dba DontScrollText ; 2c
dba ReturnFromMapSetupScript ; 2d
-
DontScrollText:
xor a
ld [wDisableTextAcceleration], a
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index fac0b4ae8..f7054c680 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -91,7 +91,6 @@ MovementPointers:
dw Movement_return_dig ; 58
dw Movement_skyfall_top ; 59
-
Movement_teleport_from:
ld hl, OBJECT_STEP_TYPE
add hl, bc
@@ -486,7 +485,6 @@ Movement_big_step_right:
ld a, STEP_BIKE << 2 | RIGHT
jp NormalStep
-
Movement_turn_away_down:
ld a, STEP_SLOW << 2 | DOWN
jp TurningStep
@@ -535,7 +533,6 @@ Movement_turn_waterfall_right:
ld a, STEP_BIKE << 2 | RIGHT
jp TurningStep
-
Movement_slow_slide_step_down:
ld a, STEP_SLOW << 2 | DOWN
jp SlideStep
@@ -584,7 +581,6 @@ Movement_fast_slide_step_right:
ld a, STEP_BIKE << 2 | RIGHT
jp SlideStep
-
Movement_slow_jump_step_down:
ld a, STEP_SLOW << 2 | DOWN
jp JumpStep
@@ -633,7 +629,6 @@ Movement_fast_jump_step_right:
ld a, STEP_BIKE << 2 | RIGHT
jp JumpStep
-
Movement_turn_step_down:
ld a, OW_DOWN
jr TurnStep
@@ -724,7 +719,6 @@ TurningStep:
ld [hl], STEP_TYPE_PLAYER_WALK
ret
-
SlideStep:
call InitStep
call UpdateTallGrassFlags
@@ -749,7 +743,6 @@ SlideStep:
ld [hl], STEP_TYPE_PLAYER_WALK
ret
-
JumpStep:
call InitStep
ld hl, OBJECT_1F
diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm
index 07881a788..b4b5ef467 100644
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_movement.asm
@@ -1,5 +1,4 @@
CanObjectMoveInDirection:
-
ld hl, OBJECT_PALETTE
add hl, bc
bit SWIMMING_F, [hl]
@@ -58,7 +57,6 @@ CanObjectMoveInDirection:
and a
ret
-
WillObjectBumpIntoWater:
call Function6f5f
ret c
@@ -144,9 +142,9 @@ Function6f5f:
Function6f7f:
ld d, a
and $f0
- cp $b0
+ cp HI_NYBBLE_SIDE_WALLS
jr z, .done
- cp $c0
+ cp HI_NYBBLE_UNUSED_C0
jr z, .done
xor a
ret
@@ -216,10 +214,7 @@ Function6fa1:
scf
ret
-
-
CheckFacingObject::
-
call GetFacingTileCoord
; Double the distance for counter tiles.
@@ -258,7 +253,6 @@ CheckFacingObject::
scf
ret
-
WillObjectBumpIntoSomeoneElse:
ld hl, OBJECT_NEXT_MAP_X
add hl, bc
@@ -532,7 +526,6 @@ Unreferenced_Function7113:
scf
ret
-
Function7171:
ld hl, OBJECT_NEXT_MAP_X
add hl, bc
diff --git a/engine/overworld/overworld.asm b/engine/overworld/overworld.asm
index 35a792921..f3dcb5b96 100644
--- a/engine/overworld/overworld.asm
+++ b/engine/overworld/overworld.asm
@@ -91,7 +91,6 @@ GetPlayerSprite:
INCLUDE "data/sprites/player_sprites.asm"
-
AddMapSprites:
call GetMapEnvironment
call CheckOutdoorMap
@@ -103,7 +102,6 @@ AddMapSprites:
call AddOutdoorSprites
ret
-
AddIndoorSprites:
ld hl, wMap1ObjectSprite
ld a, 1
@@ -119,7 +117,6 @@ AddIndoorSprites:
jr nz, .loop
ret
-
AddOutdoorSprites:
ld a, [wMapGroup]
dec a
@@ -141,7 +138,6 @@ AddOutdoorSprites:
jr nz, .loop
ret
-
LoadUsedSpritesGFX:
ld a, MAPCALLBACK_SPRITES
call RunMapCallback
@@ -165,8 +161,6 @@ LoadUsedSpritesGFX:
farcall LoadEmote
ret
-
-
SafeGetSprite:
push hl
call GetSprite
@@ -200,7 +194,6 @@ GetSprite:
ld h, a
ret
-
GetMonSprite:
; Return carry if a monster sprite was loaded.
@@ -263,7 +256,6 @@ GetMonSprite:
and a
ret
-
_DoesSpriteHaveFacings::
; Checks to see whether we can apply a facing to a sprite.
; Returns carry unless the sprite is a Pokemon or a Still Sprite.
@@ -290,7 +282,6 @@ _DoesSpriteHaveFacings::
and a
ret
-
_GetSpritePalette::
ld a, c
call GetMonSprite
@@ -310,14 +301,12 @@ _GetSpritePalette::
ld c, a
ret
-
LoadAndSortSprites:
call LoadSpriteGFX
call SortUsedSprites
call ArrangeUsedSprites
ret
-
AddSpriteGFX:
; Add any new sprite ids to a list of graphics to be loaded.
; Return carry if the list is full.
@@ -356,7 +345,6 @@ AddSpriteGFX:
and a
ret
-
LoadSpriteGFX:
; Bug: b is not preserved, so it's useless as a next count.
; Uncomment the lines below to fix.
@@ -384,7 +372,6 @@ LoadSpriteGFX:
ld a, l
ret
-
SortUsedSprites:
; Bubble-sort sprites by type.
@@ -455,7 +442,6 @@ SortUsedSprites:
.quit
ret
-
ArrangeUsedSprites:
; Get the length of each sprite and space them out in VRAM.
; Crystal introduces a second table in VRAM bank 0.
@@ -514,7 +500,6 @@ ArrangeUsedSprites:
.quit
ret
-
GetSpriteLength:
; Return the length of sprite type a in tiles.
@@ -536,7 +521,6 @@ GetSpriteLength:
ld a, 4
ret
-
GetUsedSprites:
ld hl, wUsedSprites
ld c, SPRITE_GFX_LIST_CAPACITY
@@ -678,7 +662,6 @@ LoadEmote::
call GetEmote2bpp
ret
-
INCLUDE "data/sprites/emotes.asm"
INCLUDE "data/sprites/sprite_mons.asm"
diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm
index 0a2674341..c70357f13 100644
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -256,7 +256,6 @@ DoPlayerMovement::
ret
.TryStep:
-
; Surfing actually calls .TrySurf directly instead of passing through here.
ld a, [wPlayerState]
cp PLAYER_SURF
@@ -321,7 +320,6 @@ DoPlayerMovement::
ret
.TrySurf:
-
call .CheckSurfPerms
ld [wd040], a
jr c, .surf_bump
@@ -395,7 +393,6 @@ DoPlayerMovement::
db FACE_UP | FACE_LEFT ; COLL_HOP_UP_LEFT
.CheckWarp:
-
; Bug: Since no case is made for STANDING here, it will check
; [.edgewarps + $ff]. This resolves to $3e at $8035a.
; This causes wd041 to be nonzero when standing on tile $3e,
@@ -657,7 +654,6 @@ DoPlayerMovement::
ret
.CheckStrengthBoulder:
-
ld hl, wBikeFlags
bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
jr z, .not_boulder
@@ -779,7 +775,6 @@ DoPlayerMovement::
ret
.BumpSound:
-
call CheckSFX
ret c
ld de, SFX_BUMP
diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm
index a2315a541..f8e702eb9 100644
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -1,6 +1,5 @@
; Event scripting commands.
-
EnableScriptMode::
push af
ld a, SCRIPT_READ
@@ -62,7 +61,6 @@ RunScriptCommand:
rst JumpTable
ret
-
ScriptCommandTable:
; entries correspond to macros/scripts/events.asm enumeration
dw Script_scall ; 00
@@ -332,7 +330,6 @@ JumpTextScript:
closetext
end
-
if _CRYSTAL
Script_farjumptext:
@@ -351,7 +348,6 @@ Script_farjumptext:
endc
-
Script_writetext:
; script command 0x4c
; parameters: text_pointer
@@ -521,7 +517,6 @@ Script_verbosegiveitem:
ld de, GiveItemScript
jp ScriptCall
-
ret_96f76:
ret
@@ -544,7 +539,6 @@ ReceivedItemText:
text_jump UnknownText_0x1c4719
db "@"
-
Script_verbosegiveitem2:
; script command 0x9f
; parameters: item, var
@@ -608,7 +602,6 @@ Script_specialsound:
call WaitSFX
ret
-
GetPocketName:
farcall CheckItemPocket
ld a, [wItemAttributeParamBuffer]
@@ -634,7 +627,6 @@ CurItemName:
call GetItemName
ret
-
PutItemInPocketText:
text_jump UnknownText_0x1c472c
db "@"
@@ -643,7 +635,6 @@ PocketIsFullText:
text_jump UnknownText_0x1c474b
db "@"
-
Script_pokemart:
; script command 0x94
; parameters: dialog_id, mart_id
@@ -1274,7 +1265,6 @@ ShowEmoteScript:
step_sleep 1
step_end
-
Script_earthquake:
; script command 0x78
; parameters: param
@@ -1301,7 +1291,6 @@ EarthquakeMovement:
step_end
.End
-
Script_loadpikachudata:
; script command 0x5a
@@ -2664,7 +2653,6 @@ Script_closetext:
call CloseText
ret
-
Script_passtoengine:
; script command 0x89
; parameters: data_pointer
@@ -2834,7 +2822,6 @@ Script_checksave:
ld [wScriptVar], a
ret
-
; unused
ld a, [.byte]
ld [wScriptVar], a
diff --git a/engine/overworld/select_menu.asm b/engine/overworld/select_menu.asm
index 069d74f2d..9eba9de83 100644
--- a/engine/overworld/select_menu.asm
+++ b/engine/overworld/select_menu.asm
@@ -1,5 +1,4 @@
SelectMenu::
-
call CheckRegisteredItem
jr c, .NotRegistered
jp UseRegisteredItem
@@ -12,14 +11,11 @@ SelectMenu::
call WaitButton
jp CloseText
-
ItemMayBeRegisteredText:
text_jump UnknownText_0x1c1cf3
db "@"
-
CheckRegisteredItem:
-
ld a, [wWhichRegisteredItem]
and a
jr z, .NoRegisteredItem
@@ -85,7 +81,6 @@ CheckRegisteredItem:
scf
ret
-
.CheckRegisteredNo:
ld a, [wWhichRegisteredItem]
and REGISTERED_NUMBER
@@ -100,7 +95,6 @@ CheckRegisteredItem:
scf
ret
-
.IsSameItem:
ld a, [wRegisteredItem]
cp [hl]
@@ -113,9 +107,7 @@ CheckRegisteredItem:
scf
ret
-
UseRegisteredItem:
-
farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
ld hl, .SwitchTo
diff --git a/engine/overworld/spawn_points.asm b/engine/overworld/spawn_points.asm
index 2c673d6b1..6b4476f2b 100644
--- a/engine/overworld/spawn_points.asm
+++ b/engine/overworld/spawn_points.asm
@@ -1,6 +1,5 @@
INCLUDE "data/maps/spawn_points.asm"
-
LoadSpawnPoint:
; loads the spawn point in wDefaultSpawnpoint
push hl
@@ -27,7 +26,6 @@ LoadSpawnPoint:
pop hl
ret
-
IsSpawnPoint:
; Checks if the map loaded in de is a spawn point. Returns carry if it's a spawn point.
ld hl, SpawnPoints
diff --git a/engine/overworld/time.asm b/engine/overworld/time.asm
index 136adb221..abb12d87d 100644
--- a/engine/overworld/time.asm
+++ b/engine/overworld/time.asm
@@ -137,7 +137,6 @@ StartBugContestTimer:
call CopyDayHourMinSecToHL
ret
-
CheckBugContestTimer::
ld hl, wBugContestStartTime
call CalcSecsMinsHoursDaysSince
@@ -172,7 +171,6 @@ CheckBugContestTimer::
scf
ret
-
InitializeStartDay:
call UpdateTime
ld hl, wTimerEventStartDay
diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm
index 0ab9a6c2d..54df4a97f 100644
--- a/engine/overworld/warp_connection.asm
+++ b/engine/overworld/warp_connection.asm
@@ -15,7 +15,6 @@ InitCommandQueue:
ld [wMapTimeOfDay], a
ret
-
EnterMapConnection:
; Return carry if a connection has been entered.
ld a, [wPlayerStepDirection]
@@ -388,7 +387,6 @@ CheckMovingOffEdgeOfMap::
scf
ret
-
GetCoordOfUpperLeftCorner::
ld hl, wOverworldMapBlocks
ld a, [wXCoord]
diff --git a/engine/overworld/wildmons.asm b/engine/overworld/wildmons.asm
index ae611d4ca..d88e5908f 100644
--- a/engine/overworld/wildmons.asm
+++ b/engine/overworld/wildmons.asm
@@ -490,7 +490,6 @@ LookUpWildmonsForMapDE:
scf
ret
-
InitRoamMons:
; initialize wRoamMon structs
@@ -524,7 +523,6 @@ InitRoamMons:
ret
-
CheckEncounterRoamMon:
push hl
; Don't trigger an encounter if we're on water.
@@ -572,7 +570,6 @@ CheckEncounterRoamMon:
and a
ret
-
UpdateRoamMons:
ld a, [wRoamMon1MapGroup]
cp GROUP_N_A
@@ -615,7 +612,6 @@ UpdateRoamMons:
.Finished:
jp _BackUpMapIndices
-
.Update:
ld hl, RoamMaps
.loop
@@ -752,10 +748,8 @@ _BackUpMapIndices:
ld [wRoamMons_CurrentMapGroup], a
ret
-
INCLUDE "data/wild/roammon_maps.asm"
-
ValidateTempWildMonSpecies:
; Due to a development oversight, this function is called with the wild Pokemon's level, not its species, in a.
and a
@@ -965,7 +959,6 @@ RandomPhoneMon:
ld bc, MON_NAME_LENGTH
jp CopyBytes
-
INCLUDE "data/wild/johto_grass.asm"
INCLUDE "data/wild/johto_water.asm"
INCLUDE "data/wild/kanto_grass.asm"
diff --git a/engine/phone/generic_calls.asm b/engine/phone/generic_calls.asm
index 359d0146b..407480d36 100644
--- a/engine/phone/generic_calls.asm
+++ b/engine/phone/generic_calls.asm
@@ -1255,11 +1255,9 @@ PhoneScript_MonFlavorText:
buttonsound
farjump PhoneScript_HangupText_Male
-
GrandmaString: db "Grandma@"
GrandpaString: db "Grandpa@"
MomString: db "Mom@"
DadString: db "Dad@"
SisterString: db "Sister@"
BrotherString: db "Brother@"
-
diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm
index 5c8425c75..06a241cad 100644
--- a/engine/phone/phone.asm
+++ b/engine/phone/phone.asm
@@ -11,7 +11,6 @@ AddPhoneNumber::
scf
ret
-
DelCellNum::
call _CheckCellNum
jr nc, .not_in_list
@@ -94,7 +93,6 @@ GetRemainingSpaceInPhoneList:
INCLUDE "data/phone/permanent_numbers.asm"
-
FarPlaceString:
ld a, [hROMBank]
push af
@@ -107,7 +105,6 @@ FarPlaceString:
rst Bankswitch
ret
-
CheckPhoneCall::
; Check if the phone is ringing in the overworld.
@@ -508,7 +505,6 @@ Phone_CallerTextboxWithName2:
call FarPlaceString
ret
-
Phone_NoSignal:
ld de, SFX_NO_SIGNAL
call PlaySFX
@@ -548,7 +544,6 @@ UnknownText_0x9032a:
text_jump UnknownText_0x1c5580
db "@"
-
HangUp_BoopOn:
ld hl, UnknownText_0x90336
call PrintText
@@ -558,7 +553,6 @@ UnknownText_0x90336:
text_jump UnknownText_0x1c5588
db "@"
-
HangUp_BoopOff:
call SpeechTextBox
ret
@@ -581,7 +575,6 @@ Phone_Wait20Frames:
farcall PhoneRing_CopyTilemapAtOnce
ret
-
Function90363:
push bc
call Phone_CallerTextbox
@@ -595,7 +588,6 @@ Function90363:
call Function90380
ret
-
Phone_CallerTextbox:
hlcoord 0, 0
ld b, 2
@@ -603,7 +595,6 @@ Phone_CallerTextbox:
call TextBox
ret
-
Function90380:
ld h, d
ld l, e
@@ -637,7 +628,6 @@ GetCallerTrainerClass:
pop hl
ret
-
GetCallerName:
ld a, c
and a
@@ -710,12 +700,10 @@ GetCallerLocation:
pop de
ret
-
INCLUDE "data/phone/phone_contacts.asm"
INCLUDE "data/phone/special_calls.asm"
-
UnknownScript_0x90657:
writetext UnknownText_0x9065b
end
diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm
index 147a0ff15..5682dac35 100644
--- a/engine/pokedex/pokedex.asm
+++ b/engine/pokedex/pokedex.asm
@@ -19,7 +19,6 @@ POKEDEX_SCX EQU 5
GLOBAL POKEDEX_SCX
Pokedex:
-
ld a, [hWX]
ld l, a
ld a, [hWY]
@@ -427,7 +426,6 @@ DexEntryScreen_ArrowCursorData:
dwcoord 11, 17 ; CRY
dwcoord 15, 17 ; PRNT
-
DexEntryScreen_MenuActionJumptable:
dw Pokedex_Page
dw .Area
@@ -1069,7 +1067,6 @@ Pokedex_FillColumn:
pop de
ret
-
Pokedex_DrawMainScreenBG:
; Draws the left sidebar and the bottom bar on the main screen.
hlcoord 0, 17
@@ -1416,7 +1413,6 @@ Pokedex_PlaceString:
ld [hli], a
jr .loop
-
Pokedex_PlaceBorder:
push hl
ld a, $33
@@ -1460,7 +1456,6 @@ Pokedex_PlaceBorder:
dec e
jr .row_loop
-
Pokedex_PrintListing:
; Prints the list of Pokémon on the main Pokédex screen.
@@ -1578,7 +1573,6 @@ Pokedex_DrawFootprint:
ld [hl], a
ret
-
Pokedex_GetSelectedMon:
; Gets the species of the currently selected Pokémon. This corresponds to the
; position of the cursor in the main listing, but this function can be used
@@ -1594,7 +1588,6 @@ Pokedex_GetSelectedMon:
ld [wd265], a
ret
-
Pokedex_CheckCaught:
push de
push hl
@@ -1605,7 +1598,6 @@ Pokedex_CheckCaught:
pop de
ret
-
Pokedex_CheckSeen:
push de
push hl
@@ -1616,8 +1608,6 @@ Pokedex_CheckSeen:
pop de
ret
-
-
Pokedex_OrderMonsByMode:
ld hl, wPokedexOrder
ld bc, wPokedexOrderEnd - wPokedexOrder
@@ -1711,12 +1701,10 @@ Pokedex_ABCMode:
.doneabc
ret
-
INCLUDE "data/pokemon/dex_order_alpha.asm"
INCLUDE "data/pokemon/dex_order_new.asm"
-
Pokedex_DisplayModeDescription:
xor a
ld [hBGMapMode], a
@@ -2349,7 +2337,6 @@ Pokedex_ApplyUsualPals:
call DmgToCgbObjPal0
ret
-
Pokedex_LoadPointer:
ld e, a
ld d, 0
@@ -2387,7 +2374,6 @@ Pokedex_LoadSelectedMonTiles:
call CloseSRAM
ret
-
Pokedex_LoadCurrentFootprint:
call Pokedex_GetSelectedMon
@@ -2431,7 +2417,6 @@ Pokedex_LoadAnyFootprint:
ret
-
Pokedex_LoadGFX:
call DisableLCD
ld hl, vTiles2
@@ -2561,7 +2546,6 @@ _NewPokedexEntry:
call PlayMonCry
ret
-
Pokedex_SetBGMapMode3:
ld a, $3
ld [hBGMapMode], a
@@ -2585,7 +2569,6 @@ Pokedex_SetBGMapMode_3ifDMG_4ifCGB:
call Pokedex_SetBGMapMode3
ret
-
Pokedex_ResetBGMapMode:
xor a
ld [hBGMapMode], a
diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/pokedex_2.asm
index 21aea61b4..8105a080a 100644
--- a/engine/pokedex/pokedex_2.asm
+++ b/engine/pokedex/pokedex_2.asm
@@ -279,3 +279,5 @@ endr
ld e, l
pop hl
ret
+
+INCLUDE "data/pokemon/dex_entry_pointers.asm"
diff --git a/engine/pokedex/unown_dex.asm b/engine/pokedex/unown_dex.asm
index 93f9d3d81..054c945cf 100644
--- a/engine/pokedex/unown_dex.asm
+++ b/engine/pokedex/unown_dex.asm
@@ -46,5 +46,4 @@ PrintUnownWord:
ld [hli], a
jr .loop
-
INCLUDE "data/pokemon/unown_words.asm"
diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm
index 741d58c8f..8fc5ffa3d 100644
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -157,7 +157,6 @@ Pokegear_LoadGFX:
call CopyBytes
ret
-
FastShipGFX:
INCBIN "gfx/pokegear/fast_ship.2bpp"
@@ -182,7 +181,6 @@ AnimatePokegearModeIndicatorArrow:
ld [hl], a
ret
-
.XCoords:
db $00 ; POKEGEARCARD_CLOCK
db $10 ; POKEGEARCARD_MAP
@@ -204,7 +202,6 @@ TownMap_GetCurrentLandmark:
call GetWorldMapLocation
ret
-
TownMap_InitCursorAndPlayerIconPositions:
ld a, [wMapGroup]
ld b, a
@@ -301,7 +298,6 @@ InitPokegearTilemap:
call WaitBGMap
ret
-
.Jumptable:
; entries correspond to POKEGEARCARD_* constants
dw .Clock
@@ -321,7 +317,6 @@ InitPokegearTilemap:
call Pokegear_UpdateClock
ret
-
.switch
db " SWITCH▶@"
@@ -351,7 +346,6 @@ InitPokegearTilemap:
call PokegearMap_UpdateLandmarkName
ret
-
.Radio:
ld de, RadioTilemapRLE
call Pokegear_LoadTilemapRLE
@@ -360,7 +354,6 @@ InitPokegearTilemap:
call TextBox
ret
-
.Phone:
ld de, PhoneTilemapRLE
call Pokegear_LoadTilemapRLE
@@ -371,7 +364,6 @@ InitPokegearTilemap:
call PokegearPhone_UpdateDisplayList
ret
-
.PlacePhoneBars:
hlcoord 17, 1
ld a, $3c
@@ -543,7 +535,6 @@ Pokegear_UpdateClock:
text_jump UnknownText_0x1c5821
db "@"
-
PokegearMap_CheckRegion:
ld a, [wPokegearMapPlayerIconLandmark]
cp FAST_SHIP
@@ -695,7 +686,6 @@ PokegearMap_InitPlayerIcon:
ld [hl], d
ret
-
PokegearMap_InitCursor:
push af
depixel 0, 0
@@ -713,7 +703,6 @@ PokegearMap_InitCursor:
pop bc
ret
-
PokegearMap_UpdateLandmarkName:
push af
hlcoord 8, 0
@@ -729,7 +718,6 @@ PokegearMap_UpdateLandmarkName:
ld [hl], $34
ret
-
PokegearMap_UpdateCursorPosition:
push bc
ld e, a
@@ -743,7 +731,6 @@ PokegearMap_UpdateCursorPosition:
ld [hl], d
ret
-
TownMap_GetKantoLandmarkLimits:
ld a, [wStatusFlags]
bit STATUSFLAGS_HALL_OF_FAME_F, a
@@ -757,7 +744,6 @@ TownMap_GetKantoLandmarkLimits:
ld e, VICTORY_ROAD
ret
-
PokegearRadio_Init:
call InitPokegearTilemap
depixel 4, 10, 4, 4
@@ -948,19 +934,16 @@ PokegearPhone_MakePhoneCall:
call PrintText
ret
-
.dotdotdot
;
text_jump UnknownText_0x1c5824
db "@"
-
.OutOfServiceArea:
; You're out of the service area.
text_jump UnknownText_0x1c5827
db "@"
-
PokegearPhone_FinishPhoneCall:
ld a, [hJoyPressed]
and A_BUTTON | B_BUTTON
@@ -1088,7 +1071,6 @@ PokegearPhone_UpdateDisplayList:
call PokegearPhone_UpdateCursor
ret
-
PokegearPhone_DeletePhoneNumber:
ld hl, wPhoneList
ld a, [wPokegearPhoneScrollPosition]
@@ -1114,7 +1096,6 @@ PokegearPhone_DeletePhoneNumber:
jr nz, .loop
ret
-
PokegearPhoneContactSubmenu:
ld hl, wPhoneList
ld a, [wPokegearPhoneScrollPosition]
@@ -1230,7 +1211,6 @@ PokegearPhoneContactSubmenu:
scf
ret
-
.Delete:
ld hl, PokegearText_DeleteStoredNumber
call MenuTextBox
@@ -1248,12 +1228,10 @@ PokegearPhoneContactSubmenu:
scf
ret
-
.Call:
and a
ret
-
.UpdateCursor:
push de
ld a, [de]
@@ -1280,7 +1258,6 @@ PokegearPhoneContactSubmenu:
pop de
ret
-
.CallDeleteCancelStrings:
dwcoord 10, 6
db 3
@@ -1294,7 +1271,6 @@ PokegearPhoneContactSubmenu:
dw .Delete
dw .Cancel
-
.CallCancelStrings:
dwcoord 10, 8
db 2
@@ -1306,7 +1282,6 @@ PokegearPhoneContactSubmenu:
dw .Call
dw .Cancel
-
; unused
ld a, [hHours]
cp 12
@@ -1321,7 +1296,6 @@ PokegearPhoneContactSubmenu:
and a
ret
-
Pokegear_SwitchPage:
ld de, SFX_READ_TEXT_2
call PlaySFX
@@ -1348,7 +1322,6 @@ ExitPokegearRadio_HandleMusic:
ld [wPokegearRadioMusicPlaying], a
ret
-
DeleteSpriteAnimStruct2ToEnd:
ld hl, wSpriteAnim2
ld bc, wSpriteAnimationStructsEnd - wSpriteAnim2
@@ -1378,25 +1351,21 @@ Pokegear_LoadTilemapRLE:
jr nz, .load
jr .loop
-
PokegearText_WhomToCall:
; Whom do you want to call?
text_jump UnknownText_0x1c5847
db "@"
-
PokegearText_PressAnyButtonToExit:
; Press any button to exit.
text_jump UnknownText_0x1c5862
db "@"
-
PokegearText_DeleteStoredNumber:
; Delete this stored phone number?
text_jump UnknownText_0x1c587d
db "@"
-
PokegearSpritesGFX:
INCBIN "gfx/pokegear/pokegear_sprites.2bpp.lz"
@@ -1487,7 +1456,6 @@ UpdateRadioStation:
ld [hBGMapMode], a
ret
-
; unused
ld [wPokegearRadioChannelBank], a
ld a, [hli]
@@ -1496,7 +1464,6 @@ UpdateRadioStation:
ld [wPokegearRadioChannelAddr + 1], a
ret
-
RadioChannels:
; entries correspond to constants/radio_constants.asm
@@ -1662,7 +1629,6 @@ LoadStation_BuenasPassword:
ld de, BuenasPasswordName
ret
-
BuenasPasswordName: db "BUENA'S PASSWORD@"
NotBuenasPasswordName: db "@"
@@ -1699,7 +1665,6 @@ LoadStation_LetsAllSing:
ld de, LetsAllSingName
ret
-
LoadStation_RocketRadio:
ld a, ROCKET_RADIO
ld [wCurrentRadioLine], a
@@ -1711,7 +1676,6 @@ LoadStation_RocketRadio:
ld de, LetsAllSingName
ret
-
LoadStation_PokeFluteRadio:
ld a, POKE_FLUTE_RADIO
ld [wCurrentRadioLine], a
@@ -1734,7 +1698,6 @@ LoadStation_EvolutionRadio:
ld de, UnownStationName
ret
-
Unreferenced_LoadStation:
ret
@@ -1798,7 +1761,6 @@ NoRadioName:
call TextBox
ret
-
OaksPKMNTalkName: db "OAK's <PK><MN> Talk@"
PokedexShowName: db "#DEX Show@"
PokemonMusicName: db "#MON Music@"
@@ -2008,7 +1970,6 @@ PlayRadio:
call ExitPokegearRadio_HandleMusic
ret
-
.PlayStation:
ld a, ENTER_MAP_MUSIC
ld [wPokegearRadioMusicPlaying], a
@@ -2029,17 +1990,16 @@ PlayRadio:
lb bc, 4, 18
call TextBox
hlcoord 1, 14
- ld [hl], $72
+ ld [hl], "“"
pop de
hlcoord 2, 14
call PlaceString
ld h, b
ld l, c
- ld [hl], $73
+ ld [hl], "”"
call WaitBGMap
ret
-
.StationPointers:
; entries correspond to MAPRADIO_* constants
dw .OakOrPnP
@@ -2052,7 +2012,6 @@ PlayRadio:
dw LoadStation_LetsAllSing
dw LoadStation_RocketRadio
-
.OakOrPnP:
call IsInJohto
and a
@@ -2066,7 +2025,6 @@ PlayRadio:
.kanto
jp LoadStation_PlacesAndPeople
-
PokegearMap:
ld a, e
and a
@@ -2080,7 +2038,6 @@ PokegearMap:
call FillKantoMap
ret
-
_FlyMap:
call ClearBGPalettes
call ClearTileMap
@@ -2144,7 +2101,6 @@ _FlyMap:
ld e, a
ret
-
FlyMapScroll:
ld a, [wStartFlypoint]
ld e, a
@@ -2192,7 +2148,6 @@ FlyMapScroll:
ld [hBGMapMode], a
ret
-
TownMapBubble:
; Draw the bubble containing the location text in the town map HUD
@@ -2255,7 +2210,6 @@ TownMapBubble:
call PlaceString
ret
-
GetMapCursorCoordinates:
ld a, [wTownMapPlayerIconLandmark]
ld l, a
@@ -2277,7 +2231,6 @@ GetMapCursorCoordinates:
ld [hl], d
ret
-
CheckIfVisitedFlypoint:
; Check if the flypoint loaded in [hl] has been visited yet.
push bc
@@ -2296,7 +2249,6 @@ CheckIfVisitedFlypoint:
and a
ret
-
HasVisitedSpawn:
; Check if spawn point c has been visited.
ld hl, wVisitedSpawns
@@ -2306,13 +2258,11 @@ HasVisitedSpawn:
ld a, c
ret
-
INCLUDE "data/maps/flypoints.asm"
ret_91c8f:
ret
-
FlyMap:
ld a, [wMapGroup]
ld b, a
@@ -2407,7 +2357,6 @@ FlyMap:
ld [wTownMapCursorCoordinates + 1], a
ret
-
Pokedex_GetArea:
; e: Current landmark
ld a, [wTownMapPlayerIconLandmark]
@@ -2474,7 +2423,6 @@ Pokedex_GetArea:
ld [wTownMapPlayerIconLandmark], a
ret
-
.LeftRightInput:
ld a, [hl]
and D_LEFT
@@ -2509,7 +2457,6 @@ Pokedex_GetArea:
call .GetAndPlaceNest
ret
-
.BlinkNestIcons:
ld a, [hVBlankCounter]
ld e, a
@@ -2528,7 +2475,6 @@ Pokedex_GetArea:
call CopyBytes
ret
-
.PlaceString_MonsNest:
hlcoord 0, 0
ld bc, SCREEN_WIDTH
@@ -2550,7 +2496,6 @@ Pokedex_GetArea:
call PlaceString
ret
-
.String_SNest:
db "'S NEST@"
@@ -2592,7 +2537,6 @@ Pokedex_GetArea:
call CopyBytes
ret
-
.HideNestsShowPlayer:
call .CheckPlayerLocation
ret c
@@ -2637,7 +2581,6 @@ Pokedex_GetArea:
call ByteFill
ret
-
.PlayerOAM:
; y pxl, x pxl, tile offset
db -1 * 8, -1 * 8, 0 ; top left
@@ -2677,7 +2620,6 @@ Pokedex_GetArea:
scf
ret
-
.GetPlayerOrFastShipIcon:
ld a, [wTownMapPlayerIconLandmark]
cp FAST_SHIP
@@ -2690,7 +2632,6 @@ Pokedex_GetArea:
ld b, BANK(FastShipGFX)
ret
-
TownMapBGUpdate:
; Update BG Map tiles and attributes
@@ -2719,7 +2660,6 @@ TownMapBGUpdate:
ld [hBGMapMode], a
ret
-
FillJohtoMap:
ld de, JohtoMap
jr FillTownMap
@@ -2737,7 +2677,6 @@ FillTownMap:
inc de
jr .loop
-
TownMapPals:
; Assign palettes based on tile ids
hlcoord 0, 0
@@ -2818,7 +2757,6 @@ TownMapMon:
ld [hl], SPRITE_ANIM_SEQ_NULL
ret
-
TownMapPlayerIcon:
; Draw the player icon at town map location in a
push af
@@ -2862,7 +2800,6 @@ TownMapPlayerIcon:
ld [hl], d
ret
-
LoadTownMapGFX:
ld hl, TownMapGFX
ld de, vTiles2
@@ -2870,7 +2807,6 @@ LoadTownMapGFX:
call DecompressRequest2bpp
ret
-
JohtoMap:
INCBIN "gfx/pokegear/johto.bin"
@@ -2960,7 +2896,6 @@ Unreferenced_Function92311:
ld e, a
ret
-
.HandleDPad:
ld hl, hJoyLast
ld a, [hl]
@@ -3011,4 +2946,3 @@ Unreferenced_Function92311:
xor a
ld [hBGMapMode], a
ret
-
diff --git a/engine/pokegear/radio.asm b/engine/pokegear/radio.asm
index a4eb345d4..b76cad13e 100644
--- a/engine/pokegear/radio.asm
+++ b/engine/pokegear/radio.asm
@@ -126,7 +126,6 @@ RadioJumptable:
dw PokedexShow7 ; $56
dw PokedexShow8 ; $57
-
PrintRadioLine:
ld [wNextRadioLine], a
ld hl, wRadioText
diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm
index c5904e9b0..65621192d 100644
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -152,7 +152,6 @@ BillsPCDepositJumptable:
dw BillsPCDepositFuncRelease ; Release Pokemon
dw BillsPCDepositFuncCancel ; Cancel
-
BillsPCDepositFuncDeposit:
call BillsPC_CheckMail_PreventBlackout
jp c, BillsPCDepositFuncCancel
@@ -410,7 +409,6 @@ BillsPC_Withdraw:
dw .release ; Release
dw .cancel ; Cancel
-
.withdraw
call BillsPC_CheckMail_PreventBlackout
jp c, .cancel
@@ -1874,7 +1872,6 @@ TryWithdrawPokemon:
scf
ret
-
ReleasePKMN_ByePKMN:
hlcoord 0, 0
lb bc, 15, 8
@@ -2230,7 +2227,6 @@ PCString_BoxFull: db "The BOX is full.@"
PCString_PartyFull: db "The party's full!@"
PCString_NoReleasingEGGS: db "No releasing EGGS!@"
-
_ChangeBox:
call LoadStandardMenuHeader
call BillsPC_ClearTilemap
diff --git a/engine/pokemon/breeding.asm b/engine/pokemon/breeding.asm
index f4aafe5d9..7e7f0e097 100644
--- a/engine/pokemon/breeding.asm
+++ b/engine/pokemon/breeding.asm
@@ -84,7 +84,6 @@ CheckBreedmonCompatibility:
ld [wd265], a
ret
-
.CheckDVs:
; If Defense DVs match and the lower 3 bits of the Special DVs match,
; avoid breeding
@@ -623,7 +622,6 @@ GetBreedmonMovePointer:
ld hl, wBreedMon2Moves
ret
-
GetEggFrontpic:
push de
ld [wCurPartySpecies], a
@@ -961,4 +959,3 @@ Unreferenced_DayCareMonPrintEmptyString:
.string
db "@"
-
diff --git a/engine/pokemon/evolve.asm b/engine/pokemon/evolve.asm
index dab58a44f..571cff0b8 100644
--- a/engine/pokemon/evolve.asm
+++ b/engine/pokemon/evolve.asm
@@ -87,7 +87,6 @@ EvolveAfterBattle_MasterLoop:
cp EVOLVE_HAPPINESS
jr z, .happiness
-
; EVOLVE_STAT
ld a, [wTempMonLevel]
cp [hl]
@@ -116,7 +115,6 @@ EvolveAfterBattle_MasterLoop:
inc hl
jr .proceed
-
.happiness
ld a, [wTempMonHappiness]
cp HAPPINESS_TO_EVOLVE
@@ -143,7 +141,6 @@ EvolveAfterBattle_MasterLoop:
jp z, .dont_evolve_3
jr .proceed
-
.trade
ld a, [wLinkMode]
and a
@@ -169,7 +166,6 @@ EvolveAfterBattle_MasterLoop:
ld [wTempMonItem], a
jr .proceed
-
.item
ld a, [hli]
ld b, a
@@ -185,7 +181,6 @@ EvolveAfterBattle_MasterLoop:
jp nz, .dont_evolve_3
jr .proceed
-
.level
ld a, [hli]
ld b, a
@@ -419,7 +414,6 @@ Text_WhatEvolving:
text_jump UnknownText_0x1c4be3
db "@"
-
LearnLevelMoves:
ld a, [wd265]
ld [wCurPartySpecies], a
@@ -484,7 +478,6 @@ LearnLevelMoves:
ld [wd265], a
ret
-
FillMoves:
; Fill in moves at de for wCurPartySpecies at wCurPartyLevel
@@ -605,7 +598,6 @@ ShiftMoves:
jr nz, .loop
ret
-
EvoFlagAction:
push de
ld d, $0
diff --git a/engine/pokemon/mail.asm b/engine/pokemon/mail.asm
index caaf6f01b..359d2ac8e 100644
--- a/engine/pokemon/mail.asm
+++ b/engine/pokemon/mail.asm
@@ -188,7 +188,6 @@ CheckPokeMail::
ld [wScriptVar], a
ret
-
GivePokeMail::
ld a, [wPartyCount]
dec a
@@ -237,7 +236,6 @@ GivePokeMail::
ld [de], a
jp CloseSRAM
-
BackupPartyMonMail:
ld a, BANK(sPartyMail)
call GetSRAMBank
@@ -277,7 +275,6 @@ DeletePartyMonMail:
call ByteFill
jp CloseSRAM
-
IsAnyMonHoldingMail:
ld a, [wPartyCount]
and a
diff --git a/engine/pokemon/mon_stats.asm b/engine/pokemon/mon_stats.asm
index 829e99e6b..76f09b461 100644
--- a/engine/pokemon/mon_stats.asm
+++ b/engine/pokemon/mon_stats.asm
@@ -170,7 +170,6 @@ GetGender:
call AddNTimes
.DVs:
-
; sBoxMon data is read directly from SRAM.
ld a, [wMonType]
cp BOXMON
diff --git a/engine/pokemon/move_mon.asm b/engine/pokemon/move_mon.asm
index 9e253846a..7074dafd8 100644
--- a/engine/pokemon/move_mon.asm
+++ b/engine/pokemon/move_mon.asm
@@ -1367,7 +1367,6 @@ RemoveMonFromPartyOrBox:
.close_sram
jp CloseSRAM
-
ComputeNPCTrademonStats:
ld a, MON_LEVEL
call GetPartyParamLocation
diff --git a/engine/pokemon/party_menu.asm b/engine/pokemon/party_menu.asm
index 638e046b4..c3a70dbdc 100644
--- a/engine/pokemon/party_menu.asm
+++ b/engine/pokemon/party_menu.asm
@@ -11,7 +11,6 @@ SelectMonFromParty:
call ReturnToMapWithSpeechTextbox
ret
-
SelectTradeOrDayCareMon:
ld a, b
ld [wPartyMenuActionText], a
@@ -41,7 +40,6 @@ LoadPartyMenuGFX:
callfar ClearSpriteAnims2
ret
-
WritePartyMenuTilemap:
ld hl, wOptions
ld a, [hl]
@@ -114,7 +112,6 @@ PlacePartyNicknames:
.CANCEL:
db "CANCEL@"
-
PlacePartyHPBar:
xor a
ld [wSGBPals], a
@@ -349,7 +346,6 @@ PlacePartyMonTMHMCompatibility:
.string_not_able
db "NOT ABLE@"
-
PlacePartyMonEvoStoneCompatibility:
ld a, [wPartyCount]
and a
@@ -429,7 +425,6 @@ PlacePartyMonEvoStoneCompatibility:
.string_not_able
db "NOT ABLE@"
-
PlacePartyMonGender:
ld a, [wPartyCount]
and a
@@ -478,7 +473,6 @@ PlacePartyMonGender:
.unknown
db "…UNKNOWN@"
-
PlacePartyMonMobileBattleSelection:
ld a, [wPartyCount]
and a
@@ -556,7 +550,6 @@ PlacePartyMonMobileBattleSelection:
.Strings_1_2_3:
db "1@", "2@", "3@" ; 1st, 2nd, 3rd
-
PartyMenuCheckEgg:
ld a, LOW(wPartySpecies)
add b
@@ -590,7 +583,6 @@ GetPartyMenuQualityIndexes:
INCLUDE "data/party_menu_qualities.asm"
-
InitPartyMenuGFX:
ld hl, wPartyCount
ld a, [hli]
@@ -717,7 +709,6 @@ PartyMenuSelect:
scf
ret
-
PrintPartyMenuText:
hlcoord 0, 14
lb bc, 2, 18
@@ -862,7 +853,6 @@ PrintPartyMenuActionText:
text_jump UnknownText_0x1bc16e
db "@"
-
.PrintText:
ld e, a
ld d, 0
diff --git a/engine/pokemon/search.asm b/engine/pokemon/search.asm
index 9a66169fb..c8d4439df 100644
--- a/engine/pokemon/search.asm
+++ b/engine/pokemon/search.asm
@@ -28,7 +28,6 @@ BeastsCheck:
ld [wScriptVar], a
ret
-
MonCheck:
; Check if the player owns any Pokémon of the species in wScriptVar.
; Return the result in wScriptVar.
@@ -46,7 +45,6 @@ MonCheck:
ld [wScriptVar], a
ret
-
CheckOwnMonAnywhere:
; Check if the player owns any monsters of the species in wScriptVar.
; It must exist in either party or PC, and have the player's OT and ID.
@@ -178,7 +176,6 @@ CheckOwnMonAnywhere:
and a
ret
-
CheckOwnMon:
; Check if a Pokémon belongs to the player and is of a specific species.
diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm
index c69d822a2..dfc704f1a 100644
--- a/engine/pokemon/stats_screen.asm
+++ b/engine/pokemon/stats_screen.asm
@@ -112,7 +112,6 @@ StatsScreenPointerTable:
dw MonStatsJoypad
dw StatsScreen_Exit
-
StatsScreen_WaitAnim:
ld hl, wcf64
bit 6, [hl]
@@ -174,7 +173,6 @@ EggStatsInit:
ld [wJumptableIndex], a
ret
-
EggStatsJoypad:
call StatsScreen_GetJoypad
jr nc, .check
@@ -783,7 +781,6 @@ IDNoString:
OTString:
db "OT/@"
-
StatsScreen_PlaceFrontpic:
ld hl, wTempMonDVs
predef GetUnownLetter
@@ -1029,7 +1026,6 @@ EggALotMoreTimeString:
next "lot more time to"
next "hatch.@"
-
StatsScreen_AnimateEgg:
call StatsScreen_GetAnimationParam
ret nc
@@ -1126,7 +1122,6 @@ GetNicknamePointer:
ld a, [wCurPartyMon]
jp SkipNames
-
CheckFaintedFrzSlp:
ld hl, MON_HP
add hl, bc
diff --git a/engine/pokemon/types.asm b/engine/pokemon/types.asm
index 76c7665a4..4e2ca3e45 100644
--- a/engine/pokemon/types.asm
+++ b/engine/pokemon/types.asm
@@ -38,7 +38,6 @@ PrintMonTypes:
ld bc, NAME_LENGTH_JAPANESE - 1
jp ByteFill
-
PrintMoveType:
; Print the type of move b at hl.
@@ -56,7 +55,6 @@ PrintMoveType:
ld b, a
-
PrintType:
; Print type b at hl.
@@ -75,7 +73,6 @@ PrintType:
jp PlaceString
-
GetTypeName:
; Copy the name of type [wd265] to wStringBuffer1.
@@ -92,5 +89,4 @@ GetTypeName:
ld bc, MOVE_NAME_LENGTH
jp CopyBytes
-
INCLUDE "data/types/names.asm"
diff --git a/engine/printer/printer.asm b/engine/printer/printer.asm
index e2b0f1af5..4dc74c6d2 100644
--- a/engine/printer/printer.asm
+++ b/engine/printer/printer.asm
@@ -1,5 +1,3 @@
-INCLUDE "engine/printer/printer_serial.asm"
-
SendScreenToPrinter:
.loop
call JoyTextDelay
diff --git a/engine/rtc/timeset.asm b/engine/rtc/timeset.asm
index 2661e86d5..06f800c45 100644
--- a/engine/rtc/timeset.asm
+++ b/engine/rtc/timeset.asm
@@ -532,7 +532,6 @@ SetDayOfWeek:
.Friday: db " FRIDAY@"
.Saturday: db "SATURDAY@"
-
.WhatDayIsItText:
; What day is it?
text_jump UnknownText_0x1bc369
diff --git a/engine/tilesets/mapgroup_roofs.asm b/engine/tilesets/mapgroup_roofs.asm
index 8262f57b1..b269e5277 100644
--- a/engine/tilesets/mapgroup_roofs.asm
+++ b/engine/tilesets/mapgroup_roofs.asm
@@ -15,5 +15,4 @@ LoadMapGroupRoof::
call CopyBytes
ret
-
INCLUDE "data/maps/roofs.asm"
diff --git a/engine/tilesets/tileset_anims.asm b/engine/tilesets/tileset_anims.asm
index 360bce88a..1e6abb968 100644
--- a/engine/tilesets/tileset_anims.asm
+++ b/engine/tilesets/tileset_anims.asm
@@ -290,7 +290,6 @@ StandingTileFrame8:
ld [wTileAnimationTimer], a
ret
-
ScrollTileRightLeft:
; Scroll right for 4 ticks, then left for 4 ticks.
ld a, [wTileAnimationTimer]
@@ -393,7 +392,6 @@ ScrollTileDown:
jr nz, .loop
ret
-
AnimateFountain:
ld hl, sp+0
ld b, h
@@ -431,7 +429,6 @@ AnimateFountain:
.frame4 INCBIN "gfx/tilesets/fountain/4.2bpp"
.frame5 INCBIN "gfx/tilesets/fountain/5.2bpp"
-
AnimateWaterTile:
; Draw a water tile for the current frame in VRAM tile at de.
@@ -467,7 +464,6 @@ AnimateWaterTile:
WaterTileFrames:
INCBIN "gfx/tilesets/water/water.2bpp"
-
ForestTreeLeftAnimation:
ld hl, sp+0
ld b, h
@@ -497,7 +493,6 @@ ForestTreeLeftAnimation:
ld hl, vTiles2 tile $0c
jp WriteTile
-
ForestTreeLeftFrames:
INCBIN "gfx/tilesets/forest-tree/1.2bpp"
INCBIN "gfx/tilesets/forest-tree/2.2bpp"
@@ -506,7 +501,6 @@ ForestTreeRightFrames:
INCBIN "gfx/tilesets/forest-tree/3.2bpp"
INCBIN "gfx/tilesets/forest-tree/4.2bpp"
-
ForestTreeRightAnimation:
ld hl, sp+0
ld b, h
@@ -540,7 +534,6 @@ ForestTreeRightAnimation:
ld hl, vTiles2 tile $0f
jp WriteTile
-
ForestTreeLeftAnimation2:
ld hl, sp+0
ld b, h
@@ -571,7 +564,6 @@ ForestTreeLeftAnimation2:
ld hl, vTiles2 tile $0c
jp WriteTile
-
ForestTreeRightAnimation2:
ld hl, sp+0
ld b, h
@@ -606,7 +598,6 @@ ForestTreeRightAnimation2:
ld hl, vTiles2 tile $0f
jp WriteTile
-
GetForestTreeFrame:
; Return 0 if a is even, or 2 if odd.
and a
@@ -631,7 +622,6 @@ GetForestTreeFrame:
xor a
ret
-
AnimateFlowerTile:
; No parameters.
@@ -667,7 +657,6 @@ FlowerTileFrames:
INCBIN "gfx/tilesets/flower/dmg_2.2bpp"
INCBIN "gfx/tilesets/flower/cgb_2.2bpp"
-
LavaBubbleAnim1:
; Splash in the bottom-right corner of the fountain.
ld hl, sp+0
@@ -688,7 +677,6 @@ LavaBubbleAnim1:
ld hl, vTiles2 tile $5b
jp WriteTile
-
LavaBubbleAnim2:
; Splash in the top-left corner of the fountain.
ld hl, sp+0
@@ -707,14 +695,12 @@ LavaBubbleAnim2:
ld hl, vTiles2 tile $38
jp WriteTile
-
LavaBubbleFrames:
INCBIN "gfx/tilesets/lava/1.2bpp"
INCBIN "gfx/tilesets/lava/2.2bpp"
INCBIN "gfx/tilesets/lava/3.2bpp"
INCBIN "gfx/tilesets/lava/4.2bpp"
-
AnimateTowerPillarTile:
; Read from struct at de:
; Destination (VRAM)
@@ -761,13 +747,11 @@ AnimateTowerPillarTile:
.frames
db $00, $10, $20, $30, $40, $30, $20, $10
-
StandingTileFrame:
ld hl, wTileAnimationTimer
inc [hl]
ret
-
AnimateWhirlpoolTile:
; Update whirlpool tile using struct at de.
@@ -812,7 +796,6 @@ AnimateWhirlpoolTile:
jr WriteTile
-
WriteTileFromBuffer:
; Write tiledata at wTileAnimBuffer to de.
; wTileAnimBuffer is loaded to sp for WriteTile.
@@ -828,7 +811,6 @@ WriteTileFromBuffer:
ld l, e
jr WriteTile
-
WriteTileToBuffer:
; Write tiledata de to wTileAnimBuffer.
; de is loaded to sp for WriteTile.
@@ -870,7 +852,6 @@ endr
ld sp, hl
ret
-
TileAnimationPalette:
; Transition between color values 0-2 for color 0 in palette 3.
@@ -935,7 +916,6 @@ TileAnimationPalette:
ld [rSVBK], a
ret
-
FlickeringCaveEntrancePalette:
; No palette changes on DMG.
ld a, [hCGB]
@@ -976,7 +956,6 @@ FlickeringCaveEntrancePalette:
ld [rSVBK], a
ret
-
TowerPillarTilePointer1: dw vTiles2 tile $2d, TowerPillarTile1
TowerPillarTilePointer2: dw vTiles2 tile $2f, TowerPillarTile2
TowerPillarTilePointer3: dw vTiles2 tile $3d, TowerPillarTile3
@@ -999,7 +978,6 @@ TowerPillarTile8: INCBIN "gfx/tilesets/tower-pillar/8.2bpp"
TowerPillarTile9: INCBIN "gfx/tilesets/tower-pillar/9.2bpp"
TowerPillarTile10: INCBIN "gfx/tilesets/tower-pillar/10.2bpp"
-
WhirlpoolFrames1: dw vTiles2 tile $32, WhirlpoolTiles1
WhirlpoolFrames2: dw vTiles2 tile $33, WhirlpoolTiles2
WhirlpoolFrames3: dw vTiles2 tile $42, WhirlpoolTiles3
diff --git a/engine/tilesets/timeofday_pals.asm b/engine/tilesets/timeofday_pals.asm
index cda6e1e0d..58bbe9183 100644
--- a/engine/tilesets/timeofday_pals.asm
+++ b/engine/tilesets/timeofday_pals.asm
@@ -10,7 +10,6 @@ UpdateTimeOfDayPal::
ld [wTimeOfDayPal], a
ret
-
_TimeOfDayPals::
; return carry if pals are changed
@@ -65,12 +64,10 @@ _TimeOfDayPals::
ld a, b
ld [rSVBK], a
-
; update sgb pals
ld b, SCGB_MAPPALS
call GetSGBLayout
-
; restore bg palette 7
ld hl, wOBPals1 - 1 ; last byte in wBGPals1
@@ -109,7 +106,6 @@ _TimeOfDayPals::
and a
ret
-
_UpdateTimePals::
ld c, $9 ; normal
call GetTimePalFade
@@ -161,7 +157,6 @@ FadeBlackQuickly:
call ConvertTimePalsDecHL
ret
-
FillWhiteBGColor:
ld a, [rSVBK]
push af
@@ -271,7 +266,6 @@ GetTimePalette:
rlca
ret
-
DmgToCgbTimePals:
push hl
push de
@@ -310,7 +304,6 @@ ConvertTimePalsDecHL:
jr nz, .loop
ret
-
GetTimePalFade:
; check cgb
ld a, [hCGB]