diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-08-25 14:28:22 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-08-25 14:28:22 -0400 |
commit | eb1e3636bb71509546c274bf2a5910d8e71a9600 (patch) | |
tree | 24d7742604073b2afb86c1225258f8217d1653e7 /engine/battle/move_effects/return.asm | |
parent | 376c64468bab8d162da43fc6e1b6f0942943cf43 (diff) |
Use labels instead of constants for HRAM
Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
Diffstat (limited to 'engine/battle/move_effects/return.asm')
-rw-r--r-- | engine/battle/move_effects/return.asm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engine/battle/move_effects/return.asm b/engine/battle/move_effects/return.asm index d3071d23a..18a2d10f4 100644 --- a/engine/battle/move_effects/return.asm +++ b/engine/battle/move_effects/return.asm @@ -2,24 +2,24 @@ BattleCommand_HappinessPower: ; happinesspower push bc ld hl, wBattleMonHappiness - ld a, [hBattleTurn] + ldh a, [hBattleTurn] and a jr z, .ok ld hl, wEnemyMonHappiness .ok xor a - ld [hMultiplicand + 0], a - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 0], a + ldh [hMultiplicand + 1], a ld a, [hl] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a ld a, 10 - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ld a, 25 - ld [hDivisor], a + ldh [hDivisor], a ld b, 4 call Divide - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] ld d, a pop bc ret |