2015-12-24 18:33:54 +00:00
|
|
|
const_def
|
|
|
|
const BGSQUARE_SIX
|
|
|
|
const BGSQUARE_FOUR
|
|
|
|
const BGSQUARE_TWO
|
|
|
|
const BGSQUARE_SEVEN
|
|
|
|
const BGSQUARE_FIVE
|
|
|
|
const BGSQUARE_THREE
|
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; BG effects for use in battle animations.
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
ExecuteBGEffects: ; c8000 (32:4000)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, ActiveBGEffects
|
2015-12-24 01:46:23 +00:00
|
|
|
ld e, 5
|
2015-12-04 19:33:29 +00:00
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-04 19:33:29 +00:00
|
|
|
jr z, .next
|
2013-12-18 04:54:25 +00:00
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
push hl
|
|
|
|
push de
|
2015-12-24 01:46:23 +00:00
|
|
|
call DoBattleBGEffectFunction
|
2013-12-18 04:54:25 +00:00
|
|
|
pop de
|
|
|
|
pop hl
|
2015-12-04 19:33:29 +00:00
|
|
|
.next
|
2015-12-24 01:46:23 +00:00
|
|
|
ld bc, 4
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
dec e
|
2015-12-04 19:33:29 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
QueueBGEffect: ; c801a (32:401a)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, ActiveBGEffects
|
2015-12-24 01:46:23 +00:00
|
|
|
ld e, 5
|
2015-12-04 19:33:29 +00:00
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-04 19:33:29 +00:00
|
|
|
jr z, .load
|
2015-12-24 01:46:23 +00:00
|
|
|
ld bc, 4
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
dec e
|
2015-12-04 19:33:29 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
scf
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
|
|
|
.load
|
2013-12-18 04:54:25 +00:00
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_FUNCTION
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp0]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hli], a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hli], a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hli], a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp3]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
EndBattleBGEffect: ; c8043 (32:4043)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_FUNCTION
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], 0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 01:46:23 +00:00
|
|
|
DoBattleBGEffectFunction: ; c804a (32:404a)
|
|
|
|
ld hl, BG_EFFECT_STRUCT_FUNCTION
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
ld d, 0
|
|
|
|
ld hl, BattleBGEffects
|
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]
|
|
|
|
|
|
|
|
BattleBGEffects: ; c805a (32:405a)
|
2015-12-04 19:33:29 +00:00
|
|
|
dw BattleBGEffect_End
|
|
|
|
dw BattleBGEffect_FlashInverted
|
|
|
|
dw BattleBGEffect_FlashWhite
|
|
|
|
dw BattleBGEffect_WhiteHues
|
|
|
|
dw BattleBGEffect_BlackHues
|
|
|
|
dw BattleBGEffect_AlternateHues
|
|
|
|
dw BattleBGEffect_06
|
|
|
|
dw BattleBGEffect_07
|
|
|
|
dw BattleBGEffect_08
|
|
|
|
dw BattleBGEffect_HideMon
|
|
|
|
dw BattleBGEffect_ShowMon
|
|
|
|
dw BattleBGEffect_EnterMon
|
|
|
|
dw BattleBGEffect_ReturnMon
|
|
|
|
dw BattleBGEffect_Surf
|
|
|
|
dw BattleBGEffect_Whirlpool
|
|
|
|
dw BattleBGEffect_Teleport
|
|
|
|
dw BattleBGEffect_NightShade
|
|
|
|
dw BattleBGEffect_FeetFollow
|
|
|
|
dw BattleBGEffect_HeadFollow
|
|
|
|
dw BattleBGEffect_DoubleTeam
|
|
|
|
dw BattleBGEffect_AcidArmor
|
|
|
|
dw BattleBGEffect_RapidFlash
|
|
|
|
dw BattleBGEffect_16
|
|
|
|
dw BattleBGEffect_17
|
|
|
|
dw BattleBGEffect_18
|
|
|
|
dw BattleBGEffect_19
|
|
|
|
dw BattleBGEffect_1a
|
|
|
|
dw BattleBGEffect_1b
|
|
|
|
dw BattleBGEffect_1c
|
|
|
|
dw BattleBGEffect_1d
|
|
|
|
dw BattleBGEffect_1e
|
|
|
|
dw BattleBGEffect_1f
|
|
|
|
dw BattleBGEffect_20
|
|
|
|
dw BattleBGEffect_21
|
2015-12-24 18:33:54 +00:00
|
|
|
dw BattleBGEffect_BounceDown
|
|
|
|
dw BattleBGEffect_Dig
|
2015-12-04 19:33:29 +00:00
|
|
|
dw BattleBGEffect_Tackle
|
|
|
|
dw BattleBGEffect_25
|
|
|
|
dw BattleBGEffect_26
|
|
|
|
dw BattleBGEffect_27
|
|
|
|
dw BattleBGEffect_28
|
|
|
|
dw BattleBGEffect_Psychic
|
|
|
|
dw BattleBGEffect_2a
|
|
|
|
dw BattleBGEffect_2b
|
|
|
|
dw BattleBGEffect_2c
|
|
|
|
dw BattleBGEffect_2d
|
|
|
|
dw BattleBGEffect_2e
|
|
|
|
dw BattleBGEffect_2f
|
|
|
|
dw BattleBGEffect_30
|
|
|
|
dw BattleBGEffect_31
|
|
|
|
dw BattleBGEffect_32
|
|
|
|
dw BattleBGEffect_VibrateMon
|
|
|
|
dw BattleBGEffect_WobbleMon
|
|
|
|
dw BattleBGEffect_35
|
|
|
|
|
|
|
|
|
|
|
|
BattleBGEffect_End: ; c80c6 (32:40c6)
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-24 01:46:23 +00:00
|
|
|
BatttleBGEffects_GetNamedJumptablePointer: ; c80ca (32:40ca)
|
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld l, [hl]
|
2015-12-24 01:46:23 +00:00
|
|
|
ld h, 0
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, hl
|
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffects_AnonJumptable: ; c80d7 (32:40d7)
|
2013-12-18 04:54:25 +00:00
|
|
|
pop de
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld l, [hl]
|
2015-12-24 01:46:23 +00:00
|
|
|
ld h, 0
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, hl
|
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
jp [hl]
|
|
|
|
|
2015-12-24 01:46:23 +00:00
|
|
|
BattleBGEffects_IncrementJumptable: ; c80e5 (32:40e5)
|
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_FlashInverted: ; c80eb (32:40eb)
|
2013-12-18 04:54:25 +00:00
|
|
|
ld de, .inverted
|
2015-12-24 01:46:23 +00:00
|
|
|
jp BattleBGEffect_FlashContinue
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c80f1 (32:40f1)
|
|
|
|
|
|
|
|
.inverted
|
|
|
|
db %11100100 ; 3210
|
|
|
|
db %00011011 ; 0123
|
|
|
|
; c80f3
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_FlashWhite: ; c80f3 (32:40f3)
|
2013-12-18 04:54:25 +00:00
|
|
|
ld de, .white
|
2015-12-24 01:46:23 +00:00
|
|
|
jp BattleBGEffect_FlashContinue
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c80f9 (32:40f9)
|
|
|
|
|
|
|
|
.white
|
|
|
|
db %11100100 ; 3210
|
|
|
|
db %00000000 ; 0000
|
|
|
|
; c80fb
|
|
|
|
|
2015-12-24 01:46:23 +00:00
|
|
|
BattleBGEffect_FlashContinue: ; c80fb (32:40fb)
|
|
|
|
; current timer, flash duration, number of flashes
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $1
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 01:46:23 +00:00
|
|
|
jr z, .init
|
2013-12-18 04:54:25 +00:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-24 01:46:23 +00:00
|
|
|
.init
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 01:46:23 +00:00
|
|
|
jr nz, .apply_pal
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-24 01:46:23 +00:00
|
|
|
.apply_pal
|
2013-12-18 04:54:25 +00:00
|
|
|
dec a
|
|
|
|
ld [hl], a
|
|
|
|
and 1
|
|
|
|
ld l, a
|
|
|
|
ld h, 0
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wBGP], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_WhiteHues: ; c812d (32:412d)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c813d
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d57
|
|
|
|
jr c, .asm_c8139
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wBGP], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8139
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c813d (32:413d)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c813d:
|
|
|
|
db $e4, $e0, $d0, $ff
|
|
|
|
; c8141
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_BlackHues: ; c8141 (32:4141)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8151
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d57
|
|
|
|
jr c, .asm_c814d
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wBGP], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c814d
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8151 (32:4151)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8151:
|
|
|
|
db $e4, $f4, $f8, $ff
|
|
|
|
; c8155
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_AlternateHues: ; c8155 (32:4155)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8168
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d57
|
|
|
|
jr c, .asm_c8164
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wBGP], a
|
|
|
|
ld [wOBP1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8164
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8168 (32:4168)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8168:
|
|
|
|
db $e4, $f8, $fc, $f8, $e4, $90, $40, $90, $fe
|
|
|
|
; c8171
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_06: ; c8171 (32:4171)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_CheckSGB
|
|
|
|
jr nz, .sgb
|
|
|
|
ld de, .PalsCGB
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.sgb
|
|
|
|
ld de, .PalsSGB
|
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d57
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wOBP0], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8185 (32:4185)
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.PalsCGB
|
2014-05-05 19:15:56 +00:00
|
|
|
db $e4, $90, $fe
|
|
|
|
; c8188
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.PalsSGB
|
2014-05-05 19:15:56 +00:00
|
|
|
db $f0, $c0, $fe
|
|
|
|
; c818b
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_07: ; c818b (32:418b)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_CheckSGB
|
|
|
|
jr nz, .sgb
|
|
|
|
ld de, .PalsCGB
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.sgb
|
|
|
|
ld de, .PalsSGB
|
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d57
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wOBP0], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c819f (32:419f)
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.PalsCGB
|
2014-05-05 19:15:56 +00:00
|
|
|
db $e4, $d8, $fe
|
|
|
|
; c81a2
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.PalsSGB
|
2014-05-05 19:15:56 +00:00
|
|
|
db $f0, $cc, $fe
|
|
|
|
; c81a5
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_08: ; c81a5 (32:41a5)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld de, .Pals
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d57
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wBGP], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c81af (32:41af)
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.Pals
|
2014-05-05 19:15:56 +00:00
|
|
|
db $1b, $63, $87, $fe
|
|
|
|
; c81b3
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_HideMon: ; c81b3 (32:41b3)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
2015-12-24 01:46:23 +00:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .four
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_side
|
2014-06-04 08:10:56 +00:00
|
|
|
hlcoord 12, 0
|
2015-12-04 19:33:29 +00:00
|
|
|
lb bc, 7, 7
|
2015-12-24 18:33:54 +00:00
|
|
|
jr .got_pointer
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.player_side
|
2014-06-04 08:10:56 +00:00
|
|
|
hlcoord 2, 6
|
2015-11-01 14:38:48 +00:00
|
|
|
lb bc, 6, 6
|
2015-12-24 18:33:54 +00:00
|
|
|
.got_pointer
|
2013-12-18 04:54:25 +00:00
|
|
|
call ClearBox
|
|
|
|
pop bc
|
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapThird], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.four
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_ShowMon: ; c81ea (32:41ea)
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckFlyDigStatus
|
|
|
|
jr z, .not_flying
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.not_flying
|
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_side
|
|
|
|
ld de, .EnemyData
|
|
|
|
jr .got_pointer
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.player_side
|
|
|
|
ld de, .PlayerData
|
|
|
|
.got_pointer
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, d
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffect_RunPicResizeScript
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c820c (32:420c)
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.PlayerData
|
|
|
|
db 0, $31, 0
|
|
|
|
db -1
|
2014-05-05 19:15:56 +00:00
|
|
|
; c8210
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.EnemyData
|
|
|
|
db 3, $00, 3
|
|
|
|
db -1
|
2014-05-05 19:15:56 +00:00
|
|
|
; c8214
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_FeetFollow: ; c8214 (32:4214)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
2015-12-24 01:46:23 +00:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .five
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
|
|
|
call BGEffect_CheckFlyDigStatus
|
|
|
|
jr z, .not_flying_digging
|
2015-12-23 19:00:29 +00:00
|
|
|
ld hl, wNumActiveBattleAnims
|
2013-12-18 04:54:25 +00:00
|
|
|
inc [hl]
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.not_flying_digging
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn
|
|
|
|
ld a, ANIM_OBJ_B8
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld a, 16 * 8 + 4
|
|
|
|
jr .okay
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.player_turn
|
|
|
|
ld a, ANIM_OBJ_B9
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld a, 6 * 8
|
|
|
|
.okay
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld a, 8 * 8
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp3], a
|
2015-12-04 19:33:29 +00:00
|
|
|
call _QueueBattleAnimation
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn_2
|
2014-06-04 08:10:56 +00:00
|
|
|
hlcoord 12, 6
|
2015-12-24 18:33:54 +00:00
|
|
|
lb bc, 1, 7
|
|
|
|
jr .okay2
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.player_turn_2
|
2014-06-04 08:10:56 +00:00
|
|
|
hlcoord 2, 6
|
2015-11-01 14:38:48 +00:00
|
|
|
lb bc, 1, 6
|
2015-12-24 18:33:54 +00:00
|
|
|
.okay2
|
2013-12-18 04:54:25 +00:00
|
|
|
call ClearBox
|
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.five
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_HeadFollow: ; c8281 (32:4281)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
2015-12-24 01:46:23 +00:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .five
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
|
|
|
call BGEffect_CheckFlyDigStatus
|
|
|
|
jr z, .not_flying_digging
|
2015-12-23 19:00:29 +00:00
|
|
|
ld hl, wNumActiveBattleAnims
|
2013-12-18 04:54:25 +00:00
|
|
|
inc [hl]
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.not_flying_digging
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn
|
|
|
|
ld a, ANIM_OBJ_BA
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld a, 16 * 8 + 4
|
|
|
|
jr .okay
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.player_turn
|
|
|
|
ld a, ANIM_OBJ_BB
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld a, 6 * 8
|
|
|
|
.okay
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld a, 8 * 8
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp3], a
|
2015-12-04 19:33:29 +00:00
|
|
|
call _QueueBattleAnimation
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn_2
|
2014-06-04 08:10:56 +00:00
|
|
|
hlcoord 12, 5
|
2015-12-24 18:33:54 +00:00
|
|
|
lb bc, 2, 7
|
|
|
|
jr .okay2
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.player_turn_2
|
2014-06-04 08:10:56 +00:00
|
|
|
hlcoord 2, 6
|
2015-11-01 14:38:48 +00:00
|
|
|
lb bc, 2, 6
|
2015-12-24 18:33:54 +00:00
|
|
|
.okay2
|
2013-12-18 04:54:25 +00:00
|
|
|
call ClearBox
|
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.five
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
_QueueBattleAnimation: ; c82ee (32:42ee)
|
|
|
|
callab QueueBattleAnimation
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_27: ; c82f5 (32:42f5)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
2015-12-24 01:46:23 +00:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .four
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .user
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $9
|
2015-12-24 18:33:54 +00:00
|
|
|
jr .okay
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.user
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $8
|
2015-12-24 18:33:54 +00:00
|
|
|
.okay
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .user_2
|
2014-06-04 08:10:56 +00:00
|
|
|
hlcoord 0, 6
|
2015-12-24 18:33:54 +00:00
|
|
|
lb de, 8, 6
|
|
|
|
.row1
|
2013-12-18 04:54:25 +00:00
|
|
|
push de
|
|
|
|
push hl
|
2015-12-24 18:33:54 +00:00
|
|
|
.col1
|
2013-12-18 04:54:25 +00:00
|
|
|
inc hl
|
|
|
|
ld a, [hld]
|
|
|
|
ld [hli], a
|
|
|
|
dec d
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .col1
|
2013-12-18 04:54:25 +00:00
|
|
|
pop hl
|
2015-12-24 18:33:54 +00:00
|
|
|
ld de, SCREEN_WIDTH
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
|
|
|
pop de
|
|
|
|
dec e
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .row1
|
|
|
|
jr .okay2
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.user_2
|
2014-06-04 08:10:56 +00:00
|
|
|
hlcoord 19, 0
|
2015-12-24 18:33:54 +00:00
|
|
|
lb de, 8, 7
|
|
|
|
.row2
|
2013-12-18 04:54:25 +00:00
|
|
|
push de
|
|
|
|
push hl
|
2015-12-24 18:33:54 +00:00
|
|
|
.col2
|
2013-12-18 04:54:25 +00:00
|
|
|
dec hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld [hld], a
|
|
|
|
dec d
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .col2
|
2013-12-18 04:54:25 +00:00
|
|
|
pop hl
|
2015-12-24 18:33:54 +00:00
|
|
|
ld de, SCREEN_WIDTH
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
|
|
|
pop de
|
|
|
|
dec e
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .row2
|
|
|
|
.okay2
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapThird], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.four
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .done
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.done
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_EnterMon: ; c837b (32:437b)
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn
|
|
|
|
ld de, .EnemyData
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_turn
|
|
|
|
ld de, .PlayerData
|
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, d
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffect_RunPicResizeScript
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8394 (32:4394)
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.PlayerData
|
|
|
|
db 2, $31, 2
|
|
|
|
db 1, $31, 1
|
|
|
|
db 0, $31, 0
|
|
|
|
db -1
|
2014-05-05 19:15:56 +00:00
|
|
|
; c839e
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.EnemyData
|
|
|
|
db 5, $00, 5
|
|
|
|
db 4, $00, 4
|
|
|
|
db 3, $00, 3
|
|
|
|
db -1
|
2014-05-05 19:15:56 +00:00
|
|
|
; c83a8
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_ReturnMon: ; c83a8 (32:43a8)
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn
|
|
|
|
ld de, .EnemyData
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_turn
|
|
|
|
ld de, .PlayerData
|
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, d
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffect_RunPicResizeScript
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c83c1 (32:43c1)
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.PlayerData
|
|
|
|
db 0, $31, 0
|
|
|
|
db -2, $66, 0
|
|
|
|
db 1, $31, 1
|
|
|
|
db -2, $44, 1
|
|
|
|
db 2, $31, 2
|
|
|
|
db -2, $22, 2
|
|
|
|
db -3, $00, 0
|
|
|
|
db -1
|
2014-05-05 19:15:56 +00:00
|
|
|
; c83d7
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.EnemyData
|
|
|
|
db 3, $00, 3
|
|
|
|
db -2, $77, 3
|
|
|
|
db 4, $00, 4
|
|
|
|
db -2, $55, 4
|
|
|
|
db 5, $00, 5
|
|
|
|
db -2, $33, 5
|
|
|
|
db -3, $00, 0
|
|
|
|
db -1
|
2014-05-05 19:15:56 +00:00
|
|
|
; c83ed
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
BattleBGEffect_RunPicResizeScript: ; c83ed (32:43ed)
|
2015-12-04 19:33:29 +00:00
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
2015-12-24 01:46:23 +00:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .restart
|
|
|
|
dw .end
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
ld d, $0
|
|
|
|
inc [hl]
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld h, a
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 3
|
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, [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
cp -1
|
|
|
|
jr z, .end
|
|
|
|
cp -2
|
|
|
|
jr z, .clear
|
|
|
|
cp -3
|
|
|
|
jr z, .skip
|
|
|
|
call .FillBox
|
|
|
|
.skip
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.clear
|
|
|
|
call .ClearBox
|
|
|
|
jr .zero
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.restart
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.end
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hBGMapMode], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.ClearBox
|
|
|
|
; get dims
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
|
|
|
inc hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
and $f
|
|
|
|
ld c, a
|
|
|
|
ld a, b
|
|
|
|
swap a
|
|
|
|
and $f
|
|
|
|
ld b, a
|
2015-12-24 18:33:54 +00:00
|
|
|
; get coords
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
2014-05-05 19:15:56 +00:00
|
|
|
ld d, 0
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, .Coords
|
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
|
|
|
|
call ClearBox
|
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.FillBox
|
|
|
|
; get dims
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
ld e, [hl]
|
2014-05-05 19:15:56 +00:00
|
|
|
ld d, 0
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, .BGSquares
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 3
|
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 b, a
|
|
|
|
and $f
|
|
|
|
ld c, a
|
|
|
|
ld a, b
|
|
|
|
swap a
|
|
|
|
and $f
|
|
|
|
ld b, a
|
2015-12-24 18:33:54 +00:00
|
|
|
; store pointer
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
; get byte
|
2013-12-18 04:54:25 +00:00
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
ld a, [hli]
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 18:33:54 +00:00
|
|
|
; get coord
|
2013-12-18 04:54:25 +00:00
|
|
|
push de
|
|
|
|
ld e, [hl]
|
2014-05-05 19:15:56 +00:00
|
|
|
ld d, 0
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, .Coords
|
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
|
|
|
|
pop de
|
2015-12-24 18:33:54 +00:00
|
|
|
; fill box
|
|
|
|
.row
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
|
|
|
push hl
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp0]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld b, a
|
2015-12-24 18:33:54 +00:00
|
|
|
.col
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [de]
|
|
|
|
add b
|
|
|
|
ld [hli], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .col
|
2013-12-18 04:54:25 +00:00
|
|
|
pop hl
|
2015-12-24 18:33:54 +00:00
|
|
|
ld bc, SCREEN_WIDTH
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .row
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.Coords
|
2015-02-08 07:06:52 +00:00
|
|
|
dwcoord 2, 6
|
|
|
|
dwcoord 3, 8
|
|
|
|
dwcoord 4, 10
|
|
|
|
dwcoord 12, 0
|
|
|
|
dwcoord 13, 2
|
|
|
|
dwcoord 14, 4
|
2015-12-24 18:33:54 +00:00
|
|
|
|
|
|
|
.BGSquares
|
|
|
|
bgsquare: MACRO
|
|
|
|
dn \1,\2
|
|
|
|
dw \3
|
|
|
|
endm
|
|
|
|
|
|
|
|
bgsquare 6, 6, .SixBySix
|
|
|
|
bgsquare 4, 4, .FourByFour
|
|
|
|
bgsquare 2, 2, .TwoByTwo
|
|
|
|
bgsquare 7, 7, .SevenBySeven
|
|
|
|
bgsquare 5, 5, .FiveByFive
|
|
|
|
bgsquare 3, 3, .ThreeByThree
|
|
|
|
|
|
|
|
.SixBySix
|
2014-05-05 19:15:56 +00:00
|
|
|
db $00, $06, $0c, $12, $18, $1e
|
|
|
|
db $01, $07, $0d, $13, $19, $1f
|
|
|
|
db $02, $08, $0e, $14, $1a, $20
|
|
|
|
db $03, $09, $0f, $15, $1b, $21
|
|
|
|
db $04, $0a, $10, $16, $1c, $22
|
|
|
|
db $05, $0b, $11, $17, $1d, $23
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.FourByFour
|
2014-05-05 19:15:56 +00:00
|
|
|
db $00, $0c, $12, $1e
|
|
|
|
db $02, $0e, $14, $20
|
|
|
|
db $03, $0f, $15, $21
|
|
|
|
db $05, $11, $17, $23
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.TwoByTwo
|
2014-05-05 19:15:56 +00:00
|
|
|
db $00, $1e
|
|
|
|
db $05, $23
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.SevenBySeven
|
2014-05-05 19:15:56 +00:00
|
|
|
db $00, $07, $0e, $15, $1c, $23, $2a
|
|
|
|
db $01, $08, $0f, $16, $1d, $24, $2b
|
|
|
|
db $02, $09, $10, $17, $1e, $25, $2c
|
|
|
|
db $03, $0a, $11, $18, $1f, $26, $2d
|
|
|
|
db $04, $0b, $12, $19, $20, $27, $2e
|
|
|
|
db $05, $0c, $13, $1a, $21, $28, $2f
|
|
|
|
db $06, $0d, $14, $1b, $22, $29, $30
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.FiveByFive
|
2014-05-05 19:15:56 +00:00
|
|
|
db $00, $07, $15, $23, $2a
|
|
|
|
db $01, $08, $16, $24, $2b
|
|
|
|
db $03, $0a, $18, $26, $2d
|
|
|
|
db $05, $0c, $1a, $28, $2f
|
|
|
|
db $06, $0d, $1b, $29, $30
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.ThreeByThree
|
2014-05-05 19:15:56 +00:00
|
|
|
db $00, $15, $2a
|
|
|
|
db $03, $18, $2d
|
|
|
|
db $06, $1b, $30
|
|
|
|
; c8545
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_Surf: ; c8545 (32:4545)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 03:51:50 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 03:51:50 +00:00
|
|
|
lb de, 2, 2
|
|
|
|
call InitSurfWaves
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hLCDStatCustom]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
push bc
|
2015-12-24 03:51:50 +00:00
|
|
|
call .RotatewSurfWaveBGEffect
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.RotatewSurfWaveBGEffect
|
2015-12-24 03:51:50 +00:00
|
|
|
ld hl, wSurfWaveBGEffect
|
|
|
|
ld de, wSurfWaveBGEffect + 1
|
|
|
|
ld c, wSurfWaveBGEffectEnd - wSurfWaveBGEffect - 1
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
2015-12-24 03:51:50 +00:00
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-12-24 03:51:50 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
|
|
|
ld [hl], a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld de, LYOverridesBackup
|
2015-12-24 03:51:50 +00:00
|
|
|
ld hl, wSurfWaveBGEffect
|
2013-12-18 04:54:25 +00:00
|
|
|
ld bc, $0
|
2015-12-24 03:51:50 +00:00
|
|
|
.loop2
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp e
|
2015-12-24 03:51:50 +00:00
|
|
|
jr nc, .load_zero
|
2013-12-18 04:54:25 +00:00
|
|
|
push hl
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
pop hl
|
2015-12-24 03:51:50 +00:00
|
|
|
jr .okay
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 03:51:50 +00:00
|
|
|
.load_zero
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-12-24 03:51:50 +00:00
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [de], a
|
|
|
|
ld a, c
|
|
|
|
inc a
|
|
|
|
and $3f
|
|
|
|
ld c, a
|
|
|
|
inc de
|
|
|
|
ld a, e
|
|
|
|
cp $5f
|
2015-12-24 03:51:50 +00:00
|
|
|
jr c, .loop2
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_Whirlpool: ; c8599 (32:4599)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $42
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hLCDStatCustom], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $5e
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
lb de, 2, 2
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
|
|
|
call BattleBGEffect_WavyScreenFX
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_30: ; c85c2 (32:45c2)
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $42
|
|
|
|
call Functionc8ede
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_31: ; c85ce (32:45ce)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld e, a
|
|
|
|
add $4
|
|
|
|
ld [hl], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f0
|
|
|
|
swap a
|
|
|
|
xor $ff
|
|
|
|
add $4
|
|
|
|
ld d, a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $20
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nc, .done
|
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
|
|
|
call Functionc8f9a
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.done
|
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_32: ; c8603 (32:4603)
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_Psychic: ; c8607 (32:4607)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hLCDStatCustom], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $5f
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
lb de, 6, 5
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8f2e
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
and $3
|
|
|
|
ret nz
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffect_WavyScreenFX
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_Teleport: ; c863f (32:463f)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
2015-12-24 18:33:54 +00:00
|
|
|
lb de, 6, 5
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
|
|
|
call BattleBGEffect_WavyScreenFX
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_NightShade: ; c8662 (32:4662)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $42
|
|
|
|
call Functionc8ede
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
ld d, 2
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
|
|
|
call BattleBGEffect_WavyScreenFX
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_DoubleTeam: ; c8689 (32:4689)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
|
|
|
dw .three
|
|
|
|
dw .four
|
|
|
|
dw .five
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $10
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nc, .next
|
2013-12-18 04:54:25 +00:00
|
|
|
inc [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
call .UpdateLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.three
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .next
|
2013-12-18 04:54:25 +00:00
|
|
|
dec [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
call .UpdateLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.next
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $2
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleBGEffects_Sine
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
call .UpdateLYOverrides
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $4
|
|
|
|
ld [hl], a
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.four
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.UpdateLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, a
|
|
|
|
xor $ff
|
|
|
|
inc a
|
|
|
|
ld d, a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld h, LYOverridesBackup / $100
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub l
|
|
|
|
srl a
|
|
|
|
push af
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
inc hl
|
|
|
|
dec a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
|
|
|
ret nc
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.five
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_AcidArmor: ; c8709 (32:4709)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $42
|
|
|
|
call Functionc8ede
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
ld d, 2
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8f2e
|
|
|
|
ld h, $d2
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
ld [hl], $0
|
|
|
|
dec l
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
ld h, $d2
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
dec de
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [de]
|
|
|
|
dec de
|
|
|
|
ld [hld], a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp l
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], $90
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
ld a, [hl]
|
|
|
|
cp $1
|
2015-12-24 18:33:54 +00:00
|
|
|
jr c, .okay
|
2013-12-18 04:54:25 +00:00
|
|
|
cp $90
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
dec l
|
|
|
|
ld a, [hl]
|
|
|
|
cp $2
|
|
|
|
ret c
|
|
|
|
cp $90
|
|
|
|
ret z
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_21: ; c8761 (32:4761)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $42
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $3f
|
|
|
|
ld d, a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp d
|
|
|
|
ret nc
|
|
|
|
call Functionc901b
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
rlca
|
|
|
|
rlca
|
|
|
|
and $3
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
BattleBGEffect_Dig: ; c87a7 (32:47a7)
|
2015-12-04 19:33:29 +00:00
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
|
|
|
dw .three
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $42
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $2
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .next
|
2013-12-18 04:54:25 +00:00
|
|
|
dec [hl]
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.next
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], $10
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub l
|
|
|
|
dec a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
cp [hl]
|
|
|
|
ret c
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
and $7
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .skip
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
.skip
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
|
|
|
call Functionc901b
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
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
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.three
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_Tackle: ; c8805 (32:4805)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw Tackle_BGEffect25_2d_one
|
|
|
|
dw Tackle_BGEffect25_2d_two
|
|
|
|
dw .three
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_side
|
|
|
|
ld a, 2
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_side
|
|
|
|
ld a, -2
|
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.three
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_25: ; c8837 (32:4837)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw Tackle_BGEffect25_2d_one
|
|
|
|
dw Tackle_BGEffect25_2d_two
|
|
|
|
dw .three
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ef4
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_side
|
|
|
|
ld a, 2
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_side
|
|
|
|
ld a, -2
|
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.three
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
Tackle_BGEffect25_2d_one:
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
cp -8
|
|
|
|
jr z, .reached_limit
|
|
|
|
cp 8
|
|
|
|
jr nz, .finish
|
|
|
|
.reached_limit
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
.finish
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc88a5
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
Tackle_BGEffect25_2d_two:
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_c8893
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8893
|
|
|
|
call Functionc88a5
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
xor $ff
|
|
|
|
inc a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc88a5: ; c88a5 (32:48a5)
|
|
|
|
push af
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [FXAnimIDHi] ; FXAnimIDHi
|
2013-12-18 04:54:25 +00:00
|
|
|
or a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .not_rollout
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [FXAnimIDLo] ; FXAnimID
|
2014-05-05 19:15:56 +00:00
|
|
|
cp ROLLOUT
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .rollout
|
|
|
|
.not_rollout
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
|
|
|
jp Functionc900b
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.rollout
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld d, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub d
|
|
|
|
ld d, a
|
2014-05-05 19:15:56 +00:00
|
|
|
ld h, LYOverridesBackup / $100
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hSCY]
|
2013-12-18 04:54:25 +00:00
|
|
|
or a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .skip1
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
or a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .skip2
|
2013-12-18 04:54:25 +00:00
|
|
|
dec a
|
|
|
|
ld l, a
|
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
jr .skip2
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.skip1
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
dec a
|
|
|
|
ld l, a
|
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
.skip2
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hSCY]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub l
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nc, .skip3
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
|
|
|
dec d
|
2015-12-24 18:33:54 +00:00
|
|
|
.skip3
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
pop af
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hli], a
|
|
|
|
dec d
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_2d: ; c88e7 (32:48e7)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw BGEffect2d_2f_zero
|
|
|
|
dw Tackle_BGEffect25_2d_one
|
|
|
|
dw Tackle_BGEffect25_2d_two
|
|
|
|
dw .three
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.three
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
BGEffect2d_2f_zero:
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn
|
|
|
|
ld a, -2
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_turn
|
|
|
|
ld a, 2
|
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_2f: ; c8919 (32:4919)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw BGEffect2d_2f_zero
|
|
|
|
dw Tackle_BGEffect25_2d_one
|
|
|
|
dw .two
|
|
|
|
dw Tackle_BGEffect25_2d_two
|
|
|
|
dw .four
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.four
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_26: ; c892a (32:492a)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
dw Functionc8933
|
|
|
|
dw Functionc894a
|
|
|
|
dw Functionc8960
|
|
|
|
|
|
|
|
|
|
|
|
Functionc8933: ; c8933 (32:4933)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc894a: ; c894a (32:494a)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $8
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleBGEffects_Sine
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc900b
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $4
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8960: ; c8960 (32:4960)
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_2c: ; c8964 (32:4964)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
dw Functionc896d
|
|
|
|
dw Functionc8985
|
|
|
|
dw Functionc89b1
|
|
|
|
|
|
|
|
|
|
|
|
Functionc896d: ; c896d (32:496d)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8985: ; c8985 (32:4985)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $6
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleBGEffects_Sine
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $2
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleBGEffects_Sine
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, a
|
|
|
|
pop af
|
|
|
|
add e
|
|
|
|
call Functionc900b
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $8
|
|
|
|
ld [hl], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $2
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc89b1: ; c89b1 (32:49b1)
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_28: ; c89b5 (32:49b5)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
dw Functionc89be
|
|
|
|
dw Functionc89ca
|
|
|
|
dw Functionc89da
|
|
|
|
|
|
|
|
|
|
|
|
Functionc89be: ; c89be (32:49be)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc89ca: ; c89ca (32:49ca)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $20
|
|
|
|
ret nc
|
|
|
|
inc [hl]
|
|
|
|
ld d, a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld e, 4
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc89da: ; c89da (32:49da)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_c89ea
|
|
|
|
dec [hl]
|
|
|
|
ld d, a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld e, 4
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c89ea
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
BattleBGEffect_BounceDown: ; c89ee (32:49ee)
|
2015-12-04 19:33:29 +00:00
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-18 04:54:25 +00:00
|
|
|
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $42
|
|
|
|
call Functionc8ef4
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $20
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $38
|
|
|
|
ret nc
|
|
|
|
push af
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $10
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleBGEffects_Cosine
|
2013-12-18 04:54:25 +00:00
|
|
|
add $10
|
|
|
|
ld d, a
|
|
|
|
pop af
|
|
|
|
add d
|
|
|
|
call Functionc901b
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
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
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_2a: ; c8a3a (32:4a3a)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
|
|
|
dw .three
|
|
|
|
dw .four
|
|
|
|
dw .five
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.zero
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $e4
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_SetLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $47
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
ld h, $d2
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp l
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .done
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr .loop
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.done
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
.one
|
|
|
|
.four
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.two
|
|
|
|
call .GetLYOverride
|
|
|
|
jr nc, .next
|
|
|
|
call .SetLYOverridesBackup
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.next
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.three
|
|
|
|
call .GetLYOverride
|
|
|
|
jr nc, .finish
|
|
|
|
call .SetLYOverridesBackup
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
dec a
|
|
|
|
ld l, a
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.finish
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.SetLYOverridesBackup
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub l
|
|
|
|
srl a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld h, LYOverridesBackup / $100
|
|
|
|
.loop2
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
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
|
|
|
dec a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .loop2
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.five
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8f19
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.GetLYOverride
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
ld e, a
|
2014-05-05 19:15:56 +00:00
|
|
|
ld d, 0
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, .data
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.data
|
|
|
|
db $00, $40, $90, $e4
|
|
|
|
db -1
|
2014-05-05 19:15:56 +00:00
|
|
|
; c8acc
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_2b: ; c8acc (32:4acc)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
dw Functionc8ad3
|
|
|
|
dw Functionc8ae5
|
|
|
|
|
|
|
|
|
|
|
|
Functionc8ad3: ; c8ad3 (32:4ad3)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $40
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8ae5: ; c8ae5 (32:4ae5)
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_c8afc
|
|
|
|
dec [hl]
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
and $f
|
|
|
|
ld d, a
|
|
|
|
ld e, a
|
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8afc
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_1c: ; c8b00 (32:4b00)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hCGB]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr nz, asm_c8b7a
|
2015-12-04 19:33:29 +00:00
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
dw Functionc8b0e
|
|
|
|
dw Functionc8b22
|
|
|
|
dw Functionc8b60
|
|
|
|
|
|
|
|
|
|
|
|
Functionc8b0e: ; c8b0e (32:4b0e)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $e4
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_SetLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $47
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hLCDStatCustom], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $60
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8b22: ; c8b22 (32:4b22)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
ld e, a
|
|
|
|
and $7
|
|
|
|
ret nz
|
|
|
|
ld a, e
|
|
|
|
and $18
|
|
|
|
sla a
|
|
|
|
swap a
|
|
|
|
sla a
|
|
|
|
ld e, a
|
|
|
|
ld d, $0
|
|
|
|
push bc
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
2013-12-18 04:54:25 +00:00
|
|
|
jr nz, .asm_c8b4d
|
2014-05-05 19:15:56 +00:00
|
|
|
ld hl, Unknown_c8bd8
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wOBP1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld d, a
|
|
|
|
ld e, [hl]
|
|
|
|
ld bc, $2f30
|
|
|
|
jr .asm_c8b5b
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8b4d
|
2014-05-05 19:15:56 +00:00
|
|
|
ld hl, Unknown_c8be0
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
|
|
|
ld d, [hl]
|
|
|
|
inc hl
|
|
|
|
ld a, [hl]
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wOBP1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, a
|
|
|
|
ld bc, $3728
|
|
|
|
.asm_c8b5b
|
|
|
|
call Functionc8b6c
|
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8b60: ; c8b60 (32:4b60)
|
|
|
|
call Functionc8f19
|
|
|
|
ld a, $e4
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wBGP], a
|
|
|
|
ld [wOBP1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8b6c: ; c8b6c (32:4b6c)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, LYOverridesBackup
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8b6f
|
|
|
|
ld [hl], d
|
|
|
|
inc hl
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_c8b6f
|
|
|
|
.asm_c8b74
|
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_c8b74
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
asm_c8b7a: ; c8b7a (32:4b7a)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Jumptable_c8b81
|
2015-12-24 01:46:23 +00:00
|
|
|
call BatttleBGEffects_GetNamedJumptablePointer
|
2013-12-18 04:54:25 +00:00
|
|
|
jp [hl]
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8b81 (32:4b81)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Jumptable_c8b81: ; c8b81
|
|
|
|
dw Functionc8b87
|
|
|
|
dw Functionc8b91
|
|
|
|
dw Functionc8bca
|
|
|
|
; c8b87
|
|
|
|
|
|
|
|
Functionc8b87: ; c8b87
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2014-05-05 19:15:56 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
; c8b91
|
|
|
|
|
|
|
|
Functionc8b91: ; c8b91
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2014-05-05 19:15:56 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
ld e, a
|
|
|
|
and $7
|
|
|
|
ret nz
|
|
|
|
ld a, e
|
|
|
|
and $18
|
|
|
|
sla a
|
|
|
|
swap a
|
|
|
|
sla a
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
2014-05-05 19:15:56 +00:00
|
|
|
jr nz, .asm_c8bbb
|
|
|
|
ld hl, Unknown_c8bd8
|
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
|
|
|
call Functionc8e7f
|
|
|
|
pop hl
|
|
|
|
ld a, [hl]
|
|
|
|
call Functionc8e52
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_c8bbb
|
|
|
|
ld hl, Unknown_c8bd8
|
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
|
|
|
call Functionc8e52
|
|
|
|
pop hl
|
|
|
|
ld a, [hl]
|
|
|
|
call Functionc8e7f
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
; c8bca
|
|
|
|
|
|
|
|
Functionc8bca: ; c8bca
|
|
|
|
ld a, $e4
|
|
|
|
call Functionc8e52
|
|
|
|
ld a, $e4
|
|
|
|
call Functionc8e7f
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
; c8bd8
|
|
|
|
|
|
|
|
Unknown_c8bd8: ; c8bd8
|
|
|
|
db $e4, $e4
|
|
|
|
db $f8, $90
|
|
|
|
db $fc, $40
|
|
|
|
db $f8, $90
|
|
|
|
; c8be0
|
|
|
|
|
|
|
|
Unknown_c8be0: ; c8be0
|
|
|
|
db $e4, $e4
|
|
|
|
db $90, $f8
|
|
|
|
db $40, $fc
|
|
|
|
db $90, $f8
|
|
|
|
; c8be8
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_RapidFlash: ; c8be8 (32:4be8)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8bef
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8bef (32:4bef)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8bef: ; c8bef
|
|
|
|
db $e4, $6c, $fe
|
|
|
|
; c8bf2
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_16: ; c8bf2 (32:4bf2)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8bf9
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8bf9 (32:4bf9)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8bf9: ; c8bf9
|
|
|
|
db $e4, $90, $40, $ff
|
|
|
|
; c8bfd
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_17: ; c8bfd (32:4bfd)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8c04
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8c04 (32:4c04)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8c04: ; c8c04
|
|
|
|
db $e4, $f8, $fc, $ff
|
|
|
|
; c8c08
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_18: ; c8c08 (32:4c08)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8c0f
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8c0f (32:4c0f)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8c0f: ; c8c0f
|
|
|
|
db $e4, $90, $40, $90, $fe
|
|
|
|
; c8c14
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_19: ; c8c14 (32:4c14)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8c1b
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8c1b (32:4c1b)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8c1b: ; c8c1b
|
|
|
|
db $e4, $f8, $fc, $f8, $fe
|
|
|
|
; c8c20
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_1a: ; c8c20 (32:4c20)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8c27
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8c27 (32:4c27)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8c27: ; c8c27
|
|
|
|
db $e4, $f8, $fc, $f8, $e4, $90, $40, $90, $fe
|
|
|
|
; c8c30
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_1b: ; c8c30 (32:4c30)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8c37
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8c37 (32:4c37)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8c37:
|
|
|
|
db $e4, $fc, $e4, $00, $fe
|
|
|
|
; c8c3c
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_1d: ; c8c3c (32:4c3c)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8c43
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8c43 (32:4c43)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8c43:
|
|
|
|
db $e4, $90, $40, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $40, $90, $e4, $ff
|
|
|
|
; c8c55
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_1e: ; c8c55 (32:4c55)
|
2014-05-05 19:15:56 +00:00
|
|
|
ld de, Unknown_c8c5c
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d77
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c8c5c (32:4c5c)
|
|
|
|
|
2014-05-05 19:15:56 +00:00
|
|
|
Unknown_c8c5c:
|
|
|
|
db $00, $40, $90, $e4, $ff
|
|
|
|
; c8c61
|
2013-12-18 04:54:25 +00:00
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_VibrateMon: ; c8c61 (32:4c61)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
dw Functionc8c68
|
|
|
|
dw Functionc8c85
|
|
|
|
|
|
|
|
|
|
|
|
Functionc8c68: ; c8c68 (32:4c68)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $20
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8c85: ; c8c85 (32:4c85)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_c8c9e
|
|
|
|
dec [hl]
|
|
|
|
and $1
|
|
|
|
ret nz
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
xor $ff
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
|
|
|
call Functionc900b
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8c9e
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_WobbleMon: ; c8ca2 (32:4ca2)
|
|
|
|
call BattleBGEffects_AnonJumptable
|
|
|
|
.anon_jumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
dw Functionc8cab
|
|
|
|
dw Functionc8cc3
|
|
|
|
dw Functionc8cdd
|
|
|
|
|
|
|
|
|
|
|
|
Functionc8cab: ; c8cab (32:4cab)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $43
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hLCDStatCustom], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $37
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8cc3: ; c8cc3 (32:4cc3)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $40
|
|
|
|
jr nc, Functionc8cdd
|
|
|
|
ld d, $6
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleBGEffects_Sine
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc900b
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $2
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8cdd: ; c8cdd (32:4cdd)
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_2e: ; c8ce1 (32:4ce1)
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d0b
|
|
|
|
jr c, .asm_c8cea
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_c8ceb
|
|
|
|
.asm_c8cea
|
|
|
|
xor a
|
|
|
|
.asm_c8ceb
|
|
|
|
push af
|
|
|
|
call DelayFrame
|
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hSCY], a
|
2013-12-18 04:54:25 +00:00
|
|
|
xor $ff
|
|
|
|
inc a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [OTPartyMon3SpclAtk], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_1f: ; c8cf9 (32:4cf9)
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d0b
|
|
|
|
jr nc, .asm_c8cff
|
|
|
|
xor a
|
|
|
|
.asm_c8cff
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hSCX], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_20: ; c8d02 (32:4d02)
|
2013-12-18 04:54:25 +00:00
|
|
|
call Functionc8d0b
|
|
|
|
jr nc, .asm_c8d08
|
|
|
|
xor a
|
|
|
|
.asm_c8d08
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hSCY], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8d0b: ; c8d0b (32:4d0b)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_c8d18
|
|
|
|
call EndBattleBGEffect
|
|
|
|
scf
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8d18
|
|
|
|
dec [hl]
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr z, .asm_c8d2a
|
|
|
|
dec [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8d2a
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
xor $ff
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-04 19:33:29 +00:00
|
|
|
BattleBGEffect_35: ; c8d3a (32:4d3a)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $40
|
|
|
|
jr nc, .asm_c8d53
|
|
|
|
ld d, $6
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleBGEffects_Sine
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hSCX], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $2
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8d53
|
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hSCX], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8d57: ; c8d57 (32:4d57)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_c8d69
|
|
|
|
|
|
|
|
dec [hl]
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
call Functionc8eb2
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_c8d69
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
call Functionc8eac
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8d77: ; c8d77 (32:4d77)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hCGB]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
jr nz, asm_c8dd4
|
|
|
|
push de
|
|
|
|
ld de, Jumptable_c8d85
|
2015-12-24 01:46:23 +00:00
|
|
|
call BatttleBGEffects_GetNamedJumptablePointer
|
2013-12-18 04:54:25 +00:00
|
|
|
pop de
|
|
|
|
jp [hl]
|
|
|
|
|
|
|
|
Jumptable_c8d85: ; c8d85 (32:4d85)
|
|
|
|
dw Functionc8d8b
|
|
|
|
dw Functionc8daa
|
|
|
|
dw Functionc8dc9
|
|
|
|
|
|
|
|
|
|
|
|
Functionc8d8b: ; c8d8b (32:4d8b)
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $e4
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_SetLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $47
|
|
|
|
call Functionc8ede
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
inc a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8daa: ; c8daa (32:4daa)
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr z, .asm_c8db5
|
|
|
|
dec [hl]
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8db5
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
|
|
|
call Functionc8eac
|
|
|
|
jr c, .asm_c8dc3
|
|
|
|
call Functionc900b
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8dc3
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8dc9: ; c8dc9 (32:4dc9)
|
|
|
|
call Functionc8f19
|
|
|
|
ld a, $e4
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rBGP], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
asm_c8dd4: ; c8dd4 (32:4dd4)
|
|
|
|
push de
|
|
|
|
ld de, Jumptable_c8ddd
|
2015-12-24 01:46:23 +00:00
|
|
|
call BatttleBGEffects_GetNamedJumptablePointer
|
2013-12-18 04:54:25 +00:00
|
|
|
pop de
|
|
|
|
jp [hl]
|
|
|
|
|
|
|
|
Jumptable_c8ddd: ; c8ddd (32:4ddd)
|
|
|
|
dw Functionc8de7
|
|
|
|
dw Functionc8e02
|
|
|
|
dw Functionc8e21
|
|
|
|
dw Functionc8e2a
|
|
|
|
dw Functionc8e49
|
|
|
|
|
|
|
|
|
|
|
|
Functionc8de7: ; c8de7 (32:4de7)
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
2013-12-18 04:54:25 +00:00
|
|
|
jr nz, .asm_c8df2
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8df2
|
2015-12-24 01:46:23 +00:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld [hl], $0
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8e02: ; c8e02 (32:4e02)
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr z, .asm_c8e0d
|
|
|
|
dec [hl]
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8e0d
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
|
|
|
call Functionc8eac
|
|
|
|
jr c, .asm_c8e1b
|
|
|
|
call Functionc8e52
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8e1b
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8e21: ; c8e21 (32:4e21)
|
|
|
|
ld a, $e4
|
|
|
|
call Functionc8e52
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8e2a: ; c8e2a (32:4e2a)
|
2015-12-24 18:33:54 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr z, .asm_c8e35
|
|
|
|
dec [hl]
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8e35
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
|
|
|
call Functionc8eac
|
|
|
|
jr c, .asm_c8e43
|
|
|
|
call Functionc8e7f
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8e43
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8e49: ; c8e49 (32:4e49)
|
|
|
|
ld a, $e4
|
|
|
|
call Functionc8e7f
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8e52: ; c8e52 (32:4e52)
|
|
|
|
ld h, a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, $5
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, h
|
|
|
|
push bc
|
|
|
|
push af
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BGPals ; BGPals
|
2015-11-20 20:15:32 +00:00
|
|
|
ld de, UnknBGPals ; wd000
|
2013-12-18 04:54:25 +00:00
|
|
|
ld b, a
|
|
|
|
ld c, $1
|
|
|
|
call CopyPals
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, OBPals + 8
|
2015-11-20 20:15:32 +00:00
|
|
|
ld de, UnknOBPals + 8
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
|
|
|
ld b, a
|
|
|
|
ld c, $1
|
|
|
|
call CopyPals
|
|
|
|
pop bc
|
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hCGBPalUpdate], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8e7f: ; c8e7f (32:4e7f)
|
|
|
|
ld h, a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [rSVBK]
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
|
|
|
ld a, $5
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, h
|
|
|
|
push bc
|
|
|
|
push af
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, BGPals + 8
|
2015-11-20 20:15:32 +00:00
|
|
|
ld de, UnknBGPals + 8
|
2013-12-18 04:54:25 +00:00
|
|
|
ld b, a
|
|
|
|
ld c, $1
|
|
|
|
call CopyPals
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, OBPals ; OBPals
|
2015-11-20 20:15:32 +00:00
|
|
|
ld de, UnknOBPals ; wd040
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
|
|
|
ld b, a
|
|
|
|
ld c, $1
|
|
|
|
call CopyPals
|
|
|
|
pop bc
|
|
|
|
pop af
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rSVBK], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hCGBPalUpdate], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8eac: ; c8eac (32:4eac)
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
|
|
|
|
Functionc8eb2: ; c8eb2 (32:4eb2)
|
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
jr z, .asm_c8ec8
|
|
|
|
cp $fe
|
|
|
|
jr nz, .asm_c8ec6
|
|
|
|
ld a, [de]
|
2015-12-24 01:46:23 +00:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
.asm_c8ec6
|
|
|
|
and a
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8ec8
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
BattleBGEffects_ClearLYOverrides: ; c8eca (32:4eca)
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-12-24 18:33:54 +00:00
|
|
|
BattleBGEffects_SetLYOverrides: ; c8ecb (32:4ecb)
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, LYOverrides ; wd100
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, $99
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop1
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hli], a
|
|
|
|
dec e
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .loop1
|
2014-05-05 19:15:56 +00:00
|
|
|
ld hl, LYOverridesBackup
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, $91
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop2
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hli], a
|
|
|
|
dec e
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .loop2
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8ede: ; c8ede (32:4ede)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hLCDStatCustom], a
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
2013-12-18 04:54:25 +00:00
|
|
|
jr nz, .asm_c8eea
|
|
|
|
ld de, $36
|
2015-12-24 18:33:54 +00:00
|
|
|
jr .okay
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8eea
|
|
|
|
ld de, $2f5e
|
2015-12-24 18:33:54 +00:00
|
|
|
.okay
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, d
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8ef4: ; c8ef4 (32:4ef4)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hLCDStatCustom], a
|
2015-12-24 18:33:54 +00:00
|
|
|
call BGEffect_CheckBattleTurn
|
2013-12-18 04:54:25 +00:00
|
|
|
jr nz, .asm_c8f00
|
|
|
|
ld de, $36
|
|
|
|
jr .asm_c8f03
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
.asm_c8f00
|
|
|
|
ld de, $2d5e
|
|
|
|
.asm_c8f03
|
|
|
|
ld a, d
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 03:51:50 +00:00
|
|
|
BattleAnim_ResetLCDStatCustom: ; c8f0a (32:4f0a)
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hLCDStatCustom], a
|
2013-12-18 04:54:25 +00:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8f19: ; c8f19 (32:4f19)
|
|
|
|
xor a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hLCDStatCustom], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $e4
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [rBGP], a
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wBGP], a
|
|
|
|
ld [wOBP1], a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld [hLCDStatCustom + 1], a
|
|
|
|
ld [hLCDStatCustom + 2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8f2e: ; c8f2e (32:4f2e)
|
|
|
|
push bc
|
|
|
|
xor a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, d
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $80
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp3], a
|
2015-02-08 08:03:32 +00:00
|
|
|
ld bc, LYOverridesBackup
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp c
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nc, .next
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp c
|
2015-12-24 18:33:54 +00:00
|
|
|
jr c, .next
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld d, a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp0]
|
|
|
|
call BattleBGEffects_Sine
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [bc], a
|
2015-12-24 18:33:54 +00:00
|
|
|
.next
|
2013-12-18 04:54:25 +00:00
|
|
|
inc bc
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp1]
|
|
|
|
ld hl, wBattleAnimTemp0
|
2013-12-18 04:54:25 +00:00
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld hl, wBattleAnimTemp3
|
2013-12-18 04:54:25 +00:00
|
|
|
dec [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 03:51:50 +00:00
|
|
|
InitSurfWaves: ; c8f69 (32:4f69)
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
|
|
|
xor a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp0], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, d
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp2], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, $40
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp3], a
|
|
|
|
ld bc, wSurfWaveBGEffect
|
|
|
|
.loop
|
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld d, a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp0]
|
|
|
|
call BattleBGEffects_Sine
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [bc], a
|
|
|
|
inc bc
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp1]
|
|
|
|
ld hl, wBattleAnimTemp0
|
2013-12-18 04:54:25 +00:00
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld hl, wBattleAnimTemp3
|
2013-12-18 04:54:25 +00:00
|
|
|
dec [hl]
|
2015-12-24 03:51:50 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc8f9a: ; c8f9a (32:4f9a)
|
|
|
|
push bc
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp3], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, d
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp2], a
|
2015-12-24 18:33:54 +00:00
|
|
|
call .GetLYOverrideBackupAddrOffset
|
2015-02-08 08:03:32 +00:00
|
|
|
ld hl, LYOverridesBackup
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, de
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp3]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .done
|
2013-12-18 04:54:25 +00:00
|
|
|
dec a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp3], a
|
2013-12-18 04:54:25 +00:00
|
|
|
push af
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld d, a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp1]
|
2013-12-18 04:54:25 +00:00
|
|
|
push hl
|
2015-12-24 03:51:50 +00:00
|
|
|
call BattleBGEffects_Sine
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, a
|
|
|
|
pop hl
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp c
|
2015-12-24 18:33:54 +00:00
|
|
|
jr c, .skip1
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
|
|
|
ld [bc], a
|
|
|
|
inc bc
|
2015-12-24 18:33:54 +00:00
|
|
|
.skip1
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
cp l
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nc, .skip2
|
2013-12-18 04:54:25 +00:00
|
|
|
ld [hl], e
|
|
|
|
dec hl
|
2015-12-24 18:33:54 +00:00
|
|
|
.skip2
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp1]
|
2013-12-18 04:54:25 +00:00
|
|
|
add $4
|
2015-12-24 03:51:50 +00:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
2015-12-24 18:33:54 +00:00
|
|
|
jr .loop
|
2015-12-24 01:46:23 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.done
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.GetLYOverrideBackupAddrOffset
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, a
|
2015-12-24 03:51:50 +00:00
|
|
|
ld a, [wBattleAnimTemp0]
|
2013-12-18 04:54:25 +00:00
|
|
|
add e
|
|
|
|
ld e, a
|
|
|
|
ld d, $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef)
|
2013-12-18 04:54:25 +00:00
|
|
|
push bc
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
inc a
|
|
|
|
ld e, a
|
|
|
|
ld h, $d2
|
|
|
|
ld d, h
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub l
|
|
|
|
and a
|
2015-12-24 18:33:54 +00:00
|
|
|
jr z, .done
|
2013-12-18 04:54:25 +00:00
|
|
|
ld c, a
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
2015-12-24 18:33:54 +00:00
|
|
|
.loop
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .loop
|
2013-12-18 04:54:25 +00:00
|
|
|
pop af
|
|
|
|
ld [hl], a
|
2015-12-24 18:33:54 +00:00
|
|
|
.done
|
2013-12-18 04:54:25 +00:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc900b: ; c900b (32:500b)
|
|
|
|
push af
|
|
|
|
ld h, $d2
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub l
|
|
|
|
ld d, a
|
|
|
|
pop af
|
|
|
|
.asm_c9016
|
|
|
|
ld [hli], a
|
|
|
|
dec d
|
|
|
|
jr nz, .asm_c9016
|
|
|
|
ret
|
|
|
|
|
|
|
|
Functionc901b: ; c901b (32:501b)
|
|
|
|
push af
|
|
|
|
ld e, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 2]
|
2013-12-18 04:54:25 +00:00
|
|
|
sub l
|
|
|
|
sub e
|
|
|
|
ld d, a
|
|
|
|
ld h, $d2
|
2015-10-07 17:19:41 +00:00
|
|
|
ld a, [hLCDStatCustom + 1]
|
2013-12-18 04:54:25 +00:00
|
|
|
ld l, a
|
|
|
|
ld a, $90
|
|
|
|
.asm_c902c
|
|
|
|
ld [hli], a
|
|
|
|
dec e
|
|
|
|
jr nz, .asm_c902c
|
|
|
|
pop af
|
|
|
|
xor $ff
|
|
|
|
.asm_c9033
|
|
|
|
ld [hli], a
|
|
|
|
dec d
|
|
|
|
jr nz, .asm_c9033
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
BGEffect_CheckBattleTurn: ; c9038 (32:5038)
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and $1
|
|
|
|
xor [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
BGEffect_CheckFlyDigStatus: ; c9042 (32:5042)
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-18 04:54:25 +00:00
|
|
|
add hl, bc
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hBattleTurn]
|
2013-12-18 04:54:25 +00:00
|
|
|
and $1
|
|
|
|
xor [hl]
|
2015-12-24 18:33:54 +00:00
|
|
|
jr nz, .player
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [EnemySubStatus3] ; EnemySubStatus3
|
2014-05-05 19:15:56 +00:00
|
|
|
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2015-12-24 18:33:54 +00:00
|
|
|
.player
|
2015-02-08 08:03:32 +00:00
|
|
|
ld a, [PlayerSubStatus3] ; PlayerSubStatus3
|
2014-05-05 19:15:56 +00:00
|
|
|
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
|
2013-12-18 04:54:25 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-24 01:46:23 +00:00
|
|
|
BattleBGEffects_CheckSGB: ; c9059 (32:5059)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hSGB]
|
2013-12-18 04:54:25 +00:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 03:51:50 +00:00
|
|
|
BattleBGEffects_Sine: ; c905d (32:505d)
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, a
|
2015-12-11 03:26:31 +00:00
|
|
|
callab BattleAnim_Sine_e
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 03:51:50 +00:00
|
|
|
BattleBGEffects_Cosine: ; c9066 (32:5066)
|
2013-12-18 04:54:25 +00:00
|
|
|
ld e, a
|
2015-12-11 03:26:31 +00:00
|
|
|
callab BattleAnim_Cosine_e
|
2013-12-18 04:54:25 +00:00
|
|
|
ld a, e
|
|
|
|
ret
|
2015-12-04 19:33:29 +00:00
|
|
|
|
2013-12-18 04:54:25 +00:00
|
|
|
; c906f (32:506f)
|