summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@gmail.com>2016-01-18 00:39:01 -0500
committerPikalaxALT <PikalaxALT@gmail.com>2016-01-18 00:39:01 -0500
commit8bf255b9f84f7e4f93e85a75512a002ef240a10f (patch)
tree786ae5588f8bfe4b067cb3e91fd66cc4d95bd2da
parent7cc2571529d6b3f5ffcbb71c62fab31b27ba224a (diff)
Prepare to merge
-rw-r--r--battle/core.asm66
-rw-r--r--battle/effect_commands.asm162
-rwxr-xr-xbattle/effects/transform.asm141
-rw-r--r--constants/sprite_constants.asm76
-rwxr-xr-xengine/link.asm2
-rwxr-xr-xengine/player_movement.asm20
-rwxr-xr-xengine/time_capsule/conversion.asm4
-rwxr-xr-xengine/tmhm2.asm10
-rw-r--r--home/audio.asm28
-rw-r--r--home/text.asm4
-rw-r--r--main.asm54
-rw-r--r--misc/mobile_40.asm4
-rw-r--r--text/battle.asm8
-rw-r--r--wram.asm12
14 files changed, 301 insertions, 290 deletions
diff --git a/battle/core.asm b/battle/core.asm
index 646dc34ad..7e6eea9c6 100644
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -1248,7 +1248,7 @@ HandlePerishSong: ; 3c801
res SUBSTATUS_PERISH, [hl]
ld a, [hBattleTurn]
and a
- jr nz, .asm_3c85c
+ jr nz, .kill_enemy
ld hl, BattleMonHP
xor a
ld [hli], a
@@ -1261,7 +1261,7 @@ HandlePerishSong: ; 3c801
ld [hl], a
ret
-.asm_3c85c
+.kill_enemy
ld hl, EnemyMonHP
xor a
ld [hli], a
@@ -1334,12 +1334,12 @@ HandleWrap: ; 3c874
call GetSixteenthMaxHP
call SubtractHPFromUser
ld hl, BattleText_UsersHurtByStringBuffer1
- jr .asm_3c8e1
+ jr .print_text
.release_from_bounds
ld hl, BattleText_UserWasReleasedFromStringBuffer1
-.asm_3c8e1
+.print_text
jp StdBattleTextBox
; 3c8e4
@@ -1396,7 +1396,7 @@ HandleLeftovers: ; 3c8eb
call GetSixteenthMaxHP
call SwitchTurnCore
call RestoreHP
- ld hl, BattleText_0x80880
+ ld hl, BattleText_TargetRecoveredWithItem
jp StdBattleTextBox
; 3c93c
@@ -1569,7 +1569,7 @@ HandleFutureSight: ; 3ca26
cp $1
ret nz
- ld hl, BattleText_0x808b6
+ ld hl, BattleText_TargetWasHitByFutureSight
call StdBattleTextBox
ld a, BATTLE_VARS_MOVE
@@ -1645,12 +1645,12 @@ HanleDefrost: ; 3ca8f
ld a, [wBattleMode]
dec a
- jr z, .asm_3caef
+ jr z, .wild
ld a, [CurOTMon]
ld hl, OTPartyMon1Status
call GetPartyLocation
ld [hl], 0
-.asm_3caef
+.wild
call UpdateBattleHuds
call SetPlayerTurn
@@ -1661,13 +1661,13 @@ HanleDefrost: ; 3ca8f
HandleSafeguard: ; 3cafb
ld a, [hLinkPlayerNumber]
cp $1
- jr z, .asm_3cb06
- call .asm_3cb09
- jr .asm_3cb1c
+ jr z, .player1
+ call .CheckPlayer
+ jr .CheckEnemy
-.asm_3cb06
- call .asm_3cb1c
-.asm_3cb09
+.player1
+ call .CheckEnemy
+.CheckPlayer
ld a, [PlayerScreens]
bit SCREENS_SAFEGUARD, a
ret z
@@ -1677,9 +1677,9 @@ HandleSafeguard: ; 3cafb
res SCREENS_SAFEGUARD, a
ld [PlayerScreens], a
xor a
- jr .asm_3cb2e
+ jr .print
-.asm_3cb1c
+.CheckEnemy
ld a, [EnemyScreens]
bit SCREENS_SAFEGUARD, a
ret z
@@ -1690,7 +1690,7 @@ HandleSafeguard: ; 3cafb
ld [EnemyScreens], a
ld a, $1
-.asm_3cb2e
+.print
ld [hBattleTurn], a
ld hl, BattleText_SafeguardFaded
jp StdBattleTextBox
@@ -1712,7 +1712,7 @@ HandleScreens: ; 3cb36
call .Copy
ld hl, PlayerScreens
ld de, PlayerLightScreenCount
- jr .FadeScreens
+ jr .TickScreens
.CheckEnemy
call SetEnemyTurn
@@ -1721,11 +1721,11 @@ HandleScreens: ; 3cb36
ld hl, EnemyScreens
ld de, EnemyLightScreenCount
-.FadeScreens
+.TickScreens
bit SCREENS_LIGHT_SCREEN, [hl]
- call nz, FadeLightScreen
+ call nz, .LightScreenTick
bit SCREENS_REFLECT, [hl]
- call nz, FadeReflect
+ call nz, .ReflectTick
ret
.Copy
@@ -1740,7 +1740,7 @@ HandleScreens: ; 3cb36
; 3cb80
-FadeLightScreen: ; 3cb80
+.LightScreenTick: ; 3cb80
ld a, [de]
dec a
ld [de], a
@@ -1748,21 +1748,21 @@ FadeLightScreen: ; 3cb80
res SCREENS_LIGHT_SCREEN, [hl]
push hl
push de
- ld hl, BattleText_PkmnnLightScreenFell
+ ld hl, BattleText_PkmnLightScreenFell
call StdBattleTextBox
pop de
pop hl
ret
; 3cb91
-FadeReflect: ; 3cb91
+.ReflectTick: ; 3cb91
inc de
ld a, [de]
dec a
ld [de], a
ret nz
res SCREENS_REFLECT, [hl]
- ld hl, BattleText_0x80905
+ ld hl, BattleText_PkmnReflectFaded
jp StdBattleTextBox
; 3cb9e
@@ -3969,7 +3969,7 @@ TryToRunAwayFromBattle: ; 3d8b3
and a
jr z, .can_escape
ld [hDivisor], a
- ld b, $2
+ ld b, 2
call Divide
ld a, [hQuotient + 1]
and a
@@ -4941,16 +4941,16 @@ PrintPlayerHUD: ; 3dfbf
ld [MonType], a
callab GetGender
ld a, " "
- jr c, .asm_3e013
+ jr c, .got_gender_char
ld a, "♂"
- jr nz, .asm_3e013
+ jr nz, .got_gender_char
ld a, "♀"
-.asm_3e013
+.got_gender_char
hlcoord 17, 8
ld [hl], a
hlcoord 14, 8
- push af
+ push af ; back up gender
push hl
ld de, BattleMonStatus
predef PlaceNonFaintStatus
@@ -4959,10 +4959,10 @@ PrintPlayerHUD: ; 3dfbf
ret nz
ld a, b
cp " "
- jr nz, .asm_3e02d
- dec hl
+ jr nz, .copy_level ; male or female
+ dec hl ; genderless
-.asm_3e02d
+.copy_level
ld a, [BattleMonLevel]
ld [TempMonLevel], a
jp PrintLevel
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm
index 856a1da7f..1350300ca 100644
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -1928,6 +1928,7 @@ BattleCommand_CheckHit: ; 34d32
ld a, [hBattleTurn]
and a
+ ; load the user's accuracy into b and the opponent's evasion into c.
ld hl, wPlayerMoveStruct + MOVE_ACC
ld a, [PlayerAccLevel]
ld b, a
@@ -1944,26 +1945,31 @@ BattleCommand_CheckHit: ; 34d32
.got_acc_eva
cp b
- jr c, .eva_less_than_acc
+ jr c, .skip_foresight_check
+ ; if the target's evasion is greater than the user's accuracy,
+ ; check the target's foresight status
ld a, BATTLE_VARS_SUBSTATUS1_OPP
call GetBattleVar
bit SUBSTATUS_IDENTIFIED, a
ret nz
-.eva_less_than_acc
+.skip_foresight_check
+ ; subtract evasion from 14
ld a, 14
sub c
ld c, a
+ ; store the base move accuracy for math ops
xor a
ld [hMultiplicand + 0], a
ld [hMultiplicand + 1], a
ld a, [hl]
ld [hMultiplicand + 2], a
push hl
- ld d, 2
+ ld d, 2 ; do this twice, once for the user's accuracy and once for the target's evasion
.accuracy_loop
+ ; look up the multiplier from the table
push bc
ld hl, .AccProb
dec b
@@ -1972,27 +1978,32 @@ BattleCommand_CheckHit: ; 34d32
ld b, 0
add hl, bc
pop bc
+ ; multiply by the first byte in that row...
ld a, [hli]
ld [hMultiplier], a
call Multiply
+ ; ... and divide by the second byte
ld a, [hl]
ld [hDivisor], a
ld b, 4
call Divide
+ ; minimum accuracy is $0001
ld a, [hQuotient + 2]
ld b, a
ld a, [hQuotient + 1]
or b
jr nz, .min_accuracy
ld [hQuotient + 1], a
- ld a, $1
+ ld a, 1
ld [hQuotient + 2], a
.min_accuracy
+ ; do the same thing to the target's evasion
ld b, c
dec d
jr nz, .accuracy_loop
+ ; if the result is more than 2 bytes, max out at 100%
ld a, [hQuotient + 1]
and a
ld a, [hQuotient + 2]
@@ -8393,148 +8404,7 @@ BattleCommand_Heal: ; 3713e
; 371cd
-
-BattleCommand_Transform: ; 371cd
-; transform
-
- call ClearLastMove
- ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call GetBattleVarAddr
- bit SUBSTATUS_TRANSFORMED, [hl]
- jp nz, BattleEffect_ButItFailed
- call CheckHiddenOpponent
- jp nz, BattleEffect_ButItFailed
- xor a
- ld [wNumHits], a
- ld [FXAnimIDHi], a
- ld a, $1
- ld [wKickCounter], a
- ld a, BATTLE_VARS_SUBSTATUS4
- call GetBattleVarAddr
- bit SUBSTATUS_SUBSTITUTE, [hl]
- push af
- jr z, .mimic_substitute
- call CheckUserIsCharging
- jr nz, .mimic_substitute
- ld a, SUBSTITUTE
- call LoadAnim
-.mimic_substitute
- ld a, BATTLE_VARS_SUBSTATUS5
- call GetBattleVarAddr
- set SUBSTATUS_TRANSFORMED, [hl]
- call ResetActorDisable
- ld hl, BattleMonSpecies
- ld de, EnemyMonSpecies
- ld a, [hBattleTurn]
- and a
- jr nz, .got_mon_species
- ld hl, EnemyMonSpecies
- ld de, BattleMonSpecies
- xor a
- ld [CurMoveNum], a
-.got_mon_species
- push hl
- ld a, [hli]
- ld [de], a
- inc hl
- inc de
- inc de
- ld bc, NUM_MOVES
- call CopyBytes
- ld a, [hBattleTurn]
- and a
- jr z, .mimic_enemy_backup
- ld a, [de]
- ld [wEnemyBackupDVs], a
- inc de
- ld a, [de]
- ld [wEnemyBackupDVs + 1], a
- dec de
-.mimic_enemy_backup
-; copy DVs
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
-; move pointer to stats
- ld bc, BattleMonStats - BattleMonPP
- add hl, bc
- push hl
- ld h, d
- ld l, e
- add hl, bc
- ld d, h
- ld e, l
- pop hl
- ld bc, BattleMonStructEnd - BattleMonStats
- call CopyBytes
-; init the power points
- ld bc, BattleMonMoves - BattleMonStructEnd
- add hl, bc
- push de
- ld d, h
- ld e, l
- pop hl
- ld bc, BattleMonPP - BattleMonStructEnd
- add hl, bc
- ld b, NUM_MOVES
-.pp_loop
- ld a, [de]
- inc de
- and a
- jr z, .done_move
- cp SKETCH
- ld a, 1
- jr z, .done_move
- ld a, 5
-.done_move
- ld [hli], a
- dec b
- jr nz, .pp_loop
- pop hl
- ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
- call GetPokemonName
- ld hl, EnemyStats
- ld de, PlayerStats
- ld bc, 2 * 5
- call BattleSideCopy
- ld hl, EnemyStatLevels
- ld de, PlayerStatLevels
- ld bc, 8
- call BattleSideCopy
- call _CheckBattleScene
- jr c, .mimic_anims
- ld a, [hBattleTurn]
- and a
- ld a, [wPlayerMinimized]
- jr z, .got_byte
- ld a, [wEnemyMinimized]
-.got_byte
- and a
- jr nz, .mimic_anims
- call LoadMoveAnim
- jr .after_anim
-
-.mimic_anims
- call BattleCommand_MoveDelay
- call BattleCommand_RaiseSubNoAnim
-.after_anim
- xor a
- ld [wNumHits], a
- ld [FXAnimIDHi], a
- ld a, $2
- ld [wKickCounter], a
- pop af
- ld a, SUBSTITUTE
- call nz, LoadAnim
- ld hl, TransformedText
- jp StdBattleTextBox
-
-; 372c6
-
+INCLUDE "battle/effects/transform.asm"
BattleSideCopy: ; 372c6
; Copy bc bytes from hl to de if it's the player's turn.
diff --git a/battle/effects/transform.asm b/battle/effects/transform.asm
new file mode 100755
index 000000000..eb80aea8a
--- /dev/null
+++ b/battle/effects/transform.asm
@@ -0,0 +1,141 @@
+
+BattleCommand_Transform: ; 371cd
+; transform
+
+ call ClearLastMove
+ ld a, BATTLE_VARS_SUBSTATUS5_OPP
+ call GetBattleVarAddr
+ bit SUBSTATUS_TRANSFORMED, [hl]
+ jp nz, BattleEffect_ButItFailed
+ call CheckHiddenOpponent
+ jp nz, BattleEffect_ButItFailed
+ xor a
+ ld [wNumHits], a
+ ld [FXAnimIDHi], a
+ ld a, $1
+ ld [wKickCounter], a
+ ld a, BATTLE_VARS_SUBSTATUS4
+ call GetBattleVarAddr
+ bit SUBSTATUS_SUBSTITUTE, [hl]
+ push af
+ jr z, .mimic_substitute
+ call CheckUserIsCharging
+ jr nz, .mimic_substitute
+ ld a, SUBSTITUTE
+ call LoadAnim
+.mimic_substitute
+ ld a, BATTLE_VARS_SUBSTATUS5
+ call GetBattleVarAddr
+ set SUBSTATUS_TRANSFORMED, [hl]
+ call ResetActorDisable
+ ld hl, BattleMonSpecies
+ ld de, EnemyMonSpecies
+ ld a, [hBattleTurn]
+ and a
+ jr nz, .got_mon_species
+ ld hl, EnemyMonSpecies
+ ld de, BattleMonSpecies
+ xor a
+ ld [CurMoveNum], a
+.got_mon_species
+ push hl
+ ld a, [hli]
+ ld [de], a
+ inc hl
+ inc de
+ inc de
+ ld bc, NUM_MOVES
+ call CopyBytes
+ ld a, [hBattleTurn]
+ and a
+ jr z, .mimic_enemy_backup
+ ld a, [de]
+ ld [wEnemyBackupDVs], a
+ inc de
+ ld a, [de]
+ ld [wEnemyBackupDVs + 1], a
+ dec de
+.mimic_enemy_backup
+; copy DVs
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+ inc de
+; move pointer to stats
+ ld bc, BattleMonStats - BattleMonPP
+ add hl, bc
+ push hl
+ ld h, d
+ ld l, e
+ add hl, bc
+ ld d, h
+ ld e, l
+ pop hl
+ ld bc, BattleMonStructEnd - BattleMonStats
+ call CopyBytes
+; init the power points
+ ld bc, BattleMonMoves - BattleMonStructEnd
+ add hl, bc
+ push de
+ ld d, h
+ ld e, l
+ pop hl
+ ld bc, BattleMonPP - BattleMonStructEnd
+ add hl, bc
+ ld b, NUM_MOVES
+.pp_loop
+ ld a, [de]
+ inc de
+ and a
+ jr z, .done_move
+ cp SKETCH
+ ld a, 1
+ jr z, .done_move
+ ld a, 5
+.done_move
+ ld [hli], a
+ dec b
+ jr nz, .pp_loop
+ pop hl
+ ld a, [hl]
+ ld [wNamedObjectIndexBuffer], a
+ call GetPokemonName
+ ld hl, EnemyStats
+ ld de, PlayerStats
+ ld bc, 2 * 5
+ call BattleSideCopy
+ ld hl, EnemyStatLevels
+ ld de, PlayerStatLevels
+ ld bc, 8
+ call BattleSideCopy
+ call _CheckBattleScene
+ jr c, .mimic_anims
+ ld a, [hBattleTurn]
+ and a
+ ld a, [wPlayerMinimized]
+ jr z, .got_byte
+ ld a, [wEnemyMinimized]
+.got_byte
+ and a
+ jr nz, .mimic_anims
+ call LoadMoveAnim
+ jr .after_anim
+
+.mimic_anims
+ call BattleCommand_MoveDelay
+ call BattleCommand_RaiseSubNoAnim
+.after_anim
+ xor a
+ ld [wNumHits], a
+ ld [FXAnimIDHi], a
+ ld a, $2
+ ld [wKickCounter], a
+ pop af
+ ld a, SUBSTITUTE
+ call nz, LoadAnim
+ ld hl, TransformedText
+ jp StdBattleTextBox
+
+; 372c6
diff --git a/constants/sprite_constants.asm b/constants/sprite_constants.asm
index 70399052f..e7524cd58 100644
--- a/constants/sprite_constants.asm
+++ b/constants/sprite_constants.asm
@@ -193,44 +193,44 @@ NUM_SPRITEHEADER_FIELDS EQU const_value
; sprite movement data table indices
const_def
- const SPRITEMOVEDATA_00
- const SPRITEMOVEDATA_ITEM_TREE
- const SPRITEMOVEDATA_WANDER
- const SPRITEMOVEDATA_SPINRANDOM_SLOW
- const SPRITEMOVEDATA_WALK_UP_DOWN
- const SPRITEMOVEDATA_WALK_LEFT_RIGHT
- const SPRITEMOVEDATA_STANDING_DOWN
- const SPRITEMOVEDATA_STANDING_UP
- const SPRITEMOVEDATA_STANDING_LEFT
- const SPRITEMOVEDATA_STANDING_RIGHT
- const SPRITEMOVEDATA_SPINRANDOM_FAST
- const SPRITEMOVEDATA_PLAYER
- const SPRITEMOVEDATA_0C
- const SPRITEMOVEDATA_0D
- const SPRITEMOVEDATA_0E
- const SPRITEMOVEDATA_0F
- const SPRITEMOVEDATA_10
- const SPRITEMOVEDATA_11
- const SPRITEMOVEDATA_12
- const SPRITEMOVEDATA_FOLLOWING
- const SPRITEMOVEDATA_SCRIPTED
- const SPRITEMOVEDATA_SNORLAX
- const SPRITEMOVEDATA_POKEMON
- const SPRITEMOVEDATA_SUDOWOODO
- const SPRITEMOVEDATA_SMASHABLE_ROCK
- const SPRITEMOVEDATA_STRENGTH_BOULDER
- const SPRITEMOVEDATA_FOLLOWNOTEXACT
- const SPRITEMOVEDATA_SHADOW
- const SPRITEMOVEDATA_EMOTE
- const SPRITEMOVEDATA_SCREENSHAKE
- const SPRITEMOVEDATA_SPINCOUNTERCLOCKWISE
- const SPRITEMOVEDATA_SPINCLOCKWISE
- const SPRITEMOVEDATA_20
- const SPRITEMOVEDATA_BIGDOLL
- const SPRITEMOVEDATA_BOULDERDUST
- const SPRITEMOVEDATA_GRASS
- const SPRITEMOVEDATA_LAPRAS
- const SPRITEMOVEDATA_25
+ const SPRITEMOVEDATA_00 ; 00
+ const SPRITEMOVEDATA_ITEM_TREE ; 01
+ const SPRITEMOVEDATA_WANDER ; 02
+ const SPRITEMOVEDATA_SPINRANDOM_SLOW ; 03
+ const SPRITEMOVEDATA_WALK_UP_DOWN ; 04
+ const SPRITEMOVEDATA_WALK_LEFT_RIGHT ; 05
+ const SPRITEMOVEDATA_STANDING_DOWN ; 06
+ const SPRITEMOVEDATA_STANDING_UP ; 07
+ const SPRITEMOVEDATA_STANDING_LEFT ; 08
+ const SPRITEMOVEDATA_STANDING_RIGHT ; 09
+ const SPRITEMOVEDATA_SPINRANDOM_FAST ; 0a
+ const SPRITEMOVEDATA_PLAYER ; 0b
+ const SPRITEMOVEDATA_0C ; 0c
+ const SPRITEMOVEDATA_0D ; 0d
+ const SPRITEMOVEDATA_0E ; 0e
+ const SPRITEMOVEDATA_0F ; 0f
+ const SPRITEMOVEDATA_10 ; 10
+ const SPRITEMOVEDATA_11 ; 11
+ const SPRITEMOVEDATA_12 ; 12
+ const SPRITEMOVEDATA_FOLLOWING ; 13
+ const SPRITEMOVEDATA_SCRIPTED ; 14
+ const SPRITEMOVEDATA_SNORLAX ; 15
+ const SPRITEMOVEDATA_POKEMON ; 16
+ const SPRITEMOVEDATA_SUDOWOODO ; 17
+ const SPRITEMOVEDATA_SMASHABLE_ROCK ; 18
+ const SPRITEMOVEDATA_STRENGTH_BOULDER ; 19
+ const SPRITEMOVEDATA_FOLLOWNOTEXACT ; 1a
+ const SPRITEMOVEDATA_SHADOW ; 1b
+ const SPRITEMOVEDATA_EMOTE ; 1c
+ const SPRITEMOVEDATA_SCREENSHAKE ; 1d
+ const SPRITEMOVEDATA_SPINCOUNTERCLOCKWISE ; 1e
+ const SPRITEMOVEDATA_SPINCLOCKWISE ; 1f
+ const SPRITEMOVEDATA_20 ; 20
+ const SPRITEMOVEDATA_BIGDOLL ; 21
+ const SPRITEMOVEDATA_BOULDERDUST ; 22
+ const SPRITEMOVEDATA_GRASS ; 23
+ const SPRITEMOVEDATA_LAPRAS ; 24
+ const SPRITEMOVEDATA_25 ; 25
NUM_SPRITEMOVEDATA EQU const_value +- 1
SPRITEMOVEDATA_FIELDS EQU 6
diff --git a/engine/link.asm b/engine/link.asm
index b101c7349..e425ce4d8 100755
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -427,7 +427,7 @@ Gen2ToGen2LinkComms: ; 28177
or $3
ld [hl], a
ld hl, OTPlayerName
- ld de, OTName
+ ld de, OTClassName
ld bc, NAME_LENGTH
call CopyBytes
call ReturnToMapFromSubmenu
diff --git a/engine/player_movement.asm b/engine/player_movement.asm
index 0820bd11e..4bc4c483e 100755
--- a/engine/player_movement.asm
+++ b/engine/player_movement.asm
@@ -136,7 +136,7 @@ DoPlayerMovement:: ; 80000
jr z, .land2
cp $70 ; warps
jr z, .warps
- jr .asm_8013c
+ jr .no_walk
.water
ld a, c
@@ -147,7 +147,7 @@ DoPlayerMovement:: ; 80000
add hl, bc
ld a, [hl]
ld [WalkingDirection], a
- jr .asm_8013e
+ jr .continue_walk
.water_table
db RIGHT
@@ -164,9 +164,9 @@ DoPlayerMovement:: ; 80000
add hl, bc
ld a, [hl]
cp STANDING
- jr z, .asm_8013c
+ jr z, .no_walk
ld [WalkingDirection], a
- jr .asm_8013e
+ jr .continue_walk
.land1_table
db STANDING
@@ -187,9 +187,9 @@ DoPlayerMovement:: ; 80000
add hl, bc
ld a, [hl]
cp STANDING
- jr z, .asm_8013c
+ jr z, .no_walk
ld [WalkingDirection], a
- jr .asm_8013e
+ jr .continue_walk
.land2_table
db RIGHT
@@ -210,18 +210,18 @@ DoPlayerMovement:: ; 80000
cp $7a ; stairs
jr z, .down
cp $7b ; cave
- jr nz, .asm_8013c
+ jr nz, .no_walk
.down
ld a, DOWN
ld [WalkingDirection], a
- jr .asm_8013e
+ jr .continue_walk
-.asm_8013c
+.no_walk
xor a
ret
-.asm_8013e
+.continue_walk
ld a, STEP_WALK
call .DoStep
ld a, 5
diff --git a/engine/time_capsule/conversion.asm b/engine/time_capsule/conversion.asm
index e2c545c48..5d093d515 100755
--- a/engine/time_capsule/conversion.asm
+++ b/engine/time_capsule/conversion.asm
@@ -367,13 +367,13 @@ NewPokedexEntry: ; fb877
ld a, [hSCX]
add -5 ; 251 ; NUM_POKEMON
ld [hSCX], a
- call Functionfb8c8
+ call .ReturnFromDexRegistration
pop af
ld [hMapAnims], a
ret
; fb8c8
-Functionfb8c8: ; fb8c8
+.ReturnFromDexRegistration: ; fb8c8
call ClearTileMap
call LoadFontsExtra
call LoadStandardFont
diff --git a/engine/tmhm2.asm b/engine/tmhm2.asm
index fdb829034..94de4f3e3 100755
--- a/engine/tmhm2.asm
+++ b/engine/tmhm2.asm
@@ -196,16 +196,16 @@ TMHM_PocketLoop: ; 2c8d3 (b:48d3)
xor a
ld [hBGMapMode], a
call TMHM_DisplayPocketItems
- ld a, $2
+ ld a, 2
ld [w2DMenuCursorInitY], a
- ld a, $7
+ ld a, 7
ld [w2DMenuCursorInitX], a
- ld a, $1
+ ld a, 1
ld [w2DMenuNumCols], a
- ld a, $5
+ ld a, 5
sub d
inc a
- cp $6
+ cp 6
jr nz, .okay
dec a
.okay
diff --git a/home/audio.asm b/home/audio.asm
index 1e02f91eb..c7bb7fed3 100644
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -506,18 +506,18 @@ Function3d9f:: ; 3d9f
; Places a BCD number at the
; upper center of the screen.
; Unreferenced.
- ld a, $20
- ld [Sprites + $98], a
- ld [Sprites + $9c], a
- ld a, $50
- ld [Sprites + $99], a
- ld a, $58
- ld [Sprites + $9d], a
+ ld a, 4 * 8
+ ld [Sprites + 38 * 4], a
+ ld [Sprites + 39 * 4], a
+ ld a, 10 * 8
+ ld [Sprites + 38 * 4 + 1], a
+ ld a, 11 * 8
+ ld [Sprites + 39 * 4 + 1], a
xor a
- ld [Sprites + $9b], a
- ld [Sprites + $9f], a
+ ld [Sprites + 38 * 4 + 3], a
+ ld [Sprites + 39 * 4 + 3], a
ld a, [wc296]
- cp $64
+ cp 100
jr nc, .max
add 1
daa
@@ -525,17 +525,17 @@ Function3d9f:: ; 3d9f
swap a
and $f
add "0"
- ld [Sprites + $9a], a
+ ld [Sprites + 38 * 4 + 2], a
ld a, b
and $f
add "0"
- ld [Sprites + $9e], a
+ ld [Sprites + 39 * 4 + 2], a
ret
.max
ld a, "9"
- ld [Sprites + $9a], a
- ld [Sprites + $9e], a
+ ld [Sprites + 38 * 4 + 2], a
+ ld [Sprites + 39 * 4 + 2], a
ret
; 3dde
diff --git a/home/text.asm b/home/text.asm
index 054151ff4..e3dacb478 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -399,7 +399,7 @@ PlaceEnemysName:: ; 121b
cp RIVAL2
jr z, .rival
- ld de, OTName
+ ld de, OTClassName
call PlaceString
ld h, b
ld l, c
@@ -416,7 +416,7 @@ PlaceEnemysName:: ; 121b
jr PlaceCommandCharacter
.linkbattle
- ld de, OTName
+ ld de, OTClassName
jr PlaceCommandCharacter
diff --git a/main.asm b/main.asm
index cc61c518f..1f241f088 100644
--- a/main.asm
+++ b/main.asm
@@ -6621,7 +6621,7 @@ GetOTName: ; 39550
.ok
ld bc, TRAINER_CLASS_NAME_LENGTH
- ld de, OTName
+ ld de, OTClassName
push de
call CopyBytes
pop de
@@ -9154,50 +9154,50 @@ Strings50a42: ; 50a42
dw .Youngster
dw .BugCatcher
dw .Lass
- dw OTName
+ dw OTClassName
dw .JrTrainerM
dw .JrTrainerF
dw .Pokemaniac
dw .SuperNerd
- dw OTName
- dw OTName
+ dw OTClassName
+ dw OTClassName
dw .Burglar
dw .Engineer
dw .Jack
- dw OTName
+ dw OTClassName
dw .Swimmer
- dw OTName
- dw OTName
+ dw OTClassName
+ dw OTClassName
dw .Beauty
- dw OTName
+ dw OTClassName
dw .Rocker
dw .Juggler
- dw OTName
- dw OTName
+ dw OTClassName
+ dw OTClassName
dw .Blackbelt
- dw OTName
+ dw OTClassName
dw .ProfOak
dw .Chief
dw .Scientist
- dw OTName
+ dw OTClassName
dw .Rocket
dw .CooltrainerM
dw .CooltrainerF
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
- dw OTName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
+ dw OTClassName
.Youngster db "たんパン@"
.BugCatcher db "むしとり@"
diff --git a/misc/mobile_40.asm b/misc/mobile_40.asm
index 1a185b1a0..8594f0044 100644
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -2595,7 +2595,7 @@ Function10107d: ; 10107d
ld bc, NAME_LENGTH
call .CopyAllFromOT
ld hl, OTPartyMonOT
- ld de, OTName + 1
+ ld de, OTClassName + 1
ld bc, NAME_LENGTH
call .CopyAllFromOT
ld hl, OTPartyMon1Species
@@ -4039,7 +4039,7 @@ Function1019ee: ; 1019ee
ld a, c
ld [OtherTrainerClass], a
ld hl, OTPlayerName
- ld de, OTName
+ ld de, OTClassName
ld bc, NAME_LENGTH
call CopyBytes
ld a, [wcd2f]
diff --git a/text/battle.asm b/text/battle.asm
index 42bf2b7c0..b9b121455 100644
--- a/text/battle.asm
+++ b/text/battle.asm
@@ -104,7 +104,7 @@ PerishCountText: ; 0x80864
prompt
; 0x80880
-BattleText_0x80880: ; 0x80880
+BattleText_TargetRecoveredWithItem: ; 0x80880
text "<TARGET>"
line "recovered with"
cont "@"
@@ -122,7 +122,7 @@ BattleText_UserRecoveredPPUsing: ; 0x80899
prompt
; 0x808b6
-BattleText_0x808b6: ; 0x808b6
+BattleText_TargetWasHitByFutureSight: ; 0x808b6
text "<TARGET>"
line "was hit by FUTURE"
cont "SIGHT!"
@@ -135,14 +135,14 @@ BattleText_SafeguardFaded: ; 0x808d2
prompt
; 0x808e7
-BattleText_PkmnnLightScreenFell: ; 0x808e7
+BattleText_PkmnLightScreenFell: ; 0x808e7
text_from_ram StringBuffer1
text " #MON's"
line "LIGHT SCREEN fell!"
prompt
; 0x80905
-BattleText_0x80905: ; 0x80905
+BattleText_PkmnReflectFaded: ; 0x80905
text_from_ram StringBuffer1
text " #MON's"
line "REFLECT faded!"
diff --git a/wram.asm b/wram.asm
index 747fc58aa..6f22f9c51 100644
--- a/wram.asm
+++ b/wram.asm
@@ -12,7 +12,7 @@ StackTop::
SECTION "Audio", WRAM0
-
+wMusic::
MusicPlaying:: ; c100
; nonzero if playing
ds 1
@@ -33,7 +33,7 @@ Channel8:: channel_struct Channel8 ; c25f
wCurTrackDuty:: ds 1
wCurTrackIntensity:: ds 1
wCurTrackFrequency:: dw
-wc296:: ds 1 ; used only in an unused script
+wc296:: ds 1 ; BCD value, dummied out
wc297:: ds 1 ; used in MusicE0 and LoadNote
CurMusicByte:: ; c298
@@ -132,7 +132,7 @@ wMapMusic:: ; c2c0
ds 1
wDontPlayMapMusicOnReload:: ds 1
-
+wMusicEnd::
SECTION "WRAM", WRAM0
@@ -397,7 +397,7 @@ wEnemyTrainerItem1:: ds 1
wEnemyTrainerItem2:: ds 1
wEnemyTrainerBaseReward:: ds 1
wEnemyTrainerAIFlags:: ds 3
-OTName:: ds NAME_LENGTH ; c656
+OTClassName:: ds NAME_LENGTH ; c656
ds 2
@@ -1816,9 +1816,9 @@ wItemQuantityBuffer:: ds 1
TempMon:: ; d10e
party_struct TempMon
-wSpriteFlags:: ds 1
+wSpriteFlags:: ds 1 ; d13e
-wHandlePlayerStep:: ds 2
+wHandlePlayerStep:: ds 2 ; d13f
PartyMenuActionText:: ; d141
ds 1