2023-09-24 06:06:19 -07:00
|
|
|
DoSpriteAnimFrame:
|
2015-12-01 18:54:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
|
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
ld d, 0
|
|
|
|
ld hl, .Jumptable
|
|
|
|
add hl, de
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, de
|
2015-12-01 18:54:11 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-17 16:14:55 -07:00
|
|
|
jp hl
|
2015-12-01 18:54:11 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.Jumptable:
|
2023-09-24 06:06:19 -07:00
|
|
|
; entries correspond to SPRITE_ANIM_FUNC_* constants (see constants/sprite_anim_constants.asm)
|
|
|
|
table_width 2, DoSpriteAnimFrame.Jumptable
|
|
|
|
dw SpriteAnimFunc_Null
|
|
|
|
dw SpriteAnimFunc_PartyMon
|
|
|
|
dw SpriteAnimFunc_PartyMonSwitch
|
|
|
|
dw SpriteAnimFunc_PartyMonSelected
|
|
|
|
dw SpriteAnimFunc_GSTitleTrail
|
|
|
|
dw SpriteAnimFunc_NamingScreenCursor
|
|
|
|
dw SpriteAnimFunc_GameFreakLogo
|
|
|
|
dw SpriteAnimFunc_GSGameFreakLogoStar
|
|
|
|
dw SpriteAnimFunc_GSGameFreakLogoSparkle
|
|
|
|
dw SpriteAnimFunc_SlotsGolem
|
|
|
|
dw SpriteAnimFunc_SlotsChansey
|
|
|
|
dw SpriteAnimFunc_SlotsChanseyEgg
|
|
|
|
dw SpriteAnimFunc_MailCursor
|
|
|
|
dw SpriteAnimFunc_UnusedCursor
|
|
|
|
dw SpriteAnimFunc_MemoryGameCursor
|
|
|
|
dw SpriteAnimFunc_PokegearArrow
|
|
|
|
dw SpriteAnimFunc_TradePokeBall
|
|
|
|
dw SpriteAnimFunc_TradeTubeBulge
|
|
|
|
dw SpriteAnimFunc_TrademonInTube
|
|
|
|
dw SpriteAnimFunc_RevealNewMon
|
|
|
|
dw SpriteAnimFunc_RadioTuningKnob
|
|
|
|
dw SpriteAnimFunc_CutLeaves
|
|
|
|
dw SpriteAnimFunc_FlyFrom
|
|
|
|
dw SpriteAnimFunc_FlyLeaf
|
|
|
|
dw SpriteAnimFunc_FlyTo
|
|
|
|
dw SpriteAnimFunc_GSIntroHoOhLugia
|
|
|
|
dw SpriteAnimFunc_EZChatCursor
|
|
|
|
dw SpriteAnimFunc_MobileTradeSentPulse
|
|
|
|
dw SpriteAnimFunc_MobileTradeOTPulse
|
|
|
|
dw SpriteAnimFunc_IntroSuicune
|
|
|
|
dw SpriteAnimFunc_IntroPichuWooper
|
|
|
|
dw SpriteAnimFunc_Celebi
|
|
|
|
dw SpriteAnimFunc_IntroUnown
|
|
|
|
dw SpriteAnimFunc_IntroUnownF
|
|
|
|
dw SpriteAnimFunc_IntroSuicuneAway
|
|
|
|
dw SpriteAnimFunc_LevelSelectionMenuWalkDown
|
|
|
|
dw SpriteAnimFunc_LevelSelectionMenuWalkUp
|
|
|
|
dw SpriteAnimFunc_LevelSelectionMenuWalkLeft
|
|
|
|
dw SpriteAnimFunc_LevelSelectionMenuWalkRight
|
2023-09-26 11:09:13 -07:00
|
|
|
dw SpriteAnimFunc_BoardMenuMoveDieNumber
|
2023-09-24 06:06:19 -07:00
|
|
|
assert_table_length NUM_SPRITE_ANIM_FUNCS
|
|
|
|
|
|
|
|
SpriteAnimFunc_Null:
|
|
|
|
ret
|
|
|
|
|
|
|
|
SpriteAnimFunc_PartyMon:
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
cp [hl]
|
2023-09-24 06:06:19 -07:00
|
|
|
jr z, SpriteAnimFunc_PartyMonSwitch
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
2015-12-06 19:36:09 -08:00
|
|
|
ld [hl], 8 * 2
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
2020-06-17 07:39:17 -07:00
|
|
|
ld [hl], 0
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_PartyMonSwitch:
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
2015-12-06 19:36:09 -08:00
|
|
|
ld [hl], 8 * 3
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, a
|
|
|
|
inc [hl]
|
|
|
|
and $f
|
|
|
|
ret nz
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, d
|
|
|
|
and $10 ; bit 4
|
2015-12-26 15:11:55 -08:00
|
|
|
jr z, .load_zero
|
2015-12-01 18:54:11 -08:00
|
|
|
ld a, e
|
|
|
|
and a
|
2015-12-06 19:36:09 -08:00
|
|
|
jr z, .load_minus_two
|
2015-12-01 18:54:11 -08:00
|
|
|
cp $1
|
2015-12-06 19:36:09 -08:00
|
|
|
jr z, .load_minus_one
|
2015-12-26 15:11:55 -08:00
|
|
|
.load_zero
|
2015-12-01 18:54:11 -08:00
|
|
|
xor a
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2015-12-06 19:36:09 -08:00
|
|
|
.load_minus_one
|
|
|
|
ld a, -1
|
2015-12-01 18:54:11 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2015-12-06 19:36:09 -08:00
|
|
|
.load_minus_two
|
|
|
|
ld a, -2
|
2015-12-01 18:54:11 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_PartyMonSelected:
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
cp [hl]
|
2015-12-06 19:36:09 -08:00
|
|
|
jr z, .three_offset_right
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
2015-12-06 19:36:09 -08:00
|
|
|
ld [hl], 8 * 2
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2015-12-06 19:36:09 -08:00
|
|
|
.three_offset_right
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
2015-12-06 19:36:09 -08:00
|
|
|
ld [hl], 8 * 3
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_GSTitleTrail:
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_AnonJumptable
|
2017-06-17 16:14:55 -07:00
|
|
|
jp hl
|
2020-10-22 07:54:53 -07:00
|
|
|
.anon_dw
|
|
|
|
dw .zero
|
|
|
|
dw .one
|
2015-12-01 18:54:11 -08:00
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.zero
|
|
|
|
call AnimSeqs_IncAnonJumptableIndex
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
and $3
|
|
|
|
ld [hl], a
|
|
|
|
inc [hl]
|
|
|
|
swap a
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.one
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $a4
|
2020-10-22 07:54:53 -07:00
|
|
|
jr nc, .delete
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
2020-10-22 07:54:53 -07:00
|
|
|
add 4
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
sla a
|
|
|
|
sla a
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-04 09:09:09 -07:00
|
|
|
ld d, 2
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2020-08-04 09:09:09 -07:00
|
|
|
add 3
|
2015-12-01 18:54:11 -08:00
|
|
|
ld [hl], a
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.delete
|
2015-12-04 05:46:11 -08:00
|
|
|
call DeinitializeSprite
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_GSIntroHoOhLugia:
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
2020-08-04 09:09:09 -07:00
|
|
|
ld d, 2
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_NamingScreenCursor:
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar NamingScreen_AnimateCursor
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_MailCursor:
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar ComposeMail_AnimateCursor
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_GameFreakLogo:
|
2020-08-22 06:49:21 -07:00
|
|
|
callfar GameFreakLogoSpriteAnim
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_GSGameFreakLogoStar:
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2020-10-22 07:54:53 -07:00
|
|
|
jr z, .delete
|
|
|
|
|
2015-12-01 18:54:11 -08:00
|
|
|
dec [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
dec [hl]
|
2015-12-01 18:54:11 -08:00
|
|
|
ld d, a
|
|
|
|
and $1f
|
2020-10-22 07:54:53 -07:00
|
|
|
jr nz, .stay
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
2020-10-22 07:54:53 -07:00
|
|
|
|
|
|
|
.stay
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
push de
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
pop de
|
|
|
|
pop af
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Cosine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.delete
|
2020-06-17 07:39:17 -07:00
|
|
|
ld a, 1
|
|
|
|
ld [wIntroSceneFrameCounter], a
|
2015-12-04 05:46:11 -08:00
|
|
|
call DeinitializeSprite
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_GSGameFreakLogoSparkle:
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
or [hl]
|
2020-10-22 07:54:53 -07:00
|
|
|
jr z, .delete
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR4
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld d, [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
push de
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
pop de
|
|
|
|
pop af
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Cosine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR3
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR3
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ld de, -$10
|
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
xor $20
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.delete
|
2015-12-04 05:46:11 -08:00
|
|
|
call DeinitializeSprite
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_SlotsGolem:
|
2017-12-28 11:23:17 -08:00
|
|
|
callfar Slots_AnimateGolem
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_SlotsChansey:
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar Slots_AnimateChansey
|
2020-10-28 10:35:39 -07:00
|
|
|
ld hl, wSlotsDelay
|
2015-12-01 18:54:11 -08:00
|
|
|
ld a, [hl]
|
|
|
|
cp $2
|
|
|
|
ret nz
|
|
|
|
ld [hl], $3
|
2017-11-29 11:24:19 -08:00
|
|
|
ld a, SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY_2
|
2015-12-05 12:38:25 -08:00
|
|
|
call _ReinitSpriteAnimFrame
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_SlotsChanseyEgg:
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
dec [hl]
|
|
|
|
ld e, a
|
|
|
|
and $1
|
2015-12-10 19:26:31 -08:00
|
|
|
jr z, .move_vertical
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2023-07-26 17:50:16 -07:00
|
|
|
cp 15 * TILE_WIDTH
|
2015-12-10 19:26:31 -08:00
|
|
|
jr c, .move_right
|
2015-12-04 05:46:11 -08:00
|
|
|
call DeinitializeSprite
|
2015-12-01 18:54:11 -08:00
|
|
|
ld a, $4
|
2020-10-28 10:35:39 -07:00
|
|
|
ld [wSlotsDelay], a
|
2015-12-01 18:54:11 -08:00
|
|
|
ld de, SFX_PLACE_PUZZLE_PIECE_DOWN
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2015-12-10 19:26:31 -08:00
|
|
|
.move_right
|
2015-12-01 18:54:11 -08:00
|
|
|
inc [hl]
|
2015-12-10 19:26:31 -08:00
|
|
|
.move_vertical
|
2015-12-01 18:54:11 -08:00
|
|
|
ld a, e
|
2020-08-04 09:09:09 -07:00
|
|
|
ld d, 32
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_UnusedCursor:
|
2020-10-22 07:54:53 -07:00
|
|
|
callfar UnusedCursor_InterpretJoypad_AnimateCursor
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_PokegearArrow:
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar AnimatePokegearModeIndicatorArrow
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_MemoryGameCursor:
|
2020-11-08 16:32:57 -08:00
|
|
|
callfar MemoryGame_InterpretJoypad_AnimateCursor
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_TradePokeBall:
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_AnonJumptable
|
2017-06-17 16:14:55 -07:00
|
|
|
jp hl
|
2020-10-22 07:54:53 -07:00
|
|
|
.anon_dw
|
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
|
|
|
dw .three
|
|
|
|
dw .four
|
|
|
|
dw .delete
|
|
|
|
|
|
|
|
.zero
|
2018-01-18 21:16:08 -08:00
|
|
|
ld a, SPRITE_ANIM_FRAMESET_TRADE_POKE_BALL_WOBBLE
|
2015-12-05 12:38:25 -08:00
|
|
|
call _ReinitSpriteAnimFrame
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
2020-10-22 07:54:53 -07:00
|
|
|
ld [hl], 2 ; .two
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $20
|
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.two
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2020-10-22 07:54:53 -07:00
|
|
|
jr z, .next
|
2015-12-01 18:54:11 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.next
|
|
|
|
call AnimSeqs_IncAnonJumptableIndex
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $40
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.three
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2020-08-04 09:09:09 -07:00
|
|
|
cp 48
|
2020-10-22 07:54:53 -07:00
|
|
|
jr c, .done
|
2015-12-01 18:54:11 -08:00
|
|
|
dec [hl]
|
2020-08-04 09:09:09 -07:00
|
|
|
ld d, 40
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.done
|
2015-12-01 18:54:11 -08:00
|
|
|
ld de, SFX_GOT_SAFARI_BALLS
|
|
|
|
call PlaySFX
|
2020-10-22 07:54:53 -07:00
|
|
|
jr .delete
|
2015-12-01 18:54:11 -08:00
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.one
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $4
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $30
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $24
|
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.four
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2020-10-22 07:54:53 -07:00
|
|
|
jr z, .done2
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-04 09:09:09 -07:00
|
|
|
ld d, a
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-04 11:33:29 -08:00
|
|
|
call Sprites_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ld a, [hl]
|
|
|
|
and $3f
|
|
|
|
ret nz
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $20
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
sub $c
|
|
|
|
ld [hl], a
|
|
|
|
ld de, SFX_SWITCH_POKEMON
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.done2
|
2015-12-01 18:54:11 -08:00
|
|
|
xor a
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_IncAnonJumptableIndex
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
.delete
|
2015-12-04 05:46:11 -08:00
|
|
|
call DeinitializeSprite
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_TradeTubeBulge:
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
inc [hl]
|
2015-12-01 18:54:11 -08:00
|
|
|
cp $b0
|
2016-05-13 19:46:32 -07:00
|
|
|
jr nc, .delete
|
2015-12-01 18:54:11 -08:00
|
|
|
and $3
|
|
|
|
ret nz
|
|
|
|
ld de, SFX_POKEBALLS_PLACED_ON_TABLE
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.delete
|
2015-12-04 05:46:11 -08:00
|
|
|
call DeinitializeSprite
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_TrademonInTube:
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar TradeAnim_AnimateTrademonInTube
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_RevealNewMon:
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $80
|
2015-12-18 17:07:09 -08:00
|
|
|
jr nc, .finish_EggShell
|
2015-12-01 18:54:11 -08:00
|
|
|
ld d, a
|
2020-10-22 07:54:53 -07:00
|
|
|
add 8
|
2015-12-01 18:54:11 -08:00
|
|
|
ld [hl], a
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
xor $20
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
push af
|
|
|
|
push de
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
pop de
|
|
|
|
pop af
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Cosine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-18 17:07:09 -08:00
|
|
|
.finish_EggShell
|
2015-12-04 05:46:11 -08:00
|
|
|
call DeinitializeSprite
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_RadioTuningKnob:
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar AnimateTuningKnob
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_CutLeaves:
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
ld hl, $80
|
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
2016-05-10 09:31:49 -07:00
|
|
|
inc [hl]
|
|
|
|
inc [hl]
|
2015-12-01 18:54:11 -08:00
|
|
|
push af
|
|
|
|
push de
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
pop de
|
|
|
|
pop af
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Cosine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_FlyFrom:
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret z
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
cp $40
|
|
|
|
ret c
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
dec [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR4
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, a
|
|
|
|
cp $40
|
2015-12-18 17:07:09 -08:00
|
|
|
jr nc, .skip
|
2020-10-22 07:54:53 -07:00
|
|
|
add 8
|
2015-12-01 18:54:11 -08:00
|
|
|
ld [hl], a
|
2015-12-18 17:07:09 -08:00
|
|
|
.skip
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR3
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Cosine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_FlyLeaf:
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2023-07-26 17:50:16 -07:00
|
|
|
cp -9 * TILE_WIDTH
|
2015-12-18 17:07:09 -08:00
|
|
|
jr nc, .delete_leaf
|
2015-12-01 18:54:11 -08:00
|
|
|
inc [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
inc [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2015-12-18 17:07:09 -08:00
|
|
|
ld d, $40
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Cosine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
2015-12-18 17:07:09 -08:00
|
|
|
|
|
|
|
.delete_leaf
|
2015-12-04 05:46:11 -08:00
|
|
|
call DeinitializeSprite
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_FlyTo:
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2023-07-26 17:50:16 -07:00
|
|
|
cp 10 * TILE_WIDTH + 4
|
2015-12-01 18:54:11 -08:00
|
|
|
ret z
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
inc [hl]
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR4
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, a
|
|
|
|
and a
|
2020-10-22 07:54:53 -07:00
|
|
|
jr z, .stay
|
2015-12-01 18:54:11 -08:00
|
|
|
sub $2
|
|
|
|
ld [hl], a
|
2020-10-22 07:54:53 -07:00
|
|
|
.stay
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR3
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Cosine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_MobileTradeSentPulse:
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_MobileTradeOTPulse:
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_IntroSuicune:
|
2019-04-19 15:55:04 -07:00
|
|
|
ld a, [wIntroSceneTimer]
|
2015-12-01 18:54:11 -08:00
|
|
|
and a
|
2020-10-22 07:54:53 -07:00
|
|
|
jr nz, .continue
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
2020-10-22 07:54:53 -07:00
|
|
|
|
|
|
|
.continue
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR2
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2020-08-04 09:09:09 -07:00
|
|
|
add 2
|
2015-12-01 18:54:11 -08:00
|
|
|
ld [hl], a
|
|
|
|
xor $ff
|
|
|
|
inc a
|
2020-08-04 09:09:09 -07:00
|
|
|
ld d, 32
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2017-11-29 11:24:19 -08:00
|
|
|
ld a, SPRITE_ANIM_FRAMESET_INTRO_SUICUNE_2
|
2015-12-05 12:38:25 -08:00
|
|
|
call _ReinitSpriteAnimFrame
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_IntroPichuWooper:
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2020-08-04 09:09:09 -07:00
|
|
|
cp 20
|
2020-10-22 07:54:53 -07:00
|
|
|
jr nc, .done
|
2020-08-04 09:09:09 -07:00
|
|
|
add 2
|
2015-12-01 18:54:11 -08:00
|
|
|
ld [hl], a
|
|
|
|
xor $ff
|
|
|
|
inc a
|
2020-08-04 09:09:09 -07:00
|
|
|
ld d, 32
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2020-10-22 07:54:53 -07:00
|
|
|
.done
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_IntroUnown:
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld d, [hl]
|
|
|
|
inc [hl]
|
2016-05-10 09:31:49 -07:00
|
|
|
inc [hl]
|
|
|
|
inc [hl]
|
2020-08-22 07:22:37 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
push de
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Sine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
pop de
|
|
|
|
pop af
|
2020-10-22 07:54:53 -07:00
|
|
|
call AnimSeqs_Cosine
|
2015-12-04 05:46:11 -08:00
|
|
|
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XOFFSET
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_IntroUnownF:
|
2020-10-28 10:35:39 -07:00
|
|
|
ld a, [wSlotsDelay]
|
2015-12-01 18:54:11 -08:00
|
|
|
cp $40
|
|
|
|
ret nz
|
2017-11-29 11:24:19 -08:00
|
|
|
ld a, SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F_2
|
2015-12-05 12:38:25 -08:00
|
|
|
call _ReinitSpriteAnimFrame
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_IntroSuicuneAway:
|
2015-12-04 05:46:11 -08:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2020-10-22 07:54:53 -07:00
|
|
|
add 16
|
2015-12-01 18:54:11 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_EZChatCursor:
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_Celebi:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall UpdateCelebiPosition
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_LevelSelectionMenuWalkDown:
|
2023-08-23 03:50:22 -07:00
|
|
|
call LevelSelectionMenuHandleTransition
|
2023-08-20 04:03:33 -07:00
|
|
|
ret nc
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_LevelSelectionMenuWalkUp:
|
2023-08-23 03:50:22 -07:00
|
|
|
call LevelSelectionMenuHandleTransition
|
2023-08-20 04:03:33 -07:00
|
|
|
ret nc
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_LevelSelectionMenuWalkLeft:
|
2023-08-23 03:50:22 -07:00
|
|
|
call LevelSelectionMenuHandleTransition
|
2023-08-20 04:03:33 -07:00
|
|
|
ret nc
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2023-09-24 06:06:19 -07:00
|
|
|
SpriteAnimFunc_LevelSelectionMenuWalkRight:
|
2023-08-23 03:50:22 -07:00
|
|
|
call LevelSelectionMenuHandleTransition
|
2023-08-20 04:03:33 -07:00
|
|
|
ret nc
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2023-09-26 11:09:13 -07:00
|
|
|
SpriteAnimFunc_BoardMenuMoveDieNumber:
|
2023-09-27 10:25:47 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
; 10 frames
|
|
|
|
ld e, 2
|
|
|
|
ld d, 0
|
|
|
|
cp 44 + 2
|
|
|
|
jr nc, .move
|
|
|
|
; 2 frames
|
|
|
|
ld e, 2
|
|
|
|
ld d, 1
|
|
|
|
cp 40 + 1
|
|
|
|
jr nc, .move
|
|
|
|
; 2 frames
|
|
|
|
ld e, 1
|
|
|
|
ld d, 1
|
|
|
|
cp 38 + 1
|
|
|
|
jr nc, .move
|
|
|
|
; 2 frames
|
|
|
|
ld e, 1
|
|
|
|
ld d, 2
|
|
|
|
cp 36 + 1
|
|
|
|
jr nc, .move
|
|
|
|
; 26 frames
|
|
|
|
ld e, 0
|
|
|
|
ld d, 2
|
|
|
|
.move
|
|
|
|
sub e
|
|
|
|
ld [hl], a
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp 20 + 1
|
|
|
|
ret c
|
|
|
|
sub d
|
|
|
|
ld [hl], a
|
2023-09-26 11:09:13 -07:00
|
|
|
ret
|
|
|
|
|
2023-08-23 03:50:22 -07:00
|
|
|
LevelSelectionMenuHandleTransition:
|
|
|
|
; return carry if apply x/y displacement during this frame
|
2023-08-20 04:03:33 -07:00
|
|
|
ld a, [wLevelSelectionMenuStandingStill]
|
|
|
|
and a
|
|
|
|
ret nz ; nc
|
2023-08-23 03:50:22 -07:00
|
|
|
farcall _LevelSelectionMenuHandleTransition
|
|
|
|
ret
|
2023-08-20 04:03:33 -07:00
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
AnimSeqs_AnonJumptable:
|
2020-06-17 07:39:17 -07:00
|
|
|
ld hl, sp+0
|
2015-12-01 18:54:11 -08:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
inc de
|
2015-12-04 05:46:11 -08:00
|
|
|
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
ld l, [hl]
|
2020-06-17 07:39:17 -07:00
|
|
|
ld h, 0
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, hl
|
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
AnimSeqs_IncAnonJumptableIndex:
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-12-01 18:54:11 -08:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
AnimSeqs_Sine:
|
2015-12-04 11:33:29 -08:00
|
|
|
call Sprites_Sine
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-22 07:54:53 -07:00
|
|
|
AnimSeqs_Cosine:
|
2015-12-04 11:33:29 -08:00
|
|
|
call Sprites_Cosine
|
2015-12-01 18:54:11 -08:00
|
|
|
ret
|