Specify the ldh instruction, don't turn ld into ldh

This commit is contained in:
Rangi 2020-07-06 19:03:05 -04:00
parent c480632d54
commit 772fcc7588
219 changed files with 2556 additions and 2556 deletions

View file

@ -1,7 +1,7 @@
ConversionEffect_:
ld hl, wEnemyMonType1
ld de, wBattleMonType1
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
ld a, [wEnemyBattleStatus1]
jr z, .conversionEffect

View file

@ -14,7 +14,7 @@ DrainHPEffect_:
.getAttackerHP
ld hl, wBattleMonHP
ld de, wBattleMonMaxHP
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jp z, .addDamageToAttackerHP
ld hl, wEnemyMonHP
@ -69,7 +69,7 @@ DrainHPEffect_:
ld [wHPBarNewHP+1], a
inc de
.next
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
coord hl, 10, 9
ld a, $1
@ -83,7 +83,7 @@ DrainHPEffect_:
predef DrawEnemyHUDAndHPBar
callab ReadPlayerMonCurHPAndStatus
ld hl, SuckedHealthText
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
ld a, [wPlayerMoveEffect]
jr z, .next3

View file

@ -1,6 +1,6 @@
FocusEnergyEffect_:
ld hl, wPlayerBattleStatus2
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .notEnemy
ld hl, wEnemyBattleStatus2

View file

@ -15,7 +15,7 @@ HazeEffect_:
; cure non-volatile status, but only for the target
ld hl, wEnemyMonStatus
ld de, wEnemySelectedMove
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .cureStatuses
ld hl, wBattleMonStatus

View file

@ -1,5 +1,5 @@
HealEffect_:
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
ld de, wBattleMonHP
ld hl, wBattleMonMaxHP
@ -27,7 +27,7 @@ HealEffect_:
ld c, 50
call DelayFrames
ld hl, wBattleMonStatus
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .restEffect
ld hl, wEnemyMonStatus
@ -87,7 +87,7 @@ HealEffect_:
.playAnim
ld hl, PlayCurrentMoveAnimation
call BankswitchEtoF
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
coord hl, 10, 9
ld a, $1

View file

@ -5,7 +5,7 @@ LeechSeedEffect_:
jr nz, .moveMissed
ld hl, wEnemyBattleStatus2
ld de, wEnemyMonType1
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .leechSeedEffect
ld hl, wPlayerBattleStatus2

View file

@ -1,6 +1,6 @@
MistEffect_:
ld hl, wPlayerBattleStatus2
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .mistEffect
ld hl, wEnemyBattleStatus2

View file

@ -7,7 +7,7 @@ OneHitKOEffect_:
ld [wCriticalHitOrOHKO], a
ld hl, wBattleMonSpeed + 1
ld de, wEnemyMonSpeed + 1
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .compareSpeed
ld hl, wEnemyMonSpeed + 1

View file

@ -1,7 +1,7 @@
ParalyzeEffect_:
ld hl, wEnemyMonStatus
ld de, wPlayerMoveType
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jp z, .next
ld hl, wBattleMonStatus

View file

@ -2,7 +2,7 @@ PayDayEffect_:
xor a
ld hl, wcd6d
ld [hli], a
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
ld a, [wBattleMonLevel]
jr z, .payDayEffect
@ -10,28 +10,28 @@ PayDayEffect_:
.payDayEffect
; level * 2
add a
ld [hDividend + 3], a
ldh [hDividend + 3], a
xor a
ld [hDividend], a
ld [hDividend + 1], a
ld [hDividend + 2], a
ldh [hDividend], a
ldh [hDividend + 1], a
ldh [hDividend + 2], a
; convert to BCD
ld a, 100
ld [hDivisor], a
ldh [hDivisor], a
ld b, $4
call Divide
ld a, [hQuotient + 3]
ldh a, [hQuotient + 3]
ld [hli], a
ld a, [hRemainder]
ld [hDividend + 3], a
ldh a, [hRemainder]
ldh [hDividend + 3], a
ld a, 10
ld [hDivisor], a
ldh [hDivisor], a
ld b, $4
call Divide
ld a, [hQuotient + 3]
ldh a, [hQuotient + 3]
swap a
ld b, a
ld a, [hRemainder]
ldh a, [hRemainder]
add b
ld [hl], a
ld de, wTotalPayDayMoney + 2

View file

@ -1,5 +1,5 @@
RecoilEffect_:
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
ld a, [wPlayerMoveNum]
ld hl, wBattleMonMaxHP
@ -54,7 +54,7 @@ RecoilEffect_:
ld [hl], a
.getHPBarCoords
coord hl, 10, 9
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
ld a, $1
jr z, .updateHPBar

View file

@ -1,7 +1,7 @@
ReflectLightScreenEffect_:
ld hl, wPlayerBattleStatus3
ld de, wPlayerMoveEffect
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .reflectLightScreenEffect
ld hl, wEnemyBattleStatus3

View file

@ -4,7 +4,7 @@ SubstituteEffect_:
ld hl, wBattleMonMaxHP
ld de, wPlayerSubstituteHP
ld bc, wPlayerBattleStatus2
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .notEnemy
ld hl, wEnemyMonMaxHP

View file

@ -3,7 +3,7 @@ TransformEffect_:
ld de, wEnemyMonSpecies
ld bc, wEnemyBattleStatus3
ld a, [wEnemyBattleStatus1]
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr nz, .hitTest
ld hl, wEnemyMonSpecies
@ -18,7 +18,7 @@ TransformEffect_:
push de
push bc
ld hl, wPlayerBattleStatus2
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .transformEffect
ld hl, wEnemyBattleStatus2
@ -64,7 +64,7 @@ TransformEffect_:
inc bc
inc bc
call CopyData
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .next
; save enemy mon DVs at wTransformedEnemyMonOriginalDVs
@ -128,7 +128,7 @@ TransformEffect_:
jp PrintText
.copyBasedOnTurn
ld a, [hWhoseTurn]
ldh a, [hWhoseTurn]
and a
jr z, .gotStatsOrModsToCopy
push hl