mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
eb1e3636bb
Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
37 lines
644 B
NASM
37 lines
644 B
NASM
BattleCommand_ClearHazards:
|
|
; clearhazards
|
|
|
|
ld a, BATTLE_VARS_SUBSTATUS4
|
|
call GetBattleVarAddr
|
|
bit SUBSTATUS_LEECH_SEED, [hl]
|
|
jr z, .not_leeched
|
|
res SUBSTATUS_LEECH_SEED, [hl]
|
|
ld hl, ShedLeechSeedText
|
|
call StdBattleTextBox
|
|
.not_leeched
|
|
|
|
ld hl, wPlayerScreens
|
|
ld de, wPlayerWrapCount
|
|
ldh a, [hBattleTurn]
|
|
and a
|
|
jr z, .got_screens_wrap
|
|
ld hl, wEnemyScreens
|
|
ld de, wEnemyWrapCount
|
|
.got_screens_wrap
|
|
bit SCREENS_SPIKES, [hl]
|
|
jr z, .no_spikes
|
|
res SCREENS_SPIKES, [hl]
|
|
ld hl, BlewSpikesText
|
|
push de
|
|
call StdBattleTextBox
|
|
pop de
|
|
.no_spikes
|
|
|
|
ld a, [de]
|
|
and a
|
|
ret z
|
|
xor a
|
|
ld [de], a
|
|
ld hl, ReleasedByText
|
|
jp StdBattleTextBox
|