summaryrefslogtreecommitdiff
path: root/engine/events
diff options
context:
space:
mode:
Diffstat (limited to 'engine/events')
-rw-r--r--engine/events/battle_tower/battle_tower.asm2
-rw-r--r--engine/events/battle_tower/load_trainer.asm10
-rw-r--r--engine/events/checksave.asm2
-rw-r--r--engine/events/map_name_sign.asm2
-rw-r--r--engine/events/mom_phone.asm2
-rw-r--r--engine/events/odd_egg.asm14
6 files changed, 17 insertions, 15 deletions
diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm
index 981491547..dcfe6ae22 100644
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -480,7 +480,7 @@ endr
ld a, [hl]
ld [de], a
pop hl
- ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
+ ld bc, NICKNAMED_MON_STRUCT_LENGTH
add hl, bc
pop de
dec d
diff --git a/engine/events/battle_tower/load_trainer.asm b/engine/events/battle_tower/load_trainer.asm
index 517b0e48e..0e4c9d04a 100644
--- a/engine/events/battle_tower/load_trainer.asm
+++ b/engine/events/battle_tower/load_trainer.asm
@@ -7,7 +7,7 @@ Function_LoadOpponentTrainerAndPokemons:
; Fill wBT_OTTrainer with zeros
xor a
ld hl, wBT_OTTrainer
- ld bc, wBT_OTTrainerEnd - wBT_OTTrainer
+ ld bc, BATTLE_TOWER_STRUCT_LENGTH
call ByteFill
; Write $ff into the Item-Slots
@@ -104,7 +104,7 @@ Function_LoadRandomBattleTowerMon:
ld a, [wBTChoiceOfLvlGroup]
dec a
ld hl, BattleTowerMons
- ld bc, BattleTowerMons2 - BattleTowerMons1 ; size of one level group
+ ld bc, BATTLETOWER_NUM_UNIQUE_MON * NICKNAMED_MON_STRUCT_LENGTH
call AddNTimes
ldh a, [hRandomAdd]
@@ -122,7 +122,7 @@ Function_LoadRandomBattleTowerMon:
; Check if mon was already loaded before
; Check current and the 2 previous teams
; includes check if item is double at the current team
- ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
+ ld bc, NICKNAMED_MON_STRUCT_LENGTH
call AddNTimes
ld a, [hli]
ld b, a
@@ -165,13 +165,13 @@ Function_LoadRandomBattleTowerMon:
cp b
jr z, .FindARandomBattleTowerMon
- ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
+ ld bc, NICKNAMED_MON_STRUCT_LENGTH
call CopyBytes
ld a, [wNamedObjectIndexBuffer]
push af
push de
- ld hl, - (PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH)
+ ld hl, -NICKNAMED_MON_STRUCT_LENGTH
add hl, de
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
diff --git a/engine/events/checksave.asm b/engine/events/checksave.asm
index 1e9d18e71..67efaf9e3 100644
--- a/engine/events/checksave.asm
+++ b/engine/events/checksave.asm
@@ -1,5 +1,5 @@
CheckSave::
- ld a, BANK(sCheckValue1) ; BANK(sCheckValue2)
+ ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
call GetSRAMBank
ld a, [sCheckValue1]
ld b, a
diff --git a/engine/events/map_name_sign.asm b/engine/events/map_name_sign.asm
index 0b6b2b203..6162378a9 100644
--- a/engine/events/map_name_sign.asm
+++ b/engine/events/map_name_sign.asm
@@ -242,7 +242,7 @@ PlaceMapNameFrame:
ret
.FillTopBottom:
- ld c, 5
+ ld c, (SCREEN_WIDTH - 2) / 4 + 1
jr .enterloop
.continueloop
diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm
index 6e14e33d9..0a8dbef29 100644
--- a/engine/events/mom_phone.asm
+++ b/engine/events/mom_phone.asm
@@ -1,7 +1,7 @@
NUM_MOM_ITEMS_1 EQUS "((MomItems_1.End - MomItems_1) / 8)"
NUM_MOM_ITEMS_2 EQUS "((MomItems_2.End - MomItems_2) / 8)"
-const_value = 1
+ const_def 1
const MOM_ITEM
const MOM_DOLL
diff --git a/engine/events/odd_egg.asm b/engine/events/odd_egg.asm
index 74b971806..a6ca15b8c 100644
--- a/engine/events/odd_egg.asm
+++ b/engine/events/odd_egg.asm
@@ -39,11 +39,13 @@ _GiveOddEgg:
.done
ld hl, OddEggs
- ld a, OddEgg1End - OddEgg1
+ ld a, NICKNAMED_MON_STRUCT_LENGTH
call AddNTimes
- ld de, wOddEggSpecies
- ld bc, PARTYMON_STRUCT_LENGTH + 2 * MON_NAME_LENGTH
+ ; Writes to wOddEgg, wOddEggName, and wOddEggOTName,
+ ; even though OddEggs does not have data for wOddEggOTName
+ ld de, wOddEgg
+ ld bc, NICKNAMED_MON_STRUCT_LENGTH + NAME_LENGTH
call CopyBytes
ld a, EGG_TICKET
@@ -64,10 +66,10 @@ _GiveOddEgg:
ld [wMobileMonSpeciesPointerBuffer], a
ld a, HIGH(wMobileMonSpeciesBuffer - 1)
ld [wMobileMonSpeciesPointerBuffer + 1], a
- ; load pointer to wOddEggSpecies in wMobileMonStructurePointerBuffer
- ld a, LOW(wOddEggSpecies)
+ ; load pointer to wOddEgg in wMobileMonStructurePointerBuffer
+ ld a, LOW(wOddEgg)
ld [wMobileMonStructurePointerBuffer], a
- ld a, HIGH(wOddEggSpecies)
+ ld a, HIGH(wOddEgg)
ld [wMobileMonStructurePointerBuffer + 1], a
; load Odd Egg Name in wTempOddEggNickname