summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rwxr-xr-xengine/anim_hp_bar.asm4
-rw-r--r--engine/battle_start.asm7
-rwxr-xr-xengine/items.asm2
-rwxr-xr-xengine/search.asm4
4 files changed, 11 insertions, 6 deletions
diff --git a/engine/anim_hp_bar.asm b/engine/anim_hp_bar.asm
index 6272ff7ea..a26c40b91 100755
--- a/engine/anim_hp_bar.asm
+++ b/engine/anim_hp_bar.asm
@@ -382,7 +382,10 @@ ShortHPBar_CalcPixelFrame: ; d839
and a
jr z, .return_zero
call AddNTimes
+
ld b, 0
+; This routine is buggy. If [wCurHPAnimMaxHP] * [wCurHPBarPixels] is divisible
+; by 48, the loop runs one extra time. To fix, uncomment the line below.
.loop
ld a, l
sub 6 * 8
@@ -390,6 +393,7 @@ ShortHPBar_CalcPixelFrame: ; d839
ld a, h
sbc $0
ld h, a
+ ; jr z, .done
jr c, .done
inc b
jr .loop
diff --git a/engine/battle_start.asm b/engine/battle_start.asm
index b16bbbd67..7a16c3b82 100644
--- a/engine/battle_start.asm
+++ b/engine/battle_start.asm
@@ -196,9 +196,10 @@ FlashyTransitionToBattle: ; 8c314
StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
-; The screen flashes a different number of
-; times depending on the level of your lead
-; Pokemon relative to the opponent's.
+; The screen flashes a different number of times depending on the level of
+; your lead Pokemon relative to the opponent's.
+; BUG: BattleMonLevel and EnemyMonLevel are not set at this point, so whatever
+; values happen to be there will determine the animation.
ld de, 0
ld a, [BattleMonLevel]
add 3
diff --git a/engine/items.asm b/engine/items.asm
index 0124489e5..b0bffb6d6 100755
--- a/engine/items.asm
+++ b/engine/items.asm
@@ -554,7 +554,7 @@ GetItemAttr: ; d460
ld a, [CurItem]
dec a
ld c, a
- ld a, NUM_ITEMATTRS
+ ld a, ITEMATTR_STRUCT_LENGTH
call AddNTimes
ld a, BANK(ItemAttributes)
call GetFarByte
diff --git a/engine/search.asm b/engine/search.asm
index 9543ecfbb..76be0e159 100755
--- a/engine/search.asm
+++ b/engine/search.asm
@@ -219,7 +219,7 @@ CheckOwnMon: ; 0x4a7ba
ld hl, PlayerName
- rept 4
+rept NAME_LENGTH_JAPANESE +- 2 ; should be PLAYER_NAME_LENGTH +- 2
ld a, [de]
cp [hl]
jr nz, .notfound
@@ -227,7 +227,7 @@ CheckOwnMon: ; 0x4a7ba
jr z, .found ; reached end of string
inc hl
inc de
- endr
+endr
ld a, [de]
cp [hl]