Use labels instead of constants for HRAM

Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
This commit is contained in:
Rangi
2018-08-25 14:28:22 -04:00
parent 376c64468b
commit eb1e3636bb
243 changed files with 4706 additions and 4661 deletions

View File

@@ -198,30 +198,30 @@ CalcMagikarpLength:
; c = (bc - de) / [hl]
call .BCMinusDE
ld a, b
ld [hDividend + 0], a
ldh [hDividend + 0], a
ld a, c
ld [hDividend + 1], a
ldh [hDividend + 1], a
ld a, [hl]
ld [hDivisor], a
ldh [hDivisor], a
ld b, 2
call Divide
ld a, [hQuotient + 2]
ldh a, [hQuotient + 2]
ld c, a
; de = c + 100 × (2 + i)
xor a
ld [hMultiplicand + 0], a
ld [hMultiplicand + 1], a
ldh [hMultiplicand + 0], a
ldh [hMultiplicand + 1], a
ld a, 100
ld [hMultiplicand + 2], a
ldh [hMultiplicand + 2], a
ld a, [wTempByteValue]
ld [hMultiplier], a
ldh [hMultiplier], a
call Multiply
ld b, 0
ld a, [hProduct + 3]
ldh a, [hProduct + 3]
add c
ld e, a
ld a, [hProduct + 2]
ldh a, [hProduct + 2]
adc b
ld d, a
jr .done