You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
hQuotient is a four-byte buffer (fixes #558)
This commit is contained in:
@@ -58,12 +58,12 @@ CalcExpAtLevel:
|
||||
ld b, 4
|
||||
call Divide
|
||||
; Push the cubic term to the stack
|
||||
ldh a, [hQuotient + 0]
|
||||
push af
|
||||
ldh a, [hQuotient + 1]
|
||||
push af
|
||||
ldh a, [hQuotient + 2]
|
||||
push af
|
||||
ldh a, [hQuotient + 3]
|
||||
push af
|
||||
; Square the level and multiply by the lower 7 bits of c
|
||||
call .LevelSquared
|
||||
ld a, [hl]
|
||||
|
@@ -91,7 +91,7 @@ ComputeHPBarPixels:
|
||||
ldh [hDivisor], a
|
||||
ld b, 4
|
||||
call Divide
|
||||
ldh a, [hQuotient + 2]
|
||||
ldh a, [hQuotient + 3]
|
||||
ld e, a
|
||||
pop hl
|
||||
and a
|
||||
|
@@ -766,10 +766,10 @@ MonMenu_Softboiled_MilkDrink:
|
||||
call Divide
|
||||
ld a, MON_HP + 1
|
||||
call GetPartyParamLocation
|
||||
ldh a, [hQuotient + 2]
|
||||
ldh a, [hQuotient + 3]
|
||||
sub [hl]
|
||||
dec hl
|
||||
ldh a, [hQuotient + 1]
|
||||
ldh a, [hQuotient + 2]
|
||||
sbc [hl]
|
||||
ret
|
||||
|
||||
|
@@ -1570,11 +1570,11 @@ CalcMonStatC:
|
||||
jr nz, .not_hp
|
||||
ld a, [wCurPartyLevel]
|
||||
ld b, a
|
||||
ldh a, [hQuotient + 2]
|
||||
ldh a, [hQuotient + 3]
|
||||
add b
|
||||
ldh [hMultiplicand + 2], a
|
||||
jr nc, .no_overflow_3
|
||||
ldh a, [hQuotient + 1]
|
||||
ldh a, [hQuotient + 2]
|
||||
inc a
|
||||
ldh [hMultiplicand + 1], a
|
||||
|
||||
@@ -1583,21 +1583,21 @@ CalcMonStatC:
|
||||
|
||||
.not_hp
|
||||
ld b, a
|
||||
ldh a, [hQuotient + 2]
|
||||
ldh a, [hQuotient + 3]
|
||||
add b
|
||||
ldh [hMultiplicand + 2], a
|
||||
jr nc, .no_overflow_4
|
||||
ldh a, [hQuotient + 1]
|
||||
ldh a, [hQuotient + 2]
|
||||
inc a
|
||||
ldh [hMultiplicand + 1], a
|
||||
|
||||
.no_overflow_4
|
||||
ldh a, [hQuotient + 1]
|
||||
ldh a, [hQuotient + 2]
|
||||
cp HIGH(MAX_STAT_VALUE + 1) + 1
|
||||
jr nc, .max_stat
|
||||
cp HIGH(MAX_STAT_VALUE + 1)
|
||||
jr c, .stat_value_okay
|
||||
ldh a, [hQuotient + 2]
|
||||
ldh a, [hQuotient + 3]
|
||||
cp LOW(MAX_STAT_VALUE + 1)
|
||||
jr c, .stat_value_okay
|
||||
|
||||
|
@@ -636,15 +636,15 @@ StatsScreen_LoadGFX:
|
||||
farcall CalcExpAtLevel
|
||||
ld hl, wTempMonExp + 2
|
||||
ld hl, wTempMonExp + 2
|
||||
ldh a, [hQuotient + 2]
|
||||
ldh a, [hQuotient + 3]
|
||||
sub [hl]
|
||||
dec hl
|
||||
ld [wBuffer3], a
|
||||
ldh a, [hQuotient + 1]
|
||||
ldh a, [hQuotient + 2]
|
||||
sbc [hl]
|
||||
dec hl
|
||||
ld [wBuffer2], a
|
||||
ldh a, [hQuotient]
|
||||
ldh a, [hQuotient + 1]
|
||||
sbc [hl]
|
||||
ld [wBuffer1], a
|
||||
ret
|
||||
|
Reference in New Issue
Block a user