Clean up bugs commented in the source code (#912)

Co-authored-by: Rangi <remy.oukaour+rangi42@gmail.com>
This commit is contained in:
vulcandth
2022-07-09 16:12:02 -05:00
committed by GitHub
parent bd27c0d8dc
commit ef9b9bb437
49 changed files with 267 additions and 324 deletions

View File

@@ -179,16 +179,12 @@ LongAnim_UpdateVariables:
ld c, a
ld a, [hli]
ld b, a
; This routine is buggy. The result from ComputeHPBarPixels is stored
; in e. However, the pop de opcode deletes this result before it is even
; used. The game then proceeds as though it never deleted that output.
; To fix, uncomment the line below.
; BUG: HP bar animation is slow for high HP (see docs/bugs_and_glitches.md)
call ComputeHPBarPixels
; ld a, e
pop bc
pop de
pop hl
ld a, e ; Comment or delete this line to fix the above bug.
ld a, e
ld hl, wCurHPBarPixels
cp [hl]
jr z, .loop
@@ -373,17 +369,14 @@ ShortHPBar_CalcPixelFrame:
call AddNTimes
ld b, 0
; This routine is buggy. If [wCurHPAnimMaxHP] * [wCurHPBarPixels] is
; divisible by HP_BAR_LENGTH_PX, the loop runs one extra time.
; To fix, uncomment the line below.
.loop
; BUG: HP bar animation off-by-one error for low HP (see docs/bugs_and_glitches.md)
ld a, l
sub HP_BAR_LENGTH_PX
ld l, a
ld a, h
sbc $0
ld h, a
; jr z, .done
jr c, .done
inc b
jr .loop