summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/events/odd_eggs.asm2
-rw-r--r--engine/battle/core.asm4
-rw-r--r--engine/events/battle_tower/load_trainer.asm2
-rw-r--r--engine/events/odd_egg.asm2
-rw-r--r--engine/link/link.asm2
-rw-r--r--engine/overworld/player_movement.asm37
6 files changed, 22 insertions, 27 deletions
diff --git a/data/events/odd_eggs.asm b/data/events/odd_eggs.asm
index 587b0049e..dd3dc3bbf 100644
--- a/data/events/odd_eggs.asm
+++ b/data/events/odd_eggs.asm
@@ -55,8 +55,8 @@ OddEgg1:
bigdw 8 ; SAtk
bigdw 8 ; SDef
db "EGG@@@@@@@@"
+OddEgg1End:
-OddEgg2:
db PICHU
db NO_ITEM
db THUNDERSHOCK, CHARM, DIZZY_PUNCH, 0
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index c467ac495..57c0d7990 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -3619,10 +3619,10 @@ CheckPlayerPartyForFitMon:
ld e, a
xor a
ld hl, wPartyMon1HP
- ld bc, wPartyMon2 - (wPartyMon1 + 1)
+ ld bc, PARTYMON_STRUCT_LENGTH - 1
.loop
or [hl]
- inc hl
+ inc hl ; + 1
or [hl]
add hl, bc
dec e
diff --git a/engine/events/battle_tower/load_trainer.asm b/engine/events/battle_tower/load_trainer.asm
index 2f34950b6..f9be02b28 100644
--- a/engine/events/battle_tower/load_trainer.asm
+++ b/engine/events/battle_tower/load_trainer.asm
@@ -104,7 +104,7 @@ Function_LoadRandomBattleTowerMon:
ld a, [wBTChoiceOfLvlGroup]
dec a
ld hl, BattleTowerMons
- ld bc, BattleTowerMons2 - BattleTowerMons1
+ ld bc, BattleTowerMons2 - BattleTowerMons1 ; size of one level group
call AddNTimes
ld a, [hRandomAdd]
diff --git a/engine/events/odd_egg.asm b/engine/events/odd_egg.asm
index 10d7cf9aa..a6b244b1d 100644
--- a/engine/events/odd_egg.asm
+++ b/engine/events/odd_egg.asm
@@ -39,7 +39,7 @@ _GiveOddEgg:
.done
ld hl, OddEggs
- ld a, OddEgg2 - OddEgg1
+ ld a, OddEgg1End - OddEgg1
call AddNTimes
ld de, wOddEggSpecies
diff --git a/engine/link/link.asm b/engine/link/link.asm
index d72abb0a5..e5f354f57 100644
--- a/engine/link/link.asm
+++ b/engine/link/link.asm
@@ -2039,7 +2039,7 @@ CheckTimeCapsuleCompatibility:
jr nc, .move_too_new
dec c
jr nz, .move_next
- ld de, wPartyMon2 - (wPartyMon1 + NUM_MOVES)
+ ld de, PARTYMON_STRUCT_LENGTH - NUM_MOVES
add hl, de
dec b
jr nz, .move_loop
diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm
index c70357f13..a4926e7e5 100644
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -562,8 +562,8 @@ DoPlayerMovement::
.GetAction:
; Poll player input and update movement info.
- ld hl, .table
- ld de, .table2 - .table1
+ ld hl, .action_table
+ ld de, .action_table_1_end - .action_table_1
ld a, [wCurInput]
bit D_DOWN_F, a
jr nz, .d_down
@@ -597,25 +597,20 @@ DoPlayerMovement::
ld [wWalkingTile], a
ret
-.table
-; struct:
-; walk direction
-; facing
-; x movement
-; y movement
-; tile collision pointer
-.table1
- db STANDING, FACE_CURRENT, 0, 0
- dw wPlayerStandingTile
-.table2
- db RIGHT, FACE_RIGHT, 1, 0
- dw wTileRight
- db LEFT, FACE_LEFT, -1, 0
- dw wTileLeft
- db UP, FACE_UP, 0, -1
- dw wTileUp
- db DOWN, FACE_DOWN, 0, 1
- dw wTileDown
+player_action: MACRO
+; walk direction, facing, x movement, y movement, tile collision pointer
+ db \1, \2, \3, \4
+ dw \5
+ENDM
+
+.action_table:
+.action_table_1
+ player_action STANDING, FACE_CURRENT, 0, 0, wPlayerStandingTile
+.action_table_1_end
+ player_action RIGHT, FACE_RIGHT, 1, 0, wTileRight
+ player_action LEFT, FACE_LEFT, -1, 0, wTileLeft
+ player_action UP, FACE_UP, 0, -1, wTileUp
+ player_action DOWN, FACE_DOWN, 0, 1, wTileDown
.CheckNPC:
; Returns 0 if there is an NPC in front that you can't move