ref: d13fb46d405eb1cbc78c4f7c8823cfce5cfdbfab
parent: ba05bfeafec51b183986ecaacd22c718ec21f56a
author: PikalaxALT <PikalaxALT@gmail.com>
date: Tue Nov 10 11:53:37 EST 2015
enum macros/move_anim.asm, resolve battle/anims.asm function labels
--- a/battle/ai/scoring.asm
+++ b/battle/ai/scoring.asm
@@ -2859,7 +2859,7 @@
AI_Smart_Stomp: ; 39200
; 80% chance to encourage this move if the player has used Minimize.
- ld a, [wc6fe]
+ ld a, [wPlayerMinimized]
and a
ret z
--- a/battle/anim_commands.asm
+++ b/battle/anim_commands.asm
@@ -353,54 +353,54 @@
BattleAnimCommands:: ; cc2a4 (33:42a4)
- dw BattleAnimCmd_D0
- dw BattleAnimCmd_D1
- dw BattleAnimCmd_D2
- dw BattleAnimCmd_D3
- dw BattleAnimCmd_D4
- dw BattleAnimCmd_D5
- dw BattleAnimCmd_D6
- dw BattleAnimCmd_D7
- dw BattleAnimCmd_D8
- dw BattleAnimCmd_D9
- dw BattleAnimCmd_DA
- dw BattleAnimCmd_DB
- dw BattleAnimCmd_DC
- dw BattleAnimCmd_DD
- dw BattleAnimCmd_DE
- dw BattleAnimCmd_DF
- dw BattleAnimCmd_E0
- dw BattleAnimCmd_E1
- dw BattleAnimCmd_E2
- dw BattleAnimCmd_E3
- dw BattleAnimCmd_E4
- dw BattleAnimCmd_E5
- dw BattleAnimCmd_E6
+ dw BattleAnimCmd_Obj
+ dw BattleAnimCmd_1GFX
+ dw BattleAnimCmd_2GFX
+ dw BattleAnimCmd_3GFX
+ dw BattleAnimCmd_4GFX
+ dw BattleAnimCmd_5GFX
+ dw BattleAnimCmd_IncObj
+ dw BattleAnimCmd_SetObj
+ dw BattleAnimCmd_IncBGEffect
+ dw BattleAnimCmd_EnemyFeetObj
+ dw BattleAnimCmd_PlayerHeadObj
+ dw BattleAnimCmd_CheckPokeball
+ dw BattleAnimCmd_Transform
+ dw BattleAnimCmd_RaiseSub
+ dw BattleAnimCmd_DropSub
+ dw BattleAnimCmd_ResetObp0
+ dw BattleAnimCmd_Sound
+ dw BattleAnimCmd_Cry
+ dw BattleAnimCmd_MinimizeOpp
+ dw BattleAnimCmd_OAMOn
+ dw BattleAnimCmd_OAMOff
+ dw BattleAnimCmd_ClearObjs
+ dw BattleAnimCmd_BeatUp
dw BattleAnimCmd_E7
- dw BattleAnimCmd_E8
- dw BattleAnimCmd_E9
- dw BattleAnimCmd_EA
- dw BattleAnimCmd_EB
- dw BattleAnimCmd_EC
- dw BattleAnimCmd_ED
- dw BattleAnimCmd_EE
- dw BattleAnimCmd_EF
- dw BattleAnimCmd_F0
- dw BattleAnimCmd_F1
- dw BattleAnimCmd_F2
- dw BattleAnimCmd_F3
- dw BattleAnimCmd_F4
+ dw BattleAnimCmd_UpdateActorPic
+ dw BattleAnimCmd_Minimize
+ dw BattleAnimCmd_EA ; dummy
+ dw BattleAnimCmd_EB ; dummy
+ dw BattleAnimCmd_EC ; dummy
+ dw BattleAnimCmd_ED ; dummy
+ dw BattleAnimCmd_JumpAnd
+ dw BattleAnimCmd_JumpUntil
+ dw BattleAnimCmd_BGEffect
+ dw BattleAnimCmd_BGP
+ dw BattleAnimCmd_OBP0
+ dw BattleAnimCmd_OBP1
+ dw BattleAnimCmd_ClearSprites
dw BattleAnimCmd_F5
dw BattleAnimCmd_F6
dw BattleAnimCmd_F7
- dw BattleAnimCmd_F8
- dw BattleAnimCmd_F9
- dw BattleAnimCmd_FA
- dw BattleAnimCmd_FB
- dw BattleAnimCmd_FC
- dw BattleAnimCmd_FD
- dw BattleAnimCmd_FE
- dw BattleAnimCmd_FF
+ dw BattleAnimCmd_JumpIf
+ dw BattleAnimCmd_SetVar
+ dw BattleAnimCmd_IncVar
+ dw BattleAnimCmd_JumpVar
+ dw BattleAnimCmd_Jump
+ dw BattleAnimCmd_Loop
+ dw BattleAnimCmd_Call
+ dw BattleAnimCmd_Ret
BattleAnimCmd_EA:
@@ -409,7 +409,7 @@
BattleAnimCmd_ED: ; cc304 (33:4304)
ret
-BattleAnimCmd_FF: ; cc305 (33:4305)
+BattleAnimCmd_Ret: ; cc305 (33:4305)
ld hl, BattleAnimFlags
res 1, [hl]
ld hl, BattleAnimParent
@@ -422,7 +422,7 @@
ld [hl], d
ret
-BattleAnimCmd_FE: ; cc317 (33:4317)
+BattleAnimCmd_Call: ; cc317 (33:4317)
call GetBattleAnimByte
ld e, a
call GetBattleAnimByte
@@ -445,7 +445,7 @@
set 1, [hl]
ret
-BattleAnimCmd_FC: ; cc339 (33:4339)
+BattleAnimCmd_Jump: ; cc339 (33:4339)
call GetBattleAnimByte
ld e, a
call GetBattleAnimByte
@@ -456,7 +456,7 @@
ld [hl], d
ret
-BattleAnimCmd_FD: ; cc348 (33:4348)
+BattleAnimCmd_Loop: ; cc348 (33:4348)
call GetBattleAnimByte
ld hl, BattleAnimFlags
bit 2, [hl]
@@ -497,7 +497,7 @@
ld [hl], e
ret
-BattleAnimCmd_EF: ; cc383 (33:4383)
+BattleAnimCmd_JumpUntil: ; cc383 (33:4383)
ld hl, wKickCounter
ld a, [hl]
and a
@@ -527,17 +527,17 @@
ld [hl], e
ret
-BattleAnimCmd_F9: ; cc3a6 (33:43a6)
+BattleAnimCmd_SetVar: ; cc3a6 (33:43a6)
call GetBattleAnimByte
ld [BattleAnimVar], a
ret
-BattleAnimCmd_FA: ; cc3ad (33:43ad)
+BattleAnimCmd_IncVar: ; cc3ad (33:43ad)
ld hl, BattleAnimVar
inc [hl]
ret
-BattleAnimCmd_FB: ; cc3b2 (33:43b2)
+BattleAnimCmd_JumpVar: ; cc3b2 (33:43b2)
call GetBattleAnimByte
ld hl, BattleAnimVar
cp [hl]
@@ -566,7 +566,7 @@
ld [hl], d
ret
-BattleAnimCmd_F8: ; cc3d6 (33:43d6)
+BattleAnimCmd_JumpIf: ; cc3d6 (33:43d6)
call GetBattleAnimByte
ld hl, wKickCounter
cp [hl]
@@ -595,7 +595,7 @@
ld [hl], d
ret
-BattleAnimCmd_EE: ; cc3fa (33:43fa)
+BattleAnimCmd_JumpAnd: ; cc3fa (33:43fa)
call GetBattleAnimByte
ld e, a
ld a, [wKickCounter]
@@ -624,7 +624,7 @@
ld [hl], d
ret
-BattleAnimCmd_D0: ; cc41f (33:441f)
+BattleAnimCmd_Obj: ; cc41f (33:441f)
call GetBattleAnimByte
ld [BattleAnimTemps], a
call GetBattleAnimByte
@@ -636,7 +636,7 @@
call Functioncc9a1
ret
-BattleAnimCmd_F0: ; cc43b (33:443b)
+BattleAnimCmd_BGEffect: ; cc43b (33:443b)
call GetBattleAnimByte
ld [BattleAnimTemps], a
call GetBattleAnimByte
@@ -648,23 +648,23 @@
call Functionccb4f
ret
-BattleAnimCmd_F1: ; cc457 (33:4457)
+BattleAnimCmd_BGP: ; cc457 (33:4457)
call GetBattleAnimByte
ld [wcfc7], a
ret
-BattleAnimCmd_F2: ; cc45e (33:445e)
+BattleAnimCmd_OBP0: ; cc45e (33:445e)
call GetBattleAnimByte
ld [wcfc8], a
ret
-BattleAnimCmd_F3: ; cc465 (33:4465)
+BattleAnimCmd_OBP1: ; cc465 (33:4465)
call GetBattleAnimByte
ld [wcfc9], a
ret
-BattleAnimCmd_DF: ; cc46c (33:446c)
- ld a, [hSGB] ; $ff00+$e7
+BattleAnimCmd_ResetObp0: ; cc46c (33:446c)
+ ld a, [hSGB]
and a
ld a, $e0
jr z, .asm_cc475
@@ -673,7 +673,7 @@
ld [wcfc8], a
ret
-BattleAnimCmd_E5: ; cc479 (33:4479)
+BattleAnimCmd_ClearObjs: ; cc479 (33:4479)
ld hl, OTPartyMon3HP
ld a, $a0
.asm_cc47e
@@ -683,11 +683,11 @@
jr nz, .asm_cc47e
ret
-BattleAnimCmd_D1:
-BattleAnimCmd_D2:
-BattleAnimCmd_D3:
-BattleAnimCmd_D4:
-BattleAnimCmd_D5: ; cc485 (33:4485)
+BattleAnimCmd_1GFX:
+BattleAnimCmd_2GFX:
+BattleAnimCmd_3GFX:
+BattleAnimCmd_4GFX:
+BattleAnimCmd_5GFX: ; cc485 (33:4485)
ld a, [BattleAnimByte]
and $f
ld c, a
@@ -722,7 +722,7 @@
jr nz, .asm_cc492
ret
-BattleAnimCmd_D6: ; cc4c0 (33:44c0)
+BattleAnimCmd_IncObj: ; cc4c0 (33:44c0)
call GetBattleAnimByte
ld e, $a
ld bc, OTPartyMon3HP
@@ -746,7 +746,7 @@
inc [hl]
ret
-BattleAnimCmd_D8: ; cc4e3 (33:44e3)
+BattleAnimCmd_IncBGEffect: ; cc4e3 (33:44e3)
call GetBattleAnimByte
ld e, $5
ld bc, ActiveBGEffects
@@ -770,7 +770,7 @@
inc [hl]
ret
-BattleAnimCmd_D7: ; cc506 (33:4506)
+BattleAnimCmd_SetObj: ; cc506 (33:4506)
call GetBattleAnimByte
ld e, $a
ld bc, OTPartyMon3HP
@@ -795,7 +795,7 @@
ld [hl], a
ret
-BattleAnimCmd_D9: ; cc52c (33:452c)
+BattleAnimCmd_EnemyFeetObj: ; cc52c (33:452c)
ld hl, w5_d300
.asm_cc52f
@@ -851,7 +851,7 @@
jr nz, Functioncc561
ret
-BattleAnimCmd_DA: ; cc57e (33:457e)
+BattleAnimCmd_PlayerHeadObj: ; cc57e (33:457e)
ld hl, w5_d300
.asm_cc581
@@ -907,7 +907,7 @@
jr nz, Functioncc5b3
ret
-BattleAnimCmd_DB: ; cc5d0 (33:45d0)
+BattleAnimCmd_CheckPokeball: ; cc5d0 (33:45d0)
callab GetPokeBallWobble
ld a, c
ld [BattleAnimVar], a
@@ -916,15 +916,15 @@
BattleAnimCmd_E7: ; cc5db (33:45db)
ret
-BattleAnimCmd_DC: ; cc5dc (33:45dc)
- ld a, [rSVBK] ; $ff00+$70
+BattleAnimCmd_Transform: ; cc5dc (33:45dc)
+ ld a, [rSVBK]
push af
ld a, 1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies
push af
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr z, .player
@@ -948,13 +948,13 @@
pop af
ld [CurPartySpecies], a ; CurPartySpecies
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
-BattleAnimCmd_E8: ; cc622 (33:4622)
+BattleAnimCmd_UpdateActorPic: ; cc622 (33:4622)
ld de, VTiles0 tile $00
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr z, .player
@@ -971,12 +971,12 @@
call Request2bpp
ret
-BattleAnimCmd_DD: ; cc640 (33:4640)
+BattleAnimCmd_RaiseSub: ; cc640 (33:4640)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, 1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
call GetSRAMBank
@@ -992,7 +992,7 @@
or b
jr nz, .loop
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr z, .player
@@ -1037,7 +1037,7 @@
.done
call CloseSRAM
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
CopyMonsterSpriteTile: ; cc6c6 (33:46c6)
@@ -1046,11 +1046,11 @@
call FarCopyBytes
ret
-BattleAnimCmd_E2: ; cc6cf (33:46cf)
- ld a, [rSVBK] ; $ff00+$70
+BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf)
+ ld a, [rSVBK]
push af
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
call GetSRAMBank
call GetMinimizePic
@@ -1057,7 +1057,7 @@
call Request2bpp
call CloseSRAM
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
GetMinimizePic: ; cc6e7 (33:46e7)
@@ -1071,7 +1071,7 @@
or b
jr nz, .loop
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr z, .player
@@ -1102,11 +1102,11 @@
INCBIN "gfx/battle/minimize.2bpp"
; cc735
-BattleAnimCmd_E9: ; cc735 (33:4735)
- ld a, [rSVBK] ; $ff00+$70
+BattleAnimCmd_Minimize: ; cc735 (33:4735)
+ ld a, [rSVBK]
push af
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
call GetSRAMBank
call GetMinimizePic
@@ -1114,18 +1114,18 @@
call Request2bpp
call CloseSRAM
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
-BattleAnimCmd_DE: ; cc750 (33:4750)
- ld a, [rSVBK] ; $ff00+$70
+BattleAnimCmd_DropSub: ; cc750 (33:4750)
+ ld a, [rSVBK]
push af
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies
push af
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr z, .player
@@ -1139,14 +1139,14 @@
pop af
ld [CurPartySpecies], a ; CurPartySpecies
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
-BattleAnimCmd_E6: ; cc776 (33:4776)
- ld a, [rSVBK] ; $ff00+$70
+BattleAnimCmd_BeatUp: ; cc776 (33:4776)
+ ld a, [rSVBK]
push af
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies
push af
@@ -1153,7 +1153,7 @@
ld a, [wKickCounter]
ld [CurPartySpecies], a ; CurPartySpecies
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr z, .player
@@ -1175,20 +1175,20 @@
ld b, $1
call GetSGBLayout
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
-BattleAnimCmd_E3: ; cc7bb (33:47bb)
+BattleAnimCmd_OAMOn: ; cc7bb (33:47bb)
xor a
- ld [hOAMUpdate], a ; $ff00+$d8
+ ld [hOAMUpdate], a
ret
-BattleAnimCmd_E4: ; cc7bf (33:47bf)
+BattleAnimCmd_OAMOff: ; cc7bf (33:47bf)
ld a, $1
- ld [hOAMUpdate], a ; $ff00+$d8
+ ld [hOAMUpdate], a
ret
-BattleAnimCmd_F4: ; cc7c4 (33:47c4)
+BattleAnimCmd_ClearSprites: ; cc7c4 (33:47c4)
ld hl, BattleAnimFlags
set 3, [hl]
ret
@@ -1202,7 +1202,7 @@
BattleAnimCmd_F7: ; cc7cc (33:47cc)
ret
-BattleAnimCmd_E0: ; cc7cd (33:47cd)
+BattleAnimCmd_Sound: ; cc7cd (33:47cd)
call GetBattleAnimByte
ld e, a
srl a
@@ -1232,7 +1232,7 @@
; cc7fc
Functioncc7fc: ; cc7fc (33:47fc)
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr nz, .enemy
@@ -1244,7 +1244,7 @@
xor 1
ret
-BattleAnimCmd_E1: ; cc807 (33:4807)
+BattleAnimCmd_Cry: ; cc807 (33:4807)
call GetBattleAnimByte
and 3
ld e, a
@@ -1254,12 +1254,12 @@
add hl, de
endr
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, 1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr nz, .enemy
@@ -1316,7 +1316,7 @@
.done
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
; cc871 (33:4871)
--- a/battle/anim_objects.asm
+++ b/battle/anim_objects.asm
@@ -946,14 +946,14 @@
Functioncd249: ; cd249 (33:5249)
ld hl, Unknown_cd26c
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [CurItem] ; CurItem
ld e, a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
.asm_cd25a
ld a, [hli]
cp $ff
@@ -1694,7 +1694,7 @@
Functioncd677: ; cd677 (33:5677)
call Functionce72c
ld a, $42
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
ld a, $58
ld [hLCDStatCustom + 1], a
ld a, $5e
@@ -1753,7 +1753,7 @@
cp $70
jr c, asm_cd6da
xor a
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
ld [hLCDStatCustom + 1], a
ld [hLCDStatCustom + 2], a
@@ -2839,7 +2839,7 @@
Functioncdcca: ; cdcca (33:5cca)
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr z, .asm_cdcd9
ld hl, $b
@@ -3842,7 +3842,7 @@
Functionce260: ; ce260 (33:6260)
call Functionce72c
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and a
jr nz, .asm_ce26c
ld a, $f0
@@ -3893,7 +3893,7 @@
srl a
ld e, a
ld d, $0
- ld a, [hSGB] ; $ff00+$e7
+ ld a, [hSGB]
and a
jr nz, .asm_ce2b6
ld hl, Unknown_ce2c4
--- a/battle/anims.asm
+++ b/battle/anims.asm
@@ -303,10 +303,11 @@
; c92c1
BattleAnim_ThrowPokeBall: ; c92c1
- anim_jumpif $0, BattleAnim_ThrowPokeBall_branch_c92f2
- anim_jumpif $1, BattleAnim_ThrowPokeBall_branch_c9347
- anim_jumpif $2, BattleAnim_ThrowPokeBall_branch_c9305
- anim_jumpif $4, BattleAnim_ThrowPokeBall_branch_c9326
+ anim_jumpif NO_ITEM, .TheTrainerBlockedTheBall
+ anim_jumpif MASTER_BALL, .MasterBall
+ anim_jumpif ULTRA_BALL, .UltraBall
+ anim_jumpif GREAT_BALL, .GreatBall
+ ; any other ball
anim_2gfx ANIM_GFX_POKE_BALL, ANIM_GFX_SMOKE
anim_sound $1a, SFX_THROW_BALL
anim_obj $15, 68, 92, $40
@@ -317,10 +318,10 @@
anim_sound $1, SFX_BALL_POOF
anim_obj $1c, 136, 64, $10
anim_wait 16
- anim_jump BattleAnim_ThrowPokeBall_branch_c9392
+ anim_jump .Shake
; c92f2
-BattleAnim_ThrowPokeBall_branch_c92f2: ; c92f2
+.TheTrainerBlockedTheBall: ; c92f2
anim_2gfx ANIM_GFX_POKE_BALL, ANIM_GFX_HIT
anim_sound $1a, SFX_THROW_BALL
anim_obj $16, 64, 92, $20
@@ -330,7 +331,7 @@
anim_ret
; c9305
-BattleAnim_ThrowPokeBall_branch_c9305: ; c9305
+.UltraBall: ; c9305
anim_2gfx ANIM_GFX_POKE_BALL, ANIM_GFX_SMOKE
anim_sound $1a, SFX_THROW_BALL
anim_obj $15, 68, 92, $40
@@ -341,10 +342,10 @@
anim_sound $1, SFX_BALL_POOF
anim_obj $1c, 136, 64, $10
anim_wait 16
- anim_jump BattleAnim_ThrowPokeBall_branch_c9392
+ anim_jump .Shake
; c9326
-BattleAnim_ThrowPokeBall_branch_c9326: ; c9326
+.GreatBall: ; c9326
anim_2gfx ANIM_GFX_POKE_BALL, ANIM_GFX_SMOKE
anim_sound $1a, SFX_THROW_BALL
anim_obj $15, 68, 92, $40
@@ -355,10 +356,10 @@
anim_sound $1, SFX_BALL_POOF
anim_obj $1c, 136, 64, $10
anim_wait 16
- anim_jump BattleAnim_ThrowPokeBall_branch_c9392
+ anim_jump .Shake
; c9347
-BattleAnim_ThrowPokeBall_branch_c9347: ; c9347
+.MasterBall: ; c9347
anim_3gfx ANIM_GFX_POKE_BALL, ANIM_GFX_SMOKE, ANIM_GFX_SPEED
anim_sound $1a, SFX_THROW_BALL
anim_obj $15, 64, 92, $20
@@ -379,7 +380,7 @@
anim_obj $2b, 136, 56, $36
anim_obj $2b, 136, 56, $37
anim_wait 64
-BattleAnim_ThrowPokeBall_branch_c9392: ; c9392
+.Shake: ; c9392
anim_bgeffect ANIM_BG_RETURN_MON, $0, $0, $0
anim_wait 8
anim_incobj $2
@@ -393,22 +394,22 @@
anim_wait 32
anim_wait 8
anim_setvar $0
-BattleAnim_ThrowPokeBall_branch_c93aa: ; c93aa
+.Loop: ; c93aa
anim_wait 48
anim_checkpokeball
- anim_jumpvar $1, BattleAnim_ThrowPokeBall_branch_c93bc
- anim_jumpvar $2, BattleAnim_ThrowPokeBall_branch_c93be
+ anim_jumpvar $1, .Click
+ anim_jumpvar $2, .BreakFree
anim_incobj $1
anim_sound $1, SFX_BALL_WIGGLE
- anim_jump BattleAnim_ThrowPokeBall_branch_c93aa
+ anim_jump .Loop
; c93bc
-BattleAnim_ThrowPokeBall_branch_c93bc: ; c93bc
+.Click: ; c93bc
anim_clearsprites
anim_ret
; c93be
-BattleAnim_ThrowPokeBall_branch_c93be: ; c93be
+.BreakFree: ; c93be
anim_setobj $1, $b
anim_sound $1, SFX_BALL_POOF
anim_obj $1c, 136, 64, $10
--- a/battle/bg_effects.asm
+++ b/battle/bg_effects.asm
@@ -343,14 +343,14 @@
call ClearBox
pop bc
xor a
- ld [hBGMapThird], a ; $ff00+$d5
+ ld [hBGMapThird], a
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
Functionc81e3: ; c81e3 (32:41e3)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call EndBattleBGEffect
ret
@@ -441,13 +441,13 @@
.asm_c8271
call ClearBox
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
pop bc
ret
Functionc827a: ; c827a (32:427a)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call EndBattleBGEffect
ret
@@ -507,13 +507,13 @@
.asm_c82de
call ClearBox
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
pop bc
ret
Functionc82e7: ; c82e7 (32:42e7)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call EndBattleBGEffect
ret
@@ -595,9 +595,9 @@
jr nz, .asm_c8344
.asm_c8355
xor a
- ld [hBGMapThird], a ; $ff00+$d5
+ ld [hBGMapThird], a
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Functionc80e5
ld hl, $3
add hl, bc
@@ -606,7 +606,7 @@
Functionc8365: ; c8365 (32:4365)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld hl, $3
add hl, bc
ld a, [hl]
@@ -723,7 +723,7 @@
.asm_c841d
call Functionc80e5
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
.asm_c8425
call Functionc843b
@@ -731,7 +731,7 @@
Functionc842a: ; c842a (32:442a)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld hl, $1
add hl, bc
ld [hl], $0
@@ -739,7 +739,7 @@
Functionc8434: ; c8434 (32:4434)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call EndBattleBGEffect
ret
@@ -902,7 +902,7 @@
call Functionc8f69
Functionc8557: ; c8557 (32:4557)
- ld a, [hLCDStatCustom] ; $ff00+$c6
+ ld a, [hLCDStatCustom]
and a
ret z
push bc
@@ -967,7 +967,7 @@
call Functionc80e5
call Functionc8eca
ld a, $42
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
xor a
ld [hLCDStatCustom + 1], a
ld a, $5e
@@ -1042,7 +1042,7 @@
call Functionc80e5
call Functionc8eca
ld a, $43
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
xor a
ld [hLCDStatCustom + 1], a
ld a, $5f
@@ -1530,7 +1530,7 @@
sub d
ld d, a
ld h, LYOverridesBackup / $100
- ld a, [hSCY] ; $ff00+$d0
+ ld a, [hSCY]
or a
jr nz, .asm_c88d0
ld a, [hLCDStatCustom + 1]
@@ -1546,7 +1546,7 @@
ld l, a
ld [hl], $0
.asm_c88d6
- ld a, [hSCY] ; $ff00+$d0
+ ld a, [hSCY]
ld l, a
ld a, [hLCDStatCustom + 1]
sub l
@@ -1953,7 +1953,7 @@
ret
Functionc8b00: ; c8b00 (32:4b00)
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
jr nz, asm_c8b7a
call Functionc80d7 ; ; ; call does not return
@@ -1969,7 +1969,7 @@
ld a, $e4
call Functionc8ecb
ld a, $47
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
xor a
ld [hLCDStatCustom + 1], a
ld a, $60
@@ -2266,7 +2266,7 @@
call Functionc80e5
call Functionc8eca
ld a, $43
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
xor a
ld [hLCDStatCustom + 1], a
ld a, $37
@@ -2307,7 +2307,7 @@
push af
call DelayFrame
pop af
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
xor $ff
inc a
ld [OTPartyMon3SpclAtk], a
@@ -2318,7 +2318,7 @@
jr nc, .asm_c8cff
xor a
.asm_c8cff
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ret
Functionc8d02: ; c8d02 (32:4d02)
@@ -2326,7 +2326,7 @@
jr nc, .asm_c8d08
xor a
.asm_c8d08
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
ret
Functionc8d0b: ; c8d0b (32:4d0b)
@@ -2373,7 +2373,7 @@
jr nc, .asm_c8d53
ld d, $6
call Functionc905d
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld hl, $3
add hl, bc
ld a, [hl]
@@ -2382,7 +2382,7 @@
ret
.asm_c8d53
xor a
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ret
Functionc8d57: ; c8d57 (32:4d57)
@@ -2410,7 +2410,7 @@
ret
Functionc8d77: ; c8d77 (32:4d77)
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
jr nz, asm_c8dd4
push de
@@ -2469,7 +2469,7 @@
Functionc8dc9: ; c8dc9 (32:4dc9)
call Functionc8f19
ld a, $e4
- ld [rBGP], a ; $ff00+$47
+ ld [rBGP], a
call EndBattleBGEffect
ret
asm_c8dd4: ; c8dd4 (32:4dd4)
@@ -2563,10 +2563,10 @@
Functionc8e52: ; c8e52 (32:4e52)
ld h, a
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, h
push bc
push af
@@ -2583,17 +2583,17 @@
call CopyPals
pop bc
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
ret
Functionc8e7f: ; c8e7f (32:4e7f)
ld h, a
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, h
push bc
push af
@@ -2610,9 +2610,9 @@
call CopyPals
pop bc
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
ret
Functionc8eac: ; c8eac (32:4eac)
@@ -2660,7 +2660,7 @@
ret
Functionc8ede: ; c8ede (32:4ede)
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
call Functionc9038
jr nz, .asm_c8eea
ld de, $36
@@ -2675,7 +2675,7 @@
ret
Functionc8ef4: ; c8ef4 (32:4ef4)
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
call Functionc9038
jr nz, .asm_c8f00
ld de, $36
@@ -2695,15 +2695,15 @@
ld [hLCDStatCustom + 2], a
call Functionc8eca
xor a
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
call EndBattleBGEffect
ret
Functionc8f19: ; c8f19 (32:4f19)
xor a
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
ld a, $e4
- ld [rBGP], a ; $ff00+$47
+ ld [rBGP], a
ld [wcfc7], a
ld [wcfc9], a
ld [hLCDStatCustom + 1], a
@@ -2902,7 +2902,7 @@
Functionc9038: ; c9038 (32:5038)
ld hl, $2
add hl, bc
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and $1
xor [hl]
ret
@@ -2910,7 +2910,7 @@
Functionc9042: ; c9042 (32:5042)
ld hl, $2
add hl, bc
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld a, [hBattleTurn]
and $1
xor [hl]
jr nz, .asm_c9053
@@ -2923,7 +2923,7 @@
ret
Functionc9059: ; c9059 (32:5059)
- ld a, [hSGB] ; $ff00+$e7
+ ld a, [hSGB]
and a
ret
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -174,8 +174,8 @@
ld [wPlayerIsSwitching], a
ld [wEnemyIsSwitching], a
ld [wd264], a
- ld [wc73f], a
- ld [wc740], a
+ ld [wPlayerJustGotFrozen], a
+ ld [wEnemyJustGotFrozen], a
ld [CurDamage], a
ld [CurDamage + 1], a
@@ -1604,19 +1604,21 @@
HanleDefrost: ; 3ca8f
ld a, [hLinkPlayerNumber]
cp $1
- jr z, .asm_3ca9a
- call .asm_3ca9d
- jr .asm_3cac9
+ jr z, .enemy_first
+ call .do_player_turn
+ jr .do_enemy_turn
-.asm_3ca9a
- call .asm_3cac9
-.asm_3ca9d
+.enemy_first
+ call .do_enemy_turn
+.do_player_turn
ld a, [BattleMonStatus]
bit FRZ, a
ret z
- ld a, [wc73f]
+
+ ld a, [wPlayerJustGotFrozen]
and a
ret nz
+
call BattleRandom
cp 10 percent
ret nc
@@ -1631,11 +1633,11 @@
ld hl, DefrostedOpponentText
jp StdBattleTextBox
-.asm_3cac9
+.do_enemy_turn
ld a, [EnemyMonStatus]
bit FRZ, a
ret z
- ld a, [wc740]
+ ld a, [wEnemyJustGotFrozen]
and a
ret nz
call BattleRandom
@@ -3654,9 +3656,9 @@
ld hl, EnemyMonHP
ld a, [hli]
- ld [wc6ea], a
+ ld [wEnemyHPAtTimeOfPlayerSwitch], a
ld a, [hl]
- ld [wc6eb], a
+ ld [wEnemyHPAtTimeOfPlayerSwitch + 1], a
ret
; 3d714
@@ -3814,7 +3816,7 @@
ld [EnemyProtectCount], a
ld [wEnemyRageCounter], a
ld [EnemyDisabledMove], a
- ld [wc6fa], a
+ ld [wEnemyMinimized], a
ld [wPlayerWrapCount], a
ld [wEnemyWrapCount], a
ld [EnemyTurnsTaken], a
@@ -4317,7 +4319,7 @@
ld [PlayerProtectCount], a
ld [wPlayerRageCounter], a
ld [DisabledMove], a
- ld [wc6fe], a
+ ld [wPlayerMinimized], a
ld [wEnemyWrapCount], a
ld [wPlayerWrapCount], a
ld [PlayerTurnsTaken], a
@@ -5166,9 +5168,9 @@
; Auto input: choose "ITEM"
ld a, [InputType]
or a
- jr z, .asm_3e171
+ jr z, .skip_dude_pack_select
callba _DudeAutoInput_DownA
-.asm_3e171
+.skip_dude_pack_select
call LoadBattleMenu2
ret c
@@ -5242,8 +5244,8 @@
callba BattlePack
ld a, [wd0ec]
and a
- jr z, .asm_3e20d
- jr .asm_3e209
+ jr z, .didnt_use_item
+ jr .got_item
.tutorial
callba Function107bb
@@ -5250,7 +5252,7 @@
ld a, POKE_BALL
ld [CurItem], a
call DoItemEffect
- jr .asm_3e209
+ jr .got_item
.contest
ld a, PARK_BALL
@@ -5257,11 +5259,11 @@
ld [CurItem], a
call DoItemEffect
-.asm_3e209
+.got_item
call Function3e234
ret
-.asm_3e20d
+.didnt_use_item
call ClearPalettes
call DelayFrame
call Function3ed9f
@@ -7862,7 +7864,7 @@
ld e, a
push de
ld de, TempMonExp + 2
- call Function3f39c
+ call CalcExpBar
push bc
ld hl, TempMonExp + 2
ld a, [wd004]
@@ -7950,7 +7952,7 @@
push bc
ld b, d
ld de, TempMonExp + 2
- call Function3f39c
+ call CalcExpBar
ld a, b
pop bc
ld c, a
@@ -7986,7 +7988,7 @@
push bc
push de
hlcoord 17, 11
- call Function3f41c
+ call PlaceExpBar
pop de
ld a, $1
ld [hBGMapMode], a
@@ -8002,7 +8004,7 @@
push bc
push de
hlcoord 17, 11
- call Function3f41c
+ call PlaceExpBar
pop de
ld a, $1
ld [hBGMapMode], a
@@ -8030,32 +8032,33 @@
SendOutPkmnText: ; 3f26d
ld a, [wLinkMode]
and a
- jr z, .asm_3f27c
+ jr z, .not_linked
ld hl, JumpText_GoPkmn ; If we're in a LinkBattle print just "Go <PlayerMon>"
- ld a, [wd264] ; besides this variable is set. which stands for ???
+ ld a, [wd264] ; unless this (unidentified) variable is set
and a
- jr nz, .asm_3f2ce
+ jr nz, .skip_to_textbox
-.asm_3f27c
+.not_linked
; Depending on the HP of the enemy Pkmn, the game prints a different text
ld hl, EnemyMonHP
ld a, [hli]
or [hl]
ld hl, JumpText_GoPkmn
- jr z, .asm_3f2ce
+ jr z, .skip_to_textbox
+ ; compute enemy helth remaining as a percentage
xor a
ld [hMultiplicand + 0], a
ld hl, EnemyMonHP
ld a, [hli]
- ld [wc6ea], a
+ ld [wEnemyHPAtTimeOfPlayerSwitch], a
ld [hMultiplicand + 1], a
ld a, [hl]
- ld [wc6eb], a
+ ld [wEnemyHPAtTimeOfPlayerSwitch + 1], a
ld [hMultiplicand + 2], a
- ld a, $19
+ ld a, 25
ld [hMultiplier], a
call Multiply
ld hl, EnemyMonMaxHP
@@ -8066,22 +8069,25 @@
srl a
rr b
ld a, b
- ld b, $4
+ ld b, 4
ld [hDivisor], a
call Divide
+
ld a, [hQuotient + 2]
ld hl, JumpText_GoPkmn
- cp $46
- jr nc, .asm_3f2ce
+ cp 70
+ jr nc, .skip_to_textbox
+
ld hl, JumpText_DoItPkmn
- cp $28
- jr nc, .asm_3f2ce
+ cp 40
+ jr nc, .skip_to_textbox
+
ld hl, JumpText_GoForItPkmn
- cp $a
- jr nc, .asm_3f2ce
- ld hl, JumpText_YourFoesWeakGetmPkmn
+ cp 10
+ jr nc, .skip_to_textbox
-.asm_3f2ce
+ ld hl, JumpText_YourFoesWeakGetmPkmn
+.skip_to_textbox
jp BattleTextBox
; 3f2d1
@@ -8130,13 +8136,13 @@
start_asm
; 3f2ff
-Function3f2ff: ; 3f2ff
+WithdrawPkmnText: ; 3f2ff
; Print text to withdraw Pkmn
; depending on HP the message is different
push de
push bc
ld hl, EnemyMonHP + 1
- ld de, wc6eb
+ ld de, wEnemyHPAtTimeOfPlayerSwitch + 1
ld b, [hl]
dec hl
ld a, [de]
@@ -8147,7 +8153,7 @@
ld a, [de]
sbc b
ld [hMultiplicand + 1], a
- ld a, $19
+ ld a, 25
ld [hMultiplier], a
call Multiply
ld hl, EnemyMonMaxHP
@@ -8158,7 +8164,7 @@
srl a
rr b
ld a, b
- ld b, $4
+ ld b, 4
ld [hDivisor], a
call Divide
pop bc
@@ -8169,11 +8175,11 @@
ret z
ld hl, TextJump_ComeBack
- cp $1e
+ cp 30
ret c
ld hl, TextJump_OKComeBack
- cp $46
+ cp 70
ret c
ld hl, TextJump_GoodComeBack
@@ -8207,23 +8213,23 @@
; 3f360
-Function3f360: ; 3f360
- ld hl, wc6f0
+HandleSafariAngerEatingStatus: ; unreferenced
+ ld hl, wSafariMonEating
ld a, [hl]
and a
- jr z, .asm_3f36d
+ jr z, .angry
dec [hl]
ld hl, BattleText_WildPkmnIsEating
- jr .asm_3f388
+ jr .finish
-.asm_3f36d
- dec hl
+.angry
+ dec hl ; wSafariMonAngerCount
ld a, [hl]
and a
ret z
dec [hl]
ld hl, BattleText_WildPkmnIsAngry
- jr nz, .asm_3f388
+ jr nz, .finish
push hl
ld a, [EnemyMonSpecies]
ld [CurSpecies], a
@@ -8232,7 +8238,7 @@
ld [EnemyMonCatchRate], a
pop hl
-.asm_3f388
+.finish
push hl
call Call_LoadTempTileMapToTileMap
pop hl
@@ -8242,19 +8248,22 @@
FillInExpBar: ; 3f390
push hl
- call Function3f39c
+ call CalcExpBar
pop hl
- ld de, $0007
+ ld de, 7
add hl, de
- jp Function3f41c
+ jp PlaceExpBar
; 3f39c
-Function3f39c: ; 3f39c
+CalcExpBar: ; 3f39c
+; Calculate the percent exp between this level and the next
+; Level in b
push de
ld d, b
push de
callab CalcExpAtLevel
pop de
+; exp at current level gets pushed to the stack
ld hl, hMultiplicand
ld a, [hli]
push af
@@ -8262,16 +8271,18 @@
push af
ld a, [hl]
push af
+; next level
inc d
callab CalcExpAtLevel
- ld hl, hProduct + 3
+; back up the next level exp, and subtract the two levels
+ ld hl, hMultiplicand + 2
ld a, [hl]
- ld [hPrintNum8], a
+ ld [hMathBuffer + 2], a
pop bc
sub b
ld [hld], a
ld a, [hl]
- ld [hPrintNum7], a
+ ld [hMathBuffer + 1], a
pop bc
sbc b
ld [hld], a
@@ -8281,21 +8292,24 @@
sbc b
ld [hl], a
pop de
- ld hl, hProduct + 2
+
+ ld hl, hMultiplicand + 1
ld a, [hli]
push af
ld a, [hl]
push af
+
+; get the amount of exp remaining to the next level
ld a, [de]
dec de
ld c, a
- ld a, [hPrintNum8]
+ ld a, [hMathBuffer + 2]
sub c
ld [hld], a
ld a, [de]
dec de
ld b, a
- ld a, [hPrintNum7]
+ ld a, [hMathBuffer + 1]
sbc b
ld [hld], a
ld a, [de]
@@ -8305,6 +8319,7 @@
ld [hld], a
xor a
ld [hl], a
+; multiply by 64
ld a, $40
ld [hMultiplier], a
call Multiply
@@ -8312,10 +8327,10 @@
ld c, a
pop af
ld b, a
-.asm_3f3f4
+.loop
ld a, b
and a
- jr z, .asm_3f40c
+ jr z, .done
srl b
rr c
ld hl, hProduct
@@ -8326,12 +8341,12 @@
rr [hl]
inc hl
rr [hl]
- jr .asm_3f3f4
+ jr .loop
-.asm_3f40c
+.done
ld a, c
ld [hDivisor], a
- ld b, $4
+ ld b, 4
call Divide
ld a, [hQuotient + 2]
ld b, a
@@ -8341,35 +8356,35 @@
ret
; 3f41c
-Function3f41c: ; 3f41c
- ld c, $8
-.asm_3f41e
+PlaceExpBar: ; 3f41c
+ ld c, $8 ; number of tiles
+.loop1
ld a, b
sub $8
- jr c, .asm_3f42c
+ jr c, .next
ld b, a
- ld a, $6a
+ ld a, $6a ; full bar
ld [hld], a
dec c
- jr z, .asm_3f43c
- jr .asm_3f41e
+ jr z, .finish
+ jr .loop1
-.asm_3f42c
+.next
add $8
- jr z, .asm_3f434
- add $54
- jr .asm_3f436
+ jr z, .loop2
+ add $54 ; tile to the left of small exp bar tile
+ jr .skip
-.asm_3f434
- ld a, $62
+.loop2
+ ld a, $62 ; empty bar
-.asm_3f436
+.skip
ld [hld], a
- ld a, $62
+ ld a, $62 ; empty bar
dec c
- jr nz, .asm_3f434
+ jr nz, .loop2
-.asm_3f43c
+.finish
ret
; 3f43d
@@ -8376,14 +8391,14 @@
GetMonBackpic: ; 3f43d
ld a, [PlayerSubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
- ld hl, BattleAnimCmd_DD
- jr nz, Function3f46f ; substitute
+ ld hl, BattleAnimCmd_RaiseSub
+ jr nz, GetBackpic_DoAnim ; substitute
Function3f447: ; 3f447
- ld a, [wc6fe]
+ ld a, [wPlayerMinimized]
and a
- ld hl, BattleAnimCmd_E2
- jr nz, Function3f46f
+ ld hl, BattleAnimCmd_MinimizeOpp
+ jr nz, GetBackpic_DoAnim
ld a, [CurPartySpecies]
push af
ld a, [BattleMonSpecies]
@@ -8397,7 +8412,7 @@
ret
; 3f46f
-Function3f46f: ; 3f46f
+GetBackpic_DoAnim: ; 3f46f
ld a, [hBattleTurn]
push af
xor a
@@ -8412,14 +8427,14 @@
GetMonFrontpic: ; 3f47c
ld a, [EnemySubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
- ld hl, BattleAnimCmd_DD
- jr nz, Function3f4b4
+ ld hl, BattleAnimCmd_RaiseSub
+ jr nz, GetFrontpic_DoAnim
Function3f486: ; 3f486
- ld a, [wc6fa]
+ ld a, [wEnemyMinimized]
and a
- ld hl, BattleAnimCmd_E2
- jr nz, Function3f4b4
+ ld hl, BattleAnimCmd_MinimizeOpp
+ jr nz, GetFrontpic_DoAnim
ld a, [CurPartySpecies]
push af
@@ -8436,7 +8451,7 @@
ret
; 3f4b4
-Function3f4b4: ; 3f4b4
+GetFrontpic_DoAnim: ; 3f4b4
ld a, [hBattleTurn]
push af
call SetEnemyTurn
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -5361,13 +5361,14 @@
callba UseHeldStatusHealingItem
ret nz
+
call OpponentCantMove
call EndRechargeOpp
- ld hl, wc740
+ ld hl, wEnemyJustGotFrozen
ld a, [hBattleTurn]
and a
jr z, .finish
- ld hl, wc73f
+ ld hl, wPlayerJustGotFrozen
.finish
ld [hl], $1
ret
@@ -5582,12 +5583,12 @@
StatUpAnimation: ; 36281
- ld bc, wc6fe
+ ld bc, wPlayerMinimized
ld hl, Function3f447
ld a, [hBattleTurn]
and a
jr z, .do_player ; 0x3628a $6
- ld bc, wc6fa
+ ld bc, wEnemyMinimized
ld hl, Function3f486
.do_player
ld a, BATTLE_VARS_MOVE_ANIM
@@ -8338,9 +8339,9 @@
jr c, .mimic_anims
ld a, [hBattleTurn]
and a
- ld a, [wc6fe]
+ ld a, [wPlayerMinimized]
jr z, .got_byte
- ld a, [wc6fa]
+ ld a, [wEnemyMinimized]
.got_byte
and a
jr nz, .mimic_anims
@@ -9528,11 +9529,11 @@
BattleCommand_DoubleMinimizeDamage: ; 37ce6
; doubleminimizedamage
- ld hl, wc6fa
+ ld hl, wEnemyMinimized
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, wc6fe
+ ld hl, wPlayerMinimized
.ok
ld a, [hl]
and a
--- a/battle/misc.asm
+++ b/battle/misc.asm
@@ -1,7 +1,7 @@
_DisappearUser: ; fbd54
xor a
- ld [hBGMapMode], a ; $ff00+$d4
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld [hBGMapMode], a
+ ld a, [hBattleTurn]
and a
jr z, .player
call GetEnemyFrontpicCoords
@@ -21,8 +21,8 @@
AppearUser: ; fbd77 (3e:7d77)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
- ld a, [hBattleTurn] ; $ff00+$e4
+ ld [hBGMapMode], a
+ ld a, [hBattleTurn]
and a
jr z, .player
call GetEnemyFrontpicCoords
@@ -36,7 +36,7 @@
predef FillBox
FinishAppearDisappearUser: ; fbd91 (3e:7d91)
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
GetEnemyFrontpicCoords: ; fbd96 (3e:7d96)
--- a/constants/animation_constants.asm
+++ b/constants/animation_constants.asm
@@ -48,53 +48,3 @@
const ANIM_MON_UNUSED ; 6
const ANIM_MON_EGG1 ; 7
const ANIM_MON_EGG2 ; 8
-
-const_value SET $d0
- const BATTLEANIM_D0
- const BATTLEANIM_D1
- const BATTLEANIM_D2
- const BATTLEANIM_D3
- const BATTLEANIM_D4
- const BATTLEANIM_D5
- const BATTLEANIM_D6
- const BATTLEANIM_D7
- const BATTLEANIM_D8
- const BATTLEANIM_D9
- const BATTLEANIM_DA
- const BATTLEANIM_DB
- const BATTLEANIM_DC
- const BATTLEANIM_DD
- const BATTLEANIM_DE
- const BATTLEANIM_DF
- const BATTLEANIM_E0
- const BATTLEANIM_E1
- const BATTLEANIM_E2
- const BATTLEANIM_E3
- const BATTLEANIM_E4
- const BATTLEANIM_E5
- const BATTLEANIM_E6
- const BATTLEANIM_E7
- const BATTLEANIM_E8
- const BATTLEANIM_E9
- const BATTLEANIM_EA
- const BATTLEANIM_EB
- const BATTLEANIM_EC
- const BATTLEANIM_ED
- const BATTLEANIM_EE
- const BATTLEANIM_EF
- const BATTLEANIM_F0
- const BATTLEANIM_F1
- const BATTLEANIM_F2
- const BATTLEANIM_F3
- const BATTLEANIM_F4
- const BATTLEANIM_F5
- const BATTLEANIM_F6
- const BATTLEANIM_F7
- const BATTLEANIM_F8
- const BATTLEANIM_F9
- const BATTLEANIM_FA
- const BATTLEANIM_FB
- const BATTLEANIM_FC
- const BATTLEANIM_FD
- const BATTLEANIM_FE
- const BATTLEANIM_FF
--- a/engine/battle_start.asm
+++ b/engine/battle_start.asm
@@ -254,7 +254,7 @@
call StartTrainerBattle_NextScene
xor a
ld [wcf64], a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
StartTrainerBattle_Flash: ; 8c3ab (23:43ab)
@@ -309,10 +309,10 @@
StartTrainerBattle_SetUpForWavyOutro: ; 8c3e8 (23:43e8)
callba Function5602
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call StartTrainerBattle_NextScene
ld a, $43
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
xor a
ld [hLCDStatCustom + 1], a
ld a, $90
@@ -365,7 +365,7 @@
StartTrainerBattle_SetUpForSpinOutro: ; 8c43d (23:443d)
callba Function5602
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call StartTrainerBattle_NextScene
xor a
ld [wcf64], a
@@ -386,7 +386,7 @@
StartTrainerBattle_SpinToBlack: ; 8c44f (23:444f)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, [wcf64]
ld e, a
ld d, 0
@@ -400,7 +400,7 @@
ld [wcf65], a
call .load
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call DelayFrame
call DelayFrame
ld hl, wcf64
@@ -409,12 +409,12 @@
.end
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call DelayFrame
call DelayFrame
call DelayFrame
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $20
ld [wJumptableIndex], a
ret
@@ -508,12 +508,12 @@
StartTrainerBattle_SetUpForRandomScatterOutro: ; 8c578 (23:4578)
callba Function5602
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call StartTrainerBattle_NextScene
ld a, $10
ld [wcf64], a
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)
@@ -533,12 +533,12 @@
.done
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call DelayFrame
call DelayFrame
call DelayFrame
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $20
ld [wJumptableIndex], a
ret
@@ -580,7 +580,7 @@
jp z, .nextscene
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
hlcoord 0, 0, AttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
inc b
@@ -636,11 +636,11 @@
dec b
jr nz, .loop2
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
jr nz, .cgb
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call DelayFrame
call DelayFrame
jr .nextscene
@@ -653,10 +653,10 @@
jr nz, .daytime
ld hl, .nightpals
.daytime
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5 ; WRAM5 = palettes
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call .copypals
push hl
ld de, Unkn1Pals + 8 * 7
@@ -667,9 +667,9 @@
ld bc, $8
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
call DelayFrame
call Function8cf4f
@@ -829,7 +829,7 @@
inc de
ld h, a
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call .Copy
call WaitBGMap
jr .loop
--- /dev/null
+++ b/engine/breeding/egg.asm
@@ -1,0 +1,976 @@
+Function16e1d: ; 16e1d
+ call Function16ed6
+ ld c, $0
+ jp nc, .asm_16eb7
+ ld a, [wBreedMon1Species]
+ ld [CurPartySpecies], a
+ ld a, [wBreedMon1DVs]
+ ld [TempMonDVs], a
+ ld a, [wBreedMon1DVs + 1]
+ ld [TempMonDVs + 1], a
+ ld a, $3
+ ld [MonType], a
+ predef GetGender
+ jr c, .asm_16e70
+ ld b, $1
+ jr nz, .asm_16e48
+ inc b
+
+.asm_16e48
+ push bc
+ ld a, [wBreedMon2Species]
+ ld [CurPartySpecies], a
+ ld a, [wBreedMon2DVs]
+ ld [TempMonDVs], a
+ ld a, [wBreedMon2DVs + 1]
+ ld [TempMonDVs + 1], a
+ ld a, $3
+ ld [MonType], a
+ predef GetGender
+ pop bc
+ jr c, .asm_16e70
+ ld a, $1
+ jr nz, .asm_16e6d
+ inc a
+
+.asm_16e6d
+ cp b
+ jr nz, .asm_16e89
+
+.asm_16e70
+ ld c, $0
+ ld a, [wBreedMon1Species]
+ cp DITTO
+ jr z, .asm_16e82
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr nz, .asm_16eb7
+ jr .asm_16e89
+
+.asm_16e82
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr z, .asm_16eb7
+
+.asm_16e89
+ call Function16ebc
+ ld c, $ff
+ jp z, .asm_16eb7
+ ld a, [wBreedMon2Species]
+ ld b, a
+ ld a, [wBreedMon1Species]
+ cp b
+ ld c, $fe
+ jr z, .asm_16e9f
+ ld c, $80
+.asm_16e9f
+ ld a, [wBreedMon1ID]
+ ld b, a
+ ld a, [wBreedMon2ID]
+ cp b
+ jr nz, .asm_16eb7
+ ld a, [wBreedMon1ID + 1]
+ ld b, a
+ ld a, [wBreedMon2ID + 1]
+ cp b
+ jr nz, .asm_16eb7
+ ld a, c
+ sub $4d
+ ld c, a
+
+.asm_16eb7
+ ld a, c
+ ld [wd265], a
+ ret
+; 16ebc
+
+
+Function16ebc: ; 16ebc (5:6ebc)
+ ld a, [wBreedMon1DVs]
+ and $f
+ ld b, a
+ ld a, [wBreedMon2DVs]
+ and $f
+ cp b
+ ret nz
+ ld a, [wBreedMon1DVs + 1]
+ and $7
+ ld b, a
+ ld a, [wBreedMon2DVs + 1]
+ and $7
+ cp b
+ ret
+; 16ed6
+
+Function16ed6: ; 16ed6
+ ld a, [wBreedMon2Species]
+ ld [CurSpecies], a
+ call GetBaseData
+ ld a, [BaseEggGroups]
+ cp $ff
+ jr z, .asm_16f3a
+ ld a, [wBreedMon1Species]
+ ld [CurSpecies], a
+ call GetBaseData
+ ld a, [BaseEggGroups]
+ cp $ff
+ jr z, .asm_16f3a
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr z, .asm_16f3c
+ ld [CurSpecies], a
+ call GetBaseData
+ ld a, [BaseEggGroups]
+ push af
+ and $f
+ ld b, a
+ pop af
+ and $f0
+ swap a
+ ld c, a
+ ld a, [wBreedMon1Species]
+ cp DITTO
+ jr z, .asm_16f3c
+ ld [CurSpecies], a
+ push bc
+ call GetBaseData
+ pop bc
+ ld a, [BaseEggGroups]
+ push af
+ and $f
+ ld d, a
+ pop af
+ and $f0
+ swap a
+ ld e, a
+ ld a, d
+ cp b
+ jr z, .asm_16f3c
+ cp c
+ jr z, .asm_16f3c
+ ld a, e
+ cp b
+ jr z, .asm_16f3c
+ cp c
+ jr z, .asm_16f3c
+
+.asm_16f3a
+ and a
+ ret
+
+.asm_16f3c
+ scf
+ ret
+; 16f3e
+
+DoEggStep:: ; 16f3e
+ ld de, PartySpecies
+ ld hl, PartyMon1Happiness
+ ld c, 0
+.loop
+ ld a, [de]
+ inc de
+ cp -1
+ ret z
+ cp EGG
+ jr nz, .next
+ dec [hl]
+ jr nz, .next
+ ld a, 1
+ and a
+ ret
+
+.next
+ push de
+ ld de, PARTYMON_STRUCT_LENGTH
+ add hl, de
+ pop de
+ jr .loop
+; 16f5e
+
+OverworldHatchEgg:: ; 16f5e
+ call ResetWindow
+ call LoadPartyMenuDataHeader
+ call Function16f70
+ call Function2b4d
+ call RestartMapMusic
+ jp LoadMoveSprites
+; 16f70
+
+Function16f70: ; 16f70 (5:6f70)
+ ld de, PartySpecies
+ ld hl, PartyMon1Happiness
+ xor a
+ ld [CurPartyMon], a
+
+Function16f7a: ; 16f7a (5:6f7a)
+ ld a, [de]
+ inc de
+ cp -1
+ jp z, Function1708a
+ push de
+ push hl
+ cp EGG
+ jp nz, Function1707d
+ ld a, [hl]
+ and a
+ jp nz, Function1707d
+ ld [hl], $78
+
+ push de
+
+ callba Function4dbb8
+ callba MobileFn_10608d
+ ld a, [CurPartyMon]
+ ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ ld a, [hl]
+ ld [CurPartySpecies], a
+ dec a
+ call SetSeenAndCaughtMon
+
+ ld a, [CurPartySpecies]
+ cp TOGEPI
+ jr nz, .nottogepi
+ ; set the event flag for hatching togepi
+ ld de, EVENT_TOGEPI_HATCHED
+ ld b, SET_FLAG
+ call EventFlagAction
+.nottogepi
+
+ pop de
+
+ ld a, [CurPartySpecies]
+ dec de
+ ld [de], a
+ ld [wd265], a
+ ld [CurSpecies], a
+ call GetPokemonName
+ xor a
+ ld [wd26b], a
+ call GetBaseData
+ ld a, [CurPartyMon]
+ ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ push hl
+ ld bc, MON_MAXHP
+ add hl, bc
+ ld d, h
+ ld e, l
+ pop hl
+ push hl
+ ld bc, MON_LEVEL
+ add hl, bc
+ ld a, [hl]
+ ld [CurPartyLevel], a
+ pop hl
+ push hl
+ ld bc, MON_STATUS
+ add hl, bc
+ xor a
+ ld [hli], a
+ ld [hl], a
+ pop hl
+ push hl
+ ld bc, MON_EXP + 2
+ add hl, bc
+ ld b, $0
+ predef CalcPkmnStats
+ pop bc
+ ld hl, MON_MAXHP
+ add hl, bc
+ ld d, h
+ ld e, l
+ ld hl, MON_HP
+ add hl, bc
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ ld [hl], a
+ ld hl, MON_ID
+ add hl, bc
+ ld a, [PlayerID]
+ ld [hli], a
+ ld a, [PlayerID + 1]
+ ld [hl], a
+ ld a, [CurPartyMon]
+ ld hl, PartyMonOT ; wddff (aliases: PartyMonOT)
+ ld bc, NAME_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ld hl, PlayerName
+ call CopyBytes
+ ld hl, UnknownText_0x1708b
+ call PrintText
+ ld a, [CurPartyMon]
+ ld hl, PartyMonNicknames
+ ld bc, PKMN_NAME_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ push de
+ ld hl, UnknownText_0x170ba
+ call PrintText
+ call YesNoBox
+ pop de
+ jr c, .nonickname
+ ld a, $1
+ ld [wd26b], a
+ xor a
+ ld [MonType], a
+ push de
+ ld b, $0
+ callba Function116c1
+ pop hl
+ ld de, StringBuffer1
+ call InitName
+ jr Function1707d
+.nonickname
+ ld hl, StringBuffer1
+ ld bc, PKMN_NAME_LENGTH
+ call CopyBytes
+
+Function1707d: ; 1707d (5:707d)
+ ld hl, CurPartyMon
+ inc [hl]
+ pop hl
+ ld de, PARTYMON_STRUCT_LENGTH
+ add hl, de
+ pop de
+ jp Function16f7a
+
+Function1708a: ; 1708a (5:708a)
+ ret
+; 1708b (5:708b)
+
+UnknownText_0x1708b: ; 0x1708b
+ ; Huh? @ @
+ text_jump UnknownText_0x1c0db0
+ start_asm
+; 0x17090
+
+Function17090: ; 17090
+ ld hl, VramState
+ res 0, [hl]
+ push hl
+ push de
+ push bc
+ ld a, [CurPartySpecies]
+ push af
+ call Function1728f
+ ld hl, UnknownText_0x170b0
+ call PrintText
+ pop af
+ ld [CurPartySpecies], a
+ pop bc
+ pop de
+ pop hl
+ ld hl, UnknownText_0x170b5
+ ret
+; 170b0 (5:70b0)
+
+UnknownText_0x170b0: ; 0x170b0
+ ;
+ text_jump UnknownText_0x1c0db8
+ db "@"
+; 0x170b5
+
+UnknownText_0x170b5: ; 0x170b5
+ ; came out of its EGG!@ @
+ text_jump UnknownText_0x1c0dba
+ db "@"
+; 0x170ba
+
+UnknownText_0x170ba: ; 0x170ba
+ ; Give a nickname to @ ?
+ text_jump UnknownText_0x1c0dd8
+ db "@"
+; 0x170bf
+
+Function170bf: ; 170bf
+ call Function17197
+ ld d, h
+ ld e, l
+ ld b, NUM_MOVES
+.loop
+ ld a, [de]
+ and a
+ jr z, .done
+ ld hl, wEggMonMoves
+ ld c, NUM_MOVES
+.next
+ ld a, [de]
+ cp [hl]
+ jr z, .skip
+ inc hl
+ dec c
+ jr nz, .next
+ call Function170e4
+ jr nc, .skip
+ call Function17169
+
+.skip
+ inc de
+ dec b
+ jr nz, .loop
+
+.done
+ ret
+; 170e4
+
+Function170e4: ; 170e4
+GLOBAL EggMoves
+
+ push bc
+ ld a, [wEggMonSpecies]
+ dec a
+ ld c, a
+ ld b, 0
+ ld hl, EggMovePointers
+rept 2
+ add hl, bc
+endr
+ ld a, BANK(EggMovePointers)
+ call GetFarHalfword
+.loop
+ ld a, BANK(EggMoves)
+ call GetFarByte
+ cp -1
+ jr z, .found_mon
+ ld b, a
+ ld a, [de]
+ cp b
+ jr z, .done_carry
+ inc hl
+ jr .loop
+
+.found_mon
+ call Function1720b
+ ld b, NUM_MOVES
+.loop2
+ ld a, [de]
+ cp [hl]
+ jr z, .found_eggmove
+ inc hl
+ dec b
+ jr z, .inherit_tmhm
+ jr .loop2
+
+.found_eggmove
+ ld a, [wEggMonSpecies]
+ dec a
+ ld c, a
+ ld b, 0
+ ld hl, EvosAttacksPointers
+rept 2
+ add hl, bc
+endr
+ ld a, BANK(EvosAttacksPointers)
+ call GetFarHalfword
+.loop3
+ ld a, BANK(EvosAttacks)
+ call GetFarByte
+ inc hl
+ and a
+ jr nz, .loop3
+.loop4
+ ld a, BANK(EvosAttacks)
+ call GetFarByte
+ and a
+ jr z, .inherit_tmhm
+ inc hl
+ ld a, BANK(EvosAttacks)
+ call GetFarByte
+ ld b, a
+ ld a, [de]
+ cp b
+ jr z, .done_carry
+ inc hl
+ jr .loop4
+
+.inherit_tmhm
+ ld hl, TMHMMoves
+.loop5
+ ld a, BANK(TMHMMoves)
+ call GetFarByte
+ inc hl
+ and a
+ jr z, .done
+ ld b, a
+ ld a, [de]
+ cp b
+ jr nz, .loop5
+ ld [wd262], a
+ predef CanLearnTMHMMove
+ ld a, c
+ and a
+ jr z, .done
+
+.done_carry
+ pop bc
+ scf
+ ret
+
+.done
+ pop bc
+ and a
+ ret
+; 17169
+
+Function17169: ; 17169
+ push de
+ push bc
+ ld a, [de]
+ ld b, a
+ ld hl, wEggMonMoves
+ ld c, NUM_MOVES
+.loop
+ ld a, [hli]
+ and a
+ jr z, .done
+ dec c
+ jr nz, .loop
+ ld de, wEggMonMoves
+ ld hl, wEggMonMoves + 1
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+
+.done
+ dec hl
+ ld [hl], b
+ ld hl, wEggMonMoves
+ ld de, wEggMonPP
+ predef FillPP
+ pop bc
+ pop de
+ ret
+; 17197
+
+Function17197: ; 17197
+ ld hl, wBreedMon2Moves
+ ld a, [wBreedMon1Species]
+ cp DITTO
+ jr z, .ditto1
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr z, .ditto2
+ ld a, [wDittoInDaycare]
+ and a
+ ret z
+ ld hl, wBreedMon1Moves
+ ret
+
+.ditto1
+ ld a, [CurPartySpecies]
+ push af
+ ld a, [wBreedMon2Species]
+ ld [CurPartySpecies], a
+ ld a, [wBreedMon2DVs]
+ ld [TempMonDVs], a
+ ld a, [wBreedMon2DVs + 1]
+ ld [TempMonDVs + 1], a
+ ld a, $3
+ ld [MonType], a
+ predef GetGender
+ jr c, .inherit_mon2_moves
+ jr nz, .inherit_mon2_moves
+ jr .inherit_mon1_moves
+
+.ditto2
+ ld a, [CurPartySpecies]
+ push af
+ ld a, [wBreedMon1Species]
+ ld [CurPartySpecies], a
+ ld a, [wBreedMon1DVs]
+ ld [TempMonDVs], a
+ ld a, [wBreedMon1DVs + 1]
+ ld [TempMonDVs + 1], a
+ ld a, $3
+ ld [MonType], a
+ predef GetGender
+ jr c, .inherit_mon1_moves
+ jr nz, .inherit_mon1_moves
+
+.inherit_mon2_moves
+ ld hl, wBreedMon2Moves
+ pop af
+ ld [CurPartySpecies], a
+ ret
+
+.inherit_mon1_moves
+ ld hl, wBreedMon1Moves
+ pop af
+ ld [CurPartySpecies], a
+ ret
+; 1720b
+
+Function1720b: ; 1720b
+ ld hl, wBreedMon1Moves
+ ld a, [wBreedMon1Species]
+ cp DITTO
+ ret z
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr z, .ditto
+ ld a, [wDittoInDaycare]
+ and a
+ ret z
+
+.ditto
+ ld hl, wBreedMon2Moves
+ ret
+; 17224
+
+
+Function17224: ; 17224 (5:7224)
+ push de
+ ld [CurPartySpecies], a
+ ld [CurSpecies], a
+ call GetBaseData
+ ld hl, BattleMonDVs
+ predef GetUnownLetter
+ pop de
+ predef_jump GetFrontpic
+
+Function1723c: ; 1723c (5:723c)
+ push de
+ ld [CurPartySpecies], a
+ ld [CurSpecies], a
+ call GetBaseData
+ ld hl, BattleMonDVs
+ predef GetUnownLetter
+ pop de
+ predef_jump Function5108b
+
+Function17254: ; 17254 (5:7254)
+ push af
+ call WaitTop
+ push hl
+ push bc
+ hlcoord 0, 0
+ ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
+ ld a, " "
+ call ByteFill
+ pop bc
+ pop hl
+ ld a, b
+ ld [hBGMapAddress + 1], a
+ ld a, c
+ ld [hFillBox], a
+ lb bc, 7, 7
+ predef FillBox
+ pop af
+ call Function17363
+ call SetPalettes
+ jp WaitBGMap
+
+Function1727f: ; 1727f (5:727f)
+ push hl
+ push de
+ push bc
+ callab Function8cf69
+ call DelayFrame
+ pop bc
+ pop de
+ pop hl
+ ret
+
+Function1728f: ; 1728f (5:728f)
+ ld a, [wd265]
+ ld [wJumptableIndex], a
+ ld a, [CurSpecies]
+ push af
+ ld de, MUSIC_NONE
+ call PlayMusic
+ callba Function8000
+ call DisableLCD
+ ld hl, EggHatchGFX
+ ld de, VTiles0 tile $00
+ ld bc, $20
+ ld a, BANK(EggHatchGFX)
+ call FarCopyBytes
+ callba Function8cf53
+ ld de, VTiles2 tile $00
+ ld a, [wJumptableIndex]
+ call Function1723c
+ ld de, VTiles2 tile $31
+ ld a, EGG
+ call Function17224
+ ld de, MUSIC_EVOLUTION
+ call PlayMusic
+ call EnableLCD
+ hlcoord 7, 4
+ ld b, $98
+ ld c, $31
+ ld a, EGG
+ call Function17254
+ ld c, $50
+ call DelayFrames
+ xor a
+ ld [wcf64], a
+ ld a, [hSCX]
+ ld b, a
+.asm_172ee
+ ld hl, wcf64
+ ld a, [hl]
+ inc [hl]
+ cp $8
+ jr nc, .asm_17327
+ ld e, [hl]
+.asm_172f8
+ ld a, $2
+ ld [hSCX], a
+ ld a, $fe
+ ld [wc3c0], a
+ call Function1727f
+ ld c, $2
+ call DelayFrames
+ ld a, $fe
+ ld [hSCX], a
+ ld a, $2
+ ld [wc3c0], a
+ call Function1727f
+ ld c, $2
+ call DelayFrames
+ dec e
+ jr nz, .asm_172f8
+ ld c, $10
+ call DelayFrames
+ call Function1736d
+ jr .asm_172ee
+.asm_17327
+ ld de, SFX_EGG_HATCH
+ call PlaySFX
+ xor a
+ ld [hSCX], a
+ ld [wc3c0], a
+ call ClearSprites
+ call Function173b3
+ hlcoord 6, 3
+ ld b, $98
+ ld c, $0
+ ld a, [wJumptableIndex]
+ call Function17254
+ call Function17418
+ call WaitSFX
+ ld a, [wJumptableIndex]
+ ld [CurPartySpecies], a
+ hlcoord 6, 3
+ ld d, $0
+ ld e, ANIM_MON_HATCH
+ predef AnimateFrontpic
+ pop af
+ ld [CurSpecies], a
+ ret
+
+Function17363: ; 17363 (5:7363)
+ ld [PlayerHPPal], a
+ ld b, $b
+ ld c, $0
+ jp GetSGBLayout
+
+Function1736d: ; 1736d (5:736d)
+ ld a, [wcf64]
+ dec a
+ and $7
+ cp $7
+ ret z
+ srl a
+ ret nc
+ swap a
+ srl a
+ add $4c
+ ld d, a
+ ld e, $58
+ ld a, $19
+ call Function3b2a
+ ld hl, $3
+ add hl, bc
+ ld [hl], $0
+ ld de, SFX_EGG_CRACK
+ jp PlaySFX
+; 17393 (5:7393)
+
+EggHatchGFX: ; 17393
+INCBIN "gfx/unknown/017393.2bpp"
+; 173b3
+
+Function173b3: ; 173b3 (5:73b3)
+ callba Function8cf53
+ ld hl, Unknown_173ef
+.loop
+ ld a, [hli]
+ cp $ff
+ jr z, .done
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld b, a
+ push hl
+ push bc
+ ld a, $1c
+ call Function3b2a
+ ld hl, $3
+ add hl, bc
+ ld [hl], $0
+ pop de
+ ld a, e
+ ld hl, $1
+ add hl, bc
+ add [hl]
+ ld [hl], a
+ ld hl, $b
+ add hl, bc
+ ld [hl], d
+ pop hl
+ jr .loop
+.done
+ ld de, SFX_EGG_HATCH
+ call PlaySFX
+ call Function1727f
+ ret
+; 173ef (5:73ef)
+
+Unknown_173ef: ; 173ef
+; Probably OAM.
+ db $54, $48, $00, $3c
+ db $5c, $48, $01, $04
+ db $54, $50, $00, $30
+ db $5c, $50, $01, $10
+ db $54, $58, $02, $24
+ db $5c, $58, $03, $1c
+ db $50, $4c, $00, $36
+ db $60, $4c, $01, $0a
+ db $50, $54, $02, $2a
+ db $60, $54, $03, $16
+ db $ff
+; 17418
+
+Function17418: ; 17418 (5:7418)
+ ld c, $81
+.asm_1741a
+ call Function1727f
+ dec c
+ jr nz, .asm_1741a
+ ret
+
+Special_DayCareMon1: ; 17421
+ ld hl, UnknownText_0x17467
+ call PrintText
+ ld a, [wBreedMon1Species]
+ call PlayCry
+ ld a, [wDaycareLady]
+ bit 0, a
+ jr z, Function1745f
+ call KeepTextOpen
+ ld hl, wBreedMon2Nick
+ call Function1746c
+ jp PrintText
+
+Special_DayCareMon2: ; 17440
+ ld hl, UnknownText_0x17462
+ call PrintText
+ ld a, [wBreedMon2Species]
+ call PlayCry
+ ld a, [wDaycareMan]
+ bit 0, a
+ jr z, Function1745f
+ call KeepTextOpen
+ ld hl, wBreedMon1Nick
+ call Function1746c
+ jp PrintText
+
+Function1745f: ; 1745f
+ jp Functiona80
+; 17462
+
+UnknownText_0x17462: ; 0x17462
+ ; It's @ that was left with the DAY-CARE LADY.
+ text_jump UnknownText_0x1c0df3
+ db "@"
+; 0x17467
+
+UnknownText_0x17467: ; 0x17467
+ ; It's @ that was left with the DAY-CARE MAN.
+ text_jump UnknownText_0x1c0e24
+ db "@"
+; 0x1746c
+
+Function1746c: ; 1746c
+ push bc
+ ld de, StringBuffer1
+ ld bc, NAME_LENGTH
+ call CopyBytes
+ call Function16e1d
+ pop bc
+ ld a, [wd265]
+ ld hl, UnknownText_0x1749c
+ cp $ff
+ jr z, .asm_1749b
+ ld hl, UnknownText_0x174a1
+ and a
+ jr z, .asm_1749b
+ ld hl, UnknownText_0x174a6
+ cp 230
+ jr nc, .asm_1749b
+ cp 70
+ ld hl, UnknownText_0x174ab
+ jr nc, .asm_1749b
+ ld hl, UnknownText_0x174b0
+
+.asm_1749b
+ ret
+; 1749c
+
+UnknownText_0x1749c: ; 0x1749c
+ ; It's brimming with energy.
+ text_jump UnknownText_0x1c0e54
+ db "@"
+; 0x174a1
+
+UnknownText_0x174a1: ; 0x174a1
+ ; It has no interest in @ .
+ text_jump UnknownText_0x1c0e6f
+ db "@"
+; 0x174a6
+
+UnknownText_0x174a6: ; 0x174a6
+ ; It appears to care for @ .
+ text_jump UnknownText_0x1c0e8d
+ db "@"
+; 0x174ab
+
+UnknownText_0x174ab: ; 0x174ab
+ ; It's friendly with @ .
+ text_jump UnknownText_0x1c0eac
+ db "@"
+; 0x174b0
+
+UnknownText_0x174b0: ; 0x174b0
+ ; It shows interest in @ .
+ text_jump UnknownText_0x1c0ec6
+ db "@"
+; 0x174b5
+
+Function_174b5: ; 174b5
+ ld hl, String_174b9
+ ret
+; 174b9
+
+String_174b9: ; 174b9
+ db "@"
+; 174ba
+
--- a/engine/clock_reset.asm
+++ b/engine/clock_reset.asm
@@ -72,9 +72,9 @@
call UpdateTime
call GetWeekday
ld [Buffer4], a
- ld a, [hHours] ; $ff00+$94
+ ld a, [hHours]
ld [Buffer5], a
- ld a, [hMinutes] ; $ff00+$96
+ ld a, [hMinutes]
ld [Buffer6], a
.loop
@@ -223,7 +223,7 @@
.unreferenced: ; 20160
ld a, [Buffer3]
ld b, a
- call GetTileCoord
+ call Coord2Tile
ret
; 20168
@@ -233,7 +233,7 @@
ld a, [Buffer3]
dec a
ld b, a
- call GetTileCoord
+ call Coord2Tile
pop de
ld [hl], d
ld bc, 2 * SCREEN_WIDTH
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -300,7 +300,7 @@
Function10995e: ; 10995e (42:595e)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
jp Function109951
Function109964: ; 109964 (42:5964)
@@ -317,13 +317,13 @@
Function10997b: ; 10997b (42:597b)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $8
ld [Requested2bpp], a
jp Function109951
Function109986: ; 109986 (42:5986)
- ld a, [rLY] ; $ff00+$44
+ ld a, [rLY]
cp $30
jr c, Function109986
ld a, [wcf66]
@@ -523,9 +523,9 @@
Function109a95: ; 109a95 (42:5a95)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $c
- ld [hBGMapAddress], a ; $ff00+$d6
+ ld [hBGMapAddress], a
ld a, $28
hlcoord 0, 0
ld bc, $168
@@ -558,8 +558,8 @@
call ByteFill
call Function3200
xor a
- ld [hBGMapMode], a ; $ff00+$d4
- ld [hBGMapAddress], a ; $ff00+$d6
+ ld [hBGMapMode], a
+ ld [hBGMapAddress], a
hlcoord 0, 0
call Function109aff
call Function3200
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -1813,7 +1813,7 @@
ld a, [hli]
ld [wc6fd], a
ld a, [hl]
- ld [wc6fe], a
+ ld [wPlayerMinimized], a
ld a, [DefaultFlypoint]
ld hl, PartyMon1Species
call GetPartyLocation
@@ -2810,7 +2810,7 @@
ld [CurPartySpecies], a
ld a, [wc6fd]
ld [TempMonDVs], a
- ld a, [wc6fe]
+ ld a, [wPlayerMinimized]
ld [TempMonDVs + 1], a
ld b, $1a
call GetSGBLayout
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -2995,7 +2995,7 @@
jr nc, .ok8
ld c, a
push bc
- call GetTileCoord
+ call Coord2Tile
pop bc
ld a, [hl]
cp $60
--- a/engine/menu.asm
+++ b/engine/menu.asm
@@ -1,5 +1,5 @@
Function2400e:: ; 2400e
- ld hl, Function1c66
+ ld hl, CopyMenuData2
ld a, [wcf94]
rst FarCall
call Function24085
@@ -10,7 +10,7 @@
; 24022
Function24022:: ; 24022
- ld hl, Function1c66
+ ld hl, CopyMenuData2
ld a, [wcf94]
rst FarCall
call Function24085
@@ -22,7 +22,7 @@
; 2403c
Function2403c:: ; 2403c
- ld hl, Function1c66
+ ld hl, CopyMenuData2
ld a, [wcf94]
rst FarCall
call Function24085
@@ -126,8 +126,8 @@
ld e, [hl]
inc hl
ld d, [hl]
- call Function1cc6
- call GetTileCoord
+ call GetMenuTextStartCoord
+ call Coord2Tile
call Function240d3
ld b, a
.asm_240eb
@@ -166,7 +166,7 @@
Function2411a: ; 2411a (9:411a)
- call Function1cc6
+ call GetMenuTextStartCoord
ld a, b
ld [wcfa1], a
dec c
@@ -538,7 +538,7 @@
ld b, a
ld a, [wcfa2]
ld c, a
- call GetTileCoord
+ call Coord2Tile
ld a, [wcfa7]
swap a
and $f
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -44,7 +44,7 @@
Function10046: ; 10046 (4:4046)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function10955
ld a, [wcf64]
ld [wJumptableIndex], a
@@ -113,7 +113,7 @@
call ClearPocketList
call DrawPocketName
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call WaitBGMap_DrawPackGFX
call Function10866
ret
@@ -203,7 +203,7 @@
ld [Options], a
.asm_10179
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function10955
call WaitBGMap_DrawPackGFX
call Function10a40
@@ -478,7 +478,7 @@
jr z, .NoPokemon
call DoItemEffect
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function10955
call WaitBGMap_DrawPackGFX
call Function10a40
@@ -634,7 +634,7 @@
pop af
ld [Options], a
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function10955
call WaitBGMap_DrawPackGFX
call Function10a40
@@ -702,7 +702,7 @@
Function104d9: ; 104d9 (4:44d9)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function10955
ld a, [wcf64]
ld [wJumptableIndex], a
@@ -771,7 +771,7 @@
call ClearPocketList
call DrawPocketName
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call WaitBGMap_DrawPackGFX
ld hl, UnknownText_0x10b0c
call Function10889
@@ -915,7 +915,7 @@
and a
jr nz, .asm_1067e
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function10955
call WaitBGMap_DrawPackGFX
call Function10a40
--- a/engine/phone.asm
+++ b/engine/phone.asm
@@ -182,7 +182,7 @@
; Sample a random number between 0 and 31.
ld c, a
call Random
- ld a, [hRandomAdd] ; $ff00+$e1
+ ld a, [hRandomAdd]
swap a
and $1f
; Compute that number modulo the number of available callers.
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -209,7 +209,7 @@
Function4013c: ; 4013c (10:413c)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call ClearSprites
xor a
hlcoord 0, 0, AttrMap
@@ -226,7 +226,7 @@
call Function41af7
call Function4074c
ld a, $5
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld a, [wc7d4]
cp $1
ld a, $4a
@@ -234,9 +234,9 @@
ld a, $47
.asm_4017b
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
xor a
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
call WaitBGMap
call Function41af7
ld a, $ff
@@ -272,7 +272,7 @@
ret nc
call Function41148
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function40b0f
call Function41ad7
call Function41af7
@@ -293,9 +293,9 @@
ld a, $7
ld [wJumptableIndex], a
xor a
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld a, $a7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
call DelayFrame
ret
@@ -304,9 +304,9 @@
ld a, $5
ld [wJumptableIndex], a
xor a
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld a, $a7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
call DelayFrame
ret
@@ -320,7 +320,7 @@
xor a
ld [wPokedexStatus], a
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call ClearSprites
call Function41478
call Function407fd
@@ -331,7 +331,7 @@
call Function40ba0
call WaitBGMap
ld a, $a7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
call Function40bb1
ld [CurPartySpecies], a
ld a, $4
@@ -392,7 +392,7 @@
xor a
ld [wPokedexStatus], a
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function407fd
call Function4134f
call Function41478
@@ -509,7 +509,7 @@
Function4039d: ; 4039d (10:439d)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call ClearSprites
call Function4087c
call Function4134f
@@ -615,7 +615,7 @@
Function40443: ; 40443 (10:4443)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call ClearSprites
call Function408f0
call Function4134f
@@ -723,7 +723,7 @@
Function4050a: ; 4050a (10:450a)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
xor a
hlcoord 0, 0, AttrMap
ld bc, $168
@@ -739,11 +739,11 @@
call Function41af7
call Function40962
ld a, $5
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld a, $4a
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
xor a
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
call WaitBGMap
call Function41af7
callba Function1de1d1
@@ -768,7 +768,7 @@
ret nc
call Function41281
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function40b0f
call Function41ad7
call Function41af7
@@ -797,9 +797,9 @@
ld a, $5
ld [wJumptableIndex], a
xor a
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld a, $a7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ret
Function405bd: ; 405bd (10:45bd)
@@ -876,7 +876,7 @@
.asm_40635
push af
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
pop af
call Function40654
call Function41a58
@@ -883,7 +883,7 @@
call Function40658
callba Functionfba2e
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call DelayFrame
call DelayFrame
ret
@@ -1773,7 +1773,7 @@
Function40f08: ; 40f08 (10:4f08)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
hlcoord 0, 12
ld bc, $412
call Function40ad5
@@ -1781,7 +1781,7 @@
hlcoord 1, 14
call PlaceString
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld c, $40
call DelayFrames
ld de, SFX_CHANGE_DEX_MODE
@@ -1861,7 +1861,7 @@
Function40fa8: ; 40fa8 (10:4fa8)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
hlcoord 9, 3
ld bc, $408
ld a, $7f
@@ -1873,7 +1873,7 @@
hlcoord 9, 6
call Function40fcd
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
Function40fcd: ; 40fcd (10:4fcd)
@@ -2363,16 +2363,16 @@
jp FillBoxWithByte
Function41401: ; 41401 (10:5401)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Unkn1Pals
ld bc, $40
xor a
call ByteFill
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
Function41415: ; 41415
ld a, $ff
--- a/engine/radio.asm
+++ b/engine/radio.asm
@@ -1679,15 +1679,15 @@
.PlayPassword: ; b8f22 (2e:4f22)
call StartRadioStation
- ld a, [hBGMapMode] ; $ff00+$d4
+ ld a, [hBGMapMode]
push af
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld de, String_b9171
hlcoord 2, 9
call PlaceString
pop af
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld hl, UnknownText_0xb9182
ld a, BUENAS_PASSWORD_2
jp NextRadioLine
@@ -1951,12 +1951,12 @@
jp NextRadioLine
BuenasPassword20: ; b912a (2e:512a)
- ld a, [hBGMapMode] ; $ff00+$d4
+ ld a, [hBGMapMode]
push af
callba NoRadioMusic
callba NoRadioName
pop af
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld hl, WeeklyFlags
res 7, [hl]
ld a, BUENAS_PASSWORD
@@ -1980,7 +1980,7 @@
BuenasPasswordCheckTime: ; b9169 (2e:5169)
call UpdateTime
- ld a, [hHours] ; $ff00+$94
+ ld a, [hHours]
cp 18 ; 6 PM
ret
; b9171 (2e:5171)
--- a/engine/radio2.asm
+++ b/engine/radio2.asm
@@ -371,7 +371,7 @@
ld [wc6da], a
ld [wc6db], a
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
NoRadioMusic: ; 9189d (24:589d)
@@ -383,7 +383,7 @@
NoRadioName: ; 918a9 (24:58a9)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
hlcoord 1, 8
lb bc, 3, 18
call ClearBox
--- a/event/buena.asm
+++ b/event/buena.asm
@@ -203,7 +203,7 @@
call CopyMenuDataHeader
call MenuBox
call UpdateSprites
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld bc, $0015
add hl, bc
ld de, .Points_string
--- a/event/kurt.asm
+++ b/event/kurt.asm
@@ -166,7 +166,7 @@
db 0, 0, -1, 0 ; XXX
.PlaceApricornName: ; 88116
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld de, $0015
add hl, de
ld d, h
@@ -176,7 +176,7 @@
; 88126
PlaceApricornQuantity: ; 88126
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld de, $0032
add hl, de
ld [hl], "×"
--- a/event/unown.asm
+++ b/event/unown.asm
@@ -125,7 +125,7 @@
call MenuBox
call UpdateSprites
call Function321c
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
inc hl
ld d, $0
ld e, $14
--- a/home.asm
+++ b/home.asm
@@ -1147,7 +1147,7 @@
Function350c:: ; 350c
- call Function1c66
+ call CopyMenuData2
ld a, [hROMBank]
push af
@@ -1186,7 +1186,7 @@
sub c
ld e, a
push de
- call GetTileCoord
+ call Coord2Tile
pop bc
jp TextBox
; 354b
@@ -2180,7 +2180,7 @@
; 3f7c
Function3f7c:: ; 3f7c
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
call GetMenuBoxDims
dec b
dec c
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -7,11 +7,11 @@
ret
CopyMenuDataHeader::
- ld de, wcf81
- ld bc, 16
+ ld de, wMenuDataHeader
+ ld bc, wMenuDataHeaderEnd - wMenuDataHeader
call CopyBytes
ld a, [hROMBank]
- ld [wcf8a], a
+ ld [wMenuDataBank], a
ret
; 0x1d4b
@@ -78,7 +78,7 @@
call UpdateSprites
call Function1c89
call Function321c
- call Function1c66
+ call CopyMenuData2
ld a, [wMenuData2Flags]
bit 7, a
jr z, .cancel
@@ -103,11 +103,11 @@
ret
; 1db8
-Function1db8::
+CopyNameFromMenu::
push hl
push bc
push af
- ld hl, wcf86
+ ld hl, wMenuData2Pointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -126,7 +126,7 @@
YesNoBox:: ; 1dcf
- lb bc, 14, 7
+ lb bc, SCREEN_WIDTH - 6, 7
PlaceYesNoBox:: ; 1dd2
jr _YesNoBox
@@ -152,11 +152,11 @@
.okay
ld a, b
ld [wMenuBorderLeftCoord], a
- add $5
+ add 5
ld [wMenuBorderRightCoord], a
ld a, c
ld [wMenuBorderTopCoord], a
- add $4
+ add 4
ld [wMenuBorderBottomCoord], a
call BackUpTiles
@@ -246,7 +246,7 @@
ret
MenuFunc_1e7f::
- call Function1c66
+ call CopyMenuData2
call Function1ebd
call Function1ea6
call MenuBox
@@ -310,7 +310,7 @@
; 1eda
Function1eda:: ; 1eda
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld bc, $002a
add hl, bc
.asm_1ee1
@@ -489,7 +489,7 @@
ResetTextRelatedRAM:: ; 1fbf
ld hl, wcf71
call .bytefill
- ld hl, wcf81
+ ld hl, wMenuDataHeader
call .bytefill
ld hl, wMenuData2Flags
call .bytefill
@@ -527,7 +527,7 @@
push af
and $3
jr z, .nosound
- ld hl, wcf81
+ ld hl, wMenuFlags
bit 3, [hl]
jr nz, .nosound
call PlayClickSFX
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -22,9 +22,9 @@
ret
RestoreTileBackup:: ; 0x1c23
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
call .copy
- call GetMemAttrCoord
+ call MenuBoxCoord2Attr
call .copy
ret
; 0x1c30
@@ -56,7 +56,7 @@
Function1c47:: ; 0x1c47
ld b, $10
- ld de, wcf81
+ ld de, wMenuFlags
.loop
ld a, [hld]
ld [de], a
@@ -79,17 +79,17 @@
ret
; 0x1c66
-Function1c66:: ; 1c66
+CopyMenuData2:: ; 1c66
push hl
push de
push bc
push af
- ld hl, wcf86
+ ld hl, wMenuData2Pointer
ld a, [hli]
ld h, [hl]
ld l, a
ld de, wMenuData2Flags
- ld bc, $0010
+ ld bc, wMenuData2End - wMenuData2Flags
call CopyBytes
pop af
pop bc
@@ -111,30 +111,31 @@
; 1c89
Function1c89:: ; 1c89
- call Function1c66
- ld hl, wcf86
+ call CopyMenuData2
+ ld hl, wMenuData2Pointer
ld e, [hl]
inc hl
ld d, [hl]
- call Function1cc6
- call GetTileCoord
+ call GetMenuTextStartCoord
+ call Coord2Tile ; hl now contains the TileMap address where we will start printing text.
inc de
- ld a, [de]
+ ld a, [de] ; Number of items
inc de
ld b, a
-.asm_1c9c
+.loop
push bc
call PlaceString
inc de
- ld bc, $0028
+ ld bc, 2 * SCREEN_WIDTH
add hl, bc
pop bc
dec b
- jr nz, .asm_1c9c
+ jr nz, .loop
ld a, [wMenuData2Flags]
bit 4, a
ret z
- call GetMemTileCoord
+
+ call MenuBoxCoord2Tile
ld a, [de]
ld c, a
inc de
@@ -144,7 +145,7 @@
; 1cbb
MenuBox:: ; 1cbb
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
call GetMenuBoxDims
dec b
dec c
@@ -151,7 +152,7 @@
jp TextBox
; 1cc6
-Function1cc6:: ; 1cc6
+GetMenuTextStartCoord:: ; 1cc6
ld a, [wMenuBorderTopCoord]
ld b, a
inc b
@@ -158,24 +159,26 @@
ld a, [wMenuBorderLeftCoord]
ld c, a
inc c
+; bit 6: if not set, leave extra room on top
ld a, [wMenuData2Flags]
bit 6, a
- jr nz, .asm_1cd8
+ jr nz, .bit_6_set
inc b
-.asm_1cd8
+.bit_6_set
+; bit 7: if set, leave extra room on the left
ld a, [wMenuData2Flags]
bit 7, a
- jr z, .asm_1ce0
+ jr z, .bit_7_clear
inc c
-.asm_1ce0
+.bit_7_clear
ret
; 1ce1
-Function1ce1:: ; 1ce1
- call GetMemTileCoord
- lb bc, 0, 21
+ClearMenuBoxInterior:: ; 1ce1
+ call MenuBoxCoord2Tile
+ ld bc, SCREEN_WIDTH + 1
add hl, bc
call GetMenuBoxDims
dec b
@@ -184,8 +187,8 @@
ret
; 1cf1
-Function1cf1:: ; 1cf1
- call GetMemTileCoord
+ClearWholeMenuBox:: ; 1cf1
+ call MenuBoxCoord2Tile
call GetMenuBoxDims
inc c
inc b
@@ -194,7 +197,7 @@
; 1cfd
-GetMemTileCoord:: ; 1cfd
+MenuBoxCoord2Tile:: ; 1cfd
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wMenuBorderTopCoord]
@@ -202,7 +205,7 @@
; 1d05
-GetTileCoord:: ; 1d05
+Coord2Tile:: ; 1d05
; Return the address of TileMap(c, b) in hl.
xor a
ld h, a
@@ -226,13 +229,13 @@
ret
; 1d19
-GetMemAttrCoord:: ; 1d19
+MenuBoxCoord2Attr:: ; 1d19
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wMenuBorderTopCoord]
ld b, a
-GetAttrCoord:: ; 1d21
+Coord2Attr:: ; 1d21
; Return the address of AttrMap(c, b) in hl.
xor a
ld h, a
--- a/lib/mobile/main.asm
+++ b/lib/mobile/main.asm
@@ -3487,7 +3487,7 @@
Function111686: ; 111686 (44:5686)
xor a
- ld [rTAC], a ; $ff00+$7
+ ld [rTAC], a
ld c, $ff
ld a, [$ff00+c]
and $f3
@@ -3552,7 +3552,7 @@
jp nz, Function1118bc
ld hl, $c808
add hl, de
- ld a, [rSB] ; $ff00+$1
+ ld a, [rSB]
ld [hl], a
ld a, $8
cp l
@@ -3724,7 +3724,7 @@
.asm_111803
ld b, $66
.asm_111805
- ld a, [rSB] ; $ff00+$1
+ ld a, [rSB]
cp b
jr z, .asm_111840
cp $d2
@@ -3791,7 +3791,7 @@
jr nz, Function1118bc
xor a
ld [hli], a
- ld a, [rSB] ; $ff00+$1
+ ld a, [rSB]
ld [$c80c], a
inc [hl]
or a
@@ -3810,7 +3810,7 @@
jr Function1118bc
Function111892: ; 111892 (44:5892)
- ld a, [rSB] ; $ff00+$1
+ ld a, [rSB]
ld c, a
call Function111664
ld hl, $c80a
@@ -3842,7 +3842,7 @@
ret
Function1118c2: ; 1118c2 (44:58c2)
- ld a, [rSB] ; $ff00+$1
+ ld a, [rSB]
ld c, a
ld b, $0
ld hl, $c812
@@ -4042,7 +4042,7 @@
ld a, $4b
Function111a42: ; 111a42 (44:5a42)
- ld [rSB], a ; $ff00+$1
+ ld [rSB], a
jp Function111b2e
asm_111a47: ; 111a47 (44:5a47)
ld hl, $c815
@@ -4170,7 +4170,7 @@
ld e, a
ld d, [hl]
ld a, [de]
- ld [rSB], a ; $ff00+$1
+ ld [rSB], a
inc de
ld a, d
ld [hld], a
@@ -4180,9 +4180,9 @@
ld hl, $c822
set 1, [hl]
ld a, $3
- ld [rSC], a ; $ff00+$2
+ ld [rSC], a
ld a, $83
- ld [rSC], a ; $ff00+$2
+ ld [rSC], a
Function111b3b: ; 111b3b (44:5b3b)
ret
@@ -4765,7 +4765,7 @@
scf
ret
.asm_111f17
- ld a, [rSC] ; $ff00+$2
+ ld a, [rSC]
and $80
jr nz, .asm_111f17
di
--- a/macros/charmap.asm
+++ b/macros/charmap.asm
@@ -130,6 +130,7 @@
charmap "'t", $d5
charmap "'v", $d6
+ charmap "←", $df
charmap "'", $e0
charmap "<PK>", $e1
charmap "<MN>", $e2
--- a/macros/move_anim.asm
+++ b/macros/move_anim.asm
@@ -5,8 +5,11 @@
db \1
endm
+ enum_start $d0
+
+ enum anim_obj_command ; d0
anim_obj: macro
- db $d0
+ db anim_obj_command
db \1 ; obj
db \2 ; x
db \3 ; y
@@ -13,26 +16,30 @@
db \4 ; param
endm
+ enum anim_1gfx_command ; d1
anim_1gfx: macro
- db $d1
+ db anim_1gfx_command
db \1 ; gfx1
endm
+ enum anim_2gfx_command ; d2
anim_2gfx: macro
- db $d2
+ db anim_2gfx_command
db \1 ; gfx1
db \2 ; gfx2
endm
+ enum anim_3gfx_command ; d3
anim_3gfx: macro
- db $d3
+ db anim_3gfx_command
db \1 ; gfx1
db \2 ; gfx2
db \3 ; gfx3
endm
+ enum anim_4gfx_command ; d4
anim_4gfx: macro
- db $d4
+ db anim_4gfx_command
db \1 ; gfx1
db \2 ; gfx2
db \3 ; gfx3
@@ -39,8 +46,9 @@
db \4 ; gfx4
endm
+ enum anim_5gfx_command ; d5
anim_5gfx: macro
- db $d5
+ db anim_5gfx_command
db \1 ; gfx1
db \2 ; gfx2
db \3 ; gfx3
@@ -48,122 +56,149 @@
db \5 ; gfx5
endm
+ enum anim_incobj_command ; d6
anim_incobj: macro
- db $d6
+ db anim_incobj_command
db \1 ; id
endm
+ enum anim_setobj_command ; d7
anim_setobj: macro
- db $d7
+ db anim_setobj_command
db \1 ; id
db \2 ; obj
endm
+ enum anim_incbgeffect_command ; d8
anim_incbgeffect: macro
- db $d8
+ db anim_incbgeffect_command
db \1 ; effect
endm
+ enum anim_enemyfeetobj_command ; d9
anim_enemyfeetobj: macro
- db $d9
+ db anim_enemyfeetobj_command
endm
+ enum anim_playerheadobj_command ; da
anim_playerheadobj: macro
- db $da
+ db anim_playerheadobj_command
endm
+ enum anim_checkpokeball_command ; db
anim_checkpokeball: macro
- db $db
+ db anim_checkpokeball_command
endm
+ enum anim_transform_command ; dc
anim_transform: macro
- db $dc
+ db anim_transform_command
endm
+ enum anim_raisesub_command ; dd
anim_raisesub: macro
- db $dd
+ db anim_raisesub_command
endm
+ enum anim_dropsub_command ; de
anim_dropsub: macro
- db $de
+ db anim_dropsub_command
endm
+ enum anim_resetobp0_command ; df
anim_resetobp0: macro
- db $df
+ db anim_resetobp0_command
endm
+ enum anim_sound_command ; e0
anim_sound: macro
- db $e0
+ db anim_sound_command
db \1 ; tracks
db \2 ; id
endm
+ enum anim_cry_command ; e1
anim_cry: macro
- db $e1
+ db anim_cry_command
db \1 ; pitch
endm
+ enum anim_minimizeopp_command ; e2
anim_minimizeopp: macro
- db $e2
+ db anim_minimizeopp_command
endm
+ enum anim_oamon_command ; e3
anim_oamon: macro
- db $e3
+ db anim_oamon_command
endm
+ enum anim_oamoff_command ; e4
anim_oamoff: macro
- db $e4
+ db anim_oamoff_command
endm
+ enum anim_clearobjs_command ; e5
anim_clearobjs: macro
- db $e5
+ db anim_clearobjs_command
endm
+ enum anim_beatup_command ; e6
anim_beatup: macro
- db $e6
+ db anim_beatup_command
endm
+ enum anim_0xe7_command ; e7
anim_0xe7: macro
- db $e7
+ db anim_0xe7_command
endm
+ enum anim_updateactorpic_command ; e8
anim_updateactorpic: macro
- db $e8
+ db anim_updateactorpic_command
endm
+ enum anim_minimize_command ; e9
anim_minimize: macro
- db $e9
+ db anim_minimize_command
endm
+ enum anim_0xea_command ; ea
anim_0xea: macro
- db $ea
+ db anim_0xea_command
endm
+ enum anim_0xeb_command ; eb
anim_0xeb: macro
- db $eb
+ db anim_0xeb_command
endm
+ enum anim_0xec_command ; ec
anim_0xec: macro
- db $ec
+ db anim_0xec_command
endm
+ enum anim_0xed_command ; ed
anim_0xed: macro
- db $ed
+ db anim_0xed_command
endm
+ enum anim_jumpand_command ; ee
anim_jumpand: macro
- db $ee
+ db anim_jumpand_command
db \1 ; value
dw \2 ; address
endm
+ enum anim_jumpuntil_command ; ef
anim_jumpuntil: macro
- db $ef
+ db anim_jumpuntil_command
dw \1 ; address
endm
+ enum anim_bgeffect_command ; f0
anim_bgeffect: macro
- db $f0
+ db anim_bgeffect_command
db \1 ; effect
db \2 ; unknown
db \3 ; unknown
@@ -170,74 +205,89 @@
db \4 ; unknown
endm
+ enum anim_bgp_command ; f1
anim_bgp: macro
- db $f1
+ db anim_bgp_command
db \1 ; colors
endm
+ enum anim_obp0_command ; f2
anim_obp0: macro
- db $f2
+ db anim_obp0_command
db \1 ; colors
endm
+ enum anim_obp1_command ; f3
anim_obp1: macro
- db $f3
+ db anim_obp1_command
db \1 ; colors
endm
+ enum anim_clearsprites_command ; f4
anim_clearsprites: macro
- db $f4
+ db anim_clearsprites_command
endm
+ enum anim_0xf5_command ; f5
anim_0xf5: macro
- db $f5
+ db anim_0xf5_command
endm
+ enum anim_0xf6_command ; f6
anim_0xf6: macro
- db $f6
+ db anim_0xf6_command
endm
+ enum anim_0xf7_command ; f7
anim_0xf7: macro
- db $f7
+ db anim_0xf7_command
endm
+ enum anim_jumpif_command ; f8
anim_jumpif: macro
- db $f8
+ db anim_jumpif_command
db \1 ; value
dw \2 ; address
endm
+ enum anim_setvar_command ; f9
anim_setvar: macro
- db $f9
+ db anim_setvar_command
db \1 ; value
endm
+ enum anim_incvar_command ; fa
anim_incvar: macro
- db $fa
+ db anim_incvar_command
endm
+ enum anim_jumpvar_command ; fb
anim_jumpvar: macro
- db $fb
+ db anim_jumpvar_command
db \1 ; value
dw \2 ; address
endm
+ enum anim_jump_command ; fc
anim_jump: macro
- db $fc
+ db anim_jump_command
dw \1 ; address
endm
+ enum anim_loop_command ; fd
anim_loop: macro
- db $fd
+ db anim_loop_command
db \1 ; count
dw \2 ; address
endm
+ enum anim_call_command ; fe
anim_call: macro
- db $fe
+ db anim_call_command
dw \1 ; address
endm
+ enum anim_ret_command ; ff
anim_ret: macro
- db $ff
+ db anim_ret_command
endm
--- a/macros/text.asm
+++ b/macros/text.asm
@@ -11,7 +11,6 @@
page EQUS "db $50," ; Start a new Pokedex page.
dex EQUS "db $e8, $50" ; End a Pokedex entry.
-
; TX_RAM EQU $01
; TX_FAR EQU $16
enum_start 1
--- a/main.asm
+++ b/main.asm
@@ -105,7 +105,7 @@
db "DAY@"
; 5b44
-Function5b44: ; 5b44
+NewGame_ClearTileMapEtc: ; 5b44
xor a
ld [hMapAnims], a
call ClearTileMap
@@ -131,7 +131,7 @@
xor a
ld [wc2cc], a
call ResetWRAM
- call Function5b44
+ call NewGame_ClearTileMapEtc
call AreYouABoyOrAreYouAGirl
call OakSpeech
call InitializeWorld
@@ -139,7 +139,7 @@
ld [wPreviousLandmark], a
ld a, SPAWN_HOME
- ld [wd001], a
+ ld [DefaultSpawnpoint], a
ld a, MAPSETUP_WARP
ld [hMapEntryMethod], a
@@ -648,7 +648,7 @@
Function5f1c: ; 5f1c
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
push hl
ld de, $5d
add hl, de
@@ -888,7 +888,7 @@
call InterpretMenu2
ld a, [MenuSelection2]
dec a
- call Function1db8
+ call CopyNameFromMenu
call WriteBackup
ret
; 60fa
@@ -7288,12 +7288,12 @@
ld d, a
ld a, [wd14f]
ld e, a
- ld a, [hSCX] ; $ff00+$cf
+ ld a, [hSCX]
add d
- ld [hSCX], a ; $ff00+$cf
- ld a, [hSCY] ; $ff00+$d0
+ ld [hSCX], a
+ ld a, [hSCY]
add e
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
ret
Functiond4e5: ; d4e5 (3:54e5)
@@ -9770,7 +9770,7 @@
Functione41c: ; e41c (3:641c)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call LoadPartyMenuDataHeader
call ClearPCItemScreen
ld hl, Options
@@ -9804,7 +9804,7 @@
call SetPalettes
xor a
ld [wcf76], a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function1e5d
jr c, .cancel
ld a, [wMenuCursorBuffer]
@@ -11481,7 +11481,7 @@
ld [hl], $0
call Function11f84
ld a, $e3
- ld [rLCDC], a ; $ff00+$40
+ ld [rLCDC], a
call Function11f74
ld b, $8
call GetSGBLayout
@@ -11565,14 +11565,14 @@
callab Function8cf53
call ClearSprites
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
scf
ret
Function11feb: ; 11feb (4:5feb)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
hlcoord 1, 1
lb bc, 4, 18
call ClearBox
@@ -11583,7 +11583,7 @@
hlcoord 2, 2
call PlaceString
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
Function12008: ; 12008 (4:6008)
@@ -17599,9 +17599,9 @@
endr
inc hl
ld a, [hli]
- ld [$ffc5], a
+ ld [hMoneyTemp + 2], a
ld a, [hl]
- ld [$ffc4], a
+ ld [hMoneyTemp + 1], a
xor a
ld [hMoneyTemp], a
and a
@@ -19063,22 +19063,22 @@
call GetSGBLayout
call SetPalettes
-.asm_16c6b
+.joy_loop
call JoyTextDelay
ld a, [hJoyPressed]
and B_BUTTON
- jr nz, .asm_16c95
+ jr nz, .pressed_b
ld a, [hJoyPressed]
and A_BUTTON
- jr nz, .asm_16c82
+ jr nz, .pressed_a
call Function16ca0
call DelayFrame
- jr .asm_16c6b
+ jr .joy_loop
-.asm_16c82
+.pressed_a
ld a, [wJumptableIndex]
push af
callba Function84560
@@ -19085,9 +19085,9 @@
call RestartMapMusic
pop af
ld [wJumptableIndex], a
- jr .asm_16c6b
+ jr .joy_loop
-.asm_16c95
+.pressed_b
pop af
ld [Options], a
pop af
@@ -19099,34 +19099,34 @@
Function16ca0: ; 16ca0
ld a, [hJoyLast]
and D_RIGHT
- jr nz, .asm_16cb9
+ jr nz, .press_right
ld a, [hJoyLast]
and D_LEFT
- jr nz, .asm_16cad
+ jr nz, .press_left
ret
-.asm_16cad
+.press_left
ld hl, wJumptableIndex
ld a, [hl]
and a
- jr nz, .asm_16cb6
+ jr nz, .wrap_around_left
ld [hl], $1b
-.asm_16cb6
+.wrap_around_left
dec [hl]
- jr .asm_16cc4
+ jr .return
-.asm_16cb9
+.press_right
ld hl, wJumptableIndex
ld a, [hl]
cp $1a
- jr c, .asm_16cc3
+ jr c, .wrap_around_right
ld [hl], $ff
-.asm_16cc3
+.wrap_around_right
inc [hl]
-.asm_16cc4
+.return
call Function16cc8
ret
; 16cc8
@@ -19159,6 +19159,7 @@
push af
ld a, $6
ld [rSVBK], a
+
ld a, BANK(sScratch)
call GetSRAMBank
ld de, w6_d000
@@ -19168,6 +19169,7 @@
ld c, $31
call Get2bpp
call CloseSRAM
+
pop af
ld [rSVBK], a
ret
@@ -19183,7 +19185,7 @@
xor a
call GetSRAMBank
ld hl, sScratch
- ld bc, $310 ; 784
+ ld bc, $31 tiles
xor a
call ByteFill
ld hl, VTiles2 tile $31
@@ -19205,10 +19207,10 @@
db "Do what?@"
UnownDexMenuString:
- db $ef, " PRINT"
- next $f5, " CANCEL"
- next $df, " PREVIOUS"
- next $eb, " NEXT"
+ db "♂ PRINT"
+ next "♀ CANCEL"
+ next "← PREVIOUS"
+ next "→ NEXT"
db "@"
UnownDexVacantString:
@@ -19296,984 +19298,8 @@
db "@"
; 0x16e1d
+INCLUDE "engine/breeding/egg.asm"
-Function16e1d: ; 16e1d
- call Function16ed6
- ld c, $0
- jp nc, .asm_16eb7
- ld a, [wBreedMon1Species]
- ld [CurPartySpecies], a
- ld a, [wBreedMon1DVs]
- ld [TempMonDVs], a
- ld a, [wBreedMon1DVs + 1]
- ld [TempMonDVs + 1], a
- ld a, $3
- ld [MonType], a
- predef GetGender
- jr c, .asm_16e70
- ld b, $1
- jr nz, .asm_16e48
- inc b
-
-.asm_16e48
- push bc
- ld a, [wBreedMon2Species]
- ld [CurPartySpecies], a
- ld a, [wBreedMon2DVs]
- ld [TempMonDVs], a
- ld a, [wBreedMon2DVs + 1]
- ld [TempMonDVs + 1], a
- ld a, $3
- ld [MonType], a
- predef GetGender
- pop bc
- jr c, .asm_16e70
- ld a, $1
- jr nz, .asm_16e6d
- inc a
-
-.asm_16e6d
- cp b
- jr nz, .asm_16e89
-
-.asm_16e70
- ld c, $0
- ld a, [wBreedMon1Species]
- cp DITTO
- jr z, .asm_16e82
- ld a, [wBreedMon2Species]
- cp DITTO
- jr nz, .asm_16eb7
- jr .asm_16e89
-
-.asm_16e82
- ld a, [wBreedMon2Species]
- cp DITTO
- jr z, .asm_16eb7
-
-.asm_16e89
- call Function16ebc
- ld c, $ff
- jp z, .asm_16eb7
- ld a, [wBreedMon2Species]
- ld b, a
- ld a, [wBreedMon1Species]
- cp b
- ld c, $fe
- jr z, .asm_16e9f
- ld c, $80
-.asm_16e9f
- ld a, [wBreedMon1ID]
- ld b, a
- ld a, [wBreedMon2ID]
- cp b
- jr nz, .asm_16eb7
- ld a, [wBreedMon1ID + 1]
- ld b, a
- ld a, [wBreedMon2ID + 1]
- cp b
- jr nz, .asm_16eb7
- ld a, c
- sub $4d
- ld c, a
-
-.asm_16eb7
- ld a, c
- ld [wd265], a
- ret
-; 16ebc
-
-
-Function16ebc: ; 16ebc (5:6ebc)
- ld a, [wBreedMon1DVs]
- and $f
- ld b, a
- ld a, [wBreedMon2DVs]
- and $f
- cp b
- ret nz
- ld a, [wBreedMon1DVs + 1]
- and $7
- ld b, a
- ld a, [wBreedMon2DVs + 1]
- and $7
- cp b
- ret
-; 16ed6
-
-Function16ed6: ; 16ed6
- ld a, [wBreedMon2Species]
- ld [CurSpecies], a
- call GetBaseData
- ld a, [BaseEggGroups]
- cp $ff
- jr z, .asm_16f3a
- ld a, [wBreedMon1Species]
- ld [CurSpecies], a
- call GetBaseData
- ld a, [BaseEggGroups]
- cp $ff
- jr z, .asm_16f3a
- ld a, [wBreedMon2Species]
- cp DITTO
- jr z, .asm_16f3c
- ld [CurSpecies], a
- call GetBaseData
- ld a, [BaseEggGroups]
- push af
- and $f
- ld b, a
- pop af
- and $f0
- swap a
- ld c, a
- ld a, [wBreedMon1Species]
- cp DITTO
- jr z, .asm_16f3c
- ld [CurSpecies], a
- push bc
- call GetBaseData
- pop bc
- ld a, [BaseEggGroups]
- push af
- and $f
- ld d, a
- pop af
- and $f0
- swap a
- ld e, a
- ld a, d
- cp b
- jr z, .asm_16f3c
- cp c
- jr z, .asm_16f3c
- ld a, e
- cp b
- jr z, .asm_16f3c
- cp c
- jr z, .asm_16f3c
-
-.asm_16f3a
- and a
- ret
-
-.asm_16f3c
- scf
- ret
-; 16f3e
-
-DoEggStep:: ; 16f3e
- ld de, PartySpecies
- ld hl, PartyMon1Happiness
- ld c, 0
-.loop
- ld a, [de]
- inc de
- cp -1
- ret z
- cp EGG
- jr nz, .next
- dec [hl]
- jr nz, .next
- ld a, 1
- and a
- ret
-
-.next
- push de
- ld de, PARTYMON_STRUCT_LENGTH
- add hl, de
- pop de
- jr .loop
-; 16f5e
-
-OverworldHatchEgg:: ; 16f5e
- call ResetWindow
- call LoadPartyMenuDataHeader
- call Function16f70
- call Function2b4d
- call RestartMapMusic
- jp LoadMoveSprites
-; 16f70
-
-Function16f70: ; 16f70 (5:6f70)
- ld de, PartySpecies
- ld hl, PartyMon1Happiness
- xor a
- ld [CurPartyMon], a
-
-Function16f7a: ; 16f7a (5:6f7a)
- ld a, [de]
- inc de
- cp -1
- jp z, Function1708a
- push de
- push hl
- cp EGG
- jp nz, Function1707d
- ld a, [hl]
- and a
- jp nz, Function1707d
- ld [hl], $78
-
- push de
-
- callba Function4dbb8
- callba MobileFn_10608d
- ld a, [CurPartyMon]
- ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
- ld bc, PARTYMON_STRUCT_LENGTH
- call AddNTimes
- ld a, [hl]
- ld [CurPartySpecies], a
- dec a
- call SetSeenAndCaughtMon
-
- ld a, [CurPartySpecies]
- cp TOGEPI
- jr nz, .nottogepi
- ; set the event flag for hatching togepi
- ld de, EVENT_TOGEPI_HATCHED
- ld b, SET_FLAG
- call EventFlagAction
-.nottogepi
-
- pop de
-
- ld a, [CurPartySpecies]
- dec de
- ld [de], a
- ld [wd265], a
- ld [CurSpecies], a
- call GetPokemonName
- xor a
- ld [wd26b], a
- call GetBaseData
- ld a, [CurPartyMon]
- ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
- ld bc, PARTYMON_STRUCT_LENGTH
- call AddNTimes
- push hl
- ld bc, MON_MAXHP
- add hl, bc
- ld d, h
- ld e, l
- pop hl
- push hl
- ld bc, MON_LEVEL
- add hl, bc
- ld a, [hl]
- ld [CurPartyLevel], a
- pop hl
- push hl
- ld bc, MON_STATUS
- add hl, bc
- xor a
- ld [hli], a
- ld [hl], a
- pop hl
- push hl
- ld bc, MON_EXP + 2
- add hl, bc
- ld b, $0
- predef CalcPkmnStats
- pop bc
- ld hl, MON_MAXHP
- add hl, bc
- ld d, h
- ld e, l
- ld hl, MON_HP
- add hl, bc
- ld a, [de]
- inc de
- ld [hli], a
- ld a, [de]
- ld [hl], a
- ld hl, MON_ID
- add hl, bc
- ld a, [PlayerID]
- ld [hli], a
- ld a, [PlayerID + 1]
- ld [hl], a
- ld a, [CurPartyMon]
- ld hl, PartyMonOT ; wddff (aliases: PartyMonOT)
- ld bc, NAME_LENGTH
- call AddNTimes
- ld d, h
- ld e, l
- ld hl, PlayerName
- call CopyBytes
- ld hl, UnknownText_0x1708b
- call PrintText
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
- ld bc, PKMN_NAME_LENGTH
- call AddNTimes
- ld d, h
- ld e, l
- push de
- ld hl, UnknownText_0x170ba
- call PrintText
- call YesNoBox
- pop de
- jr c, .nonickname
- ld a, $1
- ld [wd26b], a
- xor a
- ld [MonType], a
- push de
- ld b, $0
- callba Function116c1
- pop hl
- ld de, StringBuffer1
- call InitName
- jr Function1707d
-.nonickname
- ld hl, StringBuffer1
- ld bc, PKMN_NAME_LENGTH
- call CopyBytes
-
-Function1707d: ; 1707d (5:707d)
- ld hl, CurPartyMon
- inc [hl]
- pop hl
- ld de, PARTYMON_STRUCT_LENGTH
- add hl, de
- pop de
- jp Function16f7a
-
-Function1708a: ; 1708a (5:708a)
- ret
-; 1708b (5:708b)
-
-UnknownText_0x1708b: ; 0x1708b
- ; Huh? @ @
- text_jump UnknownText_0x1c0db0
- start_asm
-; 0x17090
-
-Function17090: ; 17090
- ld hl, VramState
- res 0, [hl]
- push hl
- push de
- push bc
- ld a, [CurPartySpecies]
- push af
- call Function1728f
- ld hl, UnknownText_0x170b0
- call PrintText
- pop af
- ld [CurPartySpecies], a
- pop bc
- pop de
- pop hl
- ld hl, UnknownText_0x170b5
- ret
-; 170b0 (5:70b0)
-
-UnknownText_0x170b0: ; 0x170b0
- ;
- text_jump UnknownText_0x1c0db8
- db "@"
-; 0x170b5
-
-UnknownText_0x170b5: ; 0x170b5
- ; came out of its EGG!@ @
- text_jump UnknownText_0x1c0dba
- db "@"
-; 0x170ba
-
-UnknownText_0x170ba: ; 0x170ba
- ; Give a nickname to @ ?
- text_jump UnknownText_0x1c0dd8
- db "@"
-; 0x170bf
-
-Function170bf: ; 170bf
- call Function17197
- ld d, h
- ld e, l
- ld b, NUM_MOVES
-.loop
- ld a, [de]
- and a
- jr z, .done
- ld hl, wEggMonMoves
- ld c, NUM_MOVES
-.next
- ld a, [de]
- cp [hl]
- jr z, .skip
- inc hl
- dec c
- jr nz, .next
- call Function170e4
- jr nc, .skip
- call Function17169
-
-.skip
- inc de
- dec b
- jr nz, .loop
-
-.done
- ret
-; 170e4
-
-Function170e4: ; 170e4
-GLOBAL EggMoves
-
- push bc
- ld a, [wEggMonSpecies]
- dec a
- ld c, a
- ld b, 0
- ld hl, EggMovePointers
-rept 2
- add hl, bc
-endr
- ld a, BANK(EggMovePointers)
- call GetFarHalfword
-.loop
- ld a, BANK(EggMoves)
- call GetFarByte
- cp -1
- jr z, .found_mon
- ld b, a
- ld a, [de]
- cp b
- jr z, .done_carry
- inc hl
- jr .loop
-
-.found_mon
- call Function1720b
- ld b, NUM_MOVES
-.loop2
- ld a, [de]
- cp [hl]
- jr z, .found_eggmove
- inc hl
- dec b
- jr z, .inherit_tmhm
- jr .loop2
-
-.found_eggmove
- ld a, [wEggMonSpecies]
- dec a
- ld c, a
- ld b, 0
- ld hl, EvosAttacksPointers
-rept 2
- add hl, bc
-endr
- ld a, BANK(EvosAttacksPointers)
- call GetFarHalfword
-.loop3
- ld a, BANK(EvosAttacks)
- call GetFarByte
- inc hl
- and a
- jr nz, .loop3
-.loop4
- ld a, BANK(EvosAttacks)
- call GetFarByte
- and a
- jr z, .inherit_tmhm
- inc hl
- ld a, BANK(EvosAttacks)
- call GetFarByte
- ld b, a
- ld a, [de]
- cp b
- jr z, .done_carry
- inc hl
- jr .loop4
-
-.inherit_tmhm
- ld hl, TMHMMoves
-.loop5
- ld a, BANK(TMHMMoves)
- call GetFarByte
- inc hl
- and a
- jr z, .done
- ld b, a
- ld a, [de]
- cp b
- jr nz, .loop5
- ld [wd262], a
- predef CanLearnTMHMMove
- ld a, c
- and a
- jr z, .done
-
-.done_carry
- pop bc
- scf
- ret
-
-.done
- pop bc
- and a
- ret
-; 17169
-
-Function17169: ; 17169
- push de
- push bc
- ld a, [de]
- ld b, a
- ld hl, wEggMonMoves
- ld c, NUM_MOVES
-.loop
- ld a, [hli]
- and a
- jr z, .done
- dec c
- jr nz, .loop
- ld de, wEggMonMoves
- ld hl, wEggMonMoves + 1
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
-
-.done
- dec hl
- ld [hl], b
- ld hl, wEggMonMoves
- ld de, wEggMonPP
- predef FillPP
- pop bc
- pop de
- ret
-; 17197
-
-Function17197: ; 17197
- ld hl, wBreedMon2Moves
- ld a, [wBreedMon1Species]
- cp DITTO
- jr z, .ditto1
- ld a, [wBreedMon2Species]
- cp DITTO
- jr z, .ditto2
- ld a, [wDittoInDaycare]
- and a
- ret z
- ld hl, wBreedMon1Moves
- ret
-
-.ditto1
- ld a, [CurPartySpecies]
- push af
- ld a, [wBreedMon2Species]
- ld [CurPartySpecies], a
- ld a, [wBreedMon2DVs]
- ld [TempMonDVs], a
- ld a, [wBreedMon2DVs + 1]
- ld [TempMonDVs + 1], a
- ld a, $3
- ld [MonType], a
- predef GetGender
- jr c, .inherit_mon2_moves
- jr nz, .inherit_mon2_moves
- jr .inherit_mon1_moves
-
-.ditto2
- ld a, [CurPartySpecies]
- push af
- ld a, [wBreedMon1Species]
- ld [CurPartySpecies], a
- ld a, [wBreedMon1DVs]
- ld [TempMonDVs], a
- ld a, [wBreedMon1DVs + 1]
- ld [TempMonDVs + 1], a
- ld a, $3
- ld [MonType], a
- predef GetGender
- jr c, .inherit_mon1_moves
- jr nz, .inherit_mon1_moves
-
-.inherit_mon2_moves
- ld hl, wBreedMon2Moves
- pop af
- ld [CurPartySpecies], a
- ret
-
-.inherit_mon1_moves
- ld hl, wBreedMon1Moves
- pop af
- ld [CurPartySpecies], a
- ret
-; 1720b
-
-Function1720b: ; 1720b
- ld hl, wBreedMon1Moves
- ld a, [wBreedMon1Species]
- cp DITTO
- ret z
- ld a, [wBreedMon2Species]
- cp DITTO
- jr z, .ditto
- ld a, [wDittoInDaycare]
- and a
- ret z
-
-.ditto
- ld hl, wBreedMon2Moves
- ret
-; 17224
-
-
-Function17224: ; 17224 (5:7224)
- push de
- ld [CurPartySpecies], a
- ld [CurSpecies], a
- call GetBaseData
- ld hl, BattleMonDVs
- predef GetUnownLetter
- pop de
- predef_jump GetFrontpic
-
-Function1723c: ; 1723c (5:723c)
- push de
- ld [CurPartySpecies], a
- ld [CurSpecies], a
- call GetBaseData
- ld hl, BattleMonDVs
- predef GetUnownLetter
- pop de
- predef_jump Function5108b
-
-Function17254: ; 17254 (5:7254)
- push af
- call WaitTop
- push hl
- push bc
- hlcoord 0, 0
- ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
- ld a, " "
- call ByteFill
- pop bc
- pop hl
- ld a, b
- ld [hBGMapAddress + 1], a
- ld a, c
- ld [hFillBox], a
- lb bc, 7, 7
- predef FillBox
- pop af
- call Function17363
- call SetPalettes
- jp WaitBGMap
-
-Function1727f: ; 1727f (5:727f)
- push hl
- push de
- push bc
- callab Function8cf69
- call DelayFrame
- pop bc
- pop de
- pop hl
- ret
-
-Function1728f: ; 1728f (5:728f)
- ld a, [wd265]
- ld [wJumptableIndex], a
- ld a, [CurSpecies]
- push af
- ld de, MUSIC_NONE
- call PlayMusic
- callba Function8000
- call DisableLCD
- ld hl, EggHatchGFX
- ld de, VTiles0 tile $00
- ld bc, $20
- ld a, BANK(EggHatchGFX)
- call FarCopyBytes
- callba Function8cf53
- ld de, VTiles2 tile $00
- ld a, [wJumptableIndex]
- call Function1723c
- ld de, VTiles2 tile $31
- ld a, EGG
- call Function17224
- ld de, MUSIC_EVOLUTION
- call PlayMusic
- call EnableLCD
- hlcoord 7, 4
- ld b, $98
- ld c, $31
- ld a, EGG
- call Function17254
- ld c, $50
- call DelayFrames
- xor a
- ld [wcf64], a
- ld a, [hSCX] ; $ff00+$cf
- ld b, a
-.asm_172ee
- ld hl, wcf64
- ld a, [hl]
- inc [hl]
- cp $8
- jr nc, .asm_17327
- ld e, [hl]
-.asm_172f8
- ld a, $2
- ld [hSCX], a ; $ff00+$cf
- ld a, $fe
- ld [wc3c0], a
- call Function1727f
- ld c, $2
- call DelayFrames
- ld a, $fe
- ld [hSCX], a ; $ff00+$cf
- ld a, $2
- ld [wc3c0], a
- call Function1727f
- ld c, $2
- call DelayFrames
- dec e
- jr nz, .asm_172f8
- ld c, $10
- call DelayFrames
- call Function1736d
- jr .asm_172ee
-.asm_17327
- ld de, SFX_EGG_HATCH
- call PlaySFX
- xor a
- ld [hSCX], a ; $ff00+$cf
- ld [wc3c0], a
- call ClearSprites
- call Function173b3
- hlcoord 6, 3
- ld b, $98
- ld c, $0
- ld a, [wJumptableIndex]
- call Function17254
- call Function17418
- call WaitSFX
- ld a, [wJumptableIndex]
- ld [CurPartySpecies], a
- hlcoord 6, 3
- ld d, $0
- ld e, ANIM_MON_HATCH
- predef AnimateFrontpic
- pop af
- ld [CurSpecies], a
- ret
-
-Function17363: ; 17363 (5:7363)
- ld [PlayerHPPal], a
- ld b, $b
- ld c, $0
- jp GetSGBLayout
-
-Function1736d: ; 1736d (5:736d)
- ld a, [wcf64]
- dec a
- and $7
- cp $7
- ret z
- srl a
- ret nc
- swap a
- srl a
- add $4c
- ld d, a
- ld e, $58
- ld a, $19
- call Function3b2a
- ld hl, $3
- add hl, bc
- ld [hl], $0
- ld de, SFX_EGG_CRACK
- jp PlaySFX
-; 17393 (5:7393)
-
-EggHatchGFX: ; 17393
-INCBIN "gfx/unknown/017393.2bpp"
-; 173b3
-
-Function173b3: ; 173b3 (5:73b3)
- callba Function8cf53
- ld hl, Unknown_173ef
-.loop
- ld a, [hli]
- cp $ff
- jr z, .done
- ld e, a
- ld a, [hli]
- ld d, a
- ld a, [hli]
- ld c, a
- ld a, [hli]
- ld b, a
- push hl
- push bc
- ld a, $1c
- call Function3b2a
- ld hl, $3
- add hl, bc
- ld [hl], $0
- pop de
- ld a, e
- ld hl, $1
- add hl, bc
- add [hl]
- ld [hl], a
- ld hl, $b
- add hl, bc
- ld [hl], d
- pop hl
- jr .loop
-.done
- ld de, SFX_EGG_HATCH
- call PlaySFX
- call Function1727f
- ret
-; 173ef (5:73ef)
-
-Unknown_173ef: ; 173ef
-; Probably OAM.
- db $54, $48, $00, $3c
- db $5c, $48, $01, $04
- db $54, $50, $00, $30
- db $5c, $50, $01, $10
- db $54, $58, $02, $24
- db $5c, $58, $03, $1c
- db $50, $4c, $00, $36
- db $60, $4c, $01, $0a
- db $50, $54, $02, $2a
- db $60, $54, $03, $16
- db $ff
-; 17418
-
-Function17418: ; 17418 (5:7418)
- ld c, $81
-.asm_1741a
- call Function1727f
- dec c
- jr nz, .asm_1741a
- ret
-
-Special_DayCareMon1: ; 17421
- ld hl, UnknownText_0x17467
- call PrintText
- ld a, [wBreedMon1Species]
- call PlayCry
- ld a, [wDaycareLady]
- bit 0, a
- jr z, Function1745f
- call KeepTextOpen
- ld hl, wBreedMon2Nick
- call Function1746c
- jp PrintText
-
-Special_DayCareMon2: ; 17440
- ld hl, UnknownText_0x17462
- call PrintText
- ld a, [wBreedMon2Species]
- call PlayCry
- ld a, [wDaycareMan]
- bit 0, a
- jr z, Function1745f
- call KeepTextOpen
- ld hl, wBreedMon1Nick
- call Function1746c
- jp PrintText
-
-Function1745f: ; 1745f
- jp Functiona80
-; 17462
-
-UnknownText_0x17462: ; 0x17462
- ; It's @ that was left with the DAY-CARE LADY.
- text_jump UnknownText_0x1c0df3
- db "@"
-; 0x17467
-
-UnknownText_0x17467: ; 0x17467
- ; It's @ that was left with the DAY-CARE MAN.
- text_jump UnknownText_0x1c0e24
- db "@"
-; 0x1746c
-
-Function1746c: ; 1746c
- push bc
- ld de, StringBuffer1
- ld bc, NAME_LENGTH
- call CopyBytes
- call Function16e1d
- pop bc
- ld a, [wd265]
- ld hl, UnknownText_0x1749c
- cp $ff
- jr z, .asm_1749b
- ld hl, UnknownText_0x174a1
- and a
- jr z, .asm_1749b
- ld hl, UnknownText_0x174a6
- cp 230
- jr nc, .asm_1749b
- cp 70
- ld hl, UnknownText_0x174ab
- jr nc, .asm_1749b
- ld hl, UnknownText_0x174b0
-
-.asm_1749b
- ret
-; 1749c
-
-UnknownText_0x1749c: ; 0x1749c
- ; It's brimming with energy.
- text_jump UnknownText_0x1c0e54
- db "@"
-; 0x174a1
-
-UnknownText_0x174a1: ; 0x174a1
- ; It has no interest in @ .
- text_jump UnknownText_0x1c0e6f
- db "@"
-; 0x174a6
-
-UnknownText_0x174a6: ; 0x174a6
- ; It appears to care for @ .
- text_jump UnknownText_0x1c0e8d
- db "@"
-; 0x174ab
-
-UnknownText_0x174ab: ; 0x174ab
- ; It's friendly with @ .
- text_jump UnknownText_0x1c0eac
- db "@"
-; 0x174b0
-
-UnknownText_0x174b0: ; 0x174b0
- ; It shows interest in @ .
- text_jump UnknownText_0x1c0ec6
- db "@"
-; 0x174b5
-
-Function_174b5: ; 174b5
- ld hl, String_174b9
- ret
-; 174b9
-
-String_174b9: ; 174b9
- db "@"
-; 174ba
-
-
SECTION "Tileset Data 1", ROMX, BANK[TILESETS_1]
INCLUDE "tilesets/data_1.asm"
@@ -20326,7 +19352,7 @@
push de
ld b, $10
- ld hl, wcf81
+ ld hl, wMenuFlags
.loop
ld a, [hli]
ld [de], a
@@ -20337,7 +19363,7 @@
; If bit 6 or 7 of the menu flags is set, set bit 0 of the address
; at 7:[wcf71], and draw the menu using the coordinates from the header.
; Otherwise, reset bit 0 of 7:[wcf71].
- ld a, [wcf81]
+ ld a, [wMenuFlags]
bit 6, a
jr nz, .bit_6
bit 7, a
@@ -20349,9 +19375,9 @@
ld h, [hl]
ld l, a
set 0, [hl]
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
call .copy
- call GetMemAttrCoord
+ call MenuBoxCoord2Attr
call .copy
jr .done
@@ -20431,7 +19457,7 @@
ld a, h
ld [wcf72], a
call Function1c47
- ld a, [wcf81]
+ ld a, [wMenuFlags]
bit 0, a
jr z, .next
ld d, h
@@ -20526,7 +19552,7 @@
set 5, [hl]
.asm_24492
- ld a, [wcf81]
+ ld a, [wMenuFlags]
bit 4, a
jr z, .asm_2449b
set 6, [hl]
@@ -20604,7 +19630,7 @@
ld a, [wMenuBorderLeftCoord]
inc a
ld c, a
- call GetTileCoord
+ call Coord2Tile
ld a, $80
ld [hFillBox], a
lb bc, 7, 7
@@ -20616,7 +19642,7 @@
PokepicYesOrNo:: ; 24528
ld hl, MenuDataHeader_0x24547
call CopyMenuDataHeader
- call Function1ce1
+ call ClearMenuBoxInterior
call WaitBGMap
call ClearSGB
xor a
@@ -20922,7 +19948,7 @@
; 24706
Function24706: ; 24706 (9:4706)
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH
add hl, de
ld de, 2 * SCREEN_WIDTH
@@ -21076,7 +20102,7 @@
; 247f0
Function247f0: ; 247f0
- call Function1cf1
+ call ClearWholeMenuBox
ld a, [wMenuData2Flags]
bit 4, a
jr z, .asm_2480d
@@ -21087,11 +20113,11 @@
ld b, a
ld a, [wMenuBorderRightCoord]
ld c, a
- call GetTileCoord
+ call Coord2Tile
ld [hl], $61
.asm_2480d
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld bc, $15
add hl, bc
ld a, [wMenuData2Items]
@@ -21124,7 +20150,7 @@
ld b, a
ld a, [wMenuBorderRightCoord]
ld c, a
- call GetTileCoord
+ call Coord2Tile
ld [hl], $ee
.asm_24850
@@ -21195,7 +20221,7 @@
ld a, [wMenuBorderLeftCoord]
add $0
ld c, a
- call GetTileCoord
+ call Coord2Tile
ld [hl], $ec
.asm_248b7
@@ -21572,7 +20598,7 @@
Function24b01: ; 24b01
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld de, $15
add hl, de
ld de, Money
@@ -21923,7 +20949,7 @@
; 24d91
PopulateMonMenu: ; 24d91
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld bc, $2a ; 42
add hl, bc
ld de, Buffer2
@@ -22113,7 +21139,7 @@
call UpdateSprites
call Function1c89
call WaitBGMap
- call Function1c66
+ call CopyMenuData2
ld a, [wMenuData2Flags]
bit 7, a
jr z, .asm_24ed0
@@ -22411,7 +21437,7 @@
Function25072: ; 25072
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld de, $15
add hl, de
ld [hl], $f1
@@ -22419,11 +21445,11 @@
ld de, wItemQuantityChangeBuffer
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
- ld a, [wcf86]
+ ld a, [wMenuData2Pointer]
ld e, a
- ld a, [wcf87]
+ ld a, [wMenuData2Pointer + 1]
ld d, a
- ld a, [wcf8a]
+ ld a, [wMenuDataBank]
call FarCall_de
ret
; 25097
@@ -24370,7 +23396,7 @@
ld hl, MenuDataHeader_0x26eab
call GetMenu2
call ExitMenu
- call Function1c66
+ call CopyMenuData2
jr c, .nope
ld a, [MenuSelection2]
cp 3
@@ -27182,7 +26208,7 @@
Function2c8d3: ; 2c8d3 (b:48d3)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function2c9e2
ld a, $2
ld [wcfa1], a
@@ -27221,7 +26247,7 @@
dec a
ld [wTMHMPocketCursor], a
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, [wcfa6]
bit 7, a
jp nz, Function2c9b1
@@ -28550,7 +27576,7 @@
Function41ad7: ; 41ad7 (10:5ad7)
ld a, $3
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld c, $4
call DelayFrames
ret
@@ -28557,13 +27583,13 @@
Function41ae1: ; 41ae1 (10:5ae1)
ld a, $4
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld c, $4
call DelayFrames
ret
Function41aeb: ; 41aeb (10:5aeb)
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
jr z, .asm_41af3
call Function41ae1
@@ -30772,7 +29798,7 @@
call ExitMenu
call ExitMenu
pop af
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
bit 0, a
jr z, .asm_48377
call Function483bb
@@ -31292,10 +30318,10 @@
; 4880e
Function4880e: ; 4880e (12:480e)
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
and A_BUTTON
jp nz, Function488b9
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
and B_BUTTON
jp nz, Function488b4
ld hl, hJoyLast
@@ -31444,7 +30470,7 @@
asm_48922: ; 48922 (12:4922)
push bc
call JoyTextDelay
- ld a, [hJoyDown] ; $ff00+$a8
+ ld a, [hJoyDown]
and a
jp z, Function4896e
bit 0, a
@@ -31667,10 +30693,10 @@
Function48ab5: ; 48ab5 (12:4ab5)
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
and A_BUTTON
jp nz, Function48c0f
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
and B_BUTTON
jp nz, Function48c0d
ld a, d
@@ -32195,16 +31221,16 @@
Function48d94: ; 48d94 (12:4d94)
xor a
ld [hDividend + 0], a
- ld [hDividend + 1], a ; $ff00+$b4 (aliases: hMultiplicand)
+ ld [hDividend + 1], a
ld a, [hli]
ld [hDividend + 0], a
ld a, [hl]
- ld [hDividend + 1], a ; $ff00+$b4 (aliases: hMultiplicand)
+ ld [hDividend + 1], a
ld a, 100
- ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier)
+ ld [hDivisor], a
ld b, 2
call Divide
- ld a, [hDivisor] ; $ff00+$b7 (aliases: hMultiplier)
+ ld a, [hDivisor]
ld c, $a
call SimpleDivide
sla b
@@ -36120,35 +35146,35 @@
Function4cf45: ; 4cf45 (13:4f45)
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
jp z, WaitBGMap
; The following is a modified version of Function3246.
- ld a, [hBGMapMode] ; $ff00+$d4
+ ld a, [hBGMapMode]
push af
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, [hMapAnims]
push af
xor a
ld [hMapAnims], a
.WaitLY
- ld a, [rLY] ; $ff00+$44
+ ld a, [rLY]
cp $60
jr c, .WaitLY
di
ld a, 1 ; BANK(VBGMap2)
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
hlcoord 0, 0, AttrMap
call Function4cf80
ld a, 0 ; BANK(VBGMap0)
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
hlcoord 0, 0
call Function4cf80
.WaitLY2
- ld a, [rLY] ; $ff00+$44
+ ld a, [rLY]
cp $60
jr c, .WaitLY2
ei
@@ -36156,7 +35182,7 @@
pop af
ld [hMapAnims], a
pop af
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
Function4cf80: ; 4cf80 (13:4f80)
@@ -36190,7 +35216,7 @@
ld [hTilesPerCycle], a
jr nz, .loop
- ld a, [hSPBuffer] ; $ff00+$d9
+ ld a, [hSPBuffer]
ld l, a
ld a, [hSPBuffer + 1]
ld h, a
@@ -37814,7 +36840,7 @@
jr .clear_flags
.notbreedmon
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
.clear_flags
and a
ret
@@ -37918,7 +36944,7 @@
Function4deea: ; 4deea (13:5eea)
call Function4df45
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, [CurBaseData] ; wd236 (aliases: BaseDexNo)
ld [wd265], a
ld [CurSpecies], a
@@ -38032,7 +37058,7 @@
ld [wd265], a
ld [CurSpecies], a
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function4dfda
call Function4e002
call Function4dfed
@@ -38191,7 +37217,7 @@
sbc [hl]
dec hl
ld [Buffer2], a ; wd1eb (aliases: MovementType)
- ld a, [hQuotient] ; $ff00+$b4 (aliases: hMultiplicand)
+ ld a, [hQuotient]
sbc [hl]
ld [Buffer1], a ; wd1ea (aliases: MagikarpLength)
ret
@@ -38483,16 +37509,16 @@
push bc
push af
call DelayFrame
- ld a, [rVBK] ; $ff00+$4f
+ ld a, [rVBK]
push af
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld de, TextBoxSpaceGFX
lb bc, BANK(TextBoxSpaceGFX), 1
ld hl, VTiles2 tile $7f
call Get2bpp
pop af
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
pop af
pop bc
pop de
@@ -45171,11 +44197,11 @@
ld a, $1
ld [wc2d5], a
ld a, $88
- ld [rSB], a ; $ff00+$1
+ ld [rSB], a
ld a, $1
- ld [rSC], a ; $ff00+$2
+ ld [rSC], a
ld a, $81
- ld [rSC], a ; $ff00+$2
+ ld [rSC], a
ret
Function841e2: ; 841e2 (21:41e2)
@@ -45464,7 +44490,7 @@
ret
Function843a8: ; 843a8 (21:43a8)
- ld a, [rSB] ; $ff00+$1
+ ld a, [rSB]
ld [wca88], a
ld a, $0
call Function843db
@@ -45472,7 +44498,7 @@
ret
Function843b6: ; 843b6 (21:43b6)
- ld a, [rSB] ; $ff00+$1
+ ld a, [rSB]
ld [wca89], a
xor a
ld [wc2d5], a
@@ -45497,15 +44523,15 @@
ret
Function843db: ; 843db (21:43db)
- ld [rSB], a ; $ff00+$1
+ ld [rSB], a
ld a, $1
- ld [rSC], a ; $ff00+$2
+ ld [rSC], a
ld a, $81
- ld [rSC], a ; $ff00+$2
+ ld [rSC], a
ret
Function843e6: ; 843e6 (21:43e6)
- ld a, [rSB] ; $ff00+$1
+ ld a, [rSB]
ld [wca89], a
xor a
ld [wc2d5], a
@@ -45640,18 +44666,18 @@
ld [$ffac], a
ld [wd003], a
call Function8474c
- ld a, [rIE] ; $ff00+$ff
+ ld a, [rIE]
push af
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
ld a, $9
- ld [rIE], a ; $ff00+$ff
+ ld [rIE], a
ld hl, hVBlank
ld a, [hl]
push af
ld [hl], $4
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function84817
ld a, $10
call Function84419
@@ -45661,7 +44687,7 @@
ld c, $c
call DelayFrames
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function8486f
ld a, $0
call Function84419
@@ -45671,7 +44697,7 @@
ld c, $c
call DelayFrames
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function84893
ld a, $0
call Function84419
@@ -45681,7 +44707,7 @@
ld c, $c
call DelayFrames
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function848b7
ld a, $3
call Function84419
@@ -45691,9 +44717,9 @@
ld [hVBlank], a
call Function84411
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
pop af
- ld [rIE], a ; $ff00+$ff
+ ld [rIE], a
call Function84425
pop af
ld [wcf65], a
@@ -47102,7 +46128,7 @@
call InterpretMenu2
ld a, [MenuSelection2]
dec a
- call Function1db8
+ call CopyNameFromMenu
call WriteBackup
ret
; 882b5
@@ -47567,7 +46593,7 @@
Function8ca5c: ; 8ca5c (23:4a5c)
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld hl, wJumptableIndex
inc [hl]
@@ -51737,7 +50763,7 @@
ld b, $8
call GetSGBLayout
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call LoadStandardFont
ld de, GFX_908fb
ld hl, VTiles2 tile $00
@@ -51835,13 +50861,13 @@
.ClearScreen: ; 90783 (24:4783)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
hlcoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
xor a
call ByteFill
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
SetHour: ; 90795 (24:4795)
@@ -51939,7 +50965,7 @@
; 90810
SetMinutes: ; 90810 (24:4810)
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
and A_BUTTON
jr nz, .asm_90857
ld hl, hJoyLast
@@ -52301,9 +51327,9 @@
UnknownText_0x90a6c: ; 90a6c
start_asm
call UpdateTime
- ld a, [hHours] ; $ff00+$94
+ ld a, [hHours]
ld b, a
- ld a, [hMinutes] ; $ff00+$96
+ ld a, [hMinutes]
ld c, a
decoord 1, 14
callba PrintHoursMins
@@ -52766,11 +51792,11 @@
ret
Function90e00: ; 90e00 (24:4e00)
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
jr z, .asm_90e0e
ld a, $2
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld c, $3
call DelayFrames
.asm_90e0e
@@ -52999,10 +52025,10 @@
Function90f7b: ; 90f7b (24:4f7b)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Function90f86
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
Function90f86: ; 90f86 (24:4f86)
@@ -53009,9 +52035,9 @@
hlcoord 3, 5
lb bc, 5, 14
call ClearBox
- ld a, [hHours] ; $ff00+$94
+ ld a, [hHours]
ld b, a
- ld a, [hMinutes] ; $ff00+$96
+ ld a, [hMinutes]
ld c, a
decoord 6, 8
callba PrintHoursMins
@@ -53449,7 +52475,7 @@
; 0x91256
Function91256: ; 91256 (24:5256)
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
and A_BUTTON | B_BUTTON
ret z
callba HangUp
@@ -55327,7 +54353,7 @@
ld a, $e4
call DmgToCgbBGPals
lb de, $e4, $e4
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
jr nz, .asm_927ab
lb de, $c0, $e4
@@ -55517,7 +54543,7 @@
.asm_928cf
call Function92879
xor a
- ld [hJoypadSum], a ; $ff00+$a5
+ ld [hJoypadSum], a
ret
Function928d6: ; 928d6 (24:68d6)
@@ -55540,7 +54566,7 @@
call Function929f6
call Function92879
xor a
- ld [hJoypadSum], a ; $ff00+$a5
+ ld [hJoypadSum], a
Function92900: ; 92900 (24:6900)
ld hl, hJoypadSum ; $ffa5
@@ -55562,7 +54588,7 @@
call Function929f6
call Function92879
xor a
- ld [hJoypadSum], a ; $ff00+$a5
+ ld [hJoypadSum], a
Function9292a: ; 9292a (24:692a)
ld hl, hJoypadSum ; $ffa5
@@ -55584,7 +54610,7 @@
call Function929f6
call Function92879
xor a
- ld [hJoypadSum], a ; $ff00+$a5
+ ld [hJoypadSum], a
ret
Function92955: ; 92955 (24:6955)
@@ -55607,7 +54633,7 @@
dec [hl]
srl a
ret z
- ld a, [rOBP0] ; $ff00+$48
+ ld a, [rOBP0]
xor $ff
ld e, a
ld d, a
@@ -57225,7 +56251,7 @@
xor $ff
inc a
ld [hl], a
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
ret
.asm_932a3
ld hl, $b
@@ -57232,7 +56258,7 @@
add hl, bc
xor a
ld [hl], a
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
ret
Function932ac: ; 932ac (24:72ac)
@@ -57508,16 +56534,16 @@
.skip2
ld a, $80
ld a, $70
- ld [rWY], a ; $ff00+$4a
- ld [hWY], a ; $ff00+$d2
+ ld [rWY], a
+ ld [hWY], a
ret
.disappear
ld a, $90
- ld [rWY], a ; $ff00+$4a
- ld [hWY], a ; $ff00+$d2
+ ld [rWY], a
+ ld [hWY], a
xor a
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
ret
@@ -57600,32 +56626,44 @@
PlaceMapNameFrame: ; b812f
hlcoord 0, 0
+ ; top left
ld a, $61
ld [hli], a
+ ; top row
ld a, $62
call .FillTopBottom
+ ; top right
ld a, $64
ld [hli], a
+ ; left, first line
ld a, $65
ld [hli], a
- call .FillLeftRight
+ ; first line
+ call .FillMiddle
+ ; right, first line
ld a, $6b
ld [hli], a
+ ; left, second line
ld a, $66
ld [hli], a
- call .FillLeftRight
+ ; second line
+ call .FillMiddle
+ ; right, second line
ld a, $6c
ld [hli], a
+ ; bottom left
ld a, $67
ld [hli], a
+ ; bottom
ld a, $68
call .FillTopBottom
+ ; bottom right
ld a, $6a
ld [hl], a
ret
; b815b
-.FillLeftRight: ; b815b
+.FillMiddle: ; b815b
ld c, 18
ld a, $6d
.loop
@@ -60022,7 +59060,7 @@
call WaitSFX
ld a, [wc6e8]
ld e, a
- ld d, $0
+ ld d, 0
ld hl, wc6d0
rept 2
add hl, de
@@ -60279,7 +59317,7 @@
Functione04c1: ; e04c1 (38:44c1)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
hlcoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld a, $29
@@ -61344,7 +60382,7 @@
; e0c37
Functione0c37: ; e0c37 (38:4c37)
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
ret z
hlcoord 0, 0, AttrMap
@@ -61371,16 +60409,16 @@
lb bc, 12, 1
ld a, $1
call Functione04e7
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_e0c93
ld de, Unkn1Pals
ld bc, $48
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
; e0c93 (38:4c93)
@@ -62344,14 +61382,14 @@
xor a
call ByteFill
xor a
- ld [hSCY], a ; $ff00+$d0
- ld [hSCX], a ; $ff00+$cf
- ld [rWY], a ; $ff00+$4a
+ ld [hSCY], a
+ ld [hSCX], a
+ ld [rWY], a
ld [wJumptableIndex], a
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $e3
- ld [rLCDC], a ; $ff00+$40
+ ld [rLCDC], a
ld a, $e4
call DmgToCgbBGPals
ld a, $e0
@@ -62480,7 +61518,7 @@
cp $ff
ret z
ld [wc6fd], a
- ld [wc6fe], a
+ ld [wPlayerMinimized], a
ld a, e
ld [EnemyScreens], a
call Functione2183
@@ -62580,7 +61618,7 @@
; e2010
Functione2010: ; e2010
- ld hl, wc6fe
+ ld hl, wPlayerMinimized
ld a, [hli]
cp [hl]
jr nz, .asm_e2066
@@ -62608,7 +61646,7 @@
and a
jr nz, .asm_e2044
dec hl
- ld a, [wc6fe]
+ ld a, [wPlayerMinimized]
ld [hl], a
ld [wc6fd], a
ld hl, wc709
@@ -62977,7 +62015,7 @@
Functione23e9: ; e23e9 (38:63e9)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call ClearSprites
call Functione2d30
call Functione2a8e
@@ -63009,11 +62047,11 @@
ret z
call Functione2e01
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Functione2c2c
call PCMonInfo
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call DelayFrame
call DelayFrame
ret
@@ -63040,7 +62078,7 @@
Functione245d: ; e245d (38:645d)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call ClearSprites
call Functione2def
ld [CurPartySpecies], a
@@ -63241,7 +62279,7 @@
ld a, $f
ld [wcb2e], a
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call ClearSprites
call Functione2d30
call Functione2a8e
@@ -63273,11 +62311,11 @@
ret z
call Functione2e01
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Functione2c2c
call PCMonInfo
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call DelayFrame
call DelayFrame
ret
@@ -63305,7 +62343,7 @@
Functione2655: ; e2655 (38:6655)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call ClearSprites
call Functione2def
ld [CurPartySpecies], a
@@ -65265,7 +64303,7 @@
call Functione35e2
.loop
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call Functione36cf
call Functione379c
ld hl, Functione35aa_menudataheader
@@ -65288,7 +64326,7 @@
Functione35e2: ; e35e2 (38:75e2)
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
@@ -65584,7 +64622,7 @@
hlcoord 1, 16
call PlaceString
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
@@ -66494,18 +65532,18 @@
rept 2
add hl, de
endr
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [hli]
ld [OBPals + 12], a
ld a, [hli]
ld [OBPals + 13], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
ret
.asm_e47a3
ld hl, $b
@@ -66658,14 +65696,14 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap001
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroUnownsGFX
ld de, VTiles2 tile $00
call Functione54c2
@@ -66675,10 +65713,10 @@
ld hl, IntroTilemap002
ld de, VBGMap0 tile $00
call Functione54fa
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_365ad
ld de, Unkn1Pals
ld bc, $80
@@ -66688,14 +65726,14 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
callba Function8cf53
call Functione549e
xor a
@@ -66734,14 +65772,14 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap003
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroBackgroundGFX
ld de, VTiles2 tile $00
call Functione54c2
@@ -66748,10 +65786,10 @@
ld hl, IntroTilemap004
ld de, VBGMap0 tile $00
call Functione54fa
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_e5edd
ld de, Unkn1Pals
ld bc, $80
@@ -66761,14 +65799,14 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
call Functione5516
call Functione549e
xor a
@@ -66795,15 +65833,15 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hBGMapMode], a
+ ld [hLCDStatCustom], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap005
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroUnownsGFX
ld de, VTiles2 tile $00
call Functione54c2
@@ -66813,10 +65851,10 @@
ld hl, IntroTilemap006
ld de, VBGMap0 tile $00
call Functione54fa
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_365ad
ld de, Unkn1Pals
ld bc, $80
@@ -66826,14 +65864,14 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
callba Function8cf53
call Functione549e
xor a
@@ -66890,9 +65928,9 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap003
ld de, VBGMap0 tile $00
call Functione54fa
@@ -66900,7 +65938,7 @@
ld de, VTiles0 tile $00
call Functione54c2
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroSuicuneRunGFX
ld de, VTiles0 tile $00
call Functione54de
@@ -66910,10 +65948,10 @@
ld hl, IntroTilemap004
ld de, VBGMap0 tile $00
call Functione54fa
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_e5edd
ld de, Unkn1Pals
ld bc, $80
@@ -66923,14 +65961,14 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
call Functione5516
callba Function8cf53
ld de, $6cd8
@@ -66975,7 +66013,7 @@
IntroScene9: ; e4c04 (39:4c04)
; Set up the next scene (same bg).
xor a
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
call ClearSprites
hlcoord 0, 0, AttrMap
ld bc, $f0
@@ -66988,18 +66026,18 @@
ld a, $3
call ByteFill
ld a, $2
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
call DelayFrame
call DelayFrame
call DelayFrame
ld a, $c
- ld [hBGMapAddress], a ; $ff00+$d6
+ ld [hBGMapAddress], a
call DelayFrame
call DelayFrame
call DelayFrame
xor a
- ld [hBGMapMode], a ; $ff00+$d4
- ld [hBGMapAddress], a ; $ff00+$d6
+ ld [hBGMapMode], a
+ ld [hBGMapAddress], a
ld [wc3c0], a
xor a
ld [wcf64], a
@@ -67045,15 +66083,15 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hBGMapMode], a
+ ld [hLCDStatCustom], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap007
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroUnownsGFX
ld de, VTiles2 tile $00
call Functione54c2
@@ -67060,10 +66098,10 @@
ld hl, IntroTilemap008
ld de, VBGMap0 tile $00
call Functione54fa
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_365ad
ld de, Unkn1Pals
ld bc, $80
@@ -67073,14 +66111,14 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
callba Function8cf53
call Functione549e
xor a
@@ -67168,14 +66206,14 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap003
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroSuicuneRunGFX
ld de, VTiles0 tile $00
call Functione54de
@@ -67185,10 +66223,10 @@
ld hl, IntroTilemap004
ld de, VBGMap0 tile $00
call Functione54fa
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_e5edd
ld de, Unkn1Pals
ld bc, $80
@@ -67198,14 +66236,14 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
callba Function8cf53
lb de, $6c, $58
ld a, $26
@@ -67223,9 +66261,9 @@
IntroScene14: ; e4dfa (39:4dfa)
; Suicune runs then jumps.
- ld a, [hSCX] ; $ff00+$cf
+ ld a, [hSCX]
sub 10
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld hl, wcf64
ld a, [hl]
inc [hl]
@@ -67272,14 +66310,14 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap009
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroSuicuneJumpGFX
ld de, VTiles2 tile $00
call Functione54c2
@@ -67294,10 +66332,10 @@
ld de, VBGMap0 tile $00
call Functione54fa
call Functione541b
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_e77dd
ld de, Unkn1Pals
ld bc, $80
@@ -67307,15 +66345,15 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld a, $90
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
callba Function8cf53
call Functione549e
lb de, $40, $28
@@ -67338,11 +66376,11 @@
cp $80
jr nc, .done
call Functione5441
- ld a, [hSCY] ; $ff00+$d0
+ ld a, [hSCY]
and a
ret z
add 8
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
ret
.done
call NextIntroScene
@@ -67354,14 +66392,14 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap011
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroSuicuneCloseGFX
ld de, VTiles1 tile $00
call Functione54de
@@ -67368,10 +66406,10 @@
ld hl, IntroTilemap012
ld de, VBGMap0 tile $00
call Functione54fa
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_e6d6d
ld de, Unkn1Pals
ld bc, $80
@@ -67381,14 +66419,14 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
callba Function8cf53
call Functione549e
xor a
@@ -67404,11 +66442,11 @@
inc [hl]
cp $60
jr nc, .done
- ld a, [hSCX] ; $ff00+$cf
+ ld a, [hSCX]
cp $60
ret z
add 8
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ret
.done
call NextIntroScene
@@ -67420,14 +66458,14 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap013
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroSuicuneBackGFX
ld de, VTiles2 tile $00
call Functione54c2
@@ -67442,10 +66480,10 @@
ld de, VBGMap0 tile $00
call Functione54fa
call Functione541b
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_e77dd
ld de, Unkn1Pals
ld bc, $80
@@ -67455,15 +66493,15 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
ld a, $d8
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
callba Function8cf53
ld hl, wc300
xor a
@@ -67492,9 +66530,9 @@
jr nc, .asm_e5032
cp $28
ret nc
- ld a, [hSCY] ; $ff00+$d0
+ ld a, [hSCY]
inc a
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCY], a
ret
.asm_e5032
@@ -67532,7 +66570,7 @@
ld c, $3
call DelayFrames
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld [wcf64], a
ld [wcf65], a
call NextIntroScene
@@ -67596,14 +66634,14 @@
call ClearSprites
call ClearTileMap
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroTilemap015
ld de, VBGMap0 tile $00
call Functione54fa
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, IntroCrystalUnownsGFX
ld de, VTiles2 tile $00
call Functione54c2
@@ -67610,10 +66648,10 @@
ld hl, IntroTilemap017
ld de, VBGMap0 tile $00
call Functione54fa
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_e679d
ld de, Unkn1Pals
ld bc, $80
@@ -67623,14 +66661,14 @@
ld bc, $80
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
xor a
- ld [hSCX], a ; $ff00+$cf
- ld [hSCY], a ; $ff00+$d0
+ ld [hSCX], a
+ ld [hSCY], a
ld a, $7
- ld [hWX], a ; $ff00+$d1
+ ld [hWX], a
ld a, $90
- ld [hWY], a ; $ff00+$d2
+ ld [hWY], a
callba Function8cf53
call Functione549e
xor a
@@ -67697,10 +66735,10 @@
ld a, $0
adc h
ld h, a
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld de, BGPals
ld b, $8
.asm_e5187
@@ -67716,9 +66754,9 @@
dec b
jr nz, .asm_e5187
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
ret
; e519c (39:519c)
@@ -67827,10 +66865,10 @@
.asm_e523e
ld c, a
ld b, $0
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
push hl
push bc
ld hl, BGPals
@@ -67879,9 +66917,9 @@
ld a, d
ld [hli], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
ret
; e5288 (39:5288)
@@ -67926,10 +66964,10 @@
add a
endr
ld c, a
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
push bc
ld de, BGPals
ld a, c
@@ -67951,9 +66989,9 @@
ld bc, $8
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
ret
; e538d (39:538d)
@@ -67986,10 +67024,10 @@
add a
ld c, a
ld b, $0
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
push hl
ld hl, Palette_e53db
add hl, bc
@@ -68013,9 +67051,9 @@
ld a, d
ld [hli], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
ret
; e53db (39:53db)
@@ -68038,10 +67076,10 @@
; e541b
Functione541b: ; e541b (39:541b)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $6
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Unkn1Pals
decoord 0, 0
ld b, $12
@@ -68062,7 +67100,7 @@
dec b
jr nz, .asm_e542a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Functione5441: ; e5441 (39:5441)
@@ -68074,7 +67112,7 @@
ret
.asm_e544d
xor a
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
Functione5451: ; e5451 (39:5451)
@@ -68095,7 +67133,7 @@
or b
jr nz, .asm_e5457
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
Functione546d: ; e546d (39:546d)
@@ -68130,31 +67168,31 @@
Functione549e: ; e549e (39:549e)
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
ret
Functione54a3: ; e54a3 (39:54a3)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, BGPals
ld bc, $80
xor a
call ByteFill
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hCGBPalUpdate], a ; $ff00+$e5
+ ld [hCGBPalUpdate], a
call DelayFrame
call DelayFrame
ret
Functione54c2: ; e54c2 (39:54c2)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $6
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
push de
ld de, Unkn1Pals
call Decompress
@@ -68163,14 +67201,14 @@
ld bc, $180
call Request2bpp
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Functione54de: ; e54de (39:54de)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $6
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
push de
ld de, Unkn1Pals
call Decompress
@@ -68179,14 +67217,14 @@
ld bc, $1ff
call Request2bpp
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Functione54fa: ; e54fa (39:54fa)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $6
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
push de
ld de, Unkn1Pals
call Decompress
@@ -68195,29 +67233,29 @@
ld bc, $140
call Request2bpp
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Functione5516: ; e5516 (39:5516)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, LYOverrides
ld bc, $90
xor a
call ByteFill
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $43
- ld [hLCDStatCustom], a ; $ff00+$c6
+ ld [hLCDStatCustom], a
ret
Functione552f: ; e552f (39:552f)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [wcf64]
and $1
jr z, .asm_e5548
@@ -68235,9 +67273,9 @@
ld bc, $31
call ByteFill
ld a, [LYOverrides + 0]
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCX], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
IntroSuicuneRunGFX: ; e555d
@@ -70427,7 +69465,7 @@
ld [hMoneyTemp + 1], a
ld a, [hli]
ld [hMoneyTemp + 2], a
- ld de, wd851
+ ld de, wMomsMoney
ld bc, hMoneyTemp
callba CompareMoney
jr nc, .have_enough_money
@@ -70448,7 +69486,7 @@
ld [hl], (2300 % $100) ; $fc
.loop
ld de, wdc19
- ld bc, wd851
+ ld bc, wMomsMoney
callba CompareMoney
jr z, .exact
jr nc, .less_than
@@ -70484,10 +69522,10 @@
ld a, [hli]
ld [hMoneyTemp], a
ld a, [hli]
- ld [$ffc4], a
+ ld [hMoneyTemp + 1], a
ld a, [hli]
- ld [$ffc5], a
- ld de, wd851
+ ld [hMoneyTemp + 2], a
+ ld de, wMomsMoney
ld bc, hMoneyTemp
callba TakeMoney
ret
@@ -70688,7 +69726,7 @@
ld hl, w6_d000
call Function10425f
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, w6_d000
call Function10419d
ret
@@ -70704,7 +69742,7 @@
ld hl, w6_d400
call Function104263
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, w6_d400
call Function10419d
ret
@@ -70724,18 +69762,18 @@
call Function10425f
call DelayFrame
di
- ld a, [rVBK] ; $ff00+$4f
+ ld a, [rVBK]
push af
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, w6_d400
call Function1041ad
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, w6_d000
call Function1041ad
pop af
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ei
ret
@@ -70824,18 +69862,18 @@
call Function10425f
call DelayFrame
di
- ld a, [rVBK] ; $ff00+$4f
+ ld a, [rVBK]
push af
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, w6_d400
call Function1041b7
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, w6_d000
call Function1041b7
pop af
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ei
ret
; 104148
@@ -70898,12 +69936,12 @@
Function10419d: ; 10419d (41:419d)
call Function10424e
ld a, $23
- ld [hDMATransfer], a ; $ff00+$e8
+ ld [hDMATransfer], a
Function1041a4: ; 104a14
.asm_1041a4
call DelayFrame
- ld a, [hDMATransfer] ; $ff00+$e8
+ ld a, [hDMATransfer]
and a
jr nz, .asm_1041a4
ret
@@ -70911,7 +69949,7 @@
Function1041ad: ; 1041ad (41:41ad)
ld a, [hBGMapAddress + 1]
ld d, a
- ld a, [hBGMapAddress] ; $ff00+$d6
+ ld a, [hBGMapAddress]
ld e, a
ld c, $24
jr Function104209
@@ -70919,7 +69957,7 @@
Function1041b7: ; 1041b7 (41:41b7)
ld a, [hBGMapAddress + 1]
ld d, a
- ld a, [hBGMapAddress] ; $ff00+$d6
+ ld a, [hBGMapAddress]
ld e, a
ld c, $24
jr asm_104205
@@ -71035,14 +70073,14 @@
Function10424e: ; 10424e (41:424e)
ld a, h
- ld [rHDMA1], a ; $ff00+$51
+ ld [rHDMA1], a
ld a, l
- ld [rHDMA2], a ; $ff00+$52
+ ld [rHDMA2], a
ld a, [hBGMapAddress + 1]
and $1f
- ld [rHDMA3], a ; $ff00+$53
- ld a, [hBGMapAddress] ; $ff00+$d6
- ld [rHDMA4], a ; $ff00+$54
+ ld [rHDMA3], a
+ ld a, [hBGMapAddress]
+ ld [rHDMA4], a
ret
Function10425f: ; 10425f (41:425f)
@@ -71211,13 +70249,13 @@
decoord 0, 0, AttrMap
call Function10433a
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld c, $8
ld hl, w6_d000 + $80
ld de, VBGMap1 tile $00
call Function104209
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld c, $8
ld hl, w6_d000
ld de, VBGMap1 tile $00
@@ -71509,19 +70547,19 @@
ld [wd153], a
xor a
ld [wd152], a
- ld [hSCY], a ; $ff00+$d0
- ld [hSCX], a ; $ff00+$cf
+ ld [hSCY], a
+ ld [hSCX], a
callba Function5958
- ld a, [rVBK] ; $ff00+$4f
+ ld a, [rVBK]
push af
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
xor a
lb bc, 4, 0
ld hl, VBGMap0 tile $00
call ByteFill
pop af
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld a, $60
lb bc, 4, 0
ld hl, VBGMap0 tile $00
@@ -71531,12 +70569,12 @@
Function1047a3: ; 1047a3 (41:47a3)
decoord 0, 0
call Function1047b4
- ld a, [hCGB] ; $ff00+$e6
+ ld a, [hCGB]
and a
ret z
decoord 0, 0, AttrMap
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
Function1047b4: ; 1047b4 (41:47b4)
ld hl, VBGMap0 tile $00
@@ -71556,7 +70594,7 @@
dec b
jr nz, .asm_1047bb
ld a, $0
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ret
LoadGraphics: ; 1047cf
@@ -71565,7 +70603,7 @@
xor a
ld [hMapAnims], a
xor a
- ld [hTileAnimFrame], a ; $ff00+$df
+ ld [hTileAnimFrame], a
callba RefreshSprites
call LoadFontsExtra
callba Function106594
@@ -71710,14 +70748,14 @@
ld [wca01], a
ld a, $14
ld [wca02], a
- ld a, [rIE] ; $ff00+$ff
+ ld a, [rIE]
push af
call Function104a95
ld d, a
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
pop af
- ld [rIE], a ; $ff00+$ff
+ ld [rIE], a
push de
call ClearTileMap
call EnableLCD
@@ -71812,7 +70850,7 @@
Function1049c5: ; 1049c5 (41:49c5)
call PrintText
ld a, $e3
- ld [rLCDC], a ; $ff00+$40
+ ld [rLCDC], a
ret
; 1049cd (41:49cd)
@@ -71954,10 +70992,10 @@
jp nz, Function104bd0
jr asm_104b0a
.asm_104ac8
- ld a, [rLY] ; $ff00+$44
+ ld a, [rLY]
cp $90
jr c, .asm_104ac8
- ld c, $56
+ ld c, rRP % $100
ld a, $c0
ld [$ff00+c], a
ld b, $f0
@@ -71965,12 +71003,12 @@
push bc
call Function105038
ld b, $2
- ld c, $56
+ ld c, rRP % $100
.asm_104add
ld a, [$ff00+c]
and b
ld b, a
- ld a, [rLY] ; $ff00+$44
+ ld a, [rLY]
cp $90
jr nc, .asm_104add
.asm_104ae6
@@ -71977,7 +71015,7 @@
ld a, [$ff00+c]
and b
ld b, a
- ld a, [rLY] ; $ff00+$44
+ ld a, [rLY]
cp $90
jr c, .asm_104ae6
ld a, b
@@ -71986,7 +71024,7 @@
jr z, .asm_104a9f
or a
jr nz, .asm_104a9f
- ld a, [$ffc4]
+ ld a, [hMoneyTemp + 1]
bit 1, a
jr z, .asm_104ad5
ld a, $10
@@ -72129,10 +71167,10 @@
push af
call Function104da0
xor a
- ld [rIF], a ; $ff00+$f
- ld a, [rIE] ; $ff00+$ff
+ ld [rIF], a
+ ld a, [rIE]
or $1
- ld [rIE], a ; $ff00+$ff
+ ld [rIE], a
ei
call DelayFrame
pop af
@@ -72254,10 +71292,10 @@
push af
call Function104da0
xor a
- ld [rIF], a ; $ff00+$f
- ld a, [rIE] ; $ff00+$ff
+ ld [rIF], a
+ ld a, [rIE]
or $1
- ld [rIE], a ; $ff00+$ff
+ ld [rIE], a
ei
call DelayFrame
pop af
@@ -72298,9 +71336,9 @@
Function104d5e: ; 104d5e (41:4d5e)
call Function104d74
ld a, $4
- ld [rIE], a ; $ff00+$ff
+ ld [rIE], a
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
call Function104d96
xor a
ld b, a
@@ -72313,25 +71351,25 @@
Function104d74: ; 104d74 (41:4d74)
xor a
- ld [rTAC], a ; $ff00+$7
+ ld [rTAC], a
ld a, $fe
- ld [rTMA], a ; $ff00+$6
- ld [rTIMA], a ; $ff00+$5
+ ld [rTMA], a
+ ld [rTIMA], a
ld a, $2
- ld [rTAC], a ; $ff00+$7
+ ld [rTAC], a
or $4
- ld [rTAC], a ; $ff00+$7
+ ld [rTAC], a
ret
Function104d86: ; 104d86 (41:4d86)
xor a
- ld [rTAC], a ; $ff00+$7
- ld [rTMA], a ; $ff00+$6
- ld [rTIMA], a ; $ff00+$5
+ ld [rTAC], a
+ ld [rTMA], a
+ ld [rTIMA], a
ld a, $2
- ld [rTAC], a ; $ff00+$7
+ ld [rTAC], a
or $4
- ld [rTAC], a ; $ff00+$7
+ ld [rTAC], a
ret
Function104d96: ; 104d96 (41:4d96)
@@ -72345,7 +71383,7 @@
xor a
call Function104e8c
ld a, $2
- ld [rTAC], a ; $ff00+$7
+ ld [rTAC], a
ret
Function104da9: ; 104da9 (41:4da9)
@@ -72352,7 +71390,7 @@
inc d
ret z
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
halt
ld a, [$ff00+c]
bit 1, a
@@ -72364,7 +71402,7 @@
inc d
ret z
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
halt
ld a, [$ff00+c]
bit 1, a
@@ -72379,7 +71417,7 @@
dec d
ret z
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
halt
jr .asm_104dc8
@@ -72390,7 +71428,7 @@
dec d
ret z
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
halt
jr .asm_104dd4
@@ -72402,8 +71440,8 @@
.asm_104de4
call Function105038
ld b, $2
- ld c, $56
- ld a, [$ffc4]
+ ld c, rRP % $100
+ ld a, [hMoneyTemp + 1]
bit 1, a
jr z, .asm_104df6
ld a, $10
@@ -72417,7 +71455,7 @@
jr nz, .asm_104de4
Function104dfe: ; 104dfe (41:4dfe)
- ld c, $56
+ ld c, rRP % $100
ld d, $0
ld e, d
call Function104db7
@@ -72487,7 +71525,7 @@
ret
Function104e8c: ; 104e8c (41:4e8c)
- ld [rRP], a ; $ff00+$56
+ ld [rRP], a
ld a, $ff
ld [hPrintNum10], a
ret
@@ -72494,8 +71532,8 @@
Function104e93: ; 104e93 (41:4e93)
xor a
- ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier)
- ld [hMathBuffer], a ; $ff00+$b8
+ ld [hDivisor], a
+ ld [hMathBuffer], a
push hl
push bc
ld c, $56
@@ -72511,9 +71549,9 @@
pop bc
pop hl
call Function104ed6
- ld a, [hDivisor] ; $ff00+$b7 (aliases: hMultiplier)
- ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
- ld a, [hMathBuffer] ; $ff00+$b8
+ ld a, [hDivisor]
+ ld [hQuotient], a
+ ld a, [hMathBuffer]
ld [$ffb5], a
push hl
ld hl, hQuotient ; $ffb4 (aliases: hMultiplicand)
@@ -72522,10 +71560,10 @@
ld hl, hPrintNum10
ld b, $1
call Function104faf
- ld a, [hQuotient] ; $ff00+$b4 (aliases: hMultiplicand)
- ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier)
+ ld a, [hQuotient]
+ ld [hDivisor], a
ld a, [$ffb5]
- ld [hMathBuffer], a ; $ff00+$b8
+ ld [hMathBuffer], a
pop hl
ret
@@ -72541,7 +71579,7 @@
cpl
ld b, a
ld a, $f4
- ld [rTMA], a ; $ff00+$6
+ ld [rTMA], a
.asm_104eee
inc b
jr z, .asm_104f2e
@@ -72549,18 +71587,18 @@
ld [$ffb6], a
ld a, [hli]
ld e, a
- ld a, [hDivisor] ; $ff00+$b7 (aliases: hMultiplier)
+ ld a, [hDivisor]
add e
- ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier)
- ld a, [hMathBuffer] ; $ff00+$b8
+ ld [hDivisor], a
+ ld a, [hMathBuffer]
adc $0
- ld [hMathBuffer], a ; $ff00+$b8
+ ld [hMathBuffer], a
.asm_104f02
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
halt
ld a, $c1
- ld [rRP], a ; $ff00+$56
+ ld [rRP], a
ld d, $1
ld a, e
rlca
@@ -72568,15 +71606,15 @@
jr nc, .asm_104f13
inc d
.asm_104f13
- ld a, [rTIMA] ; $ff00+$5
+ ld a, [rTIMA]
cp $f8
jr c, .asm_104f13
ld a, $c0
- ld [rRP], a ; $ff00+$56
+ ld [rRP], a
dec d
jr z, .asm_104f25
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
halt
.asm_104f25
ld a, [$ffb6]
@@ -72586,9 +71624,9 @@
jr .asm_104f02
.asm_104f2e
ld a, $fe
- ld [rTMA], a ; $ff00+$6
+ ld [rTMA], a
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
halt
ld d, $5
call Function104dc5
@@ -72616,8 +71654,8 @@
Function104f57: ; 104f57 (41:4f57)
xor a
- ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier)
- ld [hMathBuffer], a ; $ff00+$b8
+ ld [hDivisor], a
+ ld [hMathBuffer], a
push bc
push hl
ld hl, hQuotient ; $ffb4 (aliases: hMultiplicand)
@@ -72630,13 +71668,13 @@
pop af
cp b
jp c, Function104f50
- ld a, [hQuotient] ; $ff00+$b4 (aliases: hMultiplicand)
+ ld a, [hQuotient]
cp $5a
jp nz, Function104f50
call Function104faf
- ld a, [hDivisor] ; $ff00+$b7 (aliases: hMultiplier)
+ ld a, [hDivisor]
ld d, a
- ld a, [hMathBuffer] ; $ff00+$b8
+ ld a, [hMathBuffer]
ld e, a
push hl
push de
@@ -72661,13 +71699,13 @@
pop de
pop hl
ld a, d
- ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier)
+ ld [hDivisor], a
ld a, e
- ld [hMathBuffer], a ; $ff00+$b8
+ ld [hMathBuffer], a
ret
Function104faf: ; 104faf (41:4faf)
- ld c, $56
+ ld c, rRP % $100
ld d, $0
call Function104db7
jp z, Function104f42
@@ -72681,7 +71719,7 @@
cpl
ld b, a
xor a
- ld [$ffc5], a
+ ld [hMoneyTemp + 2], a
call Function104d86
.asm_104fd2
inc b
@@ -72704,10 +71742,10 @@
bit 1, a
jr nz, .asm_104fe5
.asm_104fed
- ld a, [$ffc5]
+ ld a, [hMoneyTemp + 2]
ld d, a
- ld a, [rTIMA] ; $ff00+$5
- ld [$ffc5], a
+ ld a, [rTIMA]
+ ld [hMoneyTemp + 2], a
sub d
cp $12
jr c, .asm_104ffd
@@ -72727,17 +71765,17 @@
.asm_10500b
ld a, e
ld [hli], a
- ld a, [hDivisor] ; $ff00+$b7 (aliases: hMultiplier)
+ ld a, [hDivisor]
add e
- ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier)
- ld a, [hMathBuffer] ; $ff00+$b8
+ ld [hDivisor], a
+ ld a, [hMathBuffer]
adc $0
- ld [hMathBuffer], a ; $ff00+$b8
+ ld [hMathBuffer], a
jr .asm_104fd2
.asm_10501a
call Function104d74
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
ld d, $0
call Function104da9
jp z, Function104f42
@@ -72755,9 +71793,9 @@
Function105038: ; 105038 (41:5038)
ld a, $20
- ld [rJOYP], a ; $ff00+$0
+ ld [rJOYP], a
rept 2
- ld a, [rJOYP] ; $ff00+$0
+ ld a, [rJOYP]
endr
cpl
and $f
@@ -72764,9 +71802,9 @@
swap a
ld b, a
ld a, $10
- ld [rJOYP], a ; $ff00+$0
+ ld [rJOYP], a
rept 6
- ld a, [rJOYP] ; $ff00+$0
+ ld a, [rJOYP]
endr
cpl
and $f
@@ -72775,11 +71813,11 @@
ld a, [hMoneyTemp]
xor c
and c
- ld [$ffc4], a
+ ld [hMoneyTemp + 1], a
ld a, c
ld [hMoneyTemp], a
ld a, $30
- ld [rJOYP], a ; $ff00+$0
+ ld [rJOYP], a
ret
Function105069: ; 105069 (41:5069)
@@ -73091,14 +72129,14 @@
call Function1050fb
ld a, $24
ld [wca02], a
- ld a, [rIE] ; $ff00+$ff
+ ld a, [rIE]
push af
call Function104c2d
ld d, a
xor a
- ld [rIF], a ; $ff00+$f
+ ld [rIF], a
pop af
- ld [rIE], a ; $ff00+$ff
+ ld [rIE], a
ld a, d
cp $10
jp z, Function105712
@@ -73162,7 +72200,7 @@
asm_105726: ; 105726 (41:5726)
call PrintText
ld a, $e3
- ld [rLCDC], a ; $ff00+$40
+ ld [rLCDC], a
ret
; 10572e (41:572e)
--- a/misc/crystal_misc.asm
+++ b/misc/crystal_misc.asm
@@ -144,14 +144,14 @@
ret
Function17a770: ; 17a770 (5e:6770)
- ld a, [hOAMUpdate] ; $ff00+$d8
+ ld a, [hOAMUpdate]
push af
ld a, $1
- ld [hOAMUpdate], a ; $ff00+$d8
+ ld [hOAMUpdate], a
call HideSprites
call Function17a9cb
pop af
- ld [hOAMUpdate], a ; $ff00+$d8
+ ld [hOAMUpdate], a
ret
Function17a781: ; 17a781 (5e:6781)
@@ -251,7 +251,7 @@
Function17a81a: ; 17a81a (5e:681a)
call IsSFXPlaying
ret nc
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
and $3
ret z
call ExitMenu
@@ -269,7 +269,7 @@
ld a, [hJoyLast]
and $f0
ld c, a
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
and $b
or c
ld c, a
@@ -741,10 +741,10 @@
; 17aba0
Function17aba0: ; 17aba0 (5e:6ba0)
- ld a, [rVBK] ; $ff00+$4f
+ ld a, [rVBK]
push af
ld a, $1
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, VTiles5 tile $00
ld de, GFX_17afa5
@@ -752,7 +752,7 @@
call Get2bpp
pop af
- ld [rVBK], a ; $ff00+$4f
+ ld [rVBK], a
ld hl, VTiles0 tile $00
ld de, GFX_17afa5 + $4c0
@@ -766,10 +766,10 @@
ret
Function17abcf: ; 17abcf (5e:6bcf)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, BANK(Unkn1Pals)
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_17ac55
ld de, Unkn1Pals ; $d000
@@ -793,7 +793,7 @@
call FarCopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Function17ac0c: ; 17ac0c (5e:6c0c)
--- a/misc/mobile_22.asm
+++ b/misc/mobile_22.asm
@@ -816,16 +816,16 @@
Function895c7: ; 895c7 (22:55c7)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, 5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_895de
ld de, wd030
ld bc, 8
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
; 895de (22:55de)
@@ -2147,10 +2147,10 @@
Function89d0d: ; 89d0d (22:5d0d)
call Function8923c
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld c, $8
ld de, Unkn1Pals
.asm_89d1c
@@ -2166,7 +2166,7 @@
ld bc, $8
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call SetPalettes
callba Function845db
call Function89240
@@ -2377,16 +2377,16 @@
jp Function89e36
Function89e9a: ; 89e9a (22:5e9a)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_89eb1
ld de, wd028
ld bc, $8
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
; 89eb1 (22:5eb1)
@@ -3383,10 +3383,10 @@
ret
Function8a5b6: ; 8a5b6 (22:65b6)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_8a5e5
ld de, wd020
ld bc, $18
@@ -3400,7 +3400,7 @@
ld bc, $8
call CopyBytes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
; 8a5e5 (22:65e5)
--- a/misc/mobile_22_2.asm
+++ b/misc/mobile_22_2.asm
@@ -252,7 +252,7 @@
call Function8b4fd
call Function89c44
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
pop bc
call Function8b3dd
jr nc, .asm_8b46e
@@ -809,9 +809,9 @@
ld a, [wd032]
and a
jr z, .asm_8b7e0
- ld a, [wcf81]
+ ld a, [wMenuFlags]
set 3, a
- ld [wcf81], a
+ ld [wMenuFlags], a
.asm_8b7e0
ld a, [wd0e3]
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -1825,7 +1825,7 @@
; 100b7a
Function100b7a: ; 100b7a
- ld hl, Function1c66
+ ld hl, CopyMenuData2
ld a, [wcf94]
rst FarCall
callba Function24085
@@ -2088,7 +2088,7 @@
call UpdateSprites
call Function1c89
call WaitBGMap
- call Function1c66
+ call CopyMenuData2
call Function1c10
ld hl, wcfa5
set 6, [hl]
--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -7667,10 +7667,10 @@
Function11766b: ; 11766b (45:766b)
call Function117699
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call Function1176ee
ld a, $5
call GetSRAMBank
@@ -7683,7 +7683,7 @@
call CopyBytes
call CloseSRAM
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Function117699: ; 117699 (45:7699)
@@ -7973,11 +7973,11 @@
ld hl, MenuDataHeader_1179b5
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
ld hl, MenuDataHeader_1179bd
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
callba Function104061
hlcoord 16, 8
ld de, String_1179c5
@@ -7993,7 +7993,7 @@
jp Function117a0a
Function1178e8: ; 1178e8 (45:78e8)
- ld a, [hJoyPressed] ; $ff00+$a7
+ ld a, [hJoyPressed]
cp $2
jr z, .asm_117939
cp $1
@@ -8076,7 +8076,7 @@
ld hl, MenuDataHeader_1179b5
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
callba Function104061
hlcoord 1, 14
ld de, String_1179e1
@@ -8236,7 +8236,7 @@
ld hl, Data117cbc
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
jp Function117cdd
Function117b28:
@@ -8248,7 +8248,7 @@
ld hl, Data117cc4
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
hlcoord 16, 8
ld de, YesNo117ccc
call PlaceString
@@ -8386,7 +8386,7 @@
ld hl, Data117cbc
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
callba Function104061
ld hl, MobileStadiumSuccessText
call PrintText
--- a/misc/mobile_46.asm
+++ b/misc/mobile_46.asm
@@ -311,10 +311,10 @@
ld [wcd34], a
ld a, $5
ld [wc3f0], a
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $3
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
.asm_11829d
call JoyTextDelay
call Function118473
@@ -334,7 +334,7 @@
cp [hl]
jr nz, .asm_11829d
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call Function118452
ret
; 1182d5 (46:42d5)
@@ -1038,7 +1038,7 @@
and $1
jr z, .asm_1187a7
ld a, $3
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
.asm_1187a7
jp Function119e2e
.asm_1187aa
@@ -1066,7 +1066,7 @@
jr nz, .asm_118803
set 0, [hl]
ld a, $6
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld de, Unkn1Pals
ld bc, $1000
ld a, [hl]
@@ -1111,7 +1111,7 @@
jr c, .asm_11884a
cp $4
jr z, .asm_11884a
- ld a, [hJoyDown] ; $ff00+$a8
+ ld a, [hJoyDown]
cp $5
jr nz, .asm_11884a
ld a, $a
@@ -1285,7 +1285,7 @@
ld hl, MenuDataHeader_119cf7
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
call Function321c
hlcoord 16, 8, AttrMap
ld a, $40
@@ -4092,10 +4092,10 @@
; 119d93
Function119d93: ; 119d93 (46:5d93)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [wcd4f]
ld c, 10
call SimpleMultiply
@@ -4122,7 +4122,7 @@
dec a
jr nz, .asm_119daf
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
and a
ret
.asm_119dc6
@@ -4130,18 +4130,18 @@
ld a, $4
ld [wcf66], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
scf
ret
Function119dd1: ; 119dd1 (46:5dd1)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, [wcd4f]
cp 70 / 10
jr nc, .asm_119e08
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, PartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
ld de, PartySpecies
@@ -4169,7 +4169,7 @@
jr nz, .asm_119deb
.asm_119e08
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
and a
ret
.asm_119e0d
@@ -4184,7 +4184,7 @@
ld a, $a
ld [wcf66], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
scf
ret
; 119e2b (46:5e2b)
@@ -4333,15 +4333,15 @@
ret
Function119ed8: ; 119ed8 (46:5ed8)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
ld [wcd8c], a
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call Function119eee
ld a, [wcd8c]
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $1
- ld [hBGMapMode], a ; $ff00+$d4
+ ld [hBGMapMode], a
ret
Function119eee: ; 119eee (46:5eee)
@@ -4740,7 +4740,7 @@
ld hl, MenuDataHeader_11a2de
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
call Function321c
hlcoord 16, 8
ld de, String_11a2cf
--- a/misc/mobile_5b.asm
+++ b/misc/mobile_5b.asm
@@ -1163,7 +1163,7 @@
ld b, a
ld a, [wcfa2]
ld c, a
- call GetTileCoord
+ call Coord2Tile
ld a, [wcfa7]
swap a
and $f
--- a/misc/mobile_5c.asm
+++ b/misc/mobile_5c.asm
@@ -673,7 +673,7 @@
Function17073e: ; 17073e (5c:473e)
call Random
- ld a, [hRandomAdd] ; $ff00+$e1
+ ld a, [hRandomAdd]
and $7
cp $6
jr c, .asm_17074b
@@ -842,14 +842,14 @@
Function170868: ; 170868 (5c:4868)
ld a, BANK(sbe47)
call GetSRAMBank
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $3
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [wd000 + $800]
ld [sbe47], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call CloseSRAM
ret
@@ -856,14 +856,14 @@
Function170881: ; 170881 (5c:4881)
ld a, BANK(sbe47)
call GetSRAMBank
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $3
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [sbe47]
ld [wd000 + $800], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call CloseSRAM
ret
@@ -1032,14 +1032,14 @@
db "なぞナゾ@@"
Function1709aa: ; 1709aa (5c:49aa)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, BANK(w3_d090)
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, [w3_d090]
ld [ScriptVar], a
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Function1709bb: ; 1709bb (5c:49bb)
@@ -1575,13 +1575,13 @@
Function1719d6: ; 1719d6 (5c:59d6)
callba Function1183cb
call Function1719ed
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
call Function171a11
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Function1719ed: ; 1719ed (5c:59ed)
@@ -1656,13 +1656,13 @@
ld [wc302], a
ld a, $a
call Function3e32
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
callba Function118452
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld a, $a
ld [wcd49], a
ret
@@ -1700,13 +1700,13 @@
jp Function171c66
Function171aec: ; 171aec (5c:5aec)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $1
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
callba Function118452
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
hlcoord 2, 6
ld a, $8
.asm_171b01
@@ -1860,7 +1860,7 @@
ld hl, MenuDataHeader_171c6b
call LoadMenuDataHeader
call MenuBox
- call GetMemTileCoord
+ call MenuBoxCoord2Tile
callba Function104061
hlcoord 1, 14
ld de, String_171c73
@@ -1952,10 +1952,10 @@
ret
Function171ccd: ; 171ccd (5c:5ccd)
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_171d71
ld de, Unkn1Pals
ld bc, $40
@@ -1967,7 +1967,7 @@
ld [hl], a
call SetPalettes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
Function171cf0: ; 171cf0 (5c:5cf0)
@@ -2115,10 +2115,10 @@
; 172eb9 (5c:6eb9)
Function172eb9:
- ld a, [rSVBK] ; $ff00+$70
+ ld a, [rSVBK]
push af
ld a, $5
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ld hl, Palette_172edf
ld de, Unkn1Pals
ld bc, $40
@@ -2129,7 +2129,7 @@
call CopyBytes
call SetPalettes
pop af
- ld [rSVBK], a ; $ff00+$70
+ ld [rSVBK], a
ret
; 172edf (5c:6edf)
--- a/wram.asm
+++ b/wram.asm
@@ -724,12 +724,13 @@
CurEnemyMoveNum:: ; c6e9
ds 1
+wEnemyHPAtTimeOfPlayerSwitch::
wc6ea:: ds 1
wc6eb:: ds 1
wPayDayMoney:: ds 3 ; c6ec
- ds 1
-
+wSafariMonAngerCount:: ds 1
+wSafariMonEating::
wc6f0:: ds 2
wEnemyBackupDVs:: ; used when enemy is transformed
wc6f2:: ds 2
@@ -749,7 +750,7 @@
LastPlayerCounterMove:: ; c6f9
ds 1
-wc6fa:: ds 1
+wEnemyMinimized:: ds 1 ; c6fa
AlreadyFailed:: ; c6fb
ds 1
@@ -756,7 +757,7 @@
wc6fc:: ds 1
wc6fd:: ds 1
-wc6fe:: ds 1
+wPlayerMinimized:: ds 1 ; c6fe
wc6ff::
PlayerScreens:: ; c6ff
; bit
@@ -870,8 +871,8 @@
wc739:: ds 4
wc73d:: ds 1
wc73e:: ds 1
-wc73f:: ds 1
-wc740:: ds 1
+wPlayerJustGotFrozen:: ds 1
+wEnemyJustGotFrozen:: ds 1
wc741::
wBattleEnd::
; c741
@@ -1241,6 +1242,7 @@
Requested1bppDest:: ; cf6f
ds 2
+; something to do with menu
wcf71:: ds 1
wcf72:: ds 1
wcf73:: ds 1
@@ -1252,21 +1254,31 @@
wcf77:: ds 1
wcf78:: ds 9
-; menu data header buffer (ds 16)
-wcf81:: ds 1
-
-; dw related to tilemap
+; menu data header
+wMenuDataHeader:: ; cf81
+wMenuFlags:: ds 1
wMenuBorderTopCoord:: ds 1
wMenuBorderLeftCoord:: ds 1
wMenuBorderBottomCoord:: ds 1
wMenuBorderRightCoord:: ds 1
-
-wcf86:: ds 1
-wcf87:: ds 1
+wMenuData2Pointer:: ds 2
wMenuCursorBuffer:: ds 2
-wcf8a:: ds 7 ; menu data 2 bank?
+; end menu data header
+wMenuDataBank:: ds 1 ; menu data bank?
+ ds 6
+wMenuDataHeaderEnd::
-wMenuData2Flags:: ds 1
+wMenuData2::
+wMenuData2Flags:: ds 1 ; cf91
+; bit 7: When set, start printing text one tile to the right of the border
+; bit 6: When set, start printing text one tile below the border
+; bit 5: ????
+; bit 4: ????
+; bit 3: ????
+; bit 2: ????
+; bit 1: ????
+; bit 0: ????
+
wMenuData2Items:: ds 1
wcf93:: ds 1
wcf94:: ds 1
@@ -1276,12 +1288,14 @@
wcf98:: ds 3
wcf9b:: ds 3
wcf9e:: ds 3
+wMenuData2End::
wcfa1:: ds 1
+
wcfa2:: ds 1
wcfa3:: ds 1
wcfa4:: ds 1
-wcfa5:: ds 1
-wcfa6:: ds 1
+wcfa5:: ds 1 ; dynamic menu flags?
+wcfa6:: ds 1 ; dynamic menu flags?
wcfa7:: ds 1
wcfa8:: ds 1
MenuSelection2:: ds 1
@@ -1389,6 +1403,7 @@
MiscBuffer0::
wd000:: ds 1
MiscBuffer1::
+DefaultSpawnpoint::
wd001:: ds 1
wd002::
MiscBuffer2::