2013-12-17 21:23:50 -08:00
|
|
|
; Pic animation arrangement.
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unused_AnimateMon_Slow_Normal:
|
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
|
2018-01-16 11:30:10 -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
|
2018-01-16 11:30:10 -08:00
|
|
|
call AnimateFrontpic
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
AnimateMon_Menu:
|
2015-11-07 06:48:32 -08:00
|
|
|
ld e, ANIM_MON_MENU
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2018-01-16 11:30:10 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
AnimateMon_Trade:
|
2015-11-07 06:48:32 -08:00
|
|
|
ld e, ANIM_MON_TRADE
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2018-01-16 11:30:10 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
AnimateMon_Evolve:
|
2015-11-07 06:48:32 -08:00
|
|
|
ld e, ANIM_MON_EVOLVE
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2018-01-16 11:30:10 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
AnimateMon_Hatch:
|
2015-11-07 06:48:32 -08:00
|
|
|
ld e, ANIM_MON_HATCH
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2018-01-16 11:30:10 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
|
2018-07-22 20:42:50 -07:00
|
|
|
AnimateMon_HOF:
|
|
|
|
ld e, ANIM_MON_HOF
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, $0
|
2018-01-16 11:30:10 -08:00
|
|
|
call AnimateFrontpic
|
2014-07-24 12:02:58 -07:00
|
|
|
ret
|
|
|
|
|
2017-12-13 21:36:24 -08:00
|
|
|
pokeanim: MACRO
|
2018-05-06 09:16:57 -07:00
|
|
|
rept _NARG
|
2015-04-13 21:28:04 -07:00
|
|
|
; Workaround for a bug where macro args can't come after the start of a symbol
|
2017-12-28 18:22:35 -08:00
|
|
|
if !DEF(\1_POKEANIM)
|
2017-12-28 04:23:44 -08:00
|
|
|
\1_POKEANIM EQUS "PokeAnim_\1_"
|
2015-04-13 21:28:04 -07:00
|
|
|
endc
|
|
|
|
db (\1_POKEANIM - PokeAnim_SetupCommands) / 2
|
|
|
|
shift
|
2018-05-06 09:16:57 -07:00
|
|
|
endr
|
2015-04-13 21:28:04 -07:00
|
|
|
db (PokeAnim_Finish_ - PokeAnim_SetupCommands) / 2
|
|
|
|
ENDM
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnims:
|
2018-07-22 21:13:43 -07:00
|
|
|
; entries correspond to ANIM_MON_* constants
|
2015-04-13 21:28:04 -07:00
|
|
|
dw .Slow
|
|
|
|
dw .Normal
|
|
|
|
dw .Menu
|
|
|
|
dw .Trade
|
|
|
|
dw .Evolve
|
|
|
|
dw .Hatch
|
2018-07-22 20:42:50 -07:00
|
|
|
dw .HOF
|
2015-04-13 21:28:04 -07:00
|
|
|
dw .Egg1
|
|
|
|
dw .Egg2
|
|
|
|
|
2017-12-13 21:36:24 -08:00
|
|
|
.Slow: pokeanim StereoCry, Setup2, Play
|
|
|
|
.Normal: pokeanim StereoCry, Setup, Play
|
2017-12-28 08:05:42 -08:00
|
|
|
.Menu: pokeanim CryNoWait, Setup, Play, SetWait, Wait, Idle, Play
|
|
|
|
.Trade: pokeanim Idle, Play2, Idle, Play, SetWait, Wait, Cry, Setup, Play
|
|
|
|
.Evolve: pokeanim Idle, Play, SetWait, Wait, CryNoWait, Setup, Play
|
|
|
|
.Hatch: pokeanim Idle, Play, CryNoWait, Setup, Play, SetWait, Wait, Idle, Play
|
2018-07-22 20:42:50 -07:00
|
|
|
.HOF: pokeanim CryNoWait, Setup, Play, SetWait, Wait, Idle, Play
|
2017-12-13 21:36:24 -08:00
|
|
|
.Egg1: pokeanim Setup, Play
|
2017-12-28 08:05:42 -08:00
|
|
|
.Egg2: pokeanim Idle, Play
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
AnimateFrontpic:
|
2015-11-07 06:48:32 -08:00
|
|
|
call AnimateMon_CheckIfPokemon
|
2013-12-17 21:23:50 -08:00
|
|
|
ret c
|
2018-01-16 11:30:10 -08:00
|
|
|
call LoadMonAnimation
|
2015-11-07 06:48:32 -08:00
|
|
|
.loop
|
2015-12-17 10:49:26 -08:00
|
|
|
call SetUpPokeAnim
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall HDMATransferTileMapToWRAMBank3
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nc, .loop
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
LoadMonAnimation:
|
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
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, bc
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, bc
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld b, [hl]
|
|
|
|
ld c, a
|
|
|
|
pop hl
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_InitPicAttributes
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
SetUpPokeAnim:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
2018-07-22 21:37:48 -07:00
|
|
|
ld a, BANK(wPokeAnimStruct)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [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
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
|
|
|
and $80
|
|
|
|
ret z
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_SetupCommands:
|
2017-12-28 04:23:44 -08:00
|
|
|
setup_command: MACRO
|
2015-04-13 21:28:04 -07:00
|
|
|
\1_: dw \1
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-04-13 21:28:04 -07:00
|
|
|
setup_command PokeAnim_Finish
|
2016-05-15 20:56:09 -07:00
|
|
|
setup_command PokeAnim_BasePic
|
2015-04-13 21:28:04 -07:00
|
|
|
setup_command PokeAnim_SetWait
|
|
|
|
setup_command PokeAnim_Wait
|
|
|
|
setup_command PokeAnim_Setup
|
|
|
|
setup_command PokeAnim_Setup2
|
2017-12-28 08:05:42 -08:00
|
|
|
setup_command PokeAnim_Idle
|
2015-04-13 21:28:04 -07:00
|
|
|
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
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_SetWait:
|
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
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_Wait:
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_Setup:
|
2015-12-17 10:49:26 -08:00
|
|
|
ld c, FALSE
|
|
|
|
ld b, 0
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_InitAnim
|
|
|
|
call PokeAnim_SetVBank1
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_Setup2:
|
2015-12-17 10:49:26 -08:00
|
|
|
ld c, FALSE
|
|
|
|
ld b, 4
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_InitAnim
|
|
|
|
call PokeAnim_SetVBank1
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_Idle:
|
2015-12-17 10:49:26 -08:00
|
|
|
ld c, TRUE
|
|
|
|
ld b, 0
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_InitAnim
|
|
|
|
call PokeAnim_SetVBank1
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_Play:
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_DoAnimScript
|
|
|
|
ld a, [wPokeAnimJumptableIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
bit 7, a
|
|
|
|
ret z
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_PlaceGraphic
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_Play2:
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_DoAnimScript
|
|
|
|
ld a, [wPokeAnimJumptableIndex]
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_BasePic:
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_DeinitFrames
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_Finish:
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_DeinitFrames
|
2015-11-07 06:48:32 -08:00
|
|
|
ld hl, wPokeAnimSceneIndex
|
2013-12-17 21:23:50 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_Cry:
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpecies]
|
2018-01-16 20:47:45 -08:00
|
|
|
call _PlayMonCry
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_CryNoWait:
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpecies]
|
2018-01-16 20:47:45 -08:00
|
|
|
call PlayMonCry2
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_StereoCry:
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, $f
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCryTracks], 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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_DeinitFrames:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wPokeAnimCoord)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_PlaceGraphic
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall HDMATransferTileMapToWRAMBank3
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_SetVBank0
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall HDMATransferAttrMapToWRAMBank3
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
AnimateMon_CheckIfPokemon:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_InitPicAttributes:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
2018-07-22 21:37:48 -07:00
|
|
|
ld a, BANK(wPokeAnimStruct)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-07 06:48:32 -08:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push hl
|
2018-07-22 21:37:48 -07:00
|
|
|
ld hl, wPokeAnimStruct
|
|
|
|
ld bc, wPokeAnimStructEnd - wPokeAnimStruct
|
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
|
2018-01-30 11:05:25 -08:00
|
|
|
; 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
|
2016-05-15 20:56:09 -07:00
|
|
|
; d = start tile
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, d
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimGraphicStartTile], a
|
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, BANK(wCurPartySpecies)
|
|
|
|
ld hl, wCurPartySpecies
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarWRAMByte
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimSpecies], a
|
2016-05-15 20:56:09 -07:00
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, BANK(wUnownLetter)
|
|
|
|
ld hl, wUnownLetter
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarWRAMByte
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimUnownLetter], a
|
2016-05-15 20:56:09 -07:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_GetSpeciesOrUnown
|
|
|
|
ld [wPokeAnimSpeciesOrUnown], a
|
2016-05-15 20:56:09 -07:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_InitAnim:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
2017-12-28 08:05:42 -08:00
|
|
|
ld a, BANK(wPokeAnimIdleFlag)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 21:23:50 -08:00
|
|
|
push bc
|
2017-12-28 08:05:42 -08:00
|
|
|
ld hl, wPokeAnimIdleFlag
|
|
|
|
ld bc, wPokeAnimStructEnd - wPokeAnimIdleFlag
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimSpeed], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2017-12-28 08:05:42 -08:00
|
|
|
ld [wPokeAnimIdleFlag], a
|
2015-12-17 10:49:26 -08:00
|
|
|
call GetMonAnimPointer
|
|
|
|
call GetMonFramesPointer
|
|
|
|
call GetMonBitmaskPointer
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_DoAnimScript:
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2016-05-15 20:56:09 -07:00
|
|
|
.loop
|
|
|
|
ld a, [wPokeAnimJumptableIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
and $7f
|
2016-05-15 20:56:09 -07:00
|
|
|
ld hl, .Jumptable
|
2013-12-17 21:23:50 -08:00
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.Jumptable:
|
2016-05-15 20:56:09 -07:00
|
|
|
dw .RunAnim
|
|
|
|
dw .WaitAnim
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.RunAnim:
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_GetPointer
|
|
|
|
ld a, [wPokeAnimCommand]
|
2018-06-01 00:04:36 -07:00
|
|
|
cp endanim_command
|
2015-04-13 21:28:04 -07:00
|
|
|
jr z, PokeAnim_End
|
2018-06-01 00:04:36 -07:00
|
|
|
cp setrepeat_command
|
2016-05-15 20:56:09 -07:00
|
|
|
jr z, .SetRepeat
|
2018-06-01 00:04:36 -07:00
|
|
|
cp dorepeat_command
|
2016-05-15 20:56:09 -07:00
|
|
|
jr z, .DoRepeat
|
|
|
|
call PokeAnim_GetFrame
|
|
|
|
ld a, [wPokeAnimParameter]
|
|
|
|
call PokeAnim_GetDuration
|
2015-11-07 06:48:32 -08:00
|
|
|
ld [wPokeAnimWaitCounter], a
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_StartWaitAnim
|
2018-06-24 07:09:41 -07:00
|
|
|
.WaitAnim:
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_StopWaitAnim
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SetRepeat:
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimParameter]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPokeAnimRepeatTimer], a
|
2016-05-15 20:56:09 -07:00
|
|
|
jr .loop
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.DoRepeat:
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimParameter]
|
|
|
|
ld [wPokeAnimFrame], a
|
|
|
|
jr .loop
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_End:
|
2016-05-15 20:56:09 -07:00
|
|
|
ld hl, wPokeAnimJumptableIndex
|
2013-12-17 21:23:50 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_GetDuration:
|
2016-05-15 20:56:09 -07:00
|
|
|
; a * (1 + [wPokeAnimSpeed] / 16)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
|
|
|
ld b, $0
|
2015-11-02 11:37:02 -08:00
|
|
|
ld hl, 0
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimSpeed]
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_GetFrame:
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_PlaceGraphic
|
|
|
|
ld a, [wPokeAnimCommand]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
ret z
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_GetBitmaskIndex
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_CopyBitmaskToBuffer
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_ConvertAndApplyBitmask
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_StartWaitAnim:
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimJumptableIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimJumptableIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_StopWaitAnim:
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimJumptableIndex]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimJumptableIndex], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_IsUnown:
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpecies]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp UNOWN
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_IsEgg:
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimSpecies]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp EGG
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_GetPointer:
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimFrame]
|
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
|
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimPointerBank]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimCommand], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimParameter], a
|
|
|
|
ld hl, wPokeAnimFrame
|
2013-12-17 21:23:50 -08:00
|
|
|
inc [hl]
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_GetBitmaskIndex:
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimCommand]
|
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
|
|
|
|
add hl, bc
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, bc
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimCurBitmask], a
|
2013-12-17 21:23:50 -08:00
|
|
|
inc hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_CopyBitmaskToBuffer:
|
2016-05-15 20:56:09 -07:00
|
|
|
call .GetSize
|
2013-12-17 21:23:50 -08:00
|
|
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimCurBitmask]
|
2013-12-17 21:23:50 -08:00
|
|
|
call AddNTimes
|
|
|
|
pop bc
|
2016-05-15 20:56:09 -07:00
|
|
|
ld de, wPokeAnimBitmaskBuffer
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, [wPokeAnimBitmaskBank]
|
2013-12-17 21:23:50 -08:00
|
|
|
call FarCopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetSize:
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
2015-11-07 06:48:32 -08:00
|
|
|
ld a, [wPokeAnimFrontpicHeight]
|
2016-05-15 20:56:09 -07:00
|
|
|
sub 5 ; to get a number 0, 1, or 2
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
2016-05-15 20:56:09 -07:00
|
|
|
ld hl, .Sizes
|
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
|
|
|
|
|
2016-05-15 20:56:09 -07:00
|
|
|
.Sizes: db 4, 5, 7
|
|
|
|
|
|
|
|
poke_anim_box: MACRO
|
|
|
|
y = 7
|
|
|
|
rept \1
|
2018-02-02 19:55:38 -08:00
|
|
|
x = 7 + -\1
|
2016-05-15 20:56:09 -07:00
|
|
|
rept \1
|
|
|
|
db x + y
|
|
|
|
x = x + 1
|
|
|
|
endr
|
|
|
|
y = y + 7
|
|
|
|
endr
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_ConvertAndApplyBitmask:
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimBitmaskCurBit], a
|
|
|
|
ld [wPokeAnimBitmaskCurRow], a
|
|
|
|
ld [wPokeAnimBitmaskCurCol], a
|
2015-11-07 06:48:32 -08:00
|
|
|
.loop
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
2016-05-15 20:56:09 -07:00
|
|
|
call .IsCurBitSet
|
2013-12-17 21:23:50 -08:00
|
|
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
call .ApplyFrame
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.next
|
2013-12-17 21:23:50 -08:00
|
|
|
push hl
|
2016-05-15 20:56:09 -07:00
|
|
|
call .NextBit
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
2015-11-07 06:48:32 -08:00
|
|
|
jr nc, .loop
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.IsCurBitSet:
|
2016-05-15 20:56:09 -07:00
|
|
|
; which byte
|
|
|
|
ld a, [wPokeAnimBitmaskCurBit]
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld hl, wPokeAnimBitmaskBuffer
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ld b, [hl]
|
2016-05-15 20:56:09 -07:00
|
|
|
; which bit
|
|
|
|
ld a, [wPokeAnimBitmaskCurBit]
|
|
|
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
.loop2
|
2013-12-17 21:23:50 -08:00
|
|
|
rrca
|
|
|
|
dec c
|
2016-05-15 20:56:09 -07:00
|
|
|
jr nz, .loop2
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld hl, wPokeAnimBitmaskCurBit
|
2013-12-17 21:23:50 -08:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.ApplyFrame:
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
2016-05-15 20:56:09 -07:00
|
|
|
call .GetCoord
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
|
|
|
push hl
|
2016-05-15 20:56:09 -07:00
|
|
|
call .GetTilemap
|
|
|
|
ld hl, wPokeAnimGraphicStartTile
|
2013-12-17 21:23:50 -08:00
|
|
|
add [hl]
|
|
|
|
pop hl
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetCoord:
|
2016-05-15 20:56:09 -07:00
|
|
|
call .GetStartCoord
|
|
|
|
ld a, [wPokeAnimBitmaskCurRow]
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimBitmaskCurCol]
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
jr .skip2
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2015-11-07 06:48:32 -08:00
|
|
|
.go
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimBitmaskCurCol]
|
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
|
|
|
|
|
2016-05-15 20:56:09 -07:00
|
|
|
.skip2
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-01-02 04:24:05 -08:00
|
|
|
; unused
|
2016-05-15 20:56:09 -07:00
|
|
|
db 6, 5, 4
|
2013-12-17 21:23:50 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetTilemap:
|
2013-12-17 21:23:50 -08:00
|
|
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld hl, ._5by5
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld hl, ._6by6
|
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
|
|
|
|
|
2016-05-15 20:56:09 -07:00
|
|
|
._5by5:
|
|
|
|
poke_anim_box 5
|
2015-12-17 10:49:26 -08:00
|
|
|
; 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
|
|
|
|
2016-05-15 20:56:09 -07:00
|
|
|
._6by6:
|
|
|
|
poke_anim_box 6
|
2015-12-17 10:49:26 -08:00
|
|
|
; 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
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetStartCoord:
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld de, SCREEN_WIDTH + 1
|
|
|
|
ld bc, SCREEN_WIDTH + 5
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 6
|
2015-11-07 06:48:32 -08:00
|
|
|
jr z, .okay
|
2016-05-15 20:56:09 -07:00
|
|
|
ld de, 2 * SCREEN_WIDTH + 1
|
|
|
|
ld bc, 2 * SCREEN_WIDTH + 5
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.NextBit:
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimBitmaskCurRow]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimBitmaskCurRow], 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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimBitmaskCurRow], a
|
|
|
|
ld a, [wPokeAnimBitmaskCurCol]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2016-05-15 20:56:09 -07:00
|
|
|
ld [wPokeAnimBitmaskCurCol], 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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_PlaceGraphic:
|
2016-05-15 20:56:09 -07:00
|
|
|
call .ClearBox
|
2015-12-19 11:48:30 -08:00
|
|
|
ld a, [wBoxAlignment]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
2016-05-15 20:56:09 -07:00
|
|
|
jr nz, .flipped
|
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
|
|
|
|
2016-05-15 20:56:09 -07:00
|
|
|
.flipped
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
ld a, [wPokeAnimGraphicStartTile]
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.ClearBox:
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_SetVBank1:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wPokeAnimCoord)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 21:23:50 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2016-05-15 20:56:09 -07:00
|
|
|
call .SetFlag
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall HDMATransferAttrMapToWRAMBank3
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SetFlag:
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_GetAttrMapCoord
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 7
|
|
|
|
ld c, 7
|
2016-05-15 20:56:09 -07:00
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
.row
|
2013-12-17 21:23:50 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
2016-05-15 20:56:09 -07:00
|
|
|
.col
|
2013-12-17 21:23:50 -08:00
|
|
|
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
|
2016-05-15 20:56:09 -07:00
|
|
|
jr nz, .col
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec b
|
2016-05-15 20:56:09 -07:00
|
|
|
jr nz, .row
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_SetVBank0:
|
2016-05-15 20:56:09 -07:00
|
|
|
call PokeAnim_GetAttrMapCoord
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 7
|
|
|
|
ld c, 7
|
2016-05-15 20:56:09 -07:00
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
.row
|
2013-12-17 21:23:50 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
2016-05-15 20:56:09 -07:00
|
|
|
.col
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and $f7
|
|
|
|
ld [hl], a
|
|
|
|
add hl, de
|
|
|
|
dec c
|
2016-05-15 20:56:09 -07:00
|
|
|
jr nz, .col
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec b
|
2016-05-15 20:56:09 -07:00
|
|
|
jr nz, .row
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_GetAttrMapCoord:
|
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
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wAttrMap - wTileMap
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetMonAnimPointer:
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_IsEgg
|
2014-07-24 12:02:58 -07:00
|
|
|
jr z, .egg
|
|
|
|
|
2019-01-15 04:06:16 -08:00
|
|
|
ld c, BANK(UnownAnimationPointers) ; aka BANK(UnownAnimationIdlePointers)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, UnownAnimationPointers
|
2017-12-28 08:05:42 -08:00
|
|
|
ld de, UnownAnimationIdlePointers
|
2015-11-07 06:48:32 -08:00
|
|
|
call PokeAnim_IsUnown
|
|
|
|
jr z, .unown
|
2019-01-15 04:06:16 -08:00
|
|
|
ld c, BANK(AnimationPointers) ; aka BANK(AnimationIdlePointers)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, AnimationPointers
|
2017-12-28 08:05:42 -08:00
|
|
|
ld de, AnimationIdlePointers
|
2015-11-07 06:48:32 -08:00
|
|
|
.unown
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2017-12-28 08:05:42 -08:00
|
|
|
ld a, [wPokeAnimIdleFlag]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
2017-12-28 08:05:42 -08:00
|
|
|
jr z, .idles
|
2013-12-17 21:23:50 -08:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
2017-12-28 08:05:42 -08:00
|
|
|
.idles
|
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
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
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)
|
2017-12-28 08:05:42 -08:00
|
|
|
ld a, [wPokeAnimIdleFlag]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
2017-12-28 08:05:42 -08:00
|
|
|
jr z, .idles_egg
|
|
|
|
ld hl, EggAnimationIdle
|
|
|
|
ld c, BANK(EggAnimationIdle)
|
|
|
|
.idles_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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_GetFrontpicDims:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2013-12-17 21:23:50 -08:00
|
|
|
push af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, BANK(wCurPartySpecies)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
|
|
|
ld [wCurSpecies], a
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetBaseData
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBasePicSize]
|
2013-12-17 21:23:50 -08:00
|
|
|
and $f
|
|
|
|
ld c, a
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetMonFramesPointer:
|
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]
|
2018-01-14 17:58:49 -08:00
|
|
|
cp JOHTO_POKEMON
|
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
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetMonBitmaskPointer:
|
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
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PokeAnim_GetSpeciesOrUnown:
|
2015-11-07 06:48:32 -08:00
|
|
|
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
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unused_HOF_AnimateAlignedFrontpic:
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, $1
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2018-01-02 06:05:14 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
HOF_AnimateFrontpic:
|
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
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetAnimatedFrontpic
|
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
|
2018-01-16 11:30:10 -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
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|