2013-12-18 04:54:25 +00:00
|
|
|
; Battle animation command interpreter.
|
|
|
|
|
|
|
|
|
|
|
|
PlayBattleAnim: ; cc0d6
|
|
|
|
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
|
|
|
|
ld a, 5
|
|
|
|
ld [rSVBK], a
|
|
|
|
|
|
|
|
call _PlayBattleAnim
|
|
|
|
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; cc0e4
|
|
|
|
|
|
|
|
_PlayBattleAnim: ; cc0e4
|
|
|
|
|
|
|
|
ld c, 6
|
|
|
|
.wait
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
dec c
|
|
|
|
jr nz, .wait
|
|
|
|
|
|
|
|
call BattleAnimAssignPals
|
|
|
|
call BattleAnimRequestPals
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
|
|
|
|
ld c, 1
|
|
|
|
ld a, [rKEY1]
|
|
|
|
bit 7, a
|
|
|
|
jr nz, .asm_cc0ff
|
|
|
|
ld c, 3
|
|
|
|
|
|
|
|
.asm_cc0ff
|
2015-01-20 05:31:29 +00:00
|
|
|
ld hl, hVBlank
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
|
|
|
|
ld [hl], c
|
2015-11-09 21:41:09 +00:00
|
|
|
call BattleAnimRunScript
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
pop af
|
2015-01-20 05:31:29 +00:00
|
|
|
ld [hVBlank], a
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
ld a, $1
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call WaitSFX
|
|
|
|
ret
|
|
|
|
; cc11c
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
BattleAnimRunScript: ; cc11c
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
ld a, [FXAnimIDHi]
|
|
|
|
and a
|
2015-11-09 21:41:09 +00:00
|
|
|
jr nz, .hi_byte
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
callba CheckBattleScene
|
2015-11-09 21:41:09 +00:00
|
|
|
jr c, .disabled
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
call BattleAnimClearHud
|
2015-11-09 21:41:09 +00:00
|
|
|
call RunBattleAnimScript
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
call BattleAnimAssignPals
|
|
|
|
call BattleAnimRequestPals
|
|
|
|
|
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
|
|
|
ld [hSCY], a
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call BattleAnimRestoreHuds
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.disabled
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [wcfca]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
2015-11-09 21:41:09 +00:00
|
|
|
jr z, .done
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
ld l, a
|
|
|
|
ld h, 0
|
2015-11-09 21:41:09 +00:00
|
|
|
ld de, ANIM_MISS
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, l
|
|
|
|
ld [FXAnimIDLo], a
|
|
|
|
ld a, h
|
|
|
|
ld [FXAnimIDHi], a
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.hi_byte
|
2013-12-18 04:54:25 +00:00
|
|
|
call WaitSFX
|
|
|
|
call Functioncc881
|
2015-11-09 21:41:09 +00:00
|
|
|
call RunBattleAnimScript
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.done
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functioncc8f6
|
|
|
|
ret
|
|
|
|
; cc163
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
RunBattleAnimScript: ; cc163
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
call Functioncc8d3
|
|
|
|
|
|
|
|
.playframe
|
|
|
|
call Functioncc25f
|
|
|
|
call Functionccb48
|
|
|
|
call Functioncc96e
|
|
|
|
call Function3b0c
|
|
|
|
call BattleAnimRequestPals
|
|
|
|
|
|
|
|
; Speed up Rollout's animation.
|
|
|
|
ld a, [FXAnimIDHi]
|
|
|
|
or a
|
|
|
|
jr nz, .asm_cc193
|
|
|
|
|
|
|
|
ld a, [FXAnimIDLo]
|
|
|
|
cp ROLLOUT
|
|
|
|
jr nz, .asm_cc193
|
|
|
|
|
|
|
|
ld a, $2e
|
|
|
|
ld b, 5
|
|
|
|
ld de, 4
|
|
|
|
ld hl, ActiveBGEffects
|
|
|
|
.asm_cc18c
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_cc196
|
|
|
|
add hl, de
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_cc18c
|
|
|
|
|
|
|
|
.asm_cc193
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
|
|
|
|
.asm_cc196
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimFlags]
|
2013-12-18 04:54:25 +00:00
|
|
|
bit 0, a
|
|
|
|
jr z, .playframe
|
|
|
|
|
|
|
|
call Functioncc23d
|
|
|
|
ret
|
|
|
|
; cc1a1
|
|
|
|
|
|
|
|
BattleAnimClearHud: ; cc1a1
|
|
|
|
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call WaitTop
|
|
|
|
call ClearActorHud
|
|
|
|
ld a, $1
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call WaitTop
|
|
|
|
ret
|
|
|
|
; cc1bb
|
|
|
|
|
|
|
|
BattleAnimRestoreHuds: ; cc1bb
|
|
|
|
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call WaitTop
|
|
|
|
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $1
|
|
|
|
ld [rSVBK], a
|
|
|
|
|
|
|
|
ld hl, UpdateBattleHuds
|
2015-11-04 00:43:47 +00:00
|
|
|
ld a, BANK(UpdatePlayerHUD)
|
|
|
|
rst FarCall ; Why the heck is this a callab?
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
|
|
|
|
ld a, $1
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
call WaitTop
|
|
|
|
ret
|
|
|
|
; cc1e2
|
|
|
|
|
|
|
|
BattleAnimRequestPals: ; cc1e2
|
|
|
|
|
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
|
|
|
|
ld a, [rBGP]
|
|
|
|
ld b, a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [wcfc7]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp b
|
|
|
|
call nz, Functioncc91a
|
|
|
|
|
|
|
|
ld a, [rOBP0]
|
|
|
|
ld b, a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [wcfc8]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp b
|
|
|
|
call nz, Functioncc94b
|
|
|
|
ret
|
|
|
|
; cc1fb
|
|
|
|
|
|
|
|
BattleAnimDelayFrame: ; cc1fb
|
|
|
|
; Like DelayFrame but wastes battery life.
|
|
|
|
|
|
|
|
ld a, 1
|
|
|
|
ld [VBlankOccurred], a
|
|
|
|
.wait
|
|
|
|
ld a, [VBlankOccurred]
|
|
|
|
and a
|
|
|
|
jr nz, .wait
|
|
|
|
ret
|
|
|
|
; cc207
|
|
|
|
|
|
|
|
ClearActorHud: ; cc207
|
|
|
|
|
|
|
|
ld a, [hBattleTurn]
|
|
|
|
and a
|
|
|
|
jr z, .player
|
|
|
|
|
|
|
|
hlcoord 1, 0
|
|
|
|
lb bc, 4, 10
|
|
|
|
call ClearBox
|
|
|
|
ret
|
|
|
|
|
|
|
|
.player
|
|
|
|
hlcoord 9, 7
|
|
|
|
lb bc, 5, 11
|
|
|
|
call ClearBox
|
|
|
|
ret
|
|
|
|
; cc220
|
|
|
|
|
2014-05-05 20:27:48 +00:00
|
|
|
Functioncc220: ; cc220
|
|
|
|
; Appears to be unused.
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
2015-10-19 20:49:29 +00:00
|
|
|
ld a, (VBGMap0 tile $28) % $100
|
2014-05-05 20:27:48 +00:00
|
|
|
ld [hBGMapAddress], a
|
2015-10-19 20:49:29 +00:00
|
|
|
ld a, (VBGMap0 tile $28) / $100
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hBGMapAddress + 1], a
|
2014-05-05 20:27:48 +00:00
|
|
|
call Function3200
|
|
|
|
ld a, $60
|
|
|
|
ld [hWY], a
|
|
|
|
xor a
|
|
|
|
ld [hBGMapAddress], a
|
2015-10-19 20:49:29 +00:00
|
|
|
ld a, VBGMap0 / $100
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hBGMapAddress + 1], a
|
2014-05-05 20:27:48 +00:00
|
|
|
call BattleAnimDelayFrame
|
|
|
|
ret
|
|
|
|
; cc23d
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
Functioncc23d: ; cc23d
|
|
|
|
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimFlags]
|
2013-12-18 04:54:25 +00:00
|
|
|
bit 3, a
|
2015-11-09 21:41:09 +00:00
|
|
|
jr z, .skip
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
ld hl, Sprites + 3
|
|
|
|
ld c, (SpritesEnd - Sprites) / 4
|
2015-11-09 21:41:09 +00:00
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and $f0
|
|
|
|
ld [hli], a
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 3
|
2013-12-18 04:54:25 +00:00
|
|
|
inc hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
dec c
|
2015-11-09 21:41:09 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.skip
|
2013-12-18 04:54:25 +00:00
|
|
|
ld hl, Sprites
|
|
|
|
ld c, SpritesEnd - Sprites
|
|
|
|
xor a
|
2015-11-09 21:41:09 +00:00
|
|
|
.loop2
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-11-09 21:41:09 +00:00
|
|
|
jr nz, .loop2
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
; cc25f
|
|
|
|
|
|
|
|
Functioncc25f: ; cc25f
|
2015-11-09 21:41:09 +00:00
|
|
|
call .CheckTimer
|
2013-12-18 04:54:25 +00:00
|
|
|
ret nc
|
2015-11-09 21:41:09 +00:00
|
|
|
call .RunScript
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
; cc267
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.CheckTimer: ; cc267
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimDuration]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
2015-11-09 21:41:09 +00:00
|
|
|
jr z, .done
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
dec a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimDuration], a
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.done
|
2013-12-18 04:54:25 +00:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; cc275
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.RunScript: ; cc275
|
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
|
|
|
|
cp $ff
|
2015-11-09 21:41:09 +00:00
|
|
|
jr nz, .not_done_with_anim
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
; Return from a subroutine.
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimFlags
|
2013-12-18 04:54:25 +00:00
|
|
|
bit 1, [hl]
|
2015-11-09 21:41:09 +00:00
|
|
|
jr nz, .do_anim
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
set 0, [hl]
|
|
|
|
ret
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.not_done_with_anim
|
2013-12-18 04:54:25 +00:00
|
|
|
cp $d0
|
2015-11-09 21:41:09 +00:00
|
|
|
jr nc, .do_anim
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimDuration], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.do_anim
|
|
|
|
call .DoCommand
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
jr .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
; cc293
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.DoCommand: ; cc293
|
2015-02-08 08:03:32 +00:00
|
|
|
; Execute battle animation command in [BattleAnimByte].
|
|
|
|
ld a, [BattleAnimByte]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub $d0
|
|
|
|
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
ld hl, BattleAnimCommands
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
jp [hl]
|
|
|
|
; cc2a4
|
|
|
|
|
|
|
|
|
2014-02-02 01:26:39 +00:00
|
|
|
BattleAnimCommands:: ; cc2a4 (33:42a4)
|
2015-11-10 21:53:37 +00:00
|
|
|
dw BattleAnimCmd_Obj
|
|
|
|
dw BattleAnimCmd_1GFX
|
|
|
|
dw BattleAnimCmd_2GFX
|
|
|
|
dw BattleAnimCmd_3GFX
|
|
|
|
dw BattleAnimCmd_4GFX
|
|
|
|
dw BattleAnimCmd_5GFX
|
|
|
|
dw BattleAnimCmd_IncObj
|
|
|
|
dw BattleAnimCmd_SetObj
|
|
|
|
dw BattleAnimCmd_IncBGEffect
|
|
|
|
dw BattleAnimCmd_EnemyFeetObj
|
|
|
|
dw BattleAnimCmd_PlayerHeadObj
|
|
|
|
dw BattleAnimCmd_CheckPokeball
|
|
|
|
dw BattleAnimCmd_Transform
|
|
|
|
dw BattleAnimCmd_RaiseSub
|
|
|
|
dw BattleAnimCmd_DropSub
|
|
|
|
dw BattleAnimCmd_ResetObp0
|
|
|
|
dw BattleAnimCmd_Sound
|
|
|
|
dw BattleAnimCmd_Cry
|
|
|
|
dw BattleAnimCmd_MinimizeOpp
|
|
|
|
dw BattleAnimCmd_OAMOn
|
|
|
|
dw BattleAnimCmd_OAMOff
|
|
|
|
dw BattleAnimCmd_ClearObjs
|
|
|
|
dw BattleAnimCmd_BeatUp
|
2013-12-18 04:54:25 +00:00
|
|
|
dw BattleAnimCmd_E7
|
2015-11-10 21:53:37 +00:00
|
|
|
dw BattleAnimCmd_UpdateActorPic
|
|
|
|
dw BattleAnimCmd_Minimize
|
|
|
|
dw BattleAnimCmd_EA ; dummy
|
|
|
|
dw BattleAnimCmd_EB ; dummy
|
|
|
|
dw BattleAnimCmd_EC ; dummy
|
|
|
|
dw BattleAnimCmd_ED ; dummy
|
|
|
|
dw BattleAnimCmd_JumpAnd
|
|
|
|
dw BattleAnimCmd_JumpUntil
|
|
|
|
dw BattleAnimCmd_BGEffect
|
|
|
|
dw BattleAnimCmd_BGP
|
|
|
|
dw BattleAnimCmd_OBP0
|
|
|
|
dw BattleAnimCmd_OBP1
|
|
|
|
dw BattleAnimCmd_ClearSprites
|
2013-12-18 04:54:25 +00:00
|
|
|
dw BattleAnimCmd_F5
|
|
|
|
dw BattleAnimCmd_F6
|
|
|
|
dw BattleAnimCmd_F7
|
2015-11-10 21:53:37 +00:00
|
|
|
dw BattleAnimCmd_JumpIf
|
|
|
|
dw BattleAnimCmd_SetVar
|
|
|
|
dw BattleAnimCmd_IncVar
|
|
|
|
dw BattleAnimCmd_JumpVar
|
|
|
|
dw BattleAnimCmd_Jump
|
|
|
|
dw BattleAnimCmd_Loop
|
|
|
|
dw BattleAnimCmd_Call
|
|
|
|
dw BattleAnimCmd_Ret
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
BattleAnimCmd_EA:
|
|
|
|
BattleAnimCmd_EB:
|
|
|
|
BattleAnimCmd_EC:
|
|
|
|
BattleAnimCmd_ED: ; cc304 (33:4304)
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Ret: ; cc305 (33:4305)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimFlags
|
2013-12-18 04:54:25 +00:00
|
|
|
res 1, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimParent
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Call: ; cc317 (33:4317)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld d, a
|
|
|
|
push de
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimParent
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
pop de
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimFlags
|
2013-12-18 04:54:25 +00:00
|
|
|
set 1, [hl]
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Jump: ; cc339 (33:4339)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld d, a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Loop: ; cc348 (33:4348)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimFlags
|
2013-12-18 04:54:25 +00:00
|
|
|
bit 2, [hl]
|
|
|
|
jr nz, .asm_cc35b
|
|
|
|
and a
|
|
|
|
jr z, .asm_cc363
|
|
|
|
dec a
|
|
|
|
set 2, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimLoops], a
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_cc35b
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimLoops
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_cc372
|
|
|
|
dec [hl]
|
|
|
|
.asm_cc363
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld d, a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ret
|
|
|
|
.asm_cc372
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimFlags
|
2013-12-18 04:54:25 +00:00
|
|
|
res 2, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
inc de
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], d
|
|
|
|
dec hl
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_JumpUntil: ; cc383 (33:4383)
|
2015-11-07 01:55:16 +00:00
|
|
|
ld hl, wKickCounter
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_cc39a
|
|
|
|
|
|
|
|
dec [hl]
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld d, a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_cc39a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
inc de
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], d
|
|
|
|
dec hl
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_SetVar: ; cc3a6 (33:43a6)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimVar], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_IncVar: ; cc3ad (33:43ad)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimVar
|
2013-12-18 04:54:25 +00:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_JumpVar: ; cc3b2 (33:43b2)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimVar
|
2013-12-18 04:54:25 +00:00
|
|
|
cp [hl]
|
|
|
|
jr z, .jump
|
|
|
|
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
inc de
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], d
|
|
|
|
dec hl
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
|
|
|
|
.jump
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld d, a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_JumpIf: ; cc3d6 (33:43d6)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-11-07 01:55:16 +00:00
|
|
|
ld hl, wKickCounter
|
2013-12-18 04:54:25 +00:00
|
|
|
cp [hl]
|
|
|
|
jr z, .jump
|
|
|
|
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
inc de
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], d
|
|
|
|
dec hl
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
|
|
|
|
.jump
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld d, a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_JumpAnd: ; cc3fa (33:43fa)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
2015-11-07 01:55:16 +00:00
|
|
|
ld a, [wKickCounter]
|
2013-12-18 04:54:25 +00:00
|
|
|
and e
|
|
|
|
jr nz, .jump
|
|
|
|
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
inc de
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], d
|
|
|
|
dec hl
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
.jump
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld d, a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimAddress
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Obj: ; cc41f (33:441f)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps + 2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps + 3], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functioncc9a1
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_BGEffect: ; cc43b (33:443b)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps + 2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps + 3], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionccb4f
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_BGP: ; cc457 (33:4457)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wcfc7], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_OBP0: ; cc45e (33:445e)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wcfc8], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_OBP1: ; cc465 (33:4465)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wcfc9], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_ResetObp0: ; cc46c (33:446c)
|
|
|
|
ld a, [hSGB]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
ld a, $e0
|
|
|
|
jr z, .asm_cc475
|
|
|
|
ld a, $f0
|
|
|
|
.asm_cc475
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wcfc8], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_ClearObjs: ; cc479 (33:4479)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, OTPartyMon3HP
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $a0
|
|
|
|
.asm_cc47e
|
|
|
|
ld [hl], $0
|
|
|
|
inc hl
|
|
|
|
dec a
|
|
|
|
jr nz, .asm_cc47e
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_1GFX:
|
|
|
|
BattleAnimCmd_2GFX:
|
|
|
|
BattleAnimCmd_3GFX:
|
|
|
|
BattleAnimCmd_4GFX:
|
|
|
|
BattleAnimCmd_5GFX: ; cc485 (33:4485)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimByte]
|
2013-12-18 04:54:25 +00:00
|
|
|
and $f
|
|
|
|
ld c, a
|
2015-02-10 23:14:21 +00:00
|
|
|
ld hl, w5_d300
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps], a
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_cc492
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimTemps]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp $4f
|
|
|
|
ret nc
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld [hli], a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimTemps]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hli], a
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 4
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2015-10-14 13:29:15 +00:00
|
|
|
ld de, VTiles0 tile $31
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimByte]
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionce846
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimTemps]
|
2013-12-18 04:54:25 +00:00
|
|
|
add c
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps], a
|
2013-12-18 04:54:25 +00:00
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_cc492
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_IncObj: ; cc4c0 (33:44c0)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, $a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld bc, OTPartyMon3HP
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_cc4c8
|
|
|
|
ld hl, $0
|
|
|
|
add hl, bc
|
|
|
|
ld d, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimByte]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp d
|
|
|
|
jr z, .asm_cc4dd
|
|
|
|
ld hl, $18
|
|
|
|
add hl, bc
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
dec e
|
|
|
|
jr nz, .asm_cc4c8
|
|
|
|
ret
|
|
|
|
.asm_cc4dd
|
|
|
|
ld hl, $e
|
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_IncBGEffect: ; cc4e3 (33:44e3)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, $5
|
2015-02-08 08:03:32 +00:00
|
|
|
ld bc, ActiveBGEffects
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_cc4eb
|
|
|
|
ld hl, $0
|
|
|
|
add hl, bc
|
|
|
|
ld d, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimByte]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp d
|
|
|
|
jr z, .asm_cc500
|
|
|
|
ld hl, $4
|
|
|
|
add hl, bc
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
dec e
|
|
|
|
jr nz, .asm_cc4eb
|
|
|
|
ret
|
|
|
|
.asm_cc500
|
|
|
|
ld hl, $1
|
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_SetObj: ; cc506 (33:4506)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, $a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld bc, OTPartyMon3HP
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_cc50e
|
|
|
|
ld hl, $0
|
|
|
|
add hl, bc
|
|
|
|
ld d, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimByte]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp d
|
|
|
|
jr z, .asm_cc523
|
|
|
|
ld hl, $18
|
|
|
|
add hl, bc
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
dec e
|
|
|
|
jr nz, .asm_cc50e
|
|
|
|
ret
|
|
|
|
.asm_cc523
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld hl, $e
|
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_EnemyFeetObj: ; cc52c (33:452c)
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-02-10 23:14:21 +00:00
|
|
|
ld hl, w5_d300
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_cc52f
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_cc537
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
inc hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
jr .asm_cc52f
|
|
|
|
|
|
|
|
.asm_cc537
|
|
|
|
ld a, $28
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $42
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $29
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $49
|
|
|
|
ld [hl], a
|
|
|
|
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles0 tile $73
|
|
|
|
ld de, VTiles2 tile $06
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $70
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $7
|
|
|
|
call Functioncc561
|
2015-10-14 13:29:15 +00:00
|
|
|
ld de, VTiles2 tile $31
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $60
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $6
|
|
|
|
call Functioncc561
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functioncc561: ; cc561 (33:4561)
|
|
|
|
push af
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
ld bc, $3301
|
|
|
|
call Request2bpp
|
|
|
|
pop de
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimTemps]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
pop hl
|
|
|
|
ld bc, $10
|
|
|
|
add hl, bc
|
|
|
|
pop af
|
|
|
|
dec a
|
|
|
|
jr nz, Functioncc561
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_PlayerHeadObj: ; cc57e (33:457e)
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-02-10 23:14:21 +00:00
|
|
|
ld hl, w5_d300
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_cc581
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_cc589
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
inc hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
jr .asm_cc581
|
|
|
|
|
|
|
|
.asm_cc589
|
|
|
|
ld a, $28
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $35
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $29
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $43
|
|
|
|
ld [hl], a
|
|
|
|
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles0 tile $66
|
|
|
|
ld de, VTiles2 tile $05
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $70
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $7
|
|
|
|
call Functioncc5b3
|
2015-10-14 13:29:15 +00:00
|
|
|
ld de, VTiles2 tile $31
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $60
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimTemps], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $6
|
|
|
|
call Functioncc5b3
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functioncc5b3: ; cc5b3 (33:45b3)
|
|
|
|
push af
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
ld bc, $3302
|
|
|
|
call Request2bpp
|
|
|
|
pop de
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [BattleAnimTemps]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
pop hl
|
|
|
|
ld bc, $20
|
|
|
|
add hl, bc
|
|
|
|
pop af
|
|
|
|
dec a
|
|
|
|
jr nz, Functioncc5b3
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_CheckPokeball: ; cc5d0 (33:45d0)
|
2013-12-18 04:54:25 +00:00
|
|
|
callab GetPokeBallWobble
|
|
|
|
ld a, c
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [BattleAnimVar], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
BattleAnimCmd_E7: ; cc5db (33:45db)
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Transform: ; cc5dc (33:45dc)
|
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, 1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [CurPartySpecies] ; CurPartySpecies
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr z, .player
|
|
|
|
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [TempBattleMonSpecies] ; TempBattleMonSpecies
|
|
|
|
ld [CurPartySpecies], a ; CurPartySpecies
|
|
|
|
ld hl, BattleMonDVs ; BattleMonDVs
|
2014-06-16 18:20:01 +00:00
|
|
|
predef GetUnownLetter
|
2015-10-14 13:29:15 +00:00
|
|
|
ld de, VTiles0 tile $00
|
2014-06-18 07:55:44 +00:00
|
|
|
predef GetFrontpic
|
2013-12-18 04:54:25 +00:00
|
|
|
jr .done
|
|
|
|
|
|
|
|
.player
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [TempEnemyMonSpecies] ; TempEnemyMonSpecies
|
|
|
|
ld [CurPartySpecies], a ; CurPartySpecies
|
|
|
|
ld hl, EnemyMonDVs ; EnemyMonDVs
|
2014-06-16 18:20:01 +00:00
|
|
|
predef GetUnownLetter
|
2015-10-14 13:29:15 +00:00
|
|
|
ld de, VTiles0 tile $00
|
2014-06-18 07:55:44 +00:00
|
|
|
predef GetBackpic
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
.done
|
|
|
|
pop af
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [CurPartySpecies], a ; CurPartySpecies
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_UpdateActorPic: ; cc622 (33:4622)
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-10-14 13:29:15 +00:00
|
|
|
ld de, VTiles0 tile $00
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr z, .player
|
|
|
|
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles2 tile $00
|
2013-12-18 04:54:25 +00:00
|
|
|
ld b, 0
|
|
|
|
ld c, $31
|
|
|
|
call Request2bpp
|
|
|
|
ret
|
|
|
|
|
|
|
|
.player
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles2 tile $31
|
2013-12-18 04:54:25 +00:00
|
|
|
ld b, 0
|
|
|
|
ld c, $24
|
|
|
|
call Request2bpp
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_RaiseSub: ; cc640 (33:4640)
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, 1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
|
|
|
call GetSRAMBank
|
|
|
|
|
|
|
|
GetSubstitutePic: ; cc64c
|
|
|
|
|
2015-08-20 04:51:04 +00:00
|
|
|
ld hl, sScratch
|
2013-12-18 04:54:25 +00:00
|
|
|
ld bc, $310
|
|
|
|
.loop
|
|
|
|
xor a
|
|
|
|
ld [hli], a
|
|
|
|
dec bc
|
|
|
|
ld a, c
|
|
|
|
or b
|
|
|
|
jr nz, .loop
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr z, .player
|
|
|
|
|
|
|
|
ld hl, MonsterSpriteGFX
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch + $130
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMonsterSpriteTile
|
|
|
|
ld hl, MonsterSpriteGFX + $10
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch + $1a0
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMonsterSpriteTile
|
|
|
|
ld hl, MonsterSpriteGFX + $20
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch + $140
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMonsterSpriteTile
|
|
|
|
ld hl, MonsterSpriteGFX + $30
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch + $1b0
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMonsterSpriteTile
|
|
|
|
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles2 tile $00
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch
|
2013-12-18 04:54:25 +00:00
|
|
|
lb bc, BANK(GetSubstitutePic), 7 * 7
|
|
|
|
call Request2bpp
|
|
|
|
jr .done
|
|
|
|
|
|
|
|
.player
|
|
|
|
ld hl, MonsterSpriteGFX + $40
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch + $100
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMonsterSpriteTile
|
|
|
|
ld hl, MonsterSpriteGFX + $50
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch + $160
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMonsterSpriteTile
|
|
|
|
ld hl, MonsterSpriteGFX + $60
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch + $110
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMonsterSpriteTile
|
|
|
|
ld hl, MonsterSpriteGFX + $70
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch + $170
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMonsterSpriteTile
|
|
|
|
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles2 tile $31
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch
|
2013-12-18 04:54:25 +00:00
|
|
|
lb bc, BANK(GetSubstitutePic), 6 * 6
|
|
|
|
call Request2bpp
|
|
|
|
|
|
|
|
.done
|
|
|
|
call CloseSRAM
|
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
CopyMonsterSpriteTile: ; cc6c6 (33:46c6)
|
|
|
|
ld bc, $10
|
|
|
|
ld a, BANK(MonsterSpriteGFX)
|
|
|
|
call FarCopyBytes
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf)
|
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
|
|
|
call GetSRAMBank
|
|
|
|
call GetMinimizePic
|
|
|
|
call Request2bpp
|
|
|
|
call CloseSRAM
|
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
GetMinimizePic: ; cc6e7 (33:46e7)
|
2015-08-20 04:51:04 +00:00
|
|
|
ld hl, sScratch
|
2013-12-18 04:54:25 +00:00
|
|
|
ld bc, $310
|
|
|
|
.loop
|
|
|
|
xor a
|
|
|
|
ld [hli], a
|
|
|
|
dec bc
|
|
|
|
ld a, c
|
|
|
|
or b
|
|
|
|
jr nz, .loop
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr z, .player
|
|
|
|
|
2015-08-21 06:00:59 +00:00
|
|
|
ld de, sScratch + $1a0
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMinimizePic
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles2 tile $00
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch
|
2013-12-18 04:54:25 +00:00
|
|
|
lb bc, BANK(GetMinimizePic), $31
|
|
|
|
ret
|
|
|
|
|
|
|
|
.player
|
2015-08-21 06:00:59 +00:00
|
|
|
ld de, sScratch + $160
|
2013-12-18 04:54:25 +00:00
|
|
|
call CopyMinimizePic
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles2 tile $31
|
2015-08-20 04:51:04 +00:00
|
|
|
ld de, sScratch
|
2013-12-18 04:54:25 +00:00
|
|
|
lb bc, BANK(GetMinimizePic), $24
|
|
|
|
ret
|
|
|
|
|
|
|
|
CopyMinimizePic: ; cc719 (33:4719)
|
|
|
|
ld hl, MinimizePic
|
|
|
|
ld bc, $10
|
|
|
|
ld a, BANK(MinimizePic)
|
|
|
|
call FarCopyBytes
|
|
|
|
ret
|
|
|
|
; cc725 (33:4725)
|
|
|
|
|
|
|
|
MinimizePic: ; cc725
|
|
|
|
INCBIN "gfx/battle/minimize.2bpp"
|
|
|
|
; cc735
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Minimize: ; cc735 (33:4735)
|
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
|
|
|
call GetSRAMBank
|
|
|
|
call GetMinimizePic
|
2015-10-14 13:29:15 +00:00
|
|
|
ld hl, VTiles0 tile $00
|
2013-12-18 04:54:25 +00:00
|
|
|
call Request2bpp
|
|
|
|
call CloseSRAM
|
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_DropSub: ; cc750 (33:4750)
|
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [CurPartySpecies] ; CurPartySpecies
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr z, .player
|
|
|
|
|
|
|
|
callab Function3f486
|
|
|
|
jr .done
|
|
|
|
|
|
|
|
.player
|
|
|
|
callab Function3f447
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop af
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [CurPartySpecies], a ; CurPartySpecies
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_BeatUp: ; cc776 (33:4776)
|
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [CurPartySpecies] ; CurPartySpecies
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
|
2015-11-07 01:55:16 +00:00
|
|
|
ld a, [wKickCounter]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [CurPartySpecies], a ; CurPartySpecies
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr z, .player
|
|
|
|
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleMonDVs ; BattleMonDVs
|
2014-06-16 18:20:01 +00:00
|
|
|
predef GetUnownLetter
|
2015-10-14 13:29:15 +00:00
|
|
|
ld de, VTiles2 tile $00
|
2014-06-18 07:55:44 +00:00
|
|
|
predef GetFrontpic
|
2013-12-18 04:54:25 +00:00
|
|
|
jr .done
|
|
|
|
|
|
|
|
.player
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, EnemyMonDVs ; EnemyMonDVs
|
2014-06-16 18:20:01 +00:00
|
|
|
predef GetUnownLetter
|
2015-10-14 13:29:15 +00:00
|
|
|
ld de, VTiles2 tile $31
|
2014-06-18 07:55:44 +00:00
|
|
|
predef GetBackpic
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
.done
|
|
|
|
pop af
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [CurPartySpecies], a ; CurPartySpecies
|
2015-11-16 21:01:45 +00:00
|
|
|
ld b, SCGB_01
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetSGBLayout
|
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_OAMOn: ; cc7bb (33:47bb)
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hOAMUpdate], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_OAMOff: ; cc7bf (33:47bf)
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hOAMUpdate], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_ClearSprites: ; cc7c4 (33:47c4)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BattleAnimFlags
|
2013-12-18 04:54:25 +00:00
|
|
|
set 3, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
BattleAnimCmd_F5: ; cc7ca (33:47ca)
|
|
|
|
ret
|
|
|
|
|
|
|
|
BattleAnimCmd_F6: ; cc7cb (33:47cb)
|
|
|
|
ret
|
|
|
|
|
|
|
|
BattleAnimCmd_F7: ; cc7cc (33:47cc)
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Sound: ; cc7cd (33:47cd)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
srl a
|
|
|
|
srl a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wc2be], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functioncc7fc
|
|
|
|
and 3
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [CryTracks], a ; CryTracks
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
ld hl, Datacc7f8
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wc2bc], a
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
call GetBattleAnimByte
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
callab PlayStereoSFX
|
|
|
|
|
|
|
|
ret
|
|
|
|
; cc7f8 (33:47f8)
|
|
|
|
|
|
|
|
Datacc7f8: ; cc7f8
|
|
|
|
db $f0, $0f, $f0, $0f
|
|
|
|
; cc7fc
|
|
|
|
|
|
|
|
Functioncc7fc: ; cc7fc (33:47fc)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr nz, .enemy
|
|
|
|
|
|
|
|
ld a, e
|
|
|
|
ret
|
|
|
|
|
|
|
|
.enemy
|
|
|
|
ld a, e
|
|
|
|
xor 1
|
|
|
|
ret
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
BattleAnimCmd_Cry: ; cc807 (33:4807)
|
2013-12-18 04:54:25 +00:00
|
|
|
call GetBattleAnimByte
|
|
|
|
and 3
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
ld hl, Datacc871
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 4
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, 1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr nz, .enemy
|
|
|
|
|
|
|
|
ld a, $f0
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [CryTracks], a ; CryTracks
|
|
|
|
ld a, [BattleMonSpecies] ; BattleMonSpecies
|
2013-12-18 04:54:25 +00:00
|
|
|
jr .asm_cc834
|
|
|
|
|
|
|
|
.enemy
|
|
|
|
ld a, $0f
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [CryTracks], a ; CryTracks
|
|
|
|
ld a, [EnemyMonSpecies] ; EnemyMon
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
.asm_cc834
|
|
|
|
push hl
|
2014-07-18 17:25:03 +00:00
|
|
|
call LoadCryHeader
|
2013-12-18 04:54:25 +00:00
|
|
|
pop hl
|
|
|
|
jr c, .done
|
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld c, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
|
|
|
|
push hl
|
2014-07-18 16:50:31 +00:00
|
|
|
ld hl, CryPitch
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, bc
|
|
|
|
ld a, l
|
2014-07-18 16:50:31 +00:00
|
|
|
ld [CryPitch], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, h
|
2014-07-18 16:50:31 +00:00
|
|
|
ld [CryPitch + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
pop hl
|
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld c, a
|
|
|
|
ld b, [hl]
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, CryLength ; CryLength
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, bc
|
|
|
|
|
|
|
|
ld a, l
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [CryLength], a ; CryLength
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, h
|
|
|
|
ld [CryLength + 1], a
|
|
|
|
ld a, 1
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wc2bc], a
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2014-07-18 16:59:03 +00:00
|
|
|
callab _PlayCryHeader
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
.done
|
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
; cc871 (33:4871)
|
|
|
|
|
|
|
|
Datacc871: ; cc871
|
2014-07-18 16:50:31 +00:00
|
|
|
; +pitch, +length
|
|
|
|
dw 0, $c0
|
|
|
|
dw 0, $40
|
|
|
|
dw 0, $00
|
|
|
|
dw 0, $00
|
2013-12-18 04:54:25 +00:00
|
|
|
; cc881
|
|
|
|
|
|
|
|
|
|
|
|
Functioncc881: ; cc881
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [wcfca]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp $1
|
2015-11-09 21:41:09 +00:00
|
|
|
jr z, .okay
|
2013-12-18 04:54:25 +00:00
|
|
|
cp $4
|
|
|
|
ret nz
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [TypeModifier]
|
|
|
|
and $7f
|
|
|
|
ret z
|
|
|
|
|
|
|
|
cp 10
|
|
|
|
ld de, SFX_DAMAGE
|
|
|
|
jr z, .play
|
|
|
|
|
|
|
|
ld de, SFX_SUPER_EFFECTIVE
|
|
|
|
jr nc, .play
|
|
|
|
|
|
|
|
ld de, SFX_NOT_VERY_EFFECTIVE
|
|
|
|
|
|
|
|
.play
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
|
|
|
; cc8a4
|
|
|
|
|
|
|
|
BattleAnimAssignPals: ; cc8a4
|
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
2015-11-09 21:41:09 +00:00
|
|
|
jr nz, .cgb
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hSGB]
|
|
|
|
and a
|
2015-11-09 21:41:09 +00:00
|
|
|
ld a, %11100000
|
|
|
|
jr z, .sgb
|
|
|
|
ld a, %11110000
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.sgb
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wcfc8], a
|
2015-11-09 21:41:09 +00:00
|
|
|
ld a, %11100100
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wcfc7], a
|
|
|
|
ld [wcfc9], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-09 21:41:09 +00:00
|
|
|
.cgb
|
|
|
|
ld a, %11100100
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wcfc7], a
|
|
|
|
ld [wcfc8], a
|
|
|
|
ld [wcfc9], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call DmgToCgbBGPals
|
2015-11-09 21:41:09 +00:00
|
|
|
lb de, %11100100, %11100100
|
2013-12-18 04:54:25 +00:00
|
|
|
call DmgToCgbObjPals
|
|
|
|
ret
|
|
|
|
; cc8d3
|
|
|
|
|
|
|
|
Functioncc8d3: ; cc8d3
|
2015-11-09 21:41:09 +00:00
|
|
|
; Clear animation block
|
2013-12-18 04:54:25 +00:00
|
|
|
ld hl, LYOverrides
|
2015-11-09 21:41:09 +00:00
|
|
|
ld bc, wBattleAnimEnd - LYOverrides
|
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], $0
|
|
|
|
inc hl
|
|
|
|
dec bc
|
|
|
|
ld a, c
|
|
|
|
or b
|
2015-11-09 21:41:09 +00:00
|
|
|
jr nz, .loop
|
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
ld hl, FXAnimIDLo
|
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2014-01-05 12:28:55 +00:00
|
|
|
ld hl, BattleAnimations
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2015-11-09 21:41:09 +00:00
|
|
|
call GetBattleAnimPointer
|
2013-12-18 04:54:25 +00:00
|
|
|
call BattleAnimAssignPals
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
ret
|
|
|
|
; cc8f6
|
|
|
|
|
|
|
|
Functioncc8f6: ; cc8f6
|
|
|
|
call WaitTop
|
2015-11-09 21:41:09 +00:00
|
|
|
ld a, %11100100
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wcfc7], a
|
|
|
|
ld [wcfc8], a
|
|
|
|
ld [wcfc9], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call DmgToCgbBGPals
|
2015-11-09 21:41:09 +00:00
|
|
|
lb de, %11100100, %11100100
|
2013-12-18 04:54:25 +00:00
|
|
|
call DmgToCgbObjPals
|
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
|
|
|
ld [hSCY], a
|
|
|
|
call BattleAnimDelayFrame
|
|
|
|
ld a, $1
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
ret
|
|
|
|
; cc91a
|
|
|
|
|
|
|
|
Functioncc91a: ; cc91a
|
|
|
|
ld [rBGP], a
|
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BGPals
|
2015-11-20 20:15:32 +00:00
|
|
|
ld de, UnknBGPals
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [rBGP]
|
|
|
|
ld b, a
|
|
|
|
ld c, $7
|
|
|
|
call CopyPals
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, OBPals
|
2015-11-20 20:15:32 +00:00
|
|
|
ld de, UnknOBPals
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [rBGP]
|
|
|
|
ld b, a
|
|
|
|
ld c, $2
|
|
|
|
call CopyPals
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, $1
|
|
|
|
ld [hCGBPalUpdate], a
|
|
|
|
ret
|
|
|
|
; cc94b
|
|
|
|
|
|
|
|
Functioncc94b: ; cc94b
|
|
|
|
ld [rOBP0], a
|
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, OBPals + $10
|
2015-11-20 20:15:32 +00:00
|
|
|
ld de, UnknOBPals + $10
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [rOBP0]
|
|
|
|
ld b, a
|
|
|
|
ld c, $2
|
|
|
|
call CopyPals
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, $1
|
|
|
|
ld [hCGBPalUpdate], a
|
|
|
|
ret
|
|
|
|
; cc96e
|
|
|
|
|
|
|
|
Functioncc96e: ; cc96e
|
|
|
|
ld a, $0
|
2015-02-10 23:14:21 +00:00
|
|
|
ld [w5_d418], a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, OTPartyMon3HP
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, $a
|
|
|
|
.asm_cc978
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_cc98a
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
call Functionccfbe
|
|
|
|
call Functioncca09
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
jr c, .asm_cc9a0
|
|
|
|
|
|
|
|
.asm_cc98a
|
|
|
|
ld bc, $0018
|
|
|
|
add hl, bc
|
|
|
|
dec e
|
|
|
|
jr nz, .asm_cc978
|
2015-02-10 23:14:21 +00:00
|
|
|
ld a, [w5_d418]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
ld h, $c4
|
|
|
|
.asm_cc997
|
|
|
|
ld a, l
|
|
|
|
cp $a0
|
|
|
|
jr nc, .asm_cc9a0
|
|
|
|
xor a
|
|
|
|
ld [hli], a
|
|
|
|
jr .asm_cc997
|
|
|
|
|
|
|
|
.asm_cc9a0
|
|
|
|
ret
|
|
|
|
; cc9a1
|