2013-12-17 21:23:50 -08:00
|
|
|
; Pic animation arrangement.
|
|
|
|
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
AnimateMon_Slow_Normal: ; d0000
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 12, 0
|
2015-10-19 07:23:58 -07:00
|
|
|
ld a, [wBattleMode]
|
2015-11-07 06:48:32 -08:00
|
|
|
cp WILD_BATTLE
|
|
|
|
jr z, .wild
|
|
|
|
ld e, ANIM_MON_SLOW
|
2013-12-17 21:23:50 -08:00
|
|
|
ld d, $0
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateFrontpic
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.wild
|
|
|
|
ld e, ANIM_MON_NORMAL
|
2013-12-17 21:23:50 -08:00
|
|
|
ld d, $0
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateFrontpic
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d001a
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
AnimateMon_Menu: ; d001a
|
|
|
|
ld e, ANIM_MON_MENU
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
; d0022
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
AnimateMon_Trade: ; d0022
|
|
|
|
ld e, ANIM_MON_TRADE
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
; d002a
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
AnimateMon_Evolve: ; d002a
|
|
|
|
ld e, ANIM_MON_EVOLVE
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
; d0032
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
AnimateMon_Hatch: ; d0032
|
|
|
|
ld e, ANIM_MON_HATCH
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
; d003a
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
AnimateMon_Unused: ; d003a
|
|
|
|
ld e, ANIM_MON_UNUSED
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
; d0042
|
|
|
|
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
POKEANIM: MACRO
|
|
|
|
rept _NARG
|
|
|
|
|
|
|
|
; Workaround for a bug where macro args can't come after the start of a symbol
|
|
|
|
if !def(\1_POKEANIM)
|
|
|
|
\1_POKEANIM equs "PokeAnim_\1_"
|
|
|
|
endc
|
|
|
|
|
|
|
|
db (\1_POKEANIM - PokeAnim_SetupCommands) / 2
|
|
|
|
shift
|
|
|
|
endr
|
|
|
|
|
|
|
|
db (PokeAnim_Finish_ - PokeAnim_SetupCommands) / 2
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
|
|
|
|
PokeAnims: ; d0042
|
|
|
|
dw .Slow
|
|
|
|
dw .Normal
|
|
|
|
dw .Menu
|
|
|
|
dw .Trade
|
|
|
|
dw .Evolve
|
|
|
|
dw .Hatch
|
|
|
|
dw .Unused ; same as .Menu
|
|
|
|
dw .Egg1
|
|
|
|
dw .Egg2
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.Slow: POKEANIM StereoCry, Setup2, Play
|
|
|
|
.Normal: POKEANIM StereoCry, Setup, Play
|
|
|
|
.Menu: POKEANIM CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
|
2015-04-13 21:28:04 -07:00
|
|
|
.Trade: POKEANIM Extra, Play2, Extra, Play, SetWait, Wait, Cry, Setup, Play
|
2015-11-07 06:48:32 -08:00
|
|
|
.Evolve: POKEANIM Extra, Play, SetWait, Wait, CryNoWait, Setup, Play
|
|
|
|
.Hatch: POKEANIM Extra, Play, CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
|
|
|
|
.Unused: POKEANIM CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
|
2015-04-13 21:28:04 -07:00
|
|
|
.Egg1: POKEANIM Setup, Play
|
|
|
|
.Egg2: POKEANIM Extra, Play
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
AnimateFrontpic: ; d008e
|
|
|
|
call AnimateMon_CheckIfPokemon
|
2013-12-17 21:23:50 -08:00
|
|
|
ret c
|
2015-11-07 06:48:32 -08:00
|
|
|
call LoadMonAnimation
|
|
|
|
.loop
|
2015-12-17 10:49:26 -08:00
|
|
|
call SetUpPokeAnim
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
|
|
|
callba Function10402d
|
|
|
|
pop af
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nc, .loop
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d00a3
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
LoadMonAnimation: ; d00a3
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
|
|
|
ld c, e
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
2015-04-13 21:28:04 -07:00
|
|
|
ld hl, PokeAnims
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 2
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, bc
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld b, [hl]
|
|
|
|
ld c, a
|
|
|
|
pop hl
|
|
|
|
call Functiond01d6
|
|
|
|
ret
|
|
|
|
; d00b4
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
SetUpPokeAnim: ; d00b4
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
2015-11-07 06:48:32 -08:00
|
|
|
ld hl, wPokeAnimPointer
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-04-13 21:28:04 -07:00
|
|
|
ld hl, PokeAnim_SetupCommands
|
2013-12-17 21:23:50 -08:00
|
|
|
rst JumpTable
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, c
|
|
|
|
and $80
|
|
|
|
ret z
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; d00da
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_SetupCommands: ; d00da
|
|
|
|
setup_command: macro
|
|
|
|
\1_: dw \1
|
|
|
|
endm
|
|
|
|
setup_command PokeAnim_Finish
|
|
|
|
setup_command PokeAnim_Nop
|
|
|
|
setup_command PokeAnim_SetWait
|
|
|
|
setup_command PokeAnim_Wait
|
|
|
|
setup_command PokeAnim_Setup
|
|
|
|
setup_command PokeAnim_Setup2
|
|
|
|
setup_command PokeAnim_Extra
|
|
|
|
setup_command PokeAnim_Play
|
|
|
|
setup_command PokeAnim_Play2
|
|
|
|
setup_command PokeAnim_Cry
|
2015-11-07 06:48:32 -08:00
|
|
|
setup_command PokeAnim_CryNoWait
|
|
|
|
setup_command PokeAnim_StereoCry
|
2013-12-17 21:23:50 -08:00
|
|
|
; d00f2
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_SetWait: ; d00f2
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, 18
|
|
|
|
ld [wPokeAnimWaitCounter], a
|
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Wait: ; d00fe
|
2015-11-07 06:48:32 -08:00
|
|
|
ld hl, wPokeAnimWaitCounter
|
2013-12-17 21:23:50 -08:00
|
|
|
dec [hl]
|
|
|
|
ret nz
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d010b
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Setup: ; d010b
|
2015-12-17 10:49:26 -08:00
|
|
|
ld c, FALSE
|
|
|
|
ld b, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond0228
|
|
|
|
call Functiond0504
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d011d
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Setup2: ; d011d
|
2015-12-17 10:49:26 -08:00
|
|
|
ld c, FALSE
|
|
|
|
ld b, 4
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond0228
|
|
|
|
call Functiond0504
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d012f
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Extra: ; d012f
|
2015-12-17 10:49:26 -08:00
|
|
|
ld c, TRUE
|
|
|
|
ld b, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond0228
|
|
|
|
call Functiond0504
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0141
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Play: ; d0141
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond0250
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
call Functiond04bd
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0155
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Play2: ; d0155
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond0250
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
bit 7, a
|
|
|
|
ret z
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0166
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Nop: ; d0166
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond01a9
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0171
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Finish: ; d0171
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond01a9
|
2015-11-07 06:48:32 -08:00
|
|
|
ld hl, wPokeAnimSceneIndex
|
2013-12-17 21:23:50 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
; d017a
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_Cry: ; d017a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpecies]
|
2014-07-18 10:25:03 -07:00
|
|
|
call _PlayCry
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0188
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
PokeAnim_CryNoWait: ; d0188
|
|
|
|
ld a, [wPokeAnimSpecies]
|
2014-07-18 10:25:03 -07:00
|
|
|
call PlayCry2
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0196
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
PokeAnim_StereoCry: ; d0196
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, $f
|
|
|
|
ld [CryTracks], a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpecies]
|
2014-07-18 10:25:03 -07:00
|
|
|
call PlayStereoCry2
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSceneIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSceneIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d01a9
|
|
|
|
|
|
|
|
Functiond01a9: ; d01a9
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
|
|
|
call Functiond04bd
|
|
|
|
callba Function10402d
|
|
|
|
call Functiond0536
|
|
|
|
callba Function104047
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d01c6
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
AnimateMon_CheckIfPokemon: ; d01c6
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [CurPartySpecies]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp EGG
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .fail
|
2013-12-17 21:23:50 -08:00
|
|
|
call IsAPokemon
|
2015-11-07 06:48:32 -08:00
|
|
|
jr c, .fail
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.fail
|
2013-12-17 21:23:50 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; d01d6
|
|
|
|
|
|
|
|
Functiond01d6: ; d01d6
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
2015-11-07 06:48:32 -08:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push hl
|
2015-11-07 06:48:32 -08:00
|
|
|
ld hl, wPokeAnimSceneIndex
|
|
|
|
ld bc, wPokeAnimStructEnd - wPokeAnimSceneIndex
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
pop bc
|
2015-11-07 06:48:32 -08:00
|
|
|
|
|
|
|
; bc contains anim pointer
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimPointer], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, b
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimPointer + 1], a
|
|
|
|
; hl contains TileMap coords
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, l
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimCoord], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimCoord + 1], a
|
|
|
|
; d = ?????
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, d
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d16e], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, $1
|
|
|
|
ld hl, CurPartySpecies
|
|
|
|
call GetFarWRAMByte
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSpecies], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, $1
|
|
|
|
ld hl, UnownLetter
|
|
|
|
call GetFarWRAMByte
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimUnownLetter], a
|
|
|
|
call PokeAnim_GetSpeciesOrUnown
|
|
|
|
ld [wPokeAnimSpeciesOrUnown], a
|
|
|
|
call PokeAnim_GetFrontpicDims
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimFrontpicHeight], a
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d0228
|
|
|
|
|
|
|
|
Functiond0228: ; d0228
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
|
|
|
push bc
|
2015-12-17 10:49:26 -08:00
|
|
|
ld hl, wPokeAnimExtraFlag
|
|
|
|
ld bc, wPokeAnimStructEnd - wPokeAnimExtraFlag
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
2015-04-13 21:28:04 -07:00
|
|
|
ld [w2_d173], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimExtraFlag], a
|
|
|
|
call GetMonAnimPointer
|
|
|
|
call GetMonFramesPointer
|
|
|
|
call GetMonBitmaskPointer
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d0250
|
|
|
|
|
|
|
|
Functiond0250: ; d0250
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
|
|
|
Functiond0253: ; d0253
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
and $7f
|
|
|
|
ld hl, Tabled025d
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
; d025d
|
|
|
|
|
|
|
|
Tabled025d: ; d025d
|
|
|
|
dw Functiond0261
|
|
|
|
dw Functiond0282
|
|
|
|
; d0261
|
|
|
|
|
|
|
|
Functiond0261: ; d0261
|
|
|
|
call Functiond02f8
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d182]
|
2013-12-17 21:23:50 -08:00
|
|
|
cp $ff
|
2015-04-13 21:28:04 -07:00
|
|
|
jr z, PokeAnim_End
|
2013-12-17 21:23:50 -08:00
|
|
|
cp $fe
|
2015-04-13 21:28:04 -07:00
|
|
|
jr z, PokeAnim_SetRepeat
|
2013-12-17 21:23:50 -08:00
|
|
|
cp $fd
|
2015-04-13 21:28:04 -07:00
|
|
|
jr z, PokeAnim_DoRepeat
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond02c8
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d183]
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond02ae
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimWaitCounter], a
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond02dc
|
|
|
|
|
|
|
|
Functiond0282: ; d0282
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimWaitCounter]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimWaitCounter], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret nz
|
|
|
|
call Functiond02e4
|
|
|
|
ret
|
|
|
|
; d028e
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_SetRepeat: ; d028e
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d183]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimRepeatTimer], a
|
2013-12-17 21:23:50 -08:00
|
|
|
jr Functiond0253
|
|
|
|
; d0296
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_DoRepeat: ; d0296
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimRepeatTimer]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
dec a
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimRepeatTimer], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret z
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d183]
|
|
|
|
ld [w2_d17d], a
|
2013-12-17 21:23:50 -08:00
|
|
|
jr Functiond0253
|
|
|
|
; d02a8
|
|
|
|
|
2015-04-13 21:28:04 -07:00
|
|
|
PokeAnim_End: ; d02a8
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d17e
|
2013-12-17 21:23:50 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
; d02ae
|
|
|
|
|
|
|
|
Functiond02ae: ; d02ae
|
|
|
|
ld c, a
|
|
|
|
ld b, $0
|
2015-11-02 11:37:02 -08:00
|
|
|
ld hl, 0
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d173]
|
2013-12-17 21:23:50 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld a, h
|
|
|
|
swap a
|
|
|
|
and $f0
|
|
|
|
ld h, a
|
|
|
|
ld a, l
|
|
|
|
swap a
|
|
|
|
and $f
|
|
|
|
or h
|
|
|
|
add c
|
|
|
|
ret
|
|
|
|
; d02c8
|
|
|
|
|
|
|
|
Functiond02c8: ; d02c8
|
|
|
|
call Functiond04bd
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d182]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
call Functiond031b
|
|
|
|
push hl
|
|
|
|
call Functiond033b
|
|
|
|
pop hl
|
|
|
|
call Functiond036b
|
|
|
|
ret
|
|
|
|
; d02dc
|
|
|
|
|
|
|
|
Functiond02dc: ; d02dc
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17e], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d02e4
|
|
|
|
|
|
|
|
Functiond02e4: ; d02e4
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17e], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d02ec
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
PokeAnim_IsUnown: ; d02ec
|
|
|
|
ld a, [wPokeAnimSpecies]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp UNOWN
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d02f2
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
PokeAnim_IsEgg: ; d02f2
|
|
|
|
ld a, [wPokeAnimSpecies]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp EGG
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d02f8
|
|
|
|
|
|
|
|
Functiond02f8: ; d02f8
|
|
|
|
push hl
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17d]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
|
|
|
ld d, $0
|
2015-12-17 10:49:26 -08:00
|
|
|
ld hl, wPokeAnimPointerAddr
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 2
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimPointerBank]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d182], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d183], a
|
|
|
|
ld hl, w2_d17d
|
2013-12-17 21:23:50 -08:00
|
|
|
inc [hl]
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; d031b
|
|
|
|
|
|
|
|
Functiond031b: ; d031b
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d182]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, $0
|
2015-12-17 10:49:26 -08:00
|
|
|
ld hl, wPokeAnimFramesAddr
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 2
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, bc
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimFramesBank]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimFramesBank]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarByte
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d180], a
|
2013-12-17 21:23:50 -08:00
|
|
|
inc hl
|
|
|
|
ret
|
|
|
|
; d033b
|
|
|
|
|
|
|
|
Functiond033b: ; d033b
|
|
|
|
call Functiond0356
|
|
|
|
push bc
|
2015-12-17 10:49:26 -08:00
|
|
|
ld hl, wPokeAnimBitmaskAddr
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d180]
|
2013-12-17 21:23:50 -08:00
|
|
|
call AddNTimes
|
|
|
|
pop bc
|
2015-02-10 15:14:21 -08:00
|
|
|
ld de, w2_d188
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimBitmaskBank]
|
2013-12-17 21:23:50 -08:00
|
|
|
call FarCopyBytes
|
|
|
|
ret
|
|
|
|
; d0356
|
|
|
|
|
|
|
|
Functiond0356: ; d0356
|
|
|
|
push hl
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimFrontpicHeight]
|
2014-07-24 12:02:58 -07:00
|
|
|
sub 5
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
|
|
|
ld hl, Unknown_d0368
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, bc
|
|
|
|
ld c, [hl]
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; d0368
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
Unknown_d0368: db 4, 5, 7
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond036b: ; d036b
|
|
|
|
xor a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d187], a
|
|
|
|
ld [w2_d186], a
|
|
|
|
ld [w2_d185], a
|
2015-11-07 06:48:32 -08:00
|
|
|
.loop
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
|
|
|
call Functiond0392
|
|
|
|
pop hl
|
|
|
|
ld a, b
|
|
|
|
and a
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .next
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimFramesBank]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarByte
|
|
|
|
inc hl
|
|
|
|
push hl
|
|
|
|
call Functiond03bd
|
|
|
|
pop hl
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.next
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
|
|
|
call Functiond0499
|
|
|
|
pop hl
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nc, .loop
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0392
|
|
|
|
|
|
|
|
Functiond0392: ; d0392
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d187]
|
2013-12-17 21:23:50 -08:00
|
|
|
and $f8
|
|
|
|
rrca
|
|
|
|
rrca
|
|
|
|
rrca
|
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d188
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ld b, [hl]
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d187]
|
2014-07-24 12:02:58 -07:00
|
|
|
and 7
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .skip
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
|
|
|
ld a, b
|
2015-11-07 06:48:32 -08:00
|
|
|
.loop
|
2013-12-17 21:23:50 -08:00
|
|
|
rrca
|
|
|
|
dec c
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 21:23:50 -08:00
|
|
|
ld b, a
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.skip
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
|
|
|
bit 0, b
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .finish
|
2014-07-24 12:02:58 -07:00
|
|
|
ld a, 1
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.finish
|
2013-12-17 21:23:50 -08:00
|
|
|
ld b, a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d187
|
2013-12-17 21:23:50 -08:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
; d03bd
|
|
|
|
|
|
|
|
Functiond03bd: ; d03bd
|
|
|
|
push af
|
|
|
|
call Functiond03cd
|
|
|
|
pop af
|
|
|
|
push hl
|
|
|
|
call Functiond03f7
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d16e
|
2013-12-17 21:23:50 -08:00
|
|
|
add [hl]
|
|
|
|
pop hl
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
; d03cd
|
|
|
|
|
|
|
|
Functiond03cd: ; d03cd
|
|
|
|
call Functiond046c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d186]
|
2015-11-07 06:48:32 -08:00
|
|
|
ld bc, SCREEN_WIDTH
|
2013-12-17 21:23:50 -08:00
|
|
|
call AddNTimes
|
2015-12-19 11:48:30 -08:00
|
|
|
ld a, [wBoxAlignment]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nz, .go
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d185]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
2015-11-07 06:48:32 -08:00
|
|
|
jr .skip
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.go
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d185]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
|
|
|
ld a, l
|
|
|
|
sub e
|
|
|
|
ld l, a
|
|
|
|
ld a, h
|
2014-07-24 12:02:58 -07:00
|
|
|
sbc 0
|
2013-12-17 21:23:50 -08:00
|
|
|
ld h, a
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.skip
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d03f4
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
Unknown_d03f4: db 6, 5, 4
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond03f7: ; d03f7
|
|
|
|
push af
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimFrontpicHeight]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 5
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .check_add_24
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 6
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .check_add_13
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.check_add_24
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 5 * 5
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nc, .add_24
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
|
|
|
push de
|
2014-07-24 12:02:58 -07:00
|
|
|
ld hl, Unknown_d042f
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.add_24
|
2014-07-24 12:02:58 -07:00
|
|
|
add 24
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.check_add_13
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 6 * 6
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nc, .add_13
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
|
|
|
push de
|
2014-07-24 12:02:58 -07:00
|
|
|
ld hl, Unknown_d0448
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.add_13
|
2014-07-24 12:02:58 -07:00
|
|
|
add 13
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d042f
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
macro_d042f: MACRO
|
|
|
|
y = 7
|
|
|
|
rept 7 +- \1
|
|
|
|
x = \1
|
|
|
|
rept 7 +- \1
|
|
|
|
db x + y
|
|
|
|
x = x + 1
|
|
|
|
endr
|
|
|
|
y = y + 7
|
|
|
|
endr
|
|
|
|
endm
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
Unknown_d042f:
|
2015-12-17 10:49:26 -08:00
|
|
|
macro_d042f 2
|
|
|
|
; db 9, 10, 11, 12, 13
|
|
|
|
; db 16, 17, 18, 19, 20
|
|
|
|
; db 23, 24, 25, 26, 27
|
|
|
|
; db 30, 31, 32, 33, 34
|
|
|
|
; db 37, 38, 39, 40, 41
|
2014-07-24 12:02:58 -07:00
|
|
|
|
|
|
|
Unknown_d0448:
|
2015-12-17 10:49:26 -08:00
|
|
|
macro_d042f 1
|
|
|
|
; db 8, 9, 10, 11, 12, 13
|
|
|
|
; db 15, 16, 17, 18, 19, 20
|
|
|
|
; db 22, 23, 24, 25, 26, 27
|
|
|
|
; db 29, 30, 31, 32, 33, 34
|
|
|
|
; db 36, 37, 38, 39, 40, 41
|
|
|
|
; db 43, 44, 45, 46, 47, 48
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond046c: ; d046c
|
2015-11-07 06:48:32 -08:00
|
|
|
ld hl, wPokeAnimCoord
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimFrontpicHeight]
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, 0
|
|
|
|
ld bc, 6
|
|
|
|
cp 7
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .okay
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, 21
|
|
|
|
ld bc, 25
|
|
|
|
cp 6
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .okay
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, 41
|
|
|
|
ld bc, 45
|
2015-11-07 06:48:32 -08:00
|
|
|
.okay
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-12-19 11:48:30 -08:00
|
|
|
ld a, [wBoxAlignment]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nz, .add_bc
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.add_bc
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
; d0499
|
|
|
|
|
|
|
|
Functiond0499: ; d0499
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d186]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d186], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimFrontpicHeight]
|
2013-12-17 21:23:50 -08:00
|
|
|
cp c
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nz, .no_carry
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d186], a
|
|
|
|
ld a, [w2_d185]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d185], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimFrontpicHeight]
|
2013-12-17 21:23:50 -08:00
|
|
|
cp c
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nz, .no_carry
|
2013-12-17 21:23:50 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.no_carry
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; d04bd
|
|
|
|
|
|
|
|
Functiond04bd: ; d04bd
|
|
|
|
call Functiond04f6
|
2015-12-19 11:48:30 -08:00
|
|
|
ld a, [wBoxAlignment]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nz, .minus_one_and_six
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, 1
|
|
|
|
ld bc, 0
|
2015-11-07 06:48:32 -08:00
|
|
|
jr .okay
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.minus_one_and_six
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, -1
|
|
|
|
ld bc, 6
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.okay
|
|
|
|
ld hl, wPokeAnimCoord
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, bc
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, 7
|
|
|
|
ld b, 7
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16e]
|
2015-11-07 06:48:32 -08:00
|
|
|
.loop
|
2013-12-17 21:23:50 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
push de
|
2015-11-07 06:48:32 -08:00
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
.loop2
|
2013-12-17 21:23:50 -08:00
|
|
|
ld [hl], a
|
|
|
|
inc a
|
|
|
|
add hl, de
|
|
|
|
dec b
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nz, .loop2
|
2013-12-17 21:23:50 -08:00
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
add hl, de
|
|
|
|
pop bc
|
|
|
|
dec c
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d04f6
|
|
|
|
|
|
|
|
Functiond04f6: ; d04f6
|
2015-11-07 06:48:32 -08:00
|
|
|
ld hl, wPokeAnimCoord
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 7
|
|
|
|
ld c, 7
|
2013-12-17 21:23:50 -08:00
|
|
|
call ClearBox
|
|
|
|
ret
|
|
|
|
; d0504
|
|
|
|
|
|
|
|
Functiond0504: ; d0504
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
call Functiond051b
|
|
|
|
callba Function104047
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d051b
|
|
|
|
|
|
|
|
Functiond051b: ; d051b
|
|
|
|
call Functiond0551
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 7
|
|
|
|
ld c, 7
|
2013-12-17 21:23:50 -08:00
|
|
|
ld de, $0014
|
|
|
|
.asm_d0525
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
.asm_d0527
|
|
|
|
ld a, [hl]
|
2014-07-24 12:02:58 -07:00
|
|
|
or 8
|
2013-12-17 21:23:50 -08:00
|
|
|
ld [hl], a
|
|
|
|
add hl, de
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_d0527
|
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_d0525
|
|
|
|
ret
|
|
|
|
; d0536
|
|
|
|
|
|
|
|
Functiond0536: ; d0536
|
|
|
|
call Functiond0551
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 7
|
|
|
|
ld c, 7
|
2013-12-17 21:23:50 -08:00
|
|
|
ld de, $0014
|
|
|
|
.asm_d0540
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
.asm_d0542
|
|
|
|
ld a, [hl]
|
|
|
|
and $f7
|
|
|
|
ld [hl], a
|
|
|
|
add hl, de
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_d0542
|
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_d0540
|
|
|
|
ret
|
|
|
|
; d0551
|
|
|
|
|
|
|
|
Functiond0551: ; d0551
|
2015-11-07 06:48:32 -08:00
|
|
|
ld hl, wPokeAnimCoord
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2014-08-22 20:41:57 -07:00
|
|
|
ld de, AttrMap - TileMap
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ret
|
|
|
|
; d055c
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
GetMonAnimPointer: ; d055c
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_IsEgg
|
2014-07-24 12:02:58 -07:00
|
|
|
jr z, .egg
|
|
|
|
|
|
|
|
ld c, BANK(UnownAnimations)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, UnownAnimationPointers
|
|
|
|
ld de, UnownAnimationExtraPointers
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_IsUnown
|
|
|
|
jr z, .unown
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, BANK(PicAnimations)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, AnimationPointers
|
|
|
|
ld de, AnimationExtraPointers
|
2015-11-07 06:48:32 -08:00
|
|
|
.unown
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimExtraFlag]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
2015-12-17 10:49:26 -08:00
|
|
|
jr z, .extras
|
2013-12-17 21:23:50 -08:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
2015-12-17 10:49:26 -08:00
|
|
|
.extras
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpeciesOrUnown]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 2
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimPointerBank], a
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimPointerAddr], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimPointerAddr + 1], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
.egg
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, EggAnimation
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, BANK(EggAnimation)
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimExtraFlag]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
2015-12-17 10:49:26 -08:00
|
|
|
jr z, .extras_egg
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, EggAnimationExtra
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, BANK(EggAnimationExtra)
|
2015-12-17 10:49:26 -08:00
|
|
|
.extras_egg
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimPointerBank], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, l
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimPointerAddr], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimPointerAddr + 1], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d05b4
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
PokeAnim_GetFrontpicDims: ; d05b4
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $1
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
ld [CurSpecies], a
|
|
|
|
call GetBaseData
|
|
|
|
ld a, [BasePicSize]
|
|
|
|
and $f
|
|
|
|
ld c, a
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d05ce
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
GetMonFramesPointer: ; d05ce
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_IsEgg
|
2014-07-24 12:02:58 -07:00
|
|
|
jr z, .egg
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_IsUnown
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, BANK(UnownFramesPointers)
|
|
|
|
ld c, BANK(UnownsFrames)
|
|
|
|
ld hl, UnownFramesPointers
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .got_frames
|
|
|
|
ld a, [wPokeAnimSpecies]
|
2015-12-17 10:49:26 -08:00
|
|
|
cp CHIKORITA
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, BANK(FramesPointers)
|
|
|
|
ld c, BANK(KantoFrames)
|
|
|
|
ld hl, FramesPointers
|
2015-11-07 06:48:32 -08:00
|
|
|
jr c, .got_frames
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, BANK(JohtoFrames)
|
2015-11-07 06:48:32 -08:00
|
|
|
.got_frames
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimFramesBank], a
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpeciesOrUnown]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 2
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, b
|
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimFramesAddr], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimFramesAddr + 1], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
.egg
|
|
|
|
ld hl, EggFrames
|
|
|
|
ld c, BANK(EggFrames)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimFramesBank], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, l
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimFramesAddr], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimFramesAddr + 1], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d061b
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
GetMonBitmaskPointer: ; d061b
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_IsEgg
|
2014-07-24 12:02:58 -07:00
|
|
|
jr z, .egg
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_IsUnown
|
2014-07-24 12:02:58 -07:00
|
|
|
ld a, BANK(UnownBitmasksPointers)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, UnownBitmasksPointers
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .unown
|
2014-07-24 12:02:58 -07:00
|
|
|
ld a, BANK(BitmasksPointers)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, BitmasksPointers
|
2015-11-07 06:48:32 -08:00
|
|
|
.unown
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimBitmaskBank], a
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpeciesOrUnown]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 2
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimBitmaskBank]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimBitmaskAddr], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimBitmaskAddr + 1], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
.egg
|
|
|
|
ld c, BANK(EggBitmasks)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, EggBitmasks
|
|
|
|
ld a, c
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimBitmaskBank], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, l
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimBitmaskAddr], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimBitmaskAddr + 1], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d065c
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
PokeAnim_GetSpeciesOrUnown: ; d065c
|
|
|
|
call PokeAnim_IsUnown
|
|
|
|
jr z, .unown
|
|
|
|
ld a, [wPokeAnimSpecies]
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.unown
|
|
|
|
ld a, [wPokeAnimUnownLetter]
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0669
|
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
Functiond0669: ; d0669 Predef 48
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, $1
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
HOF_AnimateFrontpic: ; d066e Predef 49
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateMon_CheckIfPokemon
|
2016-01-12 09:46:18 -08:00
|
|
|
jr c, .fail
|
2013-12-17 21:23:50 -08:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
ld de, VTiles2
|
2015-11-20 12:15:32 -08:00
|
|
|
predef FrontpicPredef
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
|
|
|
pop bc
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, c
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateFrontpic
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
.fail
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ret
|
|
|
|
; d0695
|