summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-02-25 17:06:32 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2020-02-25 18:13:50 -0500
commitee622d6ba18b9bf3f0f336fc5c22b5e9817dba8a (patch)
tree79fee7f376ef4ea220b9aa2515271ac581794e19
parent4ab60eb2d2898c21af540a605b48911954ec4c45 (diff)
Identify some labels and constants for Battle Tower
-rw-r--r--engine/events/battle_tower/battle_tower.asm26
1 files changed, 13 insertions, 13 deletions
diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm
index 088d920ba..a851c76f8 100644
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -29,7 +29,7 @@ Function1700c4:
call CopyBytes
ld hl, w3_d202Name
ld de, s5_aa8e
- ld bc, 7 * $cc ; length of battle tower struct from japanese games?
+ ld bc, BATTLETOWER_STREAK_LENGTH * $cc ; length of battle tower struct from japanese games?
call CopyBytes
ld hl, s5_aa5d ; some sort of count
ld a, [hl]
@@ -582,22 +582,22 @@ SkipBattleTowerTrainer:
ret
Unreferenced_Function1704ca:
- ld a, [$be46]
- cp $7
- jr c, .asm_1704d3
- ld a, $6
-
-.asm_1704d3
- ld hl, $afce
- ld de, -$e0
-.asm_1704d9
+ ld a, [s5_be46]
+ cp BATTLETOWER_STREAK_LENGTH
+ jr c, .not_max
+ ld a, BATTLETOWER_STREAK_LENGTH - 1
+
+.not_max
+ ld hl, s5_aa8e + BATTLE_TOWER_STRUCT_LENGTH * (BATTLETOWER_STREAK_LENGTH - 1)
+ ld de, -BATTLE_TOWER_STRUCT_LENGTH
+.loop
and a
- jr z, .asm_1704e0
+ jr z, .done
add hl, de
dec a
- jr .asm_1704d9
+ jr .loop
-.asm_1704e0
+.done
ret
Function1704e1: